Support revanced cli version 5 syntax

This commit is contained in:
Fioren
2024-10-12 02:00:20 +07:00
parent 806b328e6d
commit 7718be3c9a
40 changed files with 43 additions and 80 deletions

View File

@@ -90,13 +90,39 @@ dl_gh() {
get_patches_key() { get_patches_key() {
excludePatches="" excludePatches=""
includePatches="" includePatches=""
while IFS= read -r line1; do excludeLinesFound=false
excludePatches+=" -e \"$line1\"" includeLinesFound=false
done < src/patches/$1/exclude-patches if [[ $(ls revanced-cli-*.jar) =~ revanced-cli-([0-9]+) ]]; then
num=${BASH_REMATCH[1]}
if [ $num -ge 5 ]; then
while IFS= read -r line1; do
excludePatches+=" -d \"$line1\""
excludeLinesFound=true
done < src/patches/$1/exclude-patches
while IFS= read -r line2; do
includePatches+=" -e \"$line2\""
includeLinesFound=true
done < src/patches/$1/include-patches
else
while IFS= read -r line1; do
excludePatches+=" -e \"$line1\""
excludeLinesFound=true
done < src/patches/$1/exclude-patches
while IFS= read -r line2; do
includePatches+=" -i \"$line2\""
includeLinesFound=true
done < src/patches/$1/include-patches
fi
fi
if [ "$excludeLinesFound" = false ]; then
excludePatches=""
fi
if [ "$includeLinesFound" = false ]; then
includePatches=""
fi
export excludePatches export excludePatches
while IFS= read -r line2; do
includePatches+=" -i \"$line2\""
done < src/patches/$1/include-patches
export includePatches export includePatches
} }
@@ -117,11 +143,8 @@ req() {
dl_apk() { dl_apk() {
local url=$1 regexp=$2 output=$3 local url=$1 regexp=$2 output=$3
url="https://www.apkmirror.com$(req "$url" - | tr '\n' ' ' | sed -n "s/href=\"/@/g; s;.*${regexp}.*;\1;p")" url="https://www.apkmirror.com$(req "$url" - | tr '\n' ' ' | sed -n "s/href=\"/@/g; s;.*${regexp}.*;\1;p")"
sleep 5
url=$(req "$url" - | $HTMLQ --base https://www.apkmirror.com --attribute href ".downloadButton") url=$(req "$url" - | $HTMLQ --base https://www.apkmirror.com --attribute href ".downloadButton")
sleep 5
url=$(req "$url" - | $HTMLQ --base https://www.apkmirror.com --attribute href "span > a[rel = nofollow]") url=$(req "$url" - | $HTMLQ --base https://www.apkmirror.com --attribute href "span > a[rel = nofollow]")
sleep 5
req "$url" "$output" req "$url" "$output"
} }
get_apk() { get_apk() {
@@ -188,35 +211,29 @@ get_apk() {
patch() { patch() {
green_log "[+] Patching $1:" green_log "[+] Patching $1:"
if [ -f "./download/$1.apk" ]; then if [ -f "./download/$1.apk" ]; then
local p b m ks a pu local p b m ks a pu opt
if [ "$3" = inotia ]; then if [ "$3" = inotia ]; then
p="patch " b="--patch-bundle" m="--merge" a="" ks="_ks" pu="--purge=true" p="patch " b="--patch-bundle *patch*.jar" m="--merge *integration*.apk " a="" ks="_ks" pu="--purge=true" opt="--options=./src/options/$2.json "
echo "Patching with Revanced-cli inotia" echo "Patching with Revanced-cli inotia"
else else
if [[ $(ls revanced-cli-*.jar) =~ revanced-cli-([0-9]+) ]]; then if [[ $(ls revanced-cli-*.jar) =~ revanced-cli-([0-9]+) ]]; then
num=${BASH_REMATCH[1]} num=${BASH_REMATCH[1]}
if [ $num -ge 4 ]; then if [ $num -ge 5 ]; then
p="patch " b="--patch-bundle" m="--merge" a="" ks="ks" pu="--purge=true" p="patch " b="-p *.rvp" m="" a="" ks="ks" pu="--purge=true" opt=""
echo "Patching with Revanced-cli version 4+" echo "Patching with Revanced-cli version 5+"
elif [ $num -eq 4 ]; then
p="patch " b="--patch-bundle *patch*.jar" m="--merge *integration*.apk " a="" ks="ks" pu="--purge=true" opt="--options=./src/options/$2.json "
echo "Patching with Revanced-cli version 4"
elif [ $num -eq 3 ]; then elif [ $num -eq 3 ]; then
p="patch " b="--patch-bundle" m="--merge" a="" ks="_ks" pu="--purge=true" p="patch " b="--patch-bundle *patch*.jar" m="--merge *integration*.apk " a="" ks="_ks" pu="--purge=true" opt="--options=./src/options/$2.json "
echo "Patching with Revanced-cli version 3" echo "Patching with Revanced-cli version 3"
elif [ $num -eq 2 ]; then elif [ $num -eq 2 ]; then
p="" b="--bundle" m="--merge" a="--apk " ks="_ks" pu="--clean" p="" b="--bundle *patch*.jar" m="--merge *integration*.apk " a="--apk " ks="_ks" pu="--clean" opt="--options=./src/options/$2.json "
echo "Patching with Revanced-cli version 2" echo "Patching with Revanced-cli version 2"
fi fi
fi fi
fi fi
eval java -jar *cli*.jar $p\ eval java -jar *cli*.jar $p$b $m$opt--out=./release/$1-$2.apk$excludePatches$includePatches --keystore=./src/$ks.keystore $pu $a./download/$1.apk
$b *patch*.jar \
$m *integration*.apk\
$excludePatches\
$includePatches \
--options=./src/options/$2.json \
--out=./release/$1-$2.apk \
--keystore=./src/$ks.keystore \
$pu \
$a./download/$1.apk
unset version unset version
unset excludePatches unset excludePatches
unset includePatches unset includePatches

View File

@@ -1 +0,0 @@

View File

@@ -1 +0,0 @@

View File

@@ -1 +0,0 @@

View File

@@ -1 +0,0 @@

View File

@@ -1 +0,0 @@

View File

@@ -1 +0,0 @@

View File

@@ -1 +0,0 @@

View File

@@ -1 +0,0 @@

View File

@@ -1 +0,0 @@

View File

@@ -1 +0,0 @@

View File

@@ -1 +0,0 @@

View File

@@ -1 +0,0 @@

View File

@@ -1 +0,0 @@

View File

@@ -1 +0,0 @@

View File

@@ -1 +0,0 @@

View File

@@ -1 +0,0 @@

View File

@@ -1 +0,0 @@

View File

@@ -1 +0,0 @@

View File

@@ -1 +0,0 @@

View File

@@ -1 +0,0 @@

View File

@@ -1 +0,0 @@

View File

@@ -1 +0,0 @@

View File

@@ -1 +0,0 @@

View File

@@ -1 +0,0 @@
debug-mode

View File

@@ -1 +0,0 @@

View File

@@ -1 +0,0 @@

View File

@@ -1 +0,0 @@

View File

@@ -1 +0,0 @@

View File

@@ -1 +0,0 @@
Custom branding name for YouTube Music

View File

@@ -1,18 +1,2 @@
Custom branding icon YouTube Custom branding icon YouTube
Enable compact controls overlay
Disable QUIC protocol
Disable auto captions
Disable HDR video
Enable zen mode
Hide account menu
Hide autoplay button
Hide autoplay preview
Hide captions button
Hide description components
Hide handle
Hide latest videos button
Hide load more button
Hide mix playlists
Hide previous next button
Custom seekbar color
Translations Translations