diff --git a/scripts/magic_mask.sh b/scripts/magic_mask.sh index d8ef8e047..8bc89b30a 100644 --- a/scripts/magic_mask.sh +++ b/scripts/magic_mask.sh @@ -73,7 +73,7 @@ loopsetup() { image_size_check() { e2fsck -yf $1 - curBlocks=`e2fsck -n $1 2>/dev/null | cut -d, -f3 | cut -d\ -f2`; + curBlocks=`e2fsck -n $1 2>/dev/null | grep $1 | cut -d, -f3 | cut -d\ -f2`; curUsedM=`echo "$curBlocks" | cut -d/ -f1` curSizeM=`echo "$curBlocks" | cut -d/ -f1` curFreeM=$(((curSizeM - curUsedM) * 4 / 1024)) @@ -324,6 +324,24 @@ case $1 in chown -R 0.0 $TOOLPATH find $BINPATH $TOOLPATH -exec chcon -h u:object_r:system_file:s0 {} \; + log_print "* Linking binaries to /sbin" + mount -o rw,remount rootfs / + chmod 755 /sbin + ln -sf $BINPATH/magiskpolicy /sbin/magiskpolicy + ln -sf $BINPATH/magiskpolicy /sbin/sepolicy-inject + ln -sf $BINPATH/resetprop /sbin/resetprop + if [ ! -f /sbin/launch_daemonsu.sh ]; then + log_print "* Starting MagiskSU" + export PATH=$OLDPATH + ln -sf $BINPATH/su /sbin/su + ln -sf $BINPATH/magiskpolicy /sbin/supolicy + /sbin/su --daemon + export PATH=$TOOLPATH:$OLDPATH + fi + mount -o ro,remount rootfs / + + [ -f $DISABLEFILE ] && unblock + # Multirom functions should go here, not available right now MULTIROM=false @@ -374,24 +392,6 @@ case $1 in fi fi - log_print "* Linking binaries to /sbin" - mount -o rw,remount rootfs / - chmod 755 /sbin - ln -sf $BINPATH/magiskpolicy /sbin/magiskpolicy - ln -sf $BINPATH/magiskpolicy /sbin/sepolicy-inject - ln -sf $BINPATH/resetprop /sbin/resetprop - if [ ! -f /sbin/launch_daemonsu.sh ]; then - log_print "* Starting MagiskSU" - export PATH=$OLDPATH - ln -sf $BINPATH/su /sbin/su - ln -sf $BINPATH/magiskpolicy /sbin/supolicy - /sbin/su --daemon - export PATH=$TOOLPATH:$OLDPATH - fi - mount -o ro,remount rootfs / - - [ -f $DISABLEFILE ] && unblock - log_print "* Preparing modules" # Remove crap folder diff --git a/zip_static/common/magiskhide/enable b/zip_static/common/magiskhide/enable index d16e6d82b..e0a4f5b58 100644 --- a/zip_static/common/magiskhide/enable +++ b/zip_static/common/magiskhide/enable @@ -56,8 +56,8 @@ log_print "`$BINPATH/resetprop -v -n ro.secure 1`" log_print "`$BINPATH/resetprop -v -n ro.build.type user`" [ ! -z "$BUILDTAGS" -a "$BUILDTAGS" != "release-keys" ] && \ log_print "`$BINPATH/resetprop -v -n ro.build.tags release-keys`" -[ ! -z "$BUILDSELINUX" -a "$BUILDSELINUX" != "0" ] && \ -log_print "`$BINPATH/resetprop -v -n ro.build.selinux 0`" +[ ! -z "$BUILDSELINUX" -a "$BUILDSELINUX" != "1" ] && \ +log_print "`$BINPATH/resetprop -v -n ro.build.selinux 1`" touch $MODDIR/hidelist chmod -R 755 $MODDIR