diff --git a/README.md b/README.md index 8626492..f80bcc2 100644 --- a/README.md +++ b/README.md @@ -2,14 +2,14 @@ (unaffiliated whatsoever) -This repo includes a simple script that downloads all the latest version of necessary prebuilt revanced tools and the stock APKs of YouTube and YouTube Music from APKMirror, applies the patches and creates magisk modules +This repo includes a simple script that downloads all the latest version of necessary prebuilt revanced tools and the stock APKs of YouTube and YouTube Music from APKMirror, applies the patches and creates magisk modules. -You will need to install the stock YouTube app matching with the module's version on your phone. The link is also provided in release notes. +You will need to install the stock YouTube app matching with the module's version on your phone, there is no need for the split APKs or SAI anymore, the regular APK is just fine. The link is also provided in release notes. You can get the [latest CI release](https://github.com/j-hc/revanced-magisk-module/releases) from here. ## Updating -I use Magisk's updating system which means you are able receive updates from the Magisk apk, downloading from github releases and reflashing is not necessary. +The modules support Magisk update which means you will receive updates from your Magisk app, downloading from github releases and reflashing is not necessary. ### Note If you wish to include/exclude some patches to your liking: diff --git a/build.sh b/build.sh index faf9994..0dc9118 100755 --- a/build.sh +++ b/build.sh @@ -9,13 +9,12 @@ MUSIC_PATCHER_ARGS="-e microg-support" BUILD_YT=false BUILD_MUSIC=false -UPDATE_PREBUILTS=true print_usage() { - echo -e "Usage:\n${0} youtube|music|all|clean|reset-template" + echo -e "Usage:\n${0} all|youtube|music|clean|reset-template" } -if [ -z "$1" ]; then +if [ -z ${1+x} ]; then print_usage exit 0 elif [ "$1" == "clean" ]; then @@ -32,8 +31,6 @@ elif [ "$1" == "youtube" ]; then BUILD_YT=true elif [ "$1" == "music" ]; then BUILD_MUSIC=true -elif [ "$2" == "--no-update" ]; then - UPDATE_PREBUILTS=false else print_usage exit 1 @@ -42,9 +39,7 @@ fi >build.log log "$(date +'%Y-%m-%d')\n" -if $UPDATE_PREBUILTS; then - get_prebuilts -fi +get_prebuilts if $BUILD_YT; then build_yt "$YT_PATCHER_ARGS" diff --git a/utils.sh b/utils.sh index 9129f97..986d2ff 100755 --- a/utils.sh +++ b/utils.sh @@ -2,10 +2,9 @@ MODULE_TEMPLATE_DIR="revanced-magisk" TEMP_DIR="temp" +GITHUB_REPO_FALLBACK="j-hc/revanced-magisk-module" -if [ -z ${GITHUB_REPOSITORY+x} ]; then - GITHUB_REPOSITORY="j-hc/revanced-magisk-module" -fi +: "${GITHUB_REPOSITORY:=$GITHUB_REPO_FALLBACK}" WGET_HEADER="User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Firefox/102.0" @@ -75,8 +74,8 @@ dl_music() { build_yt() { echo "Patching YouTube" reset_template - # This only finds the supported versions of some random patch wrt the first occurance of the string but that's fine local supported_versions last_ver yt_base_apk dl_output yt_patched_apk output + # This only finds the supported versions of some random patch wrt the first occurance of the string but that's fine supported_versions=$(unzip -p "$RV_PATCHES_JAR" | strings -n 8 -s , | sed -rn 's/.*youtube,versions,(([0-9.]*,*)*),Lk.*/\1/p') echo "Supported versions of the YouTube patch: $supported_versions" last_ver=$(echo "$supported_versions" | awk -F, '{ print $NF }') @@ -92,7 +91,7 @@ build_yt() { mv -f "$yt_patched_apk" "${MODULE_TEMPLATE_DIR}/base.apk" echo "Creating the magisk module for YouTube..." - output="yt-revanced-magisk-v${last_ver}-noarch.zip" + output="yt-revanced-magisk-v${last_ver}-all.zip" service_sh "com.google.android.youtube" yt_module_prop "$last_ver" @@ -131,7 +130,9 @@ build_music() { service_sh "com.google.android.apps.youtube.music" music_module_prop "$last_ver" echo 'YTPATH=$(pm path com.google.android.apps.youtube.music | grep base | sed "s/package://g; s/\/base.apk//g") -cp_ch -n $MODPATH/libjsc.so $YTPATH/lib/arm64 0755' >"${MODULE_TEMPLATE_DIR}/common/install.sh" +if [ -n "$YTPATH" ]; then + cp_ch -n $MODPATH/libjsc.so $YTPATH/lib/arm64 0755 +fi' >"${MODULE_TEMPLATE_DIR}/common/install.sh" cd "$MODULE_TEMPLATE_DIR" || return zip -r "../$output" . @@ -158,8 +159,7 @@ version=v${1} versionCode=$(date +'%Y%m%d') author=j-hc description=mounts base.apk for YouTube ReVanced -updateJson=https://raw.githubusercontent.com/${GITHUB_REPOSITORY}/update/yt-update.json -" >"${MODULE_TEMPLATE_DIR}/module.prop" +updateJson=https://raw.githubusercontent.com/${GITHUB_REPOSITORY}/update/yt-update.json" >"${MODULE_TEMPLATE_DIR}/module.prop" } music_module_prop() { @@ -169,6 +169,5 @@ version=v${1} versionCode=$(date +'%Y%m%d') author=j-hc description=mounts base.apk for YouTube Music ReVanced -updateJson=https://raw.githubusercontent.com/${GITHUB_REPOSITORY}/update/music-update.json -" >"${MODULE_TEMPLATE_DIR}/module.prop" +updateJson=https://raw.githubusercontent.com/${GITHUB_REPOSITORY}/update/music-update.json" >"${MODULE_TEMPLATE_DIR}/module.prop" }