Skip to content

Commit

Permalink
I shall test Samsung before release...
Browse files Browse the repository at this point in the history
  • Loading branch information
topjohnwu committed Mar 20, 2017
1 parent 02e039d commit d53f33b
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 21 deletions.
38 changes: 19 additions & 19 deletions scripts/magic_mask.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions zip_static/common/magiskhide/enable
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d53f33b

Please sign in to comment.