Use custom.pif.json for custom spoofing, restore after update, fix lines

This commit is contained in:
osm0sis
2023-11-29 11:19:43 -04:00
parent 06aa2d83e9
commit 502dae9c45
5 changed files with 19 additions and 6 deletions
+8 -1
View File
@@ -1,4 +1,5 @@
#include <android/log.h>
#include <sys/stat.h>
#include <sys/system_properties.h>
#include <unistd.h>
@@ -11,6 +12,7 @@
#define DEX_FILE_PATH "/data/adb/modules/playintegrityfix/classes.dex"
#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;
@@ -247,7 +249,12 @@ static void companion(int fd) {
fclose(dex);
}
FILE *json = fopen(JSON_FILE_PATH, "r");
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");
}
if (json) {
fseek(json, 0, SEEK_END);