diff --git a/README.md b/README.md index 0e6359f..0f8b13f 100644 --- a/README.md +++ b/README.md @@ -3,11 +3,11 @@ (unaffiliated what-so-ever) This repo includes a simple script that -downloads all the latest version of necessary prebuilt revanced tools and the stock YouTube APK from APKMirror and creates a magisk module -1 +downloads all the latest version of necessary prebuilt revanced tools and the stock YouTube APK from APKMirror and creates a magisk module + You will need to install the stock YouTube app matching with the module version on your phone using [SAI](https://play.google.com/store/apps/details?id=com.aefyr.sai&hl=tr&gl=US) with the split APKs -You can go grab the split APKs from APKMirror (the bundle, not the apk or it will crash) -1 +You can go grab the split APKs from APKMirror (the bundle, not the apk or it will crash) + You can get the [latest CI release](https://github.com/j-hc/revanced-magisk-module/releases/tag/main) if you do not want to build yourself. diff --git a/build-module.sh b/build-module.sh index 2b18314..9367e7b 100755 --- a/build-module.sh +++ b/build-module.sh @@ -50,13 +50,13 @@ if [ ! -f $BASE_APK ]; then fi java -jar $RV_CLI_JAR -a $BASE_APK -c -o revanced-base.apk -b $RV_PATCHES_JAR -e microg-support -m $RV_INTEGRATIONS_APK -mv -f revanced-base.apk ./MMT-Extended/revanced-base.apk +mv -f revanced-base.apk ./revanced-magisk/revanced-base.apk echo "Creating the magisk module..." OUTPUT="revanced-magisk-v$LAST_VER.zip" -sed -i "s/version=v.*$/version=v$LAST_VER/g" ./MMT-Extended/module.prop +sed -i "s/version=v.*$/version=v$LAST_VER/g" ./revanced-magisk/module.prop -cd MMT-Extended +cd revanced-magisk zip -r ../$OUTPUT . echo "Created the magisk module '$OUTPUT'" diff --git a/revanced-magisk/META-INF/com/google/android/update-binary b/revanced-magisk/META-INF/com/google/android/update-binary old mode 100644 new mode 100755 index 29240cd..ea4889e --- a/revanced-magisk/META-INF/com/google/android/update-binary +++ b/revanced-magisk/META-INF/com/google/android/update-binary @@ -6,168 +6,28 @@ umask 022 -# Global vars -TMPDIR=/dev/tmp -PERSISTDIR=/sbin/.magisk/mirror/persist - -rm -rf $TMPDIR 2>/dev/null -mkdir -p $TMPDIR - # echo before loading util_functions ui_print() { echo "$1"; } require_new_magisk() { ui_print "*******************************" - ui_print " Please install Magisk v19.0+! " + ui_print " Please install Magisk v20.4+! " ui_print "*******************************" exit 1 } -is_legacy_script() { - unzip -l "$ZIPFILE" install.sh | grep -q install.sh - return $? -} - -print_modname() { - local len - len=`echo -n $MODNAME | wc -c` - len=$((len + 2)) - local pounds=`printf "%${len}s" | tr ' ' '*'` - ui_print "$pounds" - ui_print " $MODNAME " - ui_print "$pounds" - ui_print "*******************" - ui_print " Powered by Magisk " - ui_print "*******************" -} - -############## -# Environment -############## +######################### +# Load util_functions.sh +######################### OUTFD=$2 ZIPFILE=$3 mount /data 2>/dev/null -# Load utility functions [ -f /data/adb/magisk/util_functions.sh ] || require_new_magisk . /data/adb/magisk/util_functions.sh -[ $MAGISK_VER_CODE -gt 18100 ] || require_new_magisk +[ $MAGISK_VER_CODE -lt 20400 ] && require_new_magisk -# Preperation for flashable zips -setup_flashable - -# Mount partitions -mount_partitions - -# Detect version and architecture -api_level_arch_detect - -# Setup busybox and binaries -$BOOTMODE && boot_actions || recovery_actions - -############## -# Preparation -############## - -# Extract prop file -unzip -o "$ZIPFILE" module.prop -d $TMPDIR >&2 -[ ! -f $TMPDIR/module.prop ] && abort "! Unable to extract zip file!" - -$BOOTMODE && MODDIRNAME=modules_update || MODDIRNAME=modules -MODULEROOT=$NVBASE/$MODDIRNAME -MODID=`grep_prop id $TMPDIR/module.prop` -MODPATH=$MODULEROOT/$MODID -MODNAME=`grep_prop name $TMPDIR/module.prop` - -# Create mod paths -rm -rf $MODPATH 2>/dev/null -mkdir -p $MODPATH - -########## -# Install -########## - -if is_legacy_script; then - unzip -oj "$ZIPFILE" module.prop install.sh uninstall.sh 'common/*' -d $TMPDIR >&2 - - # Load install script - . $TMPDIR/install.sh - - # Callbacks - print_modname - on_install - - # Custom uninstaller - [ -f $TMPDIR/uninstall.sh ] && cp -af $TMPDIR/uninstall.sh $MODPATH/uninstall.sh - - # Skip mount - $SKIPMOUNT && touch $MODPATH/skip_mount - - # prop file - $PROPFILE && cp -af $TMPDIR/system.prop $MODPATH/system.prop - - # Module info - cp -af $TMPDIR/module.prop $MODPATH/module.prop - - # post-fs-data scripts - $POSTFSDATA && cp -af $TMPDIR/post-fs-data.sh $MODPATH/post-fs-data.sh - - # service scripts - $LATESTARTSERVICE && cp -af $TMPDIR/service.sh $MODPATH/service.sh - - ui_print "- Setting permissions" - set_permissions -else - print_modname - - unzip -o "$ZIPFILE" customize.sh -d $MODPATH >&2 - - if ! grep -q '^SKIPUNZIP=1$' $MODPATH/customize.sh 2>/dev/null; then - ui_print "- Extracting module files" - unzip -o "$ZIPFILE" -x 'META-INF/*' -d $MODPATH >&2 - - # Default permissions - set_perm_recursive $MODPATH 0 0 0755 0644 - fi - - # Load customization script - [ -f $MODPATH/customize.sh ] && . $MODPATH/customize.sh -fi - -# Handle replace folders -for TARGET in $REPLACE; do - ui_print "- Replace target: $TARGET" - mktouch $MODPATH$TARGET/.replace -done - -if $BOOTMODE; then - # Update info for Magisk Manager - mktouch $NVBASE/modules/$MODID/update - cp -af $MODPATH/module.prop $NVBASE/modules/$MODID/module.prop -fi - -# Copy over custom sepolicy rules -if [ -f $MODPATH/sepolicy.rule -a -e $PERSISTDIR ]; then - ui_print "- Installing custom sepolicy patch" - PERSISTMOD=$PERSISTDIR/magisk/$MODID - mkdir -p $PERSISTMOD - cp -af $MODPATH/sepolicy.rule $PERSISTMOD/sepolicy.rule -fi - -# Remove stuffs that don't belong to modules -rm -rf \ -$MODPATH/system/placeholder $MODPATH/customize.sh \ -$MODPATH/README.md $MODPATH/.git* 2>/dev/null - -############## -# Finalizing -############## - -cd / -$BOOTMODE || recovery_cleanup -rm -rf $TMPDIR - -ui_print "- Done" -exit 0 +install_module +exit 0 \ No newline at end of file diff --git a/revanced-magisk/META-INF/com/google/android/updater-script b/revanced-magisk/META-INF/com/google/android/updater-script old mode 100644 new mode 100755 diff --git a/revanced-magisk/common/addon/placeholder b/revanced-magisk/common/addon/placeholder deleted file mode 100644 index e69de29..0000000 diff --git a/revanced-magisk/common/functions.sh b/revanced-magisk/common/functions.sh old mode 100644 new mode 100755 index 5e65e12..f82b6ea --- a/revanced-magisk/common/functions.sh +++ b/revanced-magisk/common/functions.sh @@ -4,6 +4,10 @@ # ########################################################################################## +cleanup() { + rm -rf $MODPATH/common 2>/dev/null +} + abort() { ui_print "$1" rm -rf $MODPATH 2>/dev/null @@ -12,31 +16,6 @@ abort() { exit 1 } -cleanup() { - rm -rf $MODPATH/common 2>/dev/null - ui_print " " - ui_print " ***************************************" - ui_print " * MMT Extended by Zackptg5 @ XDA *" - ui_print " ***************************************" - ui_print "" - ui_print " ***************************************" - ui_print " * YouTube Vanced Magisk Installer *" - ui_print " ***************************************" - ui_print "" - ui_print " -YOU MAY NEED TO REMOVE THE PREVIOUS MODULE -AND REBOOT PRIOR TO INSTALLING ANY UPDATES. - -For more installation and troubleshooting -info, please visit: -https://forum.xda-Developers.com/showpost.php?p=83741225&postcount=17198 - -Huge thanks to: 73sydney, ipdev, Eselter, majicmazo - and the YouTube Vanced team -" - -} - device_check() { local opt=`getopt -o dm -- "$@"` type=device eval set -- "$opt" @@ -54,6 +33,7 @@ device_check() { for j in "ro.product.$type" "ro.build.$type" "ro.product.vendor.$type" "ro.vendor.product.$type"; do [ "$(sed -n "s/^$j=//p" $i/build.prop 2>/dev/null | head -n 1 | tr '[:upper:]' '[:lower:]')" == "$prop" ] && return 0 done + [ "$type" == "device" ] && [ "$(sed -n "s/^"ro.build.product"=//p" $i/build.prop 2>/dev/null | head -n 1 | tr '[:upper:]' '[:lower:]')" == "$prop" ] && return 0 fi done return 1 @@ -125,15 +105,21 @@ prop_process() { done < $1 } +# Credits +ui_print "**************************************" +ui_print "* MMT Extended by Zackptg5 @ XDA *" +ui_print "**************************************" +ui_print " " + # Check for min/max api version [ -z $MINAPI ] || { [ $API -lt $MINAPI ] && abort "! Your system API of $API is less than the minimum api of $MINAPI! Aborting!"; } [ -z $MAXAPI ] || { [ $API -gt $MAXAPI ] && abort "! Your system API of $API is greater than the maximum api of $MAXAPI! Aborting!"; } # Set variables +[ -z $ARCH32 ] && ARCH32="$(echo $ABI32 | cut -c-3)" [ $API -lt 26 ] && DYNLIB=false [ -z $DYNLIB ] && DYNLIB=false [ -z $DEBUG ] && DEBUG=false -[ -e "$PERSISTDIR" ] && PERSISTMOD=$PERSISTDIR/magisk/$MODID INFO=$NVBASE/modules/.$MODID-files ORIGDIR="$MAGISKTMP/mirror" if $DYNLIB; then diff --git a/revanced-magisk/common/install.sh b/revanced-magisk/common/install.sh old mode 100644 new mode 100755 diff --git a/revanced-magisk/customize.sh b/revanced-magisk/customize.sh old mode 100644 new mode 100755 index 89f775b..5523aa9 --- a/revanced-magisk/customize.sh +++ b/revanced-magisk/customize.sh @@ -16,6 +16,29 @@ MINAPI=21 #DYNLIB=true #DEBUG=true +########################################################################################## +# Permissions +########################################################################################## + +set_permissions() { + : # Remove this if adding to this function + + # Note that all files/folders in magisk module directory have the $MODPATH prefix - keep this prefix on all of your files/folders + # Some examples: + + # For directories (includes files in them): + # set_perm_recursive (default: u:object_r:system_file:s0) + + # set_perm_recursive $MODPATH/system/lib 0 0 0755 0644 + # set_perm_recursive $MODPATH/system/vendor/lib/soundfx 0 0 0755 0644 + + # For files (not in directories taken care of above) + # set_perm (default: u:object_r:system_file:s0) + + # set_perm $MODPATH/system/lib/libart.so 0 0 0644 + # set_perm /data/local/tmp/file.txt 0 0 644 +} + ########################################################################################## # MMT Extended Logic - Don't modify anything after this ########################################################################################## diff --git a/revanced-magisk/module.prop b/revanced-magisk/module.prop old mode 100644 new mode 100755 index 4d337cb..9f7570a --- a/revanced-magisk/module.prop +++ b/revanced-magisk/module.prop @@ -1,6 +1,6 @@ id=ytrvi -name=YouTube ReVanced v17.24.34 -version=v17.24.34 +name=YouTube ReVanced +version=v17.25.34 versionCode=1 author=j-hc description=mounts base.apk for YouTube ReVanced \ No newline at end of file diff --git a/revanced-magisk/uninstall.sh b/revanced-magisk/uninstall.sh old mode 100644 new mode 100755 index 51f472f..0b410f7 --- a/revanced-magisk/uninstall.sh +++ b/revanced-magisk/uninstall.sh @@ -1,3 +1,4 @@ +# Don't modify anything after this if [ -f $INFO ]; then while read LINE; do if [ "$(echo -n $LINE | tail -c 1)" == "~" ]; then