Fix uninstaller

This commit is contained in:
topjohnwu
2018-06-26 22:41:03 +08:00
parent e579f314a6
commit c8216f9bc5
4 changed files with 34 additions and 18 deletions
+7 -5
View File
@@ -12,11 +12,12 @@
# Preparation
##########################################################################################
BOOTMODE=false
# This path should work in any cases
TMPDIR=/dev/tmp
INSTALLER=$TMPDIR/install
CHROMEDIR=$INSTALLER/chromeos
# Default permissions
umask 022
@@ -30,6 +31,7 @@ fi
# Load utility functions
. $INSTALLER/util_functions.sh
get_outfd
##########################################################################################
@@ -42,23 +44,23 @@ ui_print "************************"
is_mounted /data || mount /data || abort "! Unable to mount partitions"
is_mounted /cache || mount /cache 2>/dev/null
mount_partitions
api_level_arch_detect
ui_print "- Device platform: $ARCH"
CHROMEDIR=$INSTALLER/chromeos
BINDIR=$INSTALLER/$ARCH32
chmod -R 755 $CHROMEDIR $BINDIR
##########################################################################################
# Detection all done, start installing
##########################################################################################
if is_mounted /data; then
check_data
if $DATA_DE; then
recovery_actions
# Save our stock boot image dump before removing it
mv $MAGISKBIN/stock_boot* /data 2>/dev/null
# Copy the binaries to /data/magisk, in case they do not exist
rm -rf $MAGISKBIN 2>/dev/null
mkdir -p $MAGISKBIN
cp -af $BINDIR/. $CHROMEDIR $TMPDIR/bin/busybox $INSTALLER/util_functions.sh $MAGISKBIN