Skip to content

Instantly share code, notes, and snippets.

@LudovicoPiero
Last active August 9, 2024 23:35
Show Gist options
  • Save LudovicoPiero/b8d217f8a8aacdd07771a2ac1c47b115 to your computer and use it in GitHub Desktop.
Save LudovicoPiero/b8d217f8a8aacdd07771a2ac1c47b115 to your computer and use it in GitHub Desktop.
Revanced-1-tap

Make sure you have jq installed already.

You need to download the APK manually. 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" "jar" "revanced-patches.jar"
# Download the latest .jar file for revanced-cli
download_latest "ReVanced/revanced-cli" "jar" "revanced-cli.jar"
# Download the latest .apk file for revanced-integrations
download_latest "ReVanced/revanced-integrations" "apk" "revanced-integrations.apk"
#!/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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment