Make sure you have jq installed already.
You need to download the APK manually here. Search for the correct version at https://revanced.app/patches
Make sure you have jq installed already.
You need to download the APK manually here. Search for the correct version at https://revanced.app/patches
| #!/usr/bin/env bash | |
| set -euo pipefail | |
| # Function to download the latest file from a GitHub release | |
| download_latest() { | |
| local repo=$1 | |
| local file_ext=$2 | |
| local file_name=$3 | |
| # Check if the file already exists | |
| if [[ -f "$file_name" ]]; then | |
| echo "$file_name already exists. Skipping download." | |
| return | |
| fi | |
| echo "Fetching download URL for $repo..." | |
| download_url=$(curl -s "https://api.github.com/repos/$repo/releases/latest" | jq -r ".assets[] | select(.name | endswith(\".$file_ext\")) | .browser_download_url") | |
| if [[ -z "$download_url" ]]; then | |
| echo "Error: No file found for extension .$file_ext in $repo." | |
| exit 1 | |
| fi | |
| echo "Downloading $file_name from $download_url..." | |
| curl -sL "$download_url" -o "$file_name" || { | |
| echo "Error downloading $file_name" | |
| exit 1 | |
| } | |
| echo "Downloaded latest $file_name" | |
| } | |
| # Download the latest .jar file for revanced-patches | |
| download_latest "ReVanced/revanced-patches" "rvp" "revanced-patches.rvp" | |
| # Download the latest .jar file for revanced-cli | |
| download_latest "ReVanced/revanced-cli" "jar" "revanced-cli.jar" |
| #!/usr/bin/env bash | |
| set -euo pipefail | |
| if [[ $# -ne 1 ]]; then | |
| echo "Usage: $0 {twitter|yt|yt-music}" | |
| exit 1 | |
| fi | |
| case $1 in | |
| yt) | |
| apk_file="youtube.apk" | |
| ;; | |
| yt-music) | |
| apk_file="youtube-music.apk" | |
| ;; | |
| twitter) | |
| apk_file="twitter.apk" | |
| ;; | |
| *) | |
| echo "Invalid argument: $1" | |
| echo "Usage: $0 {twitter|yt|yt-music}" | |
| exit 1 | |
| ;; | |
| esac | |
| # java -jar revanced-cli.jar patch --patch-bundle revanced-patches.jar -m revanced-integrations.apk | |
| java -jar revanced-cli.jar patch -p revanced-patches.rvp "$apk_file" |