Files
PlayIntegrityFork/module/customize.sh
osm0sis 36ce25f154 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
2024-03-25 15:00:49 -03:00

44 lines
2.0 KiB
Bash

# 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
ui_print "- Restoring disabled ROM apps configuration"
cp -arf /data/adb/modules/playintegrityfix/system $MODPATH
fi
# Copy any supported custom files to updated module
for FILE in custom.app_replace.list custom.pif.json; do
if [ -f "/data/adb/modules/playintegrityfix/$FILE" ]; then
ui_print "- Restoring $FILE"
cp -af /data/adb/modules/playintegrityfix/$FILE $MODPATH/$FILE
fi
done
# Warn if potentially conflicting modules are installed
if [ -d /data/adb/modules/MagiskHidePropsConf ]; then
ui_print "! MagiskHidePropsConfig (MHPC) module may cause issues with PIF"
fi
# Run common tasks for installation and boot-time
[ -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
ui_print "- Running migration script on custom.pif.json:"
ui_print " "
chmod 755 $MODPATH/migrate.sh
sh $MODPATH/migrate.sh install $MODPATH/custom.pif.json
ui_print " "
fi
# Clean up any leftover files from previous deprecated methods
rm -f /data/data/com.google.android.gms/cache/pif.prop /data/data/com.google.android.gms/pif.prop \
/data/data/com.google.android.gms/cache/pif.json /data/data/com.google.android.gms/pif.json