revanced-magisk-module/build-module.sh
j-hc f632c95ac1 magisk module
Former-commit-id: a60590db115681bd27e057ba49b8537affabb6ac
2022-06-25 18:18:30 +03:00

56 lines
1.7 KiB
Bash
Executable File

#!/bin/bash
echo "All necessary files (revanced cli, patches and integrations) will be downloaded, Youtube apk will be patched and zipped into a Magisk module"
read -p "Continue? (y/n): " confirm
if [[ ! $confirm == [yY] ]]; then
exit 0
fi
# CURRENT VERSION
YTBASE="base-v17.24.34.apk"
OUTPUT="revanced-magisk-v17.24.34.zip"
function dl() {
wget -q --show-progress $1 || {
echo "Download Failed"
exit 1
}
}
if [[ ! -f "$YTBASE" ]]; then
echo "$YTBASE not found in the current directory"
fi
RV_CLI_URL=$(wget -nv -O - https://api.github.com/repos/revanced/revanced-cli/releases/latest | sed -n 's/.*"browser_download_url": "\(.*jar\)".*/\1/p')
RV_CLI_JAR=$(echo $RV_CLI_URL | awk -F/ '{ print $NF }')
RV_INTEGRATIONS_URL=$(wget -nv -O - https://api.github.com/repos/revanced/revanced-integrations/releases/latest | sed -n 's/.*"browser_download_url": "\(.*apk\)".*/\1/p')
RV_INTEGRATIONS_APK=$(echo $RV_INTEGRATIONS_URL | awk -F/ '{ print $NF }')
RV_PATCHES_URL=$(wget -nv -O - https://api.github.com/repos/revanced/revanced-patches/releases/latest | sed -n 's/.*"browser_download_url": "\(.*jar\)".*/\1/p')
RV_PATCHES_JAR=$(echo $RV_PATCHES_URL | awk -F/ '{ print $NF }')
if [[ ! -f RV_CLI_JAR ]]; then
dl $RV_CLI_URL
fi
if [[ ! -f RV_INTEGRATIONS_APK ]]; then
dl $RV_INTEGRATIONS_URL
fi
if [[ ! -f RV_PATCHES_JAR ]]; then
dl $RV_PATCHES_URL
fi
java -jar $RV_CLI_JAR -a $YTBASE -c -o revanced-base.apk -b $RV_PATCHES_JAR -e microg-support -m $RV_INTEGRATIONS_APK ||
{
echo "Building failed"
exit 1
}
mv revanced-base.apk ./revanced-magisk/revanced-base.apk
echo "Creating the magisk module..."
zip -r $OUTPUT ./revanced-magisk
echo "Created the magisk module '$OUTPUT'"