2019-08-21 22:35:41 +00:00
|
|
|
#!/system/bin/sh
|
|
|
|
|
2021-08-09 03:01:46 +00:00
|
|
|
if [ -e /system/bin/magisk ]
|
|
|
|
then
|
|
|
|
# remove bind-mount of phh-su overriding /system/bin/su -> ./magisk
|
|
|
|
umount -l /system/bin/magisk
|
|
|
|
# we need to modify the real system partition
|
|
|
|
MAGISK_MIRROR="$(magisk --path)/.magisk/mirror"
|
|
|
|
SYSTEM=$MAGISK_MIRROR/system
|
|
|
|
MOUNTPOINT_LIST="$MAGISK_MIRROR/system_root $MAGISK_MIRROR/system"
|
|
|
|
else
|
|
|
|
SYSTEM=/system
|
|
|
|
MOUNTPOINT_LIST="/system /"
|
|
|
|
fi
|
2020-05-09 23:20:02 +00:00
|
|
|
|
2021-08-09 03:01:46 +00:00
|
|
|
# remove bind-mount of phh-su (preventing $SYSTEM/xbin/su to be removed)
|
|
|
|
umount -l /system/xbin/su
|
|
|
|
|
|
|
|
for MOUNTPOINT in $MOUNTPOINT_LIST
|
2020-05-09 23:20:02 +00:00
|
|
|
do
|
|
|
|
[ -d $MOUNTPOINT ] && mountpoint -q $MOUNTPOINT && break
|
|
|
|
done
|
|
|
|
|
|
|
|
mount -o remount,rw $MOUNTPOINT
|
2019-12-08 20:36:47 +00:00
|
|
|
remount
|
2019-08-21 22:35:41 +00:00
|
|
|
|
2020-05-09 23:20:02 +00:00
|
|
|
touch $SYSTEM/phh/secure
|
|
|
|
rm $SYSTEM/xbin/su
|
|
|
|
rm $SYSTEM/bin/phh-su
|
|
|
|
rm $SYSTEM/etc/init/su.rc
|
|
|
|
rm $SYSTEM/bin/phh-securize.sh
|
|
|
|
rm -Rf $SYSTEM/{app,priv-app}/me.phh.superuser/
|
2020-02-23 19:12:17 +00:00
|
|
|
rm -Rf /data/su || true
|
2020-05-09 23:20:02 +00:00
|
|
|
mount -o remount,ro $MOUNTPOINT
|
2019-08-21 22:35:41 +00:00
|
|
|
sync
|
|
|
|
reboot
|