mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-01-11 23:13:35 +00:00
Adjust scripts
This commit is contained in:
parent
2e185f4ec9
commit
81d054a525
@ -292,7 +292,7 @@ fi
|
|||||||
MAGISKLOOP=$LOOPDEVICE
|
MAGISKLOOP=$LOOPDEVICE
|
||||||
|
|
||||||
# Core folders and scripts
|
# Core folders and scripts
|
||||||
mkdir -p $COREDIR/bin $COREDIR/magiskhide $COREDIR/post-fs-data.d $COREDIR/service.d 2>/dev/null
|
mkdir -p $COREDIR/bin $COREDIR/props $COREDIR/magiskhide $COREDIR/post-fs-data.d $COREDIR/service.d 2>/dev/null
|
||||||
cp -af $COMMONDIR/magiskhide/. $COREDIR/magiskhide
|
cp -af $COMMONDIR/magiskhide/. $COREDIR/magiskhide
|
||||||
cp -af $BINDIR/resetprop $BINDIR/magiskhide $BINDIR/su $BINDIR/magiskpolicy $COREDIR/bin
|
cp -af $BINDIR/resetprop $BINDIR/magiskhide $BINDIR/su $BINDIR/magiskpolicy $COREDIR/bin
|
||||||
# Legacy support
|
# Legacy support
|
||||||
|
@ -317,6 +317,20 @@ case $1 in
|
|||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ -f $DATABIN/magisk.apk ]; then
|
||||||
|
if ! ls /data/app | grep com.topjohnwu.magisk; then
|
||||||
|
mkdir /data/app/com.topjohnwu.magisk-1
|
||||||
|
cp $DATABIN/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 $DATABIN/magisk.apk 2>/dev/null
|
||||||
|
fi
|
||||||
|
|
||||||
# Image merging
|
# Image merging
|
||||||
chmod 644 $IMG /cache/magisk.img /data/magisk_merge.img 2>/dev/null
|
chmod 644 $IMG /cache/magisk.img /data/magisk_merge.img 2>/dev/null
|
||||||
merge_image /cache/magisk.img
|
merge_image /cache/magisk.img
|
||||||
@ -480,29 +494,6 @@ case $1 in
|
|||||||
bind_mount "$ORIG" "$TARGET"
|
bind_mount "$ORIG" "$TARGET"
|
||||||
done
|
done
|
||||||
|
|
||||||
# Bind hosts for Adblock apps
|
|
||||||
if [ -f $COREDIR/hosts ]; then
|
|
||||||
log_print "* Enabling systemless hosts file support"
|
|
||||||
bind_mount $COREDIR/hosts /system/etc/hosts
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -f $DATABIN/magisk.apk ]; then
|
|
||||||
if ! ls /data/app | grep com.topjohnwu.magisk; then
|
|
||||||
mkdir /data/app/com.topjohnwu.magisk-1
|
|
||||||
cp $DATABIN/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 $DATABIN/magisk.apk 2>/dev/null
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Expose busybox
|
|
||||||
[ "`getprop persist.magisk.busybox`" = "1" ] && sh /sbin/magic_mask.sh mount_busybox
|
|
||||||
|
|
||||||
# Restart post-fs-data if necessary (multirom)
|
# Restart post-fs-data if necessary (multirom)
|
||||||
$MULTIROM && setprop magisk.restart_pfsd 1
|
$MULTIROM && setprop magisk.restart_pfsd 1
|
||||||
|
|
||||||
@ -522,6 +513,14 @@ case $1 in
|
|||||||
MAGISK_VERSION_STUB
|
MAGISK_VERSION_STUB
|
||||||
log_print "** Magisk late_start service mode running..."
|
log_print "** Magisk late_start service mode running..."
|
||||||
|
|
||||||
|
# Bind hosts for Adblock apps
|
||||||
|
if [ -f $COREDIR/hosts ]; then
|
||||||
|
log_print "* Enabling systemless hosts file support"
|
||||||
|
bind_mount $COREDIR/hosts /system/etc/hosts
|
||||||
|
fi
|
||||||
|
# Expose busybox
|
||||||
|
[ "`getprop persist.magisk.busybox`" = "1" ] && sh /sbin/magic_mask.sh mount_busybox
|
||||||
|
|
||||||
# Live patch sepolicy
|
# Live patch sepolicy
|
||||||
$MAGISKBIN/magiskpolicy --live --magisk
|
$MAGISKBIN/magiskpolicy --live --magisk
|
||||||
|
|
||||||
@ -545,7 +544,10 @@ case $1 in
|
|||||||
general_scripts service
|
general_scripts service
|
||||||
|
|
||||||
# Start MagiskHide
|
# Start MagiskHide
|
||||||
[ "`getprop persist.magisk.hide`" = "1" ] && sh $COREDIR/magiskhide/enable
|
if [ "`getprop persist.magisk.hide`" = "1" ]; then
|
||||||
|
log_print "* Starting MagiskHide"
|
||||||
|
sh $COREDIR/magiskhide/enable
|
||||||
|
fi
|
||||||
|
|
||||||
if [ -f $DISABLEFILE ]; then
|
if [ -f $DISABLEFILE ]; then
|
||||||
# Let MagiskManager know
|
# Let MagiskManager know
|
||||||
|
@ -32,10 +32,10 @@ log_print "Removing dangerous read-only system props"
|
|||||||
VERIFYBOOT=`getprop ro.boot.verifiedbootstate`
|
VERIFYBOOT=`getprop ro.boot.verifiedbootstate`
|
||||||
FLASHLOCKED=`getprop ro.boot.flash.locked`
|
FLASHLOCKED=`getprop ro.boot.flash.locked`
|
||||||
VERITYMODE=`getprop ro.boot.veritymode`
|
VERITYMODE=`getprop ro.boot.veritymode`
|
||||||
|
KNOX1=`getprop ro.boot.warranty_bit`
|
||||||
|
KNOX2=`getprop ro.warranty_bit`
|
||||||
DEBUGGABLE=`getprop ro.debuggable`
|
DEBUGGABLE=`getprop ro.debuggable`
|
||||||
SECURE=`getprop ro.secure`
|
SECURE=`getprop ro.secure`
|
||||||
BUILDTYPE=`getprop ro.build.type`
|
|
||||||
BUILDTAGS=`getprop ro.build.tags`
|
|
||||||
|
|
||||||
[ ! -z "$VERIFYBOOT" -a "$VERIFYBOOT" != "green" ] && \
|
[ ! -z "$VERIFYBOOT" -a "$VERIFYBOOT" != "green" ] && \
|
||||||
log_print "`$BINPATH/resetprop -v -n ro.boot.verifiedbootstate green`"
|
log_print "`$BINPATH/resetprop -v -n ro.boot.verifiedbootstate green`"
|
||||||
@ -43,14 +43,14 @@ log_print "`$BINPATH/resetprop -v -n ro.boot.verifiedbootstate green`"
|
|||||||
log_print "`$BINPATH/resetprop -v -n ro.boot.flash.locked 1`"
|
log_print "`$BINPATH/resetprop -v -n ro.boot.flash.locked 1`"
|
||||||
[ ! -z "$VERITYMODE" -a "$VERITYMODE" != "enforcing" ] && \
|
[ ! -z "$VERITYMODE" -a "$VERITYMODE" != "enforcing" ] && \
|
||||||
log_print "`$BINPATH/resetprop -v -n ro.boot.veritymode enforcing`"
|
log_print "`$BINPATH/resetprop -v -n ro.boot.veritymode enforcing`"
|
||||||
|
[ ! -z "$KNOX1" -a "$KNOX1" != "0" ] && \
|
||||||
|
log_print "`$BINPATH/resetprop -v -n ro.boot.warranty_bit 0`"
|
||||||
|
[ ! -z "$KNOX2" -a "$KNOX2" != "0" ] && \
|
||||||
|
log_print "`$BINPATH/resetprop -v -n ro.warranty_bit 0`"
|
||||||
[ ! -z "$DEBUGGABLE" -a "$DEBUGGABLE" != "0" ] && \
|
[ ! -z "$DEBUGGABLE" -a "$DEBUGGABLE" != "0" ] && \
|
||||||
log_print "`$BINPATH/resetprop -v -n ro.debuggable 0`"
|
log_print "`$BINPATH/resetprop -v -n ro.debuggable 0`"
|
||||||
[ ! -z "$SECURE" -a "$SECURE" != "1" ] && \
|
[ ! -z "$SECURE" -a "$SECURE" != "1" ] && \
|
||||||
log_print "`$BINPATH/resetprop -v -n ro.secure 1`"
|
log_print "`$BINPATH/resetprop -v -n ro.secure 1`"
|
||||||
[ ! -z "$BUILDTYPE" -a "$BUILDTYPE" != "user" ] && \
|
|
||||||
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`"
|
|
||||||
|
|
||||||
touch $MODDIR/hidelist
|
touch $MODDIR/hidelist
|
||||||
chmod -R 755 $MODDIR
|
chmod -R 755 $MODDIR
|
||||||
@ -65,4 +65,4 @@ while read PROCESS; do
|
|||||||
done < $MODDIR/hidelist
|
done < $MODDIR/hidelist
|
||||||
|
|
||||||
log_print "Starting MagiskHide daemon"
|
log_print "Starting MagiskHide daemon"
|
||||||
$BINPATH/magiskhide --daemon
|
($BINPATH/magiskhide --daemon)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user