Add custom.pif.json migration script

- runs during install/update when an old format file is detected and upgrades it to the current default format which now properly separates Build fields and system properties
- supports all previously used deprecated entries, e.g. BUILD_ID, FIRST_API_LEVEL and VNDK_VERSION
- extracts any missing information for default added fields from the FINGERPRINT
- may also be run manually from command prompt with `sh migrate.sh` or with file explorer app supporting scripts like FX File Explorer
This commit is contained in:
osm0sis
2023-12-24 14:02:19 -04:00
parent 63e4191745
commit 38f8861f30
2 changed files with 101 additions and 0 deletions

View File

@@ -18,6 +18,15 @@ if [ -f /data/adb/modules/playintegrityfix/custom.pif.json ]; then
cp -af /data/adb/modules/playintegrityfix/custom.pif.json $MODPATH/custom.pif.json
fi
# 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
rm -f /data/data/com.google.android.gms/cache/pif.json /data/data/com.google.android.gms/pif.json