mirror of
https://github.com/FiorenMas/Revanced-And-Revanced-Extended-Non-Root.git
synced 2025-12-06 16:17:40 +00:00
Update patch.sh
This commit is contained in:
49
patch.sh
49
patch.sh
@@ -1,15 +1,15 @@
|
|||||||
`#!/bin/bash
|
#!/bin/bash
|
||||||
set -e
|
set -e
|
||||||
# Set variables for Revanced
|
# Set variables for Revanced
|
||||||
readonly revanced_name="revanced"
|
readonly revanced_name="revanced"
|
||||||
readonly revanced_user="revanced"
|
readonly revanced_user="revanced"
|
||||||
readonly revanced_patch="patches.rv"
|
readonly revanced_patch="patches.rv"
|
||||||
readonly revanced_ytmsversion="" # Input version supported if you need patch specific YT version.Example: "18.03.36"
|
readonly revanced_ytversion="" # Input version supported if you need patch specific YT version.Example: "18.03.36"
|
||||||
# Set variables for Revanced Extended
|
# Set variables for Revanced Extended
|
||||||
readonly revanced_extended_name="revanced-extended"
|
readonly revanced_extended_name="revanced-extended"
|
||||||
readonly revanced_extended_user="inotia00"
|
readonly revanced_extended_user="inotia00"
|
||||||
readonly revanced_extended_patch="patches.rve"
|
readonly revanced_extended_patch="patches.rve"
|
||||||
readonly revanced_extended_ytmsversion="" # Input version supported if you need patch specific YT version.Example: "18.07.35"
|
readonly revanced_extended_ytversion="" # Input version supported if you need patch specific YT version.Example: "18.07.35"
|
||||||
# Function prepare patches keywords
|
# Function prepare patches keywords
|
||||||
get_patch() {
|
get_patch() {
|
||||||
local excluded_start=$(grep -n -m1 'EXCLUDE PATCHES' "$patch_file" | cut -d':' -f1)
|
local excluded_start=$(grep -n -m1 'EXCLUDE PATCHES' "$patch_file" | cut -d':' -f1)
|
||||||
@@ -40,22 +40,14 @@ download_latest_release() {
|
|||||||
req() {
|
req() {
|
||||||
curl -sSL -H "User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:111.0) Gecko/20100101 Firefox/111.0" "$1" -o "$2"
|
curl -sSL -H "User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:111.0) Gecko/20100101 Firefox/111.0" "$1" -o "$2"
|
||||||
}
|
}
|
||||||
dl_ytm() {
|
dl_yt() {
|
||||||
rm -rf $2
|
rm -rf $2
|
||||||
echo "Downloading YouTubeMusic $1"
|
echo "⏬ Downloading YouTube $1..."
|
||||||
url="https://www.apkmirror.com/apk/google-inc/youtube/youtube-music-${1//./-}-release/"
|
url="https://www.apkmirror.com/apk/google-inc/youtube/youtube-${1//./-}-release/"
|
||||||
url="$url$(req "$url" - | grep arm64 -A30 | grep youtube-music | head -1 | sed "s#.*-release/##g;s#/\".*##g")"
|
url="$url$(req "$url" - | grep Variant -A50 | grep ">APK<" -A2 | grep android-apk-download | sed "s#.*-release/##g;s#/\#.*##g")"
|
||||||
url="https://www.apkmirror.com$(req "$url" - | tr '\n' ' ' | sed -n 's;.*href="\(.*key=[^"]*\)">.*;\1;p')"
|
url="https://www.apkmirror.com$(req "$url" - | tr '\n' ' ' | sed -n 's;.*href="\(.*key=[^"]*\)">.*;\1;p')"
|
||||||
url="https://www.apkmirror.com$(req "$url" - | tr '\n' ' ' | sed -n 's;.*href="\(.*key=[^"]*\)">.*;\1;p')"
|
url="https://www.apkmirror.com$(req "$url" - | tr '\n' ' ' | sed -n 's;.*href="\(.*key=[^"]*\)">.*;\1;p')"
|
||||||
req "$url" "$2"
|
req "$url" "$2"
|
||||||
}
|
|
||||||
get_latestytmversion() {
|
|
||||||
url="https://www.apkmirror.com/apk/google-inc/youtube-music/"
|
|
||||||
ytmsversion=$(req "$url" - | grep "All version" -A200 | grep app_release | sed 's:.*/youtube-music-::g;s:-release/.*::g;s:-:.:g' | sort -r | head -1)
|
|
||||||
echo "Latest YoutubeMusic Version: $ytmsversion"
|
|
||||||
}
|
|
||||||
get_support_version() {
|
|
||||||
ytmsversion=$(jq -r '.[] | select(.name == "hide-get-premium") | .compatiblePackages[] | select(.name == "com.google.android.apps.youtube.music") | .versions[-1]' patches.json)
|
|
||||||
}
|
}
|
||||||
# Function Patch APK
|
# Function Patch APK
|
||||||
patch_apk() {
|
patch_apk() {
|
||||||
@@ -63,10 +55,10 @@ echo "⚙️ Patching YouTube..."
|
|||||||
java -jar revanced-cli*.jar \
|
java -jar revanced-cli*.jar \
|
||||||
-m revanced-integrations*.apk \
|
-m revanced-integrations*.apk \
|
||||||
-b revanced-patches*.jar \
|
-b revanced-patches*.jar \
|
||||||
-a youtube-music-v$ytmsversion.apk \
|
-a youtube-v$ytversion.apk \
|
||||||
${patches[@]} \
|
${patches[@]} \
|
||||||
--keystore=ks.keystore \
|
--keystore=ks.keystore \
|
||||||
-o ytms-$name-v$ytmsversion.apk
|
-o yt-$name.apk
|
||||||
}
|
}
|
||||||
# Function clean caches to new build
|
# Function clean caches to new build
|
||||||
clean_cache() {
|
clean_cache() {
|
||||||
@@ -84,20 +76,19 @@ for name in $revanced_name $revanced_extended_name ; do
|
|||||||
if [[ "$name" = "$revanced_name" ]]; then
|
if [[ "$name" = "$revanced_name" ]]; then
|
||||||
user="$revanced_user"
|
user="$revanced_user"
|
||||||
patch_file="$revanced_patch"
|
patch_file="$revanced_patch"
|
||||||
ytmsversion="$revanced_ytmsversion"
|
ytversion="$revanced_ytversion"
|
||||||
else
|
else
|
||||||
user="$revanced_extended_user"
|
user="$revanced_extended_user"
|
||||||
patch_file="$revanced_extended_patch"
|
patch_file="$revanced_extended_patch"
|
||||||
ytmsversion="$revanced_extended_ytmsversion"
|
ytversion="$revanced_extended_ytversion"
|
||||||
fi
|
fi
|
||||||
get_patch
|
get_patch
|
||||||
download_latest_release
|
download_latest_release
|
||||||
if [[ "$name" = "$revanced_name" ]] ; then
|
if [[ $ytversion ]] ;
|
||||||
get_support_version
|
then dl_yt $ytversion youtube-v$ytversion.apk
|
||||||
dl_ytm $ytmsversion youtube-music-v$ytmsversion.apk
|
else ytversion=$(jq -r '.[] | select(.name == "microg-support") | .compatiblePackages[] | select(.name == "com.google.android.youtube") | .versions[-1]' patches.json)
|
||||||
else get_latestytmversion
|
dl_yt $ytversion youtube-v$ytversion.apk
|
||||||
dl_ytm $ytmsversion youtube-music-v$ytmsversion.apk
|
|
||||||
fi
|
fi
|
||||||
patch_apk
|
patch_apk
|
||||||
clean_cache
|
clean_cache
|
||||||
done`
|
done
|
||||||
|
|||||||
Reference in New Issue
Block a user