mirror of
https://github.com/topjohnwu/Magisk.git
synced 2024-11-23 10:05:23 +00:00
Install Magisk Manager stub if not installed
This commit is contained in:
parent
2afd2f0d3b
commit
f8eab72c7a
3
.gitattributes
vendored
3
.gitattributes
vendored
@ -13,4 +13,5 @@
|
||||
busybox binary
|
||||
futility binary
|
||||
*.jar binary
|
||||
*.exe binary
|
||||
*.exe binary
|
||||
*.apk binary
|
||||
|
@ -291,6 +291,7 @@ if (is_mounted /data); then
|
||||
mkdir -p /data/busybox
|
||||
cp -af $BINDIR /data/magisk
|
||||
cp -af $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
|
||||
@ -303,6 +304,7 @@ else
|
||||
rm -rf /cache/data_bin 2>/dev/null
|
||||
cp -af $BINDIR /cache/data_bin
|
||||
cp -af $INSTALLER/common/init.magisk.rc $INSTALLER/common/magic_mask.sh /cache/data_bin
|
||||
cp -af $INSTALLER/common/magisk.apk /cache/magisk.apk
|
||||
chmod -R 755 /cache/data_bin
|
||||
BINDIR=/cache/data_bin
|
||||
fi
|
||||
|
@ -280,7 +280,8 @@ case $1 in
|
||||
rm -f $TOOLPATH/su $TOOLPATH/sh $TOOLPATH/reboot
|
||||
fi
|
||||
|
||||
mv /cache/stock_boot.img /data 2>/dev/null
|
||||
mv /cache/stock_boot.img /data/stock_boot.img 2>/dev/null
|
||||
mv /cache/magisk.apk /data/magisk.apk 2>/dev/null
|
||||
|
||||
find $BINPATH -exec chcon -h "u:object_r:system_file:s0" {} \;
|
||||
find $TOOLPATH -exec chcon -h "u:object_r:system_file:s0" {} \;
|
||||
@ -435,6 +436,20 @@ case $1 in
|
||||
bind_mount $COREDIR/busybox /system/xbin
|
||||
fi
|
||||
|
||||
if [ -f /data/magisk.apk ]; then
|
||||
if [ -z `ls /data/app | grep com.topjohnwu.magisk` ]; then
|
||||
mkdir /data/app/com.topjohnwu.magisk-1
|
||||
cp /data/magisk.apk /data/app/com.topjohnwu.magisk-1/base.apk
|
||||
chown 1000.1000 /data/app/com.topjohnwu.magisk-1
|
||||
chown 1000.1000 /data/app/com.topjohnwu.magisk-1/base.apk
|
||||
chmod 755 /data/app/com.topjohnwu.magisk-1
|
||||
chmod 644 /data/app/com.topjohnwu.magisk-1/base.apk
|
||||
chcon u:object_r:apk_data_file:s0 /data/app/com.topjohnwu.magisk-1
|
||||
chcon u:object_r:apk_data_file:s0 /data/app/com.topjohnwu.magisk-1/base.apk
|
||||
fi
|
||||
rm -f /data/magisk.apk 2>/dev/null
|
||||
fi
|
||||
|
||||
# Restart post-fs-data if necessary (multirom)
|
||||
$MULTIROM && setprop magisk.restart_pfsd 1
|
||||
|
||||
|
BIN
zip_static/common/magisk.apk
Normal file
BIN
zip_static/common/magisk.apk
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user