[Magisk] zgfg:
Script for automatic Play Integrity testing of *.json files by use of Simple Play Integrity Checker (SPIC) - app must be installed to the phone.

Script must be executed on the (rooted) phone - eg from MiXPlorer or from Terminal Emulator (or by ADB)

Download and unzip the attached script pif-test.sh

Script launches SPIC, automatically kicks "Make Play Integrity" button and reads the verdict from display.

Hence, display must be unlocked and portrait oriented - ie, you must be able to see both the "Make Play Integrity" button and the verdict below, without scrolling up and down.

Test must be run in foreground - do not use the phone while testing

Script tests one by one *.json file from the given folder and its subfolders, crawling down till all the sub-sub-sub-sub-folders.

Script deletes tested JSON files that did not meet DEVICE or STRONG INTEGRITY and saves results for all tested JSON files to pif.txt list

In case of no connection, verdicts not received on time or not recognized (you played with the phone/screen), overquota on the SPIC side, etc - script will not delete those JSON files (you can retest them later)

Sometimes the same JSON file (same FINGERPRINT, BRAND, etc) does not pass DEVICE integrity with the original FIRST_API_LEVEL eg 29, but maybe will pass with FIRST_API_LEVEL lowered to 27 or 23.

Therefore, if you want to test by varying and tweaking FIRST_API_LEVEL or other fields in JSON files, prepare in advance different versions of JSON files or keep their copies aside.

Script can be used both with Chiteroman's Play Integrity Fix module or Osm0sis Play Integrity Fork module - the module must be installed

For the beginning. open the script, read comments on top and tweak the required parameters if needed

---

Testing from MiXPlorer:

MiXPlorer must be installed and granted root. Copy the script to eg Download folder

Place your *.json files you want to test into the same folder and subfolders.

Execute the script (see the screenshots) and get your hands up from the phone until the test completes

Start first with only a few JSON files, ones you know do they pass or not, to see how it works and do you need to tweak the params in the script

Read the pif.txt file with test results. You can also read pif.log with the PIF logcat for the last tested JSON file

---

Testing from Terminal Emulator (TE):

Terminal emulator must be installed with the root granted for su. User must be familiar with TE and shell commands

Copy the script to /data/local/tmp and change the chmod to 755 (executable properties).

Copy your *.json files again to eg Download folder (and subfolders) on the Internal memory

Invoke the script by passing the path to your folder with JSON files for testing:

su -c /data/local/tmp/pif-test.sh /sdcard/Download

Read the results from pif.txt file in the same folder where you tested the JSON files (eg, Download folder)

---

Testing by ADB

ADB must be installed and set (USB, drivers, etc). User must be familiar with DOS and ADB commands

Again, prepare your *.json files to be tested, eg into the Download folder (and subfolders) on your phone (not on the PC)

Connect the phone, make sure that ADB is running and execute from the DOS shell (CMD):

adb shell su -c /data/local/tmp/pif-test.sh /sdcard/Download

Read the test results from pif.txt, on the phone (as explained above)

However, if you really want to test from the PC, via ADB, I suggest to rather use the powerful and user-friendly PixelFlasher (PF) program from Badabing2003

Credits to him - this script is based on techniques he has implemented in PF (but here we use a different way to launch SPIC and to detect/extract the verdict)