From 06c42d05c38a395a17147204ac721301adeb7c90 Mon Sep 17 00:00:00 2001 From: topjohnwu Date: Sun, 15 Dec 2019 21:01:12 -0500 Subject: [PATCH] Drop image based Magisk support --- scripts/module_installer.sh | 40 +++++++++---------------------------- scripts/util_functions.sh | 17 ---------------- 2 files changed, 9 insertions(+), 48 deletions(-) diff --git a/scripts/module_installer.sh b/scripts/module_installer.sh index 112eb2823..6dbe11d30 100644 --- a/scripts/module_installer.sh +++ b/scripts/module_installer.sh @@ -14,17 +14,12 @@ mkdir -p $TMPDIR ui_print() { echo "$1"; } require_new_magisk() { - ui_print "***********************************" - ui_print " Please install the latest Magisk! " - ui_print "***********************************" + ui_print "*******************************" + ui_print " Please install Magisk v19.0+! " + ui_print "*******************************" exit 1 } -imageless_magisk() { - [ $MAGISK_VER_CODE -gt 18100 ] - return $? -} - ########################################################################################## # Environment ########################################################################################## @@ -38,6 +33,7 @@ mount /data 2>/dev/null if [ -f /data/adb/magisk/util_functions.sh ]; then . /data/adb/magisk/util_functions.sh NVBASE=/data/adb + [ $MAGISK_VER_CODE -gt 18100 ] || require_new_magisk else require_new_magisk fi @@ -65,16 +61,8 @@ unzip -oj "$ZIPFILE" module.prop install.sh uninstall.sh 'common/*' -d $TMPDIR > # Load install script . $TMPDIR/install.sh -if imageless_magisk; then - $BOOTMODE && MODDIRNAME=modules_update || MODDIRNAME=modules - MODULEROOT=$NVBASE/$MODDIRNAME -else - $BOOTMODE && IMGNAME=magisk_merge.img || IMGNAME=magisk.img - IMG=$NVBASE/$IMGNAME - request_zip_size_check "$ZIPFILE" - mount_magisk_img - MODULEROOT=$MOUNTPATH -fi +$BOOTMODE && MODDIRNAME=modules_update || MODDIRNAME=modules +MODULEROOT=$NVBASE/$MODDIRNAME MODID=`grep_prop id $TMPDIR/module.prop` MODPATH=$MODULEROOT/$MODID @@ -102,11 +90,7 @@ rm -f $MODPATH/system/placeholder 2>/dev/null [ -f $TMPDIR/uninstall.sh ] && cp -af $TMPDIR/uninstall.sh $MODPATH/uninstall.sh # Auto Mount -if imageless_magisk; then - $SKIPMOUNT && touch $MODPATH/skip_mount -else - $SKIPMOUNT || touch $MODPATH/auto_mount -fi +$SKIPMOUNT && touch $MODPATH/skip_mount # prop files $PROPFILE && cp -af $TMPDIR/system.prop $MODPATH/system.prop @@ -115,13 +99,8 @@ $PROPFILE && cp -af $TMPDIR/system.prop $MODPATH/system.prop cp -af $TMPDIR/module.prop $MODPATH/module.prop if $BOOTMODE; then # Update info for Magisk Manager - if imageless_magisk; then - mktouch $NVBASE/modules/$MODID/update - cp -af $TMPDIR/module.prop $NVBASE/modules/$MODID/module.prop - else - mktouch /sbin/.magisk/img/$MODID/update - cp -af $TMPDIR/module.prop /sbin/.magisk/img/$MODID/module.prop - fi + mktouch $NVBASE/modules/$MODID/update + cp -af $TMPDIR/module.prop $NVBASE/modules/$MODID/module.prop fi # post-fs-data mode scripts @@ -143,7 +122,6 @@ set_permissions ########################################################################################## cd / -imageless_magisk || unmount_magisk_img $BOOTMODE || recovery_cleanup rm -rf $TMPDIR $MOUNTPATH diff --git a/scripts/util_functions.sh b/scripts/util_functions.sh index 25e5fdfe3..e9a5fdb56 100644 --- a/scripts/util_functions.sh +++ b/scripts/util_functions.sh @@ -446,23 +446,6 @@ request_zip_size_check() { reqSizeM=`unzip -l "$1" | tail -n 1 | awk '{ print int(($1 - 1) / 1048576 + 1) }'` } -################################## -# Backwards Compatibile Functions -################################## - -get_outfd() { setup_flashable; } - -mount_magisk_img() { - $BOOTMODE && MODULE_BASE=modules_update || MODULE_BASE=modules - MODULEPATH=$NVBASE/$MODULE_BASE - mkdir -p $MODULEPATH 2>/dev/null - ln -s $MODULEPATH $MOUNTPATH -} - -unmount_magisk_img() { - rm -f $MOUNTPATH 2>/dev/null -} - boot_actions() { return; } ########