Commit 91b6d285 authored by osm0sis's avatar osm0sis Committed by John Wu

scripts: add nand/mtd support to uninstaller

parent d7cd1b37
......@@ -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*
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment