support cli v5 options

Revanced CLI version 5 no longer use options.json anymore use directly `Revanced-And-Revanced-Extended-Non-Root/src/patches/` instead.

The options separate with patches name with `|`

Example Youtube apps include patches:

`Custom branding|-OappName="YouTube ReVanced" -OiconPath=ReVanced*Logo`
This commit is contained in:
Fioren
2024-11-12 07:29:29 +07:00
parent a1244677eb
commit d9671b4d04
4 changed files with 16 additions and 12 deletions

View File

@@ -99,9 +99,14 @@ get_patches_key() {
excludePatches+=" -d \"$line1\""
excludeLinesFound=true
done < src/patches/$1/exclude-patches
while IFS= read -r line2; do
includePatches+=" -e \"$line2\""
if [[ "$line2" == *"|"* ]]; then
patch_name="${line2%%|*}"
options="${line2#*|}"
includePatches+=" -e \"${patch_name}\" ${options}"
else
includePatches+=" -e \"$line2\""
fi
includeLinesFound=true
done < src/patches/$1/include-patches
else

View File

@@ -1,9 +0,0 @@
[
{
"patchName" : "Custom branding",
"options" : [ {
"key" : "appName",
"value" : "ReVanced"
} ]
}
]

View File

@@ -1 +1 @@
Custom branding
Custom branding|-OappName="YouTube ReVanced" -OiconPath=ReVanced*Logo