2024-10-23 15:22:27 +03:00
|
|
|
# Don't flash in recovery!
|
|
|
|
if ! $BOOTMODE; then
|
|
|
|
ui_print "*********************************************************"
|
|
|
|
ui_print "! Install from recovery is NOT supported"
|
|
|
|
ui_print "! Recovery sucks"
|
|
|
|
ui_print "! Please install from Magisk / KernelSU / APatch app"
|
|
|
|
abort "*********************************************************"
|
|
|
|
fi
|
2024-09-04 13:12:52 +03:00
|
|
|
|
2024-07-21 19:34:45 +03:00
|
|
|
# Error on < Android 8
|
|
|
|
if [ "$API" -lt 26 ]; then
|
2024-09-04 13:12:52 +03:00
|
|
|
abort "! You can't use this module on Android < 8.0"
|
2024-07-21 19:34:45 +03:00
|
|
|
fi
|
|
|
|
|
2024-11-17 02:41:01 +02:00
|
|
|
check_zygisk() {
|
|
|
|
local ZYGISK_MODULE="/data/adb/modules/zygisksu"
|
|
|
|
local MAGISK_DIR="/data/adb/magisk"
|
|
|
|
local ZYGISK_MSG="Zygisk is not enabled. Please either:
|
|
|
|
- Enable Zygisk in Magisk settings
|
|
|
|
- Install ZygiskNext or ReZygisk module"
|
|
|
|
|
|
|
|
# Check if Zygisk module directory exists
|
|
|
|
if [ -d "$ZYGISK_MODULE" ]; then
|
|
|
|
return 0
|
|
|
|
fi
|
|
|
|
|
|
|
|
# If Magisk is installed, check Zygisk settings
|
|
|
|
if [ -d "$MAGISK_DIR" ]; then
|
|
|
|
# Query Zygisk status from Magisk database
|
|
|
|
local ZYGISK_STATUS
|
|
|
|
ZYGISK_STATUS=$(magisk --sqlite "SELECT value FROM settings WHERE key='zygisk';")
|
|
|
|
|
|
|
|
# Check if Zygisk is disabled
|
|
|
|
if [ "$ZYGISK_STATUS" = "value=0" ]; then
|
|
|
|
abort "$ZYGISK_MSG"
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
abort "$ZYGISK_MSG"
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
# Module requires Zygisk to work
|
|
|
|
check_zygisk
|
|
|
|
|
|
|
|
# safetynet-fix module is obsolete and it's incompatible with PIF
|
|
|
|
SNFix="/data/adb/modules/safetynet-fix"
|
|
|
|
if [ -d "$SNFix" ]; then
|
|
|
|
ui_print "! safetynet-fix module is obsolete and it's incompatible with PIF, it will be removed on next reboot"
|
|
|
|
ui_print "! Do not install it"
|
|
|
|
touch "$SNFix"/remove
|
|
|
|
fi
|
|
|
|
|
2024-10-23 15:22:27 +03:00
|
|
|
# playcurl warn
|
2024-07-21 19:34:45 +03:00
|
|
|
if [ -d "/data/adb/modules/playcurl" ]; then
|
2024-10-23 15:22:27 +03:00
|
|
|
ui_print "! playcurl may overwrite fingerprint with invalid one, be careful!"
|
2024-07-21 19:34:45 +03:00
|
|
|
fi
|
|
|
|
|
|
|
|
# MagiskHidePropsConf module is obsolete in Android 8+ but it shouldn't give issues
|
|
|
|
if [ -d "/data/adb/modules/MagiskHidePropsConf" ]; then
|
|
|
|
ui_print "! WARNING, MagiskHidePropsConf module may cause issues with PIF."
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Check custom fingerprint
|
|
|
|
if [ -f "/data/adb/pif.json" ]; then
|
2024-12-24 20:44:06 +02:00
|
|
|
ui_print "- Backup custom pif.json"
|
|
|
|
mv -f /data/adb/pif.json /data/adb/pif.json.old
|
2024-07-21 19:34:45 +03:00
|
|
|
fi
|