Switch to simplest file check for custom json

This commit is contained in:
osm0sis 2023-11-30 08:17:15 -04:00
parent ffcc2df8b5
commit e7ed2db1cb
No known key found for this signature in database
GPG Key ID: 6F67B35EACE37744

View File

@ -1,5 +1,4 @@
#include <android/log.h>
#include <sys/stat.h>
#include <sys/system_properties.h>
#include <unistd.h>
@ -12,6 +11,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;
@ -249,12 +249,9 @@ static void companion(int fd) {
fclose(dex);
}
struct stat tmpbuf;
if (stat(CUSTOM_JSON_FILE_PATH, &tmpbuf) == 0) {
FILE *json = fopen(CUSTOM_JSON_FILE_PATH, "r");
else {
if (!json)
FILE *json = fopen(JSON_FILE_PATH, "r");
}
if (json) {
fseek(json, 0, SEEK_END);