scripts: add nand/mtd support to uninstaller

This commit is contained in:
osm0sis 2020-03-22 05:02:03 -03:00 committed by John Wu
parent d7cd1b37f8
commit 91b6d2852a

View File

@ -67,6 +67,12 @@ cd $MAGISKBIN
CHROMEOS=false
ui_print "- Unpacking boot image"
# Dump image for MTD/NAND character device boot partitions
if [ -c $BOOTIMAGE ]; then
nanddump -f boot.img $BOOTIMAGE
BOOTNAND=$BOOTIMAGE
BOOTIMAGE=boot.img
fi
./magiskboot unpack "$BOOTIMAGE"
case $? in
@ -79,6 +85,9 @@ case $? in
;;
esac
# Restore the original boot partition path
[ "$BOOTNAND" ] && BOOTIMAGE=$BOOTNAND
# Detect boot image state
ui_print "- Checking ramdisk status"
if [ -e ramdisk.cpio ]; then
@ -142,10 +151,10 @@ fi
cd /
if $BOOTMODE; then
ui_print "**********************************************"
ui_print "* Magisk Manager will uninstall itself, and *"
ui_print "* the device will reboot after a few seconds *"
ui_print "**********************************************"
ui_print "********************************************"
ui_print " Magisk Manager will uninstall itself, and"
ui_print " the device will reboot after a few seconds"
ui_print "********************************************"
(sleep 8; /system/bin/reboot)&
else
rm -rf /data/user*/*/*magisk* /data/app/*magisk*