clean up a few thing

This commit is contained in:
j-hc 2022-07-18 19:19:30 +03:00
parent 17ff562f4b
commit 6589b3621e
No known key found for this signature in database
GPG Key ID: 242B44D16774A2ED
3 changed files with 15 additions and 21 deletions

View File

@ -2,14 +2,14 @@
<sub>(unaffiliated whatsoever)<sub> <sub>(unaffiliated whatsoever)<sub>
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. You can get the [latest CI release](https://github.com/j-hc/revanced-magisk-module/releases) from here.
## Updating ## 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 ### Note
If you wish to include/exclude some patches to your liking: If you wish to include/exclude some patches to your liking:

View File

@ -9,13 +9,12 @@ MUSIC_PATCHER_ARGS="-e microg-support"
BUILD_YT=false BUILD_YT=false
BUILD_MUSIC=false BUILD_MUSIC=false
UPDATE_PREBUILTS=true
print_usage() { 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 print_usage
exit 0 exit 0
elif [ "$1" == "clean" ]; then elif [ "$1" == "clean" ]; then
@ -32,8 +31,6 @@ elif [ "$1" == "youtube" ]; then
BUILD_YT=true BUILD_YT=true
elif [ "$1" == "music" ]; then elif [ "$1" == "music" ]; then
BUILD_MUSIC=true BUILD_MUSIC=true
elif [ "$2" == "--no-update" ]; then
UPDATE_PREBUILTS=false
else else
print_usage print_usage
exit 1 exit 1
@ -42,9 +39,7 @@ fi
>build.log >build.log
log "$(date +'%Y-%m-%d')\n" log "$(date +'%Y-%m-%d')\n"
if $UPDATE_PREBUILTS; then get_prebuilts
get_prebuilts
fi
if $BUILD_YT; then if $BUILD_YT; then
build_yt "$YT_PATCHER_ARGS" build_yt "$YT_PATCHER_ARGS"

View File

@ -2,10 +2,9 @@
MODULE_TEMPLATE_DIR="revanced-magisk" MODULE_TEMPLATE_DIR="revanced-magisk"
TEMP_DIR="temp" TEMP_DIR="temp"
GITHUB_REPO_FALLBACK="j-hc/revanced-magisk-module"
if [ -z ${GITHUB_REPOSITORY+x} ]; then : "${GITHUB_REPOSITORY:=$GITHUB_REPO_FALLBACK}"
GITHUB_REPOSITORY="j-hc/revanced-magisk-module"
fi
WGET_HEADER="User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Firefox/102.0" 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() { build_yt() {
echo "Patching YouTube" echo "Patching YouTube"
reset_template 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 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') 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" echo "Supported versions of the YouTube patch: $supported_versions"
last_ver=$(echo "$supported_versions" | awk -F, '{ print $NF }') 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" mv -f "$yt_patched_apk" "${MODULE_TEMPLATE_DIR}/base.apk"
echo "Creating the magisk module for YouTube..." 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" service_sh "com.google.android.youtube"
yt_module_prop "$last_ver" yt_module_prop "$last_ver"
@ -131,7 +130,9 @@ build_music() {
service_sh "com.google.android.apps.youtube.music" service_sh "com.google.android.apps.youtube.music"
music_module_prop "$last_ver" 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") 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 cd "$MODULE_TEMPLATE_DIR" || return
zip -r "../$output" . zip -r "../$output" .
@ -158,8 +159,7 @@ version=v${1}
versionCode=$(date +'%Y%m%d') versionCode=$(date +'%Y%m%d')
author=j-hc author=j-hc
description=mounts base.apk for YouTube ReVanced description=mounts base.apk for YouTube ReVanced
updateJson=https://raw.githubusercontent.com/${GITHUB_REPOSITORY}/update/yt-update.json updateJson=https://raw.githubusercontent.com/${GITHUB_REPOSITORY}/update/yt-update.json" >"${MODULE_TEMPLATE_DIR}/module.prop"
" >"${MODULE_TEMPLATE_DIR}/module.prop"
} }
music_module_prop() { music_module_prop() {
@ -169,6 +169,5 @@ version=v${1}
versionCode=$(date +'%Y%m%d') versionCode=$(date +'%Y%m%d')
author=j-hc author=j-hc
description=mounts base.apk for YouTube Music ReVanced description=mounts base.apk for YouTube Music ReVanced
updateJson=https://raw.githubusercontent.com/${GITHUB_REPOSITORY}/update/music-update.json updateJson=https://raw.githubusercontent.com/${GITHUB_REPOSITORY}/update/music-update.json" >"${MODULE_TEMPLATE_DIR}/module.prop"
" >"${MODULE_TEMPLATE_DIR}/module.prop"
} }