diff --git a/.github/workflows/patch-test.yml b/.github/workflows/patch-test.yml new file mode 100644 index 0000000..06a5964 --- /dev/null +++ b/.github/workflows/patch-test.yml @@ -0,0 +1,218 @@ +name: TEST Patch Revanced & Revanced Extended +on: + schedule: + - cron: "0 0 */5 * *" + workflow_dispatch: +jobs: + patch: + name: Patch Revanced & Revanced Extended + permissions: write-all + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Set up jdk + uses: actions/setup-java@v3.10.0 + with: + distribution: 'zulu' + java-version: '17' + + - name: Patch Youtube Revanced & Revanced Extended non-root + run: bash src/yt/patch.sh + + - name: Patch Youtube Music Revanced & Revanced Extended non-root + run: bash src/ytm/patch.sh + + - name: Patch Messenger Revanced + env: + GMAIL: ${{ secrets.GMAIL }} + PASSWORD: ${{ secrets.PASSWORD }} + run: | + echo "[google] + username = $GMAIL + password = $PASSWORD" >> ~/apkeep.ini + bash src/messenger/patch.sh + + - name: Patch Tiktok Revanced + env: + GMAIL: ${{ secrets.GMAIL }} + PASSWORD: ${{ secrets.PASSWORD }} + run: | + echo "[google] + username = $GMAIL + password = $PASSWORD" >> ~/apkeep.ini + bash src/tiktok/patch.sh + + - name: Patch Twitch Revanced + run: bash src/twitch/patch.sh + + - name: Patch Twitter Revanced + env: + GMAIL: ${{ secrets.GMAIL }} + PASSWORD: ${{ secrets.PASSWORD }} + run: | + echo "[google] + username = $GMAIL + password = $PASSWORD" >> ~/apkeep.ini + bash src/twitter/patch.sh + + - name: Patch Instagram Revanced + env: + GMAIL: ${{ secrets.GMAIL }} + PASSWORD: ${{ secrets.PASSWORD }} + run: | + echo "[google] + username = $GMAIL + password = $PASSWORD" >> ~/apkeep.ini + bash src/instagram/patch.sh + + - name: Generate Changelog + run: | + curl -s https://api.github.com/repos/revanced/revanced-patches/releases/latest \ + | grep "browser_download_url.*json" \ + | cut -d : -f 2,3 \ + | tr -d \" \ + | wget -qi - + 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 \ + | grep "browser_download_url.*json" \ + | cut -d : -f 2,3 \ + | tr -d \" \ + | wget -qi - + 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 \ + | grep "browser_download_url.*json" \ + | cut -d : -f 2,3 \ + | tr -d \" \ + | wget -qi - + 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 "[Change Log](https://github.com/revanced/revanced-patches/releases/latest) + **Download Below** :point_down: + " > ${{ github.workspace }}-CHANGELOG-rv.txt + echo "[Change Log](https://github.com/inotia00/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 + echo "INFO-YTM-RVE=Youtube Music Revanced Extended v${YTMRVEVERSION}" >> $GITHUB_ENV + + - uses: vishnudxb/cancel-workflow@v1.2 + if: failure() + with: + repo: octocat/hello-world + workflow_id: ${{ github.run_id }} + access_token: ${{ github.token }} + + - name: Delete Release + uses: dev-drprasad/delete-older-releases@v0.2.1 + with: + repo: ${{ github.repository }} + keep_latest: 0 + delete_tags: false + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Release Youtube Music Revanced + uses: softprops/action-gh-release@v1 + with: + files: ytm-revanced.apk + name: ${{ env.INFO-YTM-RV }} + tag_name: YTM-Revanced + 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 + name: ${{ env.INFO-YTM-RVE }} + tag_name: YTM-Revanced-Extended + body_path: ${{ github.workspace }}-CHANGELOG-rve.txt + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Release Youtube Revanced + uses: softprops/action-gh-release@v1 + with: + files: yt-revanced.apk + name: ${{ env.INFO-YT-RV }} + tag_name: YT-Revanced + body_path: ${{ github.workspace }}-CHANGELOG-rv.txt + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Release Youtube Revanced Extended + uses: softprops/action-gh-release@v1 + with: + files: yt-revanced-extended.apk + name: ${{ env.INFO-YT-RVE }} + tag_name: YT-Revanced-Extended + body_path: ${{ github.workspace }}-CHANGELOG-rve.txt + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Release Tiktok Revanced + uses: softprops/action-gh-release@v1 + with: + files: Tiktok.apk + name: "Tiktok" + tag_name: Tiktok-Revanced + body_path: ${{ github.workspace }}-CHANGELOG-rv.txt + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Release Twitch Revanced + uses: softprops/action-gh-release@v1 + with: + files: Twitch.apk + name: "Twitch" + tag_name: Twitch-Revanced + body_path: ${{ github.workspace }}-CHANGELOG-rv.txt + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Release Facebook Messenger Revanced + uses: softprops/action-gh-release@v1 + with: + files: Messenger.apk + name: "Facebook Messenger" + tag_name: Facebook-Messenger-Revanced + body_path: ${{ github.workspace }}-CHANGELOG-rv.txt + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Release Twitter Revanced + uses: softprops/action-gh-release@v1 + with: + files: Twitter.apk + name: "Twitter" + tag_name: Twitter-Revanced + body_path: ${{ github.workspace }}-CHANGELOG-rv.txt + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Release Instagram Revanced + uses: softprops/action-gh-release@v1 + with: + files: Instagram.apk + name: "Instagram" + tag_name: Instagram-Revanced + body_path: ${{ github.workspace }}-CHANGELOG-rv.txt + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Delete workflow runs + uses: Mattraks/delete-workflow-runs@v2 + with: + token: ${{ github.token }} + repository: ${{ github.repository }} + retain_days: 0 + keep_minimum_runs: 5 diff --git a/src/instagram/exclude-patches.txt b/src/instagram/exclude-patches.txt new file mode 100644 index 0000000..e69de29 diff --git a/src/instagram/patch.sh b/src/instagram/patch.sh new file mode 100644 index 0000000..2d51795 --- /dev/null +++ b/src/instagram/patch.sh @@ -0,0 +1,23 @@ +#!/bin/bash +DIR_TMP="$(mktemp -d)" + +echo "⏬ Downloading Revanced resources..." +for repos in revanced-patches revanced-cli revanced-integrations; do + curl -s "https://api.github.com/repos/revanced/$repos/releases/latest" | jq -r '.assets[].browser_download_url' | xargs -n 1 curl -sL -O +done + +echo "⚙️ Importing Patches..." +EXCLUDE_PATCHES=() +for word in $(cat src/instagram/exclude-patches.txt) ; do + EXCLUDE_PATCHES+=("-e $word") +done + +echo "⏬ Downloading apkeep resources..." +curl --retry 10 --retry-max-time 60 -H "Cache-Control: no-cache" -fsSL github.com/EFForg/apkeep/releases/latest/download/apkeep-x86_64-unknown-linux-gnu -o ${DIR_TMP}/apkeep + +echo "⏬ Downloading Instagram..." +chmod +x ${DIR_TMP}/apkeep +${DIR_TMP}/apkeep -a com.instagram.android -d google-play -o split_apk=false,locale=vi_VN -i ~/apkeep.ini . + +echo "⚙️ Patching Instagram..." +java -jar revanced-cli*.jar -m revanced-integrations*.apk -b revanced-patches*.jar ${EXCLUDE_PATCHES[@]} -a com.instagram.android.apk --keystore=ks.keystore -o Instagram.apk diff --git a/src/messenger/patch.sh b/src/messenger/patch.sh index 83afddc..fb2a33e 100644 --- a/src/messenger/patch.sh +++ b/src/messenger/patch.sh @@ -1,12 +1,23 @@ #!/bin/bash DIR_TMP="$(mktemp -d)" + +echo "⏬ Downloading Revanced resources..." for repos in revanced-patches revanced-cli revanced-integrations; do curl -s "https://api.github.com/repos/revanced/$repos/releases/latest" | jq -r '.assets[].browser_download_url' | xargs -n 1 curl -sL -O done + +echo "⚙️ Importing Patches..." EXCLUDE_PATCHES=() for word in $(cat src/messenger/exclude-patches.txt) ; do EXCLUDE_PATCHES+=("-e $word") done -curl --retry 10 --retry-max-time 60 -H "Cache-Control: no-cache" -fsSL github.com/EFForg/apkeep/releases/latest/download/apkeep-x86_64-unknown-linux-gnu -o ${DIR_TMP}/apkkeep -chmod +x ${DIR_TMP}/apkkeep && ${DIR_TMP}/apkkeep -a com.facebook.orca . + +echo "⏬ Downloading apkeep resources..." +curl --retry 10 --retry-max-time 60 -H "Cache-Control: no-cache" -fsSL github.com/EFForg/apkeep/releases/latest/download/apkeep-x86_64-unknown-linux-gnu -o ${DIR_TMP}/apkeep + +echo "⏬ Downloading Messenger..." +chmod +x ${DIR_TMP}/apkeep +${DIR_TMP}/apkeep -a com.facebook.orca -d google-play -o split_apk=false,locale=vi_VN -i ~/apkeep.ini . + +echo "⚙️ Patching Messenger..." java -jar revanced-cli*.jar -m revanced-integrations*.apk -b revanced-patches*.jar ${EXCLUDE_PATCHES[@]} -a com.facebook.orca.apk --keystore=ks.keystore -o Messenger.apk \ No newline at end of file diff --git a/src/tiktok/patch.sh b/src/tiktok/patch.sh index 3041627..2b405e0 100644 --- a/src/tiktok/patch.sh +++ b/src/tiktok/patch.sh @@ -1,15 +1,23 @@ #!/bin/bash DIR_TMP="$(mktemp -d)" + +echo "⏬ Downloading Revanced resources..." for repos in revanced-patches revanced-cli revanced-integrations; do curl -s "https://api.github.com/repos/revanced/$repos/releases/latest" | jq -r '.assets[].browser_download_url' | xargs -n 1 curl -sL -O done + +echo "⚙️ Importing Patches..." EXCLUDE_PATCHES=() for word in $(cat src/tiktok/exclude-patches.txt) ; do EXCLUDE_PATCHES+=("-e $word") done + echo "⏬ Downloading apkeep resources..." -curl --retry 10 --retry-max-time 60 -H "Cache-Control: no-cache" -fsSL github.com/EFForg/apkeep/releases/latest/download/apkeep-x86_64-unknown-linux-gnu -o ${DIR_TMP}/apkkeep +curl --retry 10 --retry-max-time 60 -H "Cache-Control: no-cache" -fsSL github.com/EFForg/apkeep/releases/latest/download/apkeep-x86_64-unknown-linux-gnu -o ${DIR_TMP}/apkeep + echo "⏬ Downloading Titok..." -chmod +x ${DIR_TMP}/apkkeep && ${DIR_TMP}/apkkeep -a com.ss.android.ugc.trill@29.3.3 . +chmod +x ${DIR_TMP}/apkeep +${DIR_TMP}/apkeep -a com.ss.android.ugc.trill -d google-play -o split_apk=false,locale=vi_VN -i ~/apkeep.ini . + echo "⚙️ Patching Tiktok..." -java -jar revanced-cli*.jar -m revanced-integrations*.apk -b revanced-patches*.jar ${EXCLUDE_PATCHES[@]} -a com.ss.android.ugc.trill@29.3.3.apk --keystore=ks.keystore -o Tiktok.apk +java -jar revanced-cli*.jar -m revanced-integrations*.apk -b revanced-patches*.jar ${EXCLUDE_PATCHES[@]} -a com.ss.android.ugc.trill.apk --keystore=ks.keystore -o Tiktok.apk diff --git a/src/twitch/patch.sh b/src/twitch/patch.sh index 4d16b05..2479d29 100644 --- a/src/twitch/patch.sh +++ b/src/twitch/patch.sh @@ -1,13 +1,26 @@ #!/bin/bash DIR_TMP="$(mktemp -d)" + +echo "⏬ Downloading Revanced resources..." for repos in revanced-patches revanced-cli revanced-integrations; do curl -s "https://api.github.com/repos/revanced/$repos/releases/latest" | jq -r '.assets[].browser_download_url' | xargs -n 1 curl -sL -O done + +echo "⚙️ Importing Patches..." EXCLUDE_PATCHES=() for word in $(cat src/twitch/exclude-patches.txt) ; do EXCLUDE_PATCHES+=("-e $word") done + +"⚙️ Finding Twitch patches..." version=$(jq -r '.[] | select(.name == "block-video-ads") | .compatiblePackages[] | select(.name == "tv.twitch.android.app") | .versions[-1]' patches.json) -curl --retry 10 --retry-max-time 60 -H "Cache-Control: no-cache" -fsSL github.com/EFForg/apkeep/releases/latest/download/apkeep-x86_64-unknown-linux-gnu -o ${DIR_TMP}/apkkeep -chmod +x ${DIR_TMP}/apkkeep && ${DIR_TMP}/apkkeep -a tv.twitch.android.app@$version . + +echo "⏬ Downloading apkeep resources..." +curl --retry 10 --retry-max-time 60 -H "Cache-Control: no-cache" -fsSL github.com/EFForg/apkeep/releases/latest/download/apkeep-x86_64-unknown-linux-gnu -o ${DIR_TMP}/apkeep + +echo "⏬ Downloading Twitch..." +chmod +x ${DIR_TMP}/apkeep +${DIR_TMP}/apkeep -a tv.twitch.android.app@$version . + +echo "⚙️ Patching Twitch..." java -jar revanced-cli*.jar -m revanced-integrations*.apk -b revanced-patches*.jar ${EXCLUDE_PATCHES[@]} -a tv.twitch.android.app*.apk --keystore=ks.keystore -o Twitch.apk \ No newline at end of file diff --git a/src/twitter/exclude-patches.txt b/src/twitter/exclude-patches.txt new file mode 100644 index 0000000..e69de29 diff --git a/src/twitter/patch.sh b/src/twitter/patch.sh new file mode 100644 index 0000000..84059a3 --- /dev/null +++ b/src/twitter/patch.sh @@ -0,0 +1,23 @@ +#!/bin/bash +DIR_TMP="$(mktemp -d)" + +echo "⏬ Downloading Revanced resources..." +for repos in revanced-patches revanced-cli revanced-integrations; do + curl -s "https://api.github.com/repos/revanced/$repos/releases/latest" | jq -r '.assets[].browser_download_url' | xargs -n 1 curl -sL -O +done + +echo "⚙️ Importing Patches..." +EXCLUDE_PATCHES=() +for word in $(cat src/twitter/exclude-patches.txt) ; do + EXCLUDE_PATCHES+=("-e $word") +done + +echo "⏬ Downloading apkeep resources..." +curl --retry 10 --retry-max-time 60 -H "Cache-Control: no-cache" -fsSL github.com/EFForg/apkeep/releases/latest/download/apkeep-x86_64-unknown-linux-gnu -o ${DIR_TMP}/apkeep + +echo "⏬ Downloading Twitter..." +chmod +x ${DIR_TMP}/apkeep +${DIR_TMP}/apkeep -a com.twitter.android -d google-play -o split_apk=false,locale=vi_VN -i ~/apkeep.ini . + +echo "⚙️ Patching Twitter..." +java -jar revanced-cli*.jar -m revanced-integrations*.apk -b revanced-patches*.jar ${EXCLUDE_PATCHES[@]} -a com.twitter.android.apk --keystore=ks.keystore -o Twitter.apk diff --git a/src/yt/patch.sh b/src/yt/patch.sh index 5b388f3..a4839c4 100644 --- a/src/yt/patch.sh +++ b/src/yt/patch.sh @@ -9,7 +9,7 @@ readonly revanced_ytversion="" # Input version supported if you need patch speci readonly revanced_extended_name="revanced-extended" readonly revanced_extended_user="inotia00" readonly revanced_extended_patch="src/yt/patches.rve" -readonly revanced_extended_ytversion="18.16.37" # 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 get_patch() { local excluded_start=$(grep -n -m1 'EXCLUDE PATCHES' "$patch_file" | cut -d':' -f1)