Bring back USNF's scripts-only mode for older Android, but better

- do scripts-only mode automatically on Android < 8.0 since it doesn't support Zygisk and generally doesn't need a PIF module to pass at all
- clean up all unused files in scripts-only mode, and modify script behaviors for it, including allowing GMS on DenyList, and even add it if missing since it's necessary on some scripts-only configurations
- allow manually entering scripts-only mode by deleting the zygisk directory of the currently installed module and reinstalling
- intentionally don't alter the Enforce DenyList state, since we don't know what other modules are installed that might depend on it one way or the other, so leave that up to the user
This commit is contained in:
osm0sis
2024-03-25 14:59:13 -03:00
parent af7063d055
commit 36ce25f154
2 changed files with 20 additions and 12 deletions

View File

@@ -1,10 +1,14 @@
# Error on < Android 8 # Allow a scripts-only mode on older Android without Zygisk
if [ "$API" -lt 26 ]; then if [ "$API" -lt 26 -o ! -d /data/adb/modules/playintegrityfix/zygisk ]; then
abort "! You can't use this module on Android < 8.0" ui_print "! Installing global scripts only for Android < 8.0; no Zygisk device spoofing possible"
rm -rf $MODPATH/classes.dex $MODPATH/common_setup.sh $MODPATH/custom.pif.json \
$MODPATH/example.app_replace.list $MODPATH/example.pif.json $MODPATH/migrate.sh $MODPATH/zygisk \
/data/adb/modules/playintegrityfix/custom.app_replace.list \
/data/adb/modules/playintegrityfix/custom.pif.json /data/adb/modules/playintegrityfix/system
fi fi
# Copy any disabled app files to updated module # Copy any disabled app files to updated module
if [ -d "/data/adb/modules/playintegrityfix/system" ]; then if [ -d /data/adb/modules/playintegrityfix/system ]; then
ui_print "- Restoring disabled ROM apps configuration" ui_print "- Restoring disabled ROM apps configuration"
cp -arf /data/adb/modules/playintegrityfix/system $MODPATH cp -arf /data/adb/modules/playintegrityfix/system $MODPATH
fi fi
@@ -23,7 +27,7 @@ if [ -d /data/adb/modules/MagiskHidePropsConf ]; then
fi fi
# Run common tasks for installation and boot-time # Run common tasks for installation and boot-time
. $MODPATH/common_setup.sh [ -d "$MODPATH/zygisk" ] && . $MODPATH/common_setup.sh
# Migrate custom.pif.json to latest defaults if needed # Migrate custom.pif.json to latest defaults if needed
if [ -f "$MODPATH/custom.pif.json" ] && ! grep -q "api_level" $MODPATH/custom.pif.json; then if [ -f "$MODPATH/custom.pif.json" ] && ! grep -q "api_level" $MODPATH/custom.pif.json; then

View File

@@ -1,14 +1,18 @@
MODPATH="${0%/*}" MODPATH="${0%/*}"
. $MODPATH/common_func.sh . $MODPATH/common_func.sh
# Remove Play Services from Magisk Denylist when set to enforcing if [ -d "$MODPATH/zygisk" ]; then
if magisk --denylist status; then # Remove Play Services from Magisk DenyList when set to Enforce in normal mode
magisk --denylist rm com.google.android.gms if magisk --denylist status; then
magisk --denylist rm com.google.android.gms
fi
# Run common tasks for installation and boot-time
. $MODPATH/common_setup.sh
else
# Add Play Services DroidGuard process to Magisk DenyList for better results in scripts-only mode
magisk --denylist add com.google.android.gms com.google.android.gms.unstable
fi fi
# Run common tasks for installation and boot-time
. $MODPATH/common_setup.sh
# Conditional early sensitive properties # Conditional early sensitive properties
# Samsung # Samsung
@@ -26,7 +30,7 @@ resetprop_if_diff ro.boot.realmebootstate green
# OnePlus # OnePlus
resetprop_if_diff ro.is_ever_orange 0 resetprop_if_diff ro.is_ever_orange 0
# Microsoft, RootBeer # Microsoft
resetprop_if_diff ro.build.tags release-keys resetprop_if_diff ro.build.tags release-keys
# Other # Other