2
0
mirror of https://github.com/topjohnwu/Magisk synced 2025-09-01 14:15:30 +00:00

Update busybox handling

This commit is contained in:
topjohnwu
2017-02-04 18:44:07 +08:00
parent ef9948a967
commit db501822ef
3 changed files with 49 additions and 37 deletions

View File

@@ -320,18 +320,14 @@ fi
ui_print "- Constructing environment"
if (is_mounted /data); then
rm -rf /data/busybox /data/magisk 2>/dev/null
mkdir -p /data/busybox /data/magisk
rm -rf /data/magisk 2>/dev/null
mkdir -p /data/magisk
cp -af $BINDIR/busybox $BINDIR/sepolicy-inject $BINDIR/resetprop \
$INSTALLER/common/init.magisk.rc $INSTALLER/common/magic_mask.sh /data/magisk
cp -af $INSTALLER/common/magisk.apk /data/magisk.apk
/data/magisk/busybox --install -s /data/busybox
ln -s /data/magisk/busybox /data/busybox/busybox
# Prevent issues
rm -f /data/busybox/su /data/busybox/sh /data/busybox/reboot
chcon -hR u:object_r:system_file:s0 /data/magisk /data/busybox
chmod -R 755 /data/magisk /data/busybox
# PATH=/data/busybox:$PATH
chmod -R 755 /data/magisk
chcon -h u:object_r:system_file:s0 /data/magisk /data/magisk/*
PATH=/data/busybox:$PATH
else
rm -rf /cache/data_bin 2>/dev/null
mkdir -p /cache/data_bin
@@ -342,6 +338,13 @@ else
chmod -R 755 /cache/data_bin
fi
# Temporary busybox for installation
mkdir -p $TMPDIR/busybox
$BINDIR/busybox --install -s $TMPDIR/busybox
rm -f $TMPDIR/busybox/su $TMPDIR/busybox/sh $TMPDIR/busybox/reboot
PATH=$TMPDIR/busybox:$PATH
##########################################################################################
# Image
##########################################################################################
@@ -486,11 +489,10 @@ else
# MagiskSU
ui_print "- Installing MagiskSU"
rm -rf $COREDIR/su 2>/dev/null
mkdir -p $COREDIR/su
mkdir -p $COREDIR/su 2>/dev/null
cp -af $BINDIR/su $INSTALLER/common/magisksu.sh $COREDIR/su
chmod -R 755 $COREDIR/su
chown -R 0.0 $COREDIR/su
chmod 755 $COREDIR/su/su $COREDIR/su/magisksu.sh
chown -R 0.0 $COREDIR/su/su $COREDIR/su/magisksu.sh
# Patch ramdisk
ui_print "- Patching ramdisk"