From 1f071748cf412de474186804d7112398ca82dc0b Mon Sep 17 00:00:00 2001 From: FiorenMas <102145692+FiorenMas@users.noreply.github.com> Date: Sat, 22 Apr 2023 10:49:40 +0700 Subject: [PATCH] Commit --- .github/workflows/patch.yml | 36 +++--- README.md | 2 +- yt/ks.keystore => ks.keystore | Bin yt/patches-yt.rv => patches/ytrv-patches.txt | 0 .../ytrve-patches.txt | 2 +- src/config.sh | 118 ++++++++++++++++++ src/patch.sh | 50 ++++++++ yt/patch-yt.sh | 94 -------------- ytm/ks.keystore | Bin 2040 -> 0 bytes ytm/patch-ytm.sh | 103 --------------- ytm/patches-ytm.rv | 12 -- ytm/patches-ytm.rve | 12 -- 12 files changed, 189 insertions(+), 240 deletions(-) rename yt/ks.keystore => ks.keystore (100%) rename yt/patches-yt.rv => patches/ytrv-patches.txt (100%) rename yt/patches-yt.rve => patches/ytrve-patches.txt (97%) create mode 100644 src/config.sh create mode 100644 src/patch.sh delete mode 100644 yt/patch-yt.sh delete mode 100644 ytm/ks.keystore delete mode 100644 ytm/patch-ytm.sh delete mode 100644 ytm/patches-ytm.rv delete mode 100644 ytm/patches-ytm.rve diff --git a/.github/workflows/patch.yml b/.github/workflows/patch.yml index 9c247d7..5e1d9b1 100644 --- a/.github/workflows/patch.yml +++ b/.github/workflows/patch.yml @@ -5,6 +5,8 @@ on: workflow_dispatch: jobs: patch: + name: Patch Revanced & Revanced Extended + permissions: write-all runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 @@ -15,11 +17,8 @@ jobs: distribution: 'zulu' java-version: '17' - - name: Patch Youtube Revanced & Revanced Extended non-root - run: bash yt/patch-yt.sh - - - name: Patch Youtube Music Revanced & Revanced Extended non-root - run: bash ytm/patch-ytm.sh + - name: Patch apk + run: bash ./src/patch.sh - name: Generate Changelog run: | @@ -28,7 +27,7 @@ jobs: | cut -d : -f 2,3 \ | tr -d \" \ | wget -qi - - YTRVVERSION=$(jq -r '.[] | select(.name == "microg-support") | .compatiblePackages[] | select(.name == "com.google.android.youtube") | .versions[-1]' patches.json) + YTRVVERSION=$(jq -r '.[] | select(.name == "video-ads") | .compatiblePackages[] | select(.name == "com.google.android.youtube") | .versions[-1]' patches.json) rm -rf patches.json curl -s https://api.github.com/repos/inotia00/revanced-patches/releases/latest \ @@ -36,7 +35,7 @@ jobs: | cut -d : -f 2,3 \ | tr -d \" \ | wget -qi - - YTRVEVERSION=$(jq -r '.[] | select(.name == "microg-support") | .compatiblePackages[] | select(.name == "com.google.android.youtube") | .versions[-1]' patches.json) + YTRVEVERSION=$(jq -r '.[] | select(.name == "hide-general-ads") | .compatiblePackages[] | select(.name == "com.google.android.youtube") | .versions[-1]' patches.json) rm -rf patches.json curl -s https://api.github.com/repos/revanced/revanced-patches/releases/latest \ @@ -47,7 +46,12 @@ jobs: YTMRVVERSION=$(jq -r '.[] | select(.name == "hide-get-premium") | .compatiblePackages[] | select(.name == "com.google.android.apps.youtube.music") | .versions[-1]' patches.json) YTMRVEVERSION=$(jq -r '.[] | select(.name == "hide-get-premium") | .compatiblePackages[] | select(.name == "com.google.android.apps.youtube.music") | .versions[-1]' patches.json) rm -rf patches.json - echo "Download Below :point_down:" > ${{ github.workspace }}-CHANGELOG.txt + echo "[**Change Logs**] (https://github.com/revanced/revanced-patches/releases/latest) + Download Below :point_down: + " > ${{ github.workspace }}-CHANGELOG-rv.txt + echo "[**Change Logs**] (https://github.com/revanced/revanced-patches/releases/latest) + Download Below :point_down: + " > ${{ github.workspace }}-CHANGELOG-rve.txt echo "INFO-YT-RV=Youtube Revanced v${YTRVVERSION}" >> $GITHUB_ENV echo "INFO-YT-RVE=Youtube Revanced Extended v${YTRVEVERSION}" >> $GITHUB_ENV echo "INFO-YTM-RV=Youtube Music Revanced v${YTMRVVERSION}" >> $GITHUB_ENV @@ -71,20 +75,20 @@ jobs: - name: Release Youtube Music Revanced uses: softprops/action-gh-release@v1 with: - files: ytm-revanced.apk + files: ytms-revanced.apk name: ${{ env.INFO-YTM-RV }} tag_name: YTM-Revanced - body_path: ${{ github.workspace }}-CHANGELOG.txt + body_path: ${{ github.workspace }}-CHANGELOG-rv.txt env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Release Youtube Music Revanced Extended uses: softprops/action-gh-release@v1 with: - files: ytm-revanced-extended.apk + files: ytms-revanced-extended.apk name: ${{ env.INFO-YTM-RVE }} tag_name: YTM-Revanced-Extended - body_path: ${{ github.workspace }}-CHANGELOG.txt + body_path: ${{ github.workspace }}-CHANGELOG-rve.txt env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -94,7 +98,7 @@ jobs: files: yt-revanced.apk name: ${{ env.INFO-YT-RV }} tag_name: YT-Revanced - body_path: ${{ github.workspace }}-CHANGELOG.txt + body_path: ${{ github.workspace }}-CHANGELOG-rv.txt env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -104,7 +108,7 @@ jobs: files: yt-revanced-extended.apk name: ${{ env.INFO-YT-RVE }} tag_name: YT-Revanced-Extended - body_path: ${{ github.workspace }}-CHANGELOG.txt + body_path: ${{ github.workspace }}-CHANGELOG-rve.txt env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -114,6 +118,4 @@ jobs: token: ${{ github.token }} repository: ${{ github.repository }} retain_days: 0 - keep_minimum_runs: 5 - -permissions: write-all + keep_minimum_runs: 5 diff --git a/README.md b/README.md index ee5705a..45faf25 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ # MicroG from inotia00 source: -[![Release](https://img.shields.io/github/v/release/inotia00/VancedMicroG.svg)](https://github.com/inotia00/VancedMicroG/releases/latest/download/microg.apk) +[![Release](https://img.shields.io/github/v/release/inotia00/vancedmicrog?label=MicroG&style=for-the-badge)](https://github.com/inotia00/VancedMicroG/releases/latest/download/microg.apk) # About This repository forked from [@luxysiv](https://github.com/luxysiv/yt-revanced-nonroot) diff --git a/yt/ks.keystore b/ks.keystore similarity index 100% rename from yt/ks.keystore rename to ks.keystore diff --git a/yt/patches-yt.rv b/patches/ytrv-patches.txt similarity index 100% rename from yt/patches-yt.rv rename to patches/ytrv-patches.txt diff --git a/yt/patches-yt.rve b/patches/ytrve-patches.txt similarity index 97% rename from yt/patches-yt.rve rename to patches/ytrve-patches.txt index 285e3f8..965a3e0 100644 --- a/yt/patches-yt.rve +++ b/patches/ytrve-patches.txt @@ -21,4 +21,4 @@ downloads remember-video-quality client-spoof general-ads -video-ads +video-ads \ No newline at end of file diff --git a/src/config.sh b/src/config.sh new file mode 100644 index 0000000..a7ca858 --- /dev/null +++ b/src/config.sh @@ -0,0 +1,118 @@ +#!/bin/bash +# Function prepare patches keywords +get_patch() { + local excluded_start=$(grep -n -m1 'EXCLUDE PATCHES' "$patch_file" | cut -d':' -f1) + local included_start=$(grep -n -m1 'INCLUDE PATCHES' "$patch_file" | cut -d':' -f1) + local excluded_patches=$(tail -n +$excluded_start $patch_file | head -n "$(( included_start - excluded_start ))" | grep '^[^#[:blank:]]') + local included_patches=$(tail -n +$included_start $patch_file | grep '^[^#[:blank:]]') + patches=() + if [[ -n "$excluded_patches" ]]; then + while read -r patch; do + patches+=("-e $patch") + done <<< "$excluded_patches" + fi + if [[ -n "$included_patches" ]]; then + while read -r patch; do + patches+=("-i $patch") + done <<< "$included_patches" + fi +} +# Function download latest github releases +download_latest_release() { + echo "๐Ÿ”ฝ Downloading $name resources" + for repo in revanced-patches revanced-cli revanced-integrations; do + local url="https://api.github.com/repos/$user/$repo/releases/latest" + echo "๐Ÿ” Searching for download link at $url" + curl -s "$url" | jq -r '.assets[] | "\(.name) \(.browser_download_url)"' | while read name download_url; do + echo "๐Ÿ“ฅ Downloading $name from $download_url" + curl -O -s -L "$download_url" + echo "โœ… Download $name complete!" + done + done +} +# Function download YouTube and YouTube Music apk from APKmirror +req() { + curl -sSL -H "User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:111.0) Gecko/20100101 Firefox/111.0" "$1" -o "$2" +} +dl_yt() { + rm -rf $2 + echo "๐Ÿ”ฝ Downloading YouTube version $1" + url="https://www.apkmirror.com/apk/google-inc/youtube/youtube-${1//./-}-release/" + echo "๐Ÿ” Searching for download link at $url" + 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')" + echo "๐Ÿ“ฅ Downloading from $url" + if req "$url" "$2" ; then + echo "โœ… Download complete!" + else + echo "โŒ Download failed." + fi +} +dl_ytms() { + rm -rf $2 + echo "๐Ÿ”ฝ Downloading YouTube Music version $1" + url="https://www.apkmirror.com/apk/google-inc/youtube/youtube-music-${1//./-}-release/" + echo "๐Ÿ” Searching for download link at $url" + url="$url$(req "$url" - | grep arm64 -A30 | grep youtube-music | head -1 | 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')" + echo "๐Ÿ“ฅ Downloading from $url" + if req "$url" "$2" ; then + echo "โœ… Download complete!" + else + echo "โŒ Download failed." + fi +} +# Function fletch latest supported version can patch +get_support_ytversion() { + if [[ "$name" = "$revanced_name" ]] ; then + ytversion=$(jq -r '.[] | select(.name == "video-ads") | .compatiblePackages[] | select(.name == "com.google.android.youtube") | .versions[-1]' patches.json) + echo "โœ…๏ธ Found YouTube version: $ytversion" + else + ytversion=$(jq -r '.[] | select(.name == "hide-general-ads") | .compatiblePackages[] | select(.name == "com.google.android.youtube") | .versions[-1]' patches.json) + echo "โœ…๏ธ Found YouTube version: $ytversion" + fi +} +get_support_ytmsversion() { + ytmsversion=$(jq -r '.[] | select(.name == "hide-get-premium") | .compatiblePackages[] | select(.name == "com.google.android.apps.youtube.music") | .versions[-1]' patches.json) + echo "โœ…๏ธ Found YouTube Music version: $ytmsversion" +} +get_latest_ytmsversion() { + 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 "โœ…๏ธ Found YouTube Music version: $ytmsversion" +} +# Function Patch APK +patch_yt() { + if [ -f "youtube-v$ytversion.apk" ]; then + echo "โš™๏ธ Patching YouTube" + java -jar revanced-cli*.jar -m revanced-integrations*.apk -b revanced-patches*.jar -a youtube-v$ytversion.apk ${patches[@]} --keystore=ks.keystore -o yt-$name.apk + echo "โœ… Patch Complete!" + else + echo "โŒ YouTube APK not found, skipping patching" + fi +} +patch_msrv() { + if [ -f "youtube-music-v$ytmsversion.apk" ]; then + echo "โš™๏ธ Patching YouTube Music" + java -jar revanced-cli*.jar -m revanced-integrations*.apk -b revanced-patches*.jar -a youtube-music-v$ytmsversion.apk --keystore=ks.keystore -o ytms-$name.apk + echo "โœ… Patch Complete!" + else + echo "โŒ YouTube Music APK not found, skipping patching" + fi +} +patch_msrve() { + if [ -f "youtube-music-v$ytmsversion.apk" ]; then + echo "โš™๏ธ Patching YouTube Music" + java -jar revanced-cli*.jar -m revanced-integrations*.apk -b revanced-patches*.jar -a youtube-music-v$ytmsversion.apk -e custom-branding-music-afn-red --keystore=ks.keystore -o ytms-$name.apk + echo "โœ… Patch Complete!" + else + echo "โŒ YouTube Music APK not found, skipping patching" + fi +} +# Function clean caches to new build +clean_cache() { + echo "๐Ÿงน Clean cache" + rm -f revanced-cli*.jar revanced-integrations*.apk revanced-patches*.jar patches.json options.toml youtube*.apk +} diff --git a/src/patch.sh b/src/patch.sh new file mode 100644 index 0000000..00b923b --- /dev/null +++ b/src/patch.sh @@ -0,0 +1,50 @@ +#!/bin/bash +set -e +source ./src/config.sh +# Set variables for Revanced +readonly revanced_name="revanced" +readonly revanced_user="revanced" +readonly revanced_patch="./patches/ytrv-patches.txt" +readonly revanced_ytversion="" # Input version supported if you need patch specific YT version.Example: "18.03.36" +# Set variables for Revanced Extended +readonly revanced_extended_name="revanced-extended" +readonly revanced_extended_user="inotia00" +readonly revanced_extended_patch="./patches/ytrve-patches.txt" +readonly revanced_extended_ytversion="" # Input version supported if you need patch specific YT version.Example: "18.07.35" +# Loop over Revanced & Revanced Extended +for name in $revanced_name $revanced_extended_name ; do + # Select variables based on name + if [[ "$name" = "$revanced_name" ]]; then + user="$revanced_user" + patch_file="$revanced_patch" + key="$revanced_patch_key" + ytversion="$revanced_ytversion" + else + user="$revanced_extended_user" + patch_file="$revanced_extended_patch" + key="$revanced_extended_patch_key" + ytversion="$revanced_extended_ytversion" + fi +get_patch +download_latest_release + # Patch YouTube + if [[ $ytversion ]] ; then + dl_yt $ytversion youtube-v$ytversion.apk + patch_yt + else + get_support_ytversion + dl_yt $ytversion youtube-v$ytversion.apk + patch_yt + fi + #Patch YouTube Music + if [[ "$name" = "$revanced_name" ]] ; then + get_support_ytmsversion + dl_ytms $ytmsversion youtube-music-v$ytmsversion.apk + patch_msrv + else + get_latest_ytmsversion + dl_ytms $ytmsversion youtube-music-v$ytmsversion.apk + patch_msrve + fi +clean_cache +done diff --git a/yt/patch-yt.sh b/yt/patch-yt.sh deleted file mode 100644 index 642c559..0000000 --- a/yt/patch-yt.sh +++ /dev/null @@ -1,94 +0,0 @@ -#!/bin/bash -set -e -# Set variables for Revanced -readonly revanced_name="revanced" -readonly revanced_user="revanced" -readonly revanced_patch="yt/patches-yt.rv" -readonly revanced_ytversion="" # Input version supported if you need patch specific YT version.Example: "18.03.36" -# Set variables for Revanced Extended -readonly revanced_extended_name="revanced-extended" -readonly revanced_extended_user="inotia00" -readonly revanced_extended_patch="yt/patches-yt.rve" -readonly revanced_extended_ytversion="" # Input version supported if you need patch specific YT version.Example: "18.07.35" -# Function prepare patches keywords -get_patch() { - local excluded_start=$(grep -n -m1 'EXCLUDE PATCHES' "$patch_file" | cut -d':' -f1) - local included_start=$(grep -n -m1 'INCLUDE PATCHES' "$patch_file" | cut -d':' -f1) - local excluded_patches=$(tail -n +$excluded_start $patch_file | head -n "$(( included_start - excluded_start ))" | grep '^[^#[:blank:]]') - local included_patches=$(tail -n +$included_start $patch_file | grep '^[^#[:blank:]]') - patches=() - if [[ -n "$excluded_patches" ]]; then - while read -r patch; do - patches+=("-e $patch") - done <<< "$excluded_patches" - fi - if [[ -n "$included_patches" ]]; then - while read -r patch; do - patches+=("-i $patch") - done <<< "$included_patches" - fi -} -# Function download latest github releases -download_latest_release() { - echo "โฌ Downloading $name resources..." - for repos in revanced-patches revanced-cli revanced-integrations; do - local url="https://api.github.com/repos/$user/$repos/releases/latest" - curl -s "$url" | jq -r '.assets[].browser_download_url' | xargs -n 1 curl -O -s -L - done -} -# Function download YouTube apk from APKmirror -req() { - curl -sSL -H "User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:111.0) Gecko/20100101 Firefox/111.0" "$1" -o "$2" -} -dl_yt() { - rm -rf $2 - echo "โฌ Downloading YouTube $1..." - url="https://www.apkmirror.com/apk/google-inc/youtube/youtube-${1//./-}-release/" - 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')" - req "$url" "$2" -} -# Function Patch APK -patch_apk() { -echo "โš™๏ธ Patching YouTube..." -java -jar revanced-cli*.jar \ - -m revanced-integrations*.apk \ - -b revanced-patches*.jar \ - -a youtube-v$ytversion.apk \ - ${patches[@]} \ - --keystore=ks.keystore \ - -o yt-$name.apk -} -# Function clean caches to new build -clean_cache() { -echo "๐Ÿงน Clean caches..." -rm -f revanced-cli*.jar \ - revanced-integrations*.apk \ - revanced-patches*.jar \ - patches.json \ - options.toml \ - youtube*.apk \ -} -# Loop over Revanced & Revanced Extended -for name in $revanced_name $revanced_extended_name ; do - # Select variables based on name - if [[ "$name" = "$revanced_name" ]]; then - user="$revanced_user" - patch_file="$revanced_patch" - ytversion="$revanced_ytversion" - else - user="$revanced_extended_user" - patch_file="$revanced_extended_patch" - ytversion="$revanced_extended_ytversion" - fi -get_patch -download_latest_release -if [[ $ytversion ]] ; - then dl_yt $ytversion youtube-v$ytversion.apk -else ytversion=$(jq -r '.[] | select(.name == "microg-support") | .compatiblePackages[] | select(.name == "com.google.android.youtube") | .versions[-1]' patches.json) - dl_yt $ytversion youtube-v$ytversion.apk -fi -patch_apk -clean_cache -done diff --git a/ytm/ks.keystore b/ytm/ks.keystore deleted file mode 100644 index 1c07f386d90317cb2a4a5bd7c3ff238e2745d042..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2040 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 W8bw54fk`1(lR}>|DD1Qw@V7YNp}AcE diff --git a/ytm/patch-ytm.sh b/ytm/patch-ytm.sh deleted file mode 100644 index 0274e92..0000000 --- a/ytm/patch-ytm.sh +++ /dev/null @@ -1,103 +0,0 @@ -#!/bin/bash -set -e -# Set variables for Revanced -readonly revanced_name="revanced" -readonly revanced_user="revanced" -readonly revanced_patch="ytm/patches-ytm.rv" -readonly revanced_ytmversion="" # Input version supported if you need patch specific YT version.Example: "18.03.36" -# Set variables for Revanced Extended -readonly revanced_extended_name="revanced-extended" -readonly revanced_extended_user="inotia00" -readonly revanced_extended_patch="ytm/patches-ytm.rve" -readonly revanced_extended_ytmversion="" # Input version supported if you need patch specific YT version.Example: "18.07.35" -# Function prepare patches keywords -get_patch() { - local excluded_start=$(grep -n -m1 'EXCLUDE PATCHES' "$patch_file" | cut -d':' -f1) - local included_start=$(grep -n -m1 'INCLUDE PATCHES' "$patch_file" | cut -d':' -f1) - local excluded_patches=$(tail -n +$excluded_start $patch_file | head -n "$(( included_start - excluded_start ))" | grep '^[^#[:blank:]]') - local included_patches=$(tail -n +$included_start $patch_file | grep '^[^#[:blank:]]') - patches=() - if [[ -n "$excluded_patches" ]]; then - while read -r patch; do - patches+=("-e $patch") - done <<< "$excluded_patches" - fi - if [[ -n "$included_patches" ]]; then - while read -r patch; do - patches+=("-i $patch") - done <<< "$included_patches" - fi -} -# Function download latest github releases -download_latest_release() { - echo "โฌ Downloading $name resources..." - for repos in revanced-patches revanced-cli revanced-integrations; do - local url="https://api.github.com/repos/$user/$repos/releases/latest" - curl -s "$url" | jq -r '.assets[].browser_download_url' | xargs -n 1 curl -O -s -L - done -} -# Function download YouTube apk from APKmirror -req() { - 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() { - rm -rf $2 - echo "Downloading YouTube Music $1" - url="https://www.apkmirror.com/apk/google-inc/youtube/youtube-music-${1//./-}-release/" - url="$url$(req "$url" - | grep arm64 -A30 | grep youtube-music | head -1 | 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')" - req "$url" "$2" -} -get_latestytmversion() { - url="https://www.apkmirror.com/apk/google-inc/youtube-music/" - ytmversion=$(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 Youtube Music Version: $ytmversion" -} -get_support_version() { -ytmversion=$(jq -r '.[] | select(.name == "hide-get-premium") | .compatiblePackages[] | select(.name == "com.google.android.apps.youtube.music") | .versions[-1]' patches.json) -} -# Function Patch APK -patch_ms() { -echo "โš™๏ธ Patching YouTube Music..." -java -jar revanced-cli*.jar \ - -m revanced-integrations*.apk \ - -b revanced-patches*.jar \ - -a youtube-music-v$ytmversion.apk \ - ${patches[@]} \ - --keystore=ks.keystore \ - -o ytm-$name.apk -} -# Function clean caches to new build -clean_cache() { -echo "๐Ÿงน Clean caches..." -rm -f revanced-cli*.jar \ - revanced-integrations*.apk \ - revanced-patches*.jar \ - patches.json \ - options.toml \ - youtube-music*.apk \ -} -# Loop over Revanced & Revanced Extended -for name in $revanced_name $revanced_extended_name ; do - # Select variables based on name - if [[ "$name" = "$revanced_name" ]]; then - user="$revanced_user" - patch_file="$revanced_patch" - ytmversion="$revanced_ytmversion" - else - user="$revanced_extended_user" - patch_file="$revanced_extended_patch" - ytmversion="$revanced_extended_ytmversion" - fi -get_patch -download_latest_release - if [[ "$name" = "$revanced_name" ]] ; then - get_support_version - dl_ytm $ytmversion youtube-music-v$ytmversion.apk - else get_latestytmversion - dl_ytm $ytmversion youtube-music-v$ytmversion.apk -fi -patch_ms -clean_cache -done \ No newline at end of file diff --git a/ytm/patches-ytm.rv b/ytm/patches-ytm.rv deleted file mode 100644 index 42b8b55..0000000 --- a/ytm/patches-ytm.rv +++ /dev/null @@ -1,12 +0,0 @@ -# EXCLUDE PATCHES FROM BELOW -compact-header -# INCLUDE PATCHES FROM BELOW -background-play -codecs-unlock -exclusive-audio-playback -hide-get-premium -minimized-playback-music -music-video-ads -tasteBuilder-remover -upgrade-button-remover -custom-branding-icon-afn-red diff --git a/ytm/patches-ytm.rve b/ytm/patches-ytm.rve deleted file mode 100644 index 42b8b55..0000000 --- a/ytm/patches-ytm.rve +++ /dev/null @@ -1,12 +0,0 @@ -# EXCLUDE PATCHES FROM BELOW -compact-header -# INCLUDE PATCHES FROM BELOW -background-play -codecs-unlock -exclusive-audio-playback -hide-get-premium -minimized-playback-music -music-video-ads -tasteBuilder-remover -upgrade-button-remover -custom-branding-icon-afn-red