mirror of
https://github.com/topjohnwu/Magisk.git
synced 2024-11-23 18:15:30 +00:00
Drop image based Magisk support
This commit is contained in:
parent
404104208f
commit
06c42d05c3
@ -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
|
||||
|
||||
|
@ -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; }
|
||||
|
||||
########
|
||||
|
Loading…
Reference in New Issue
Block a user