mirror of
https://github.com/chiteroman/PlayIntegrityFix.git
synced 2025-01-19 11:32:39 +02:00
Test v14.1
This commit is contained in:
parent
fa15834c71
commit
c1f1c77811
@ -12,7 +12,7 @@
|
|||||||
|
|
||||||
#define JSON_FILE_PATH "/data/adb/pif.json"
|
#define JSON_FILE_PATH "/data/adb/pif.json"
|
||||||
|
|
||||||
#define DEFAULT_FIRST_API_LEVEL "23"
|
#define JSON_TEMP_FILE "/data/adb/modules/playintegrityfix/temp"
|
||||||
|
|
||||||
static std::string FIRST_API_LEVEL, SECURITY_PATCH;
|
static std::string FIRST_API_LEVEL, SECURITY_PATCH;
|
||||||
|
|
||||||
@ -29,19 +29,16 @@ static void modify_callback(void *cookie, const char *name, const char *value, u
|
|||||||
std::string_view prop(name);
|
std::string_view prop(name);
|
||||||
|
|
||||||
if (prop.ends_with("api_level")) {
|
if (prop.ends_with("api_level")) {
|
||||||
if (FIRST_API_LEVEL.empty()) {
|
if (!FIRST_API_LEVEL.empty()) {
|
||||||
LOGD("[%s]: %s -> %s", name, value, DEFAULT_FIRST_API_LEVEL);
|
value = FIRST_API_LEVEL.c_str();
|
||||||
return callbacks[cookie](cookie, name, DEFAULT_FIRST_API_LEVEL, serial);
|
LOGD("[%s]: %s", name, value);
|
||||||
} else {
|
|
||||||
LOGD("[%s]: %s -> %s", name, value, FIRST_API_LEVEL.c_str());
|
|
||||||
return callbacks[cookie](cookie, name, FIRST_API_LEVEL.c_str(), serial);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (prop.ends_with("security_patch")) {
|
if (prop.ends_with("security_patch")) {
|
||||||
if (!SECURITY_PATCH.empty()) {
|
if (!SECURITY_PATCH.empty()) {
|
||||||
LOGD("[%s]: %s -> %s", name, value, SECURITY_PATCH.c_str());
|
value = SECURITY_PATCH.c_str();
|
||||||
return callbacks[cookie](cookie, name, SECURITY_PATCH.c_str(), serial);
|
LOGD("[%s]: %s", name, value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -238,7 +235,8 @@ static void companion(int fd) {
|
|||||||
fclose(dex);
|
fclose(dex);
|
||||||
}
|
}
|
||||||
|
|
||||||
FILE *json = fopen(JSON_FILE_PATH, "r");
|
if (std::filesystem::exists(JSON_FILE_PATH)) {
|
||||||
|
FILE *json = fopen(JSON_FILE_PATH, "rb");
|
||||||
|
|
||||||
if (json) {
|
if (json) {
|
||||||
fseek(json, 0, SEEK_END);
|
fseek(json, 0, SEEK_END);
|
||||||
@ -250,6 +248,20 @@ static void companion(int fd) {
|
|||||||
|
|
||||||
fclose(json);
|
fclose(json);
|
||||||
}
|
}
|
||||||
|
} else if (std::filesystem::exists(JSON_TEMP_FILE)) {
|
||||||
|
FILE *json = fopen(JSON_TEMP_FILE, "rb");
|
||||||
|
|
||||||
|
if (json) {
|
||||||
|
fseek(json, 0, SEEK_END);
|
||||||
|
jsonSize = ftell(json);
|
||||||
|
fseek(json, 0, SEEK_SET);
|
||||||
|
|
||||||
|
jsonVector.resize(jsonSize);
|
||||||
|
fread(jsonVector.data(), 1, jsonSize, json);
|
||||||
|
|
||||||
|
fclose(json);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
write(fd, &dexSize, sizeof(long));
|
write(fd, &dexSize, sizeof(long));
|
||||||
write(fd, &jsonSize, sizeof(long));
|
write(fd, &jsonSize, sizeof(long));
|
||||||
|
@ -3,12 +3,6 @@ if [ "$API" -lt 26 ]; then
|
|||||||
abort "!!! You can't use this module on Android < 8.0"
|
abort "!!! You can't use this module on Android < 8.0"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Copy default pif.json if it doesn't exist.
|
|
||||||
if [ ! -e /data/adb/pif.json ]; then
|
|
||||||
cp -af $MODPATH/pif.json /data/adb/pif.json
|
|
||||||
ui_print "Moved default pif.json file!"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# SafetyNet-Fix module is obsolete and it's incompatible with PIF.
|
# SafetyNet-Fix module is obsolete and it's incompatible with PIF.
|
||||||
if [ -d /data/adb/modules/safetynet-fix ]; then
|
if [ -d /data/adb/modules/safetynet-fix ]; then
|
||||||
touch /data/adb/modules/safetynet-fix/remove
|
touch /data/adb/modules/safetynet-fix/remove
|
||||||
|
@ -1,3 +1,6 @@
|
|||||||
|
# Remove temp file
|
||||||
|
rm -f /data/adb/modules/playintegrityfix/temp
|
||||||
|
|
||||||
# Conditional sensitive properties
|
# Conditional sensitive properties
|
||||||
|
|
||||||
resetprop_if_diff() {
|
resetprop_if_diff() {
|
||||||
|
@ -3,12 +3,6 @@ if [ "$API" -lt 26 ]; then
|
|||||||
abort "!!! You can't use this module on Android < 8.0"
|
abort "!!! You can't use this module on Android < 8.0"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Copy default pif.json if it doesn't exist.
|
|
||||||
if [ ! -e /data/adb/pif.json ]; then
|
|
||||||
cp -af $MODPATH/pif.json /data/adb/pif.json
|
|
||||||
ui_print "- Moved default pif.json file!"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# SafetyNet-Fix module is obsolete and it's incompatible with PIF.
|
# SafetyNet-Fix module is obsolete and it's incompatible with PIF.
|
||||||
if [ -d /data/adb/modules/safetynet-fix ]; then
|
if [ -d /data/adb/modules/safetynet-fix ]; then
|
||||||
touch /data/adb/modules/safetynet-fix/remove
|
touch /data/adb/modules/safetynet-fix/remove
|
||||||
|
@ -1,3 +1,6 @@
|
|||||||
|
# Remove temp file
|
||||||
|
rm -f /data/adb/modules/playintegrityfix/temp
|
||||||
|
|
||||||
# Conditional sensitive properties
|
# Conditional sensitive properties
|
||||||
|
|
||||||
RESETPROP="${0%/*}/resetprop"
|
RESETPROP="${0%/*}/resetprop"
|
||||||
|
10
pif.json
Normal file
10
pif.json
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
{
|
||||||
|
"PRODUCT": "WW_Phone",
|
||||||
|
"DEVICE": "ASUS_Z012D",
|
||||||
|
"MANUFACTURER": "asus",
|
||||||
|
"BRAND": "asus",
|
||||||
|
"MODEL": "ASUS_Z012D",
|
||||||
|
"FINGERPRINT": "asus/WW_Phone/ASUS_Z012D:7.0/NRD90M/14.2015.1701.8-20170222:user/release-keys",
|
||||||
|
"SECURITY_PATCH": "2017-01-01",
|
||||||
|
"FIRST_API_LEVEL": "23"
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user