mirror of
https://github.com/chiteroman/PlayIntegrityFix.git
synced 2025-01-19 19:05:01 +08:00
Use custom.pif.json for custom spoofing, restore after update, fix lines
This commit is contained in:
parent
06aa2d83e9
commit
502dae9c45
@ -27,9 +27,9 @@ It injects a classes.dex file to modify a few fields in the android.os.Build cla
|
|||||||
|
|
||||||
The purpose of the module is to avoid a hardware attestation.
|
The purpose of the module is to avoid a hardware attestation.
|
||||||
|
|
||||||
## About 'pif.json' file
|
## About 'custom.pif.json' file
|
||||||
|
|
||||||
You can modify this file in the module directory to spoof custom values to the GMS unstable process.
|
You can create this file in the module directory to spoof custom values to the GMS unstable process. It will be used instead of the included pif.json.
|
||||||
|
|
||||||
You can't use values from recent devices due them triggering hardware backed attestation.
|
You can't use values from recent devices due them triggering hardware backed attestation.
|
||||||
|
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
#include <android/log.h>
|
#include <android/log.h>
|
||||||
|
#include <sys/stat.h>
|
||||||
#include <sys/system_properties.h>
|
#include <sys/system_properties.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
@ -11,6 +12,7 @@
|
|||||||
#define DEX_FILE_PATH "/data/adb/modules/playintegrityfix/classes.dex"
|
#define DEX_FILE_PATH "/data/adb/modules/playintegrityfix/classes.dex"
|
||||||
|
|
||||||
#define JSON_FILE_PATH "/data/adb/modules/playintegrityfix/pif.json"
|
#define JSON_FILE_PATH "/data/adb/modules/playintegrityfix/pif.json"
|
||||||
|
#define CUSTOM_JSON_FILE_PATH "/data/adb/modules/playintegrityfix/custom.pif.json"
|
||||||
|
|
||||||
static std::string FIRST_API_LEVEL, SECURITY_PATCH;
|
static std::string FIRST_API_LEVEL, SECURITY_PATCH;
|
||||||
|
|
||||||
@ -247,7 +249,12 @@ static void companion(int fd) {
|
|||||||
fclose(dex);
|
fclose(dex);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
struct stat tmpbuf;
|
||||||
|
if (stat(CUSTOM_JSON_FILE_PATH, &tmpbuf) == 0) {
|
||||||
|
FILE *json = fopen(CUSTOM_JSON_FILE_PATH, "r");
|
||||||
|
else {
|
||||||
FILE *json = fopen(JSON_FILE_PATH, "r");
|
FILE *json = fopen(JSON_FILE_PATH, "r");
|
||||||
|
}
|
||||||
|
|
||||||
if (json) {
|
if (json) {
|
||||||
fseek(json, 0, SEEK_END);
|
fseek(json, 0, SEEK_END);
|
||||||
|
@ -9,6 +9,12 @@ if [ -d /data/adb/modules/safetynet-fix ]; then
|
|||||||
ui_print "- 'safetynet-fix' module will be removed on next reboot"
|
ui_print "- 'safetynet-fix' module will be removed on next reboot"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Copy any custom.pif.json to updated module
|
||||||
|
if [ -f /data/adb/modules/playintegrityfix/custom.pif.json ]; then
|
||||||
|
ui_print "- Restoring custom.pif.json"
|
||||||
|
cp -af /data/adb/modules/playintegrityfix/custom.pif.json $MODPATH/custom.pif.json
|
||||||
|
fi
|
||||||
|
|
||||||
# Clean up any leftover files from previous deprecated methods
|
# 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.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
|
rm -f /data/data/com.google.android.gms/cache/pif.json /data/data/com.google.android.gms/pif.json
|
Loading…
Reference in New Issue
Block a user