From 36ce25f154d8a5d39d9b0527e2f8b294ccb3df6c Mon Sep 17 00:00:00 2001 From: osm0sis Date: Mon, 25 Mar 2024 14:59:13 -0300 Subject: [PATCH] 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 --- module/customize.sh | 14 +++++++++----- module/post-fs-data.sh | 18 +++++++++++------- 2 files changed, 20 insertions(+), 12 deletions(-) diff --git a/module/customize.sh b/module/customize.sh index a6cd9f2..c583def 100644 --- a/module/customize.sh +++ b/module/customize.sh @@ -1,10 +1,14 @@ -# Error on < Android 8 -if [ "$API" -lt 26 ]; then - abort "! You can't use this module on Android < 8.0" +# Allow a scripts-only mode on older Android without Zygisk +if [ "$API" -lt 26 -o ! -d /data/adb/modules/playintegrityfix/zygisk ]; then + 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 # 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" cp -arf /data/adb/modules/playintegrityfix/system $MODPATH fi @@ -23,7 +27,7 @@ if [ -d /data/adb/modules/MagiskHidePropsConf ]; then fi # 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 if [ -f "$MODPATH/custom.pif.json" ] && ! grep -q "api_level" $MODPATH/custom.pif.json; then diff --git a/module/post-fs-data.sh b/module/post-fs-data.sh index ce4f031..b19c9dc 100644 --- a/module/post-fs-data.sh +++ b/module/post-fs-data.sh @@ -1,14 +1,18 @@ MODPATH="${0%/*}" . $MODPATH/common_func.sh -# Remove Play Services from Magisk Denylist when set to enforcing -if magisk --denylist status; then - magisk --denylist rm com.google.android.gms +if [ -d "$MODPATH/zygisk" ]; then + # Remove Play Services from Magisk DenyList when set to Enforce in normal mode + 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 -# Run common tasks for installation and boot-time -. $MODPATH/common_setup.sh - # Conditional early sensitive properties # Samsung @@ -26,7 +30,7 @@ resetprop_if_diff ro.boot.realmebootstate green # OnePlus resetprop_if_diff ro.is_ever_orange 0 -# Microsoft, RootBeer +# Microsoft resetprop_if_diff ro.build.tags release-keys # Other