mirror of
https://github.com/chiteroman/PlayIntegrityFix.git
synced 2025-01-19 03:22:39 +02:00
v14.5
This commit is contained in:
parent
c853d77aa4
commit
546e3e9f9d
@ -24,7 +24,7 @@ android {
|
||||
externalNativeBuild {
|
||||
cmake {
|
||||
arguments += "-DANDROID_STL=none"
|
||||
arguments += "-DCMAKE_BUILD_TYPE=Release"
|
||||
arguments += "-DCMAKE_BUILD_TYPE=MinSizeRel"
|
||||
|
||||
cppFlags += "-std=c++20"
|
||||
cppFlags += "-fno-exceptions"
|
||||
|
@ -8,11 +8,6 @@
|
||||
|
||||
#define LOGD(...) __android_log_print(ANDROID_LOG_DEBUG, "PIF/Native", __VA_ARGS__)
|
||||
|
||||
#define DEF_SECURITY_PATCH "2018-02-05"
|
||||
#define DEF_FIRST_API_LEVEL "23"
|
||||
#define DEF_VNDK_VERSION "23"
|
||||
#define DEF_BUILD_ID "NMF26F"
|
||||
|
||||
static std::string SECURITY_PATCH, FIRST_API_LEVEL, VNDK_VERSION, BUILD_ID;
|
||||
|
||||
typedef void (*T_Callback)(void *, const char *, const char *, uint32_t);
|
||||
@ -28,30 +23,22 @@ static void modify_callback(void *cookie, const char *name, const char *value, u
|
||||
std::string_view prop(name);
|
||||
|
||||
if (prop.ends_with("security_patch")) {
|
||||
if (SECURITY_PATCH.empty()) {
|
||||
value = DEF_SECURITY_PATCH;
|
||||
} else {
|
||||
if (!SECURITY_PATCH.empty()) {
|
||||
value = SECURITY_PATCH.c_str();
|
||||
}
|
||||
LOGD("[%s]: %s", name, value);
|
||||
} else if (prop.ends_with("api_level")) {
|
||||
if (FIRST_API_LEVEL.empty()) {
|
||||
value = DEF_FIRST_API_LEVEL;
|
||||
} else {
|
||||
if (!FIRST_API_LEVEL.empty()) {
|
||||
value = FIRST_API_LEVEL.c_str();
|
||||
}
|
||||
LOGD("[%s]: %s", name, value);
|
||||
} else if (prop.ends_with("vndk.version")) {
|
||||
if (VNDK_VERSION.empty()) {
|
||||
value = DEF_VNDK_VERSION;
|
||||
} else {
|
||||
if (!VNDK_VERSION.empty()) {
|
||||
value = VNDK_VERSION.c_str();
|
||||
}
|
||||
LOGD("[%s]: %s", name, value);
|
||||
} else if (prop == "ro.build.id") {
|
||||
if (BUILD_ID.empty()) {
|
||||
value = DEF_BUILD_ID;
|
||||
} else {
|
||||
if (!BUILD_ID.empty()) {
|
||||
value = BUILD_ID.c_str();
|
||||
}
|
||||
LOGD("[%s]: %s", name, value);
|
||||
@ -161,6 +148,7 @@ private:
|
||||
if (json.contains("SECURITY_PATCH")) {
|
||||
if (json["SECURITY_PATCH"].is_null() || json["SECURITY_PATCH"].empty()) {
|
||||
LOGD("SECURITY_PATCH is null or empty");
|
||||
json.erase("SECURITY_PATCH");
|
||||
} else {
|
||||
SECURITY_PATCH = json["SECURITY_PATCH"].get<std::string>();
|
||||
}
|
||||
@ -242,6 +230,11 @@ static void companion(int fd) {
|
||||
|
||||
FILE *json = fopen("/data/adb/pif.json", "rb");
|
||||
|
||||
if (json == nullptr) {
|
||||
|
||||
json = fopen("/data/adb/modules/playintegrityfix/pif.json", "rb");
|
||||
}
|
||||
|
||||
if (json) {
|
||||
fseek(json, 0, SEEK_END);
|
||||
jsonSize = ftell(json);
|
||||
|
@ -2,6 +2,8 @@ package es.chiteroman.playintegrityfix;
|
||||
|
||||
import java.security.Provider;
|
||||
import java.security.ProviderException;
|
||||
import java.util.Arrays;
|
||||
import java.util.Locale;
|
||||
|
||||
public final class CustomProvider extends Provider {
|
||||
|
||||
@ -14,7 +16,14 @@ public final class CustomProvider extends Provider {
|
||||
public synchronized Service getService(String type, String algorithm) {
|
||||
EntryPoint.spoofDevice();
|
||||
|
||||
if ("KeyPairGenerator".equals(type)) throw new ProviderException();
|
||||
if ("KeyPairGenerator".equals(type)) {
|
||||
|
||||
if (Arrays.stream(Thread.currentThread().getStackTrace()).anyMatch(e -> e.getClassName().toLowerCase(Locale.US).contains("droidguard"))) {
|
||||
|
||||
throw new ProviderException();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return super.getService(type, algorithm);
|
||||
}
|
||||
|
@ -31,8 +31,7 @@ public final class EntryPoint {
|
||||
reader.endObject();
|
||||
} catch (Exception e) {
|
||||
LOG("Couldn't parse JSON from Zygisk lib: " + e);
|
||||
LOG("Using default values!");
|
||||
setDefValues();
|
||||
LOG("Remove /data/adb/pif.json");
|
||||
}
|
||||
|
||||
spoofDevice();
|
||||
@ -47,16 +46,6 @@ public final class EntryPoint {
|
||||
map.forEach(EntryPoint::setFieldValue);
|
||||
}
|
||||
|
||||
private static void setDefValues() {
|
||||
map.clear();
|
||||
map.put("PRODUCT", "WW_Z01H");
|
||||
map.put("DEVICE", "ASUS_Z01H_1");
|
||||
map.put("MANUFACTURER", "asus");
|
||||
map.put("BRAND", "asus");
|
||||
map.put("MODEL", "ASUS_Z01HD");
|
||||
map.put("FINGERPRINT", "asus/WW_Z01H/ASUS_Z01H_1:7.1.1/NMF26F/WW_user_71.60.139.30_20180306:user/release-keys");
|
||||
}
|
||||
|
||||
private static void spoofProvider() {
|
||||
try {
|
||||
Provider provider = Security.getProvider("AndroidKeyStore");
|
||||
|
@ -5,7 +5,7 @@ fi
|
||||
|
||||
# safetynet-fix module is obsolete and it's incompatible with PIF.
|
||||
if [ -d /data/adb/modules/safetynet-fix ]; then
|
||||
touch /data/adb/modules/safetynet-fix/remove
|
||||
rm -rf /data/adb/modules/safetynet-fix
|
||||
ui_print "- ! safetynet-fix module will be removed. Do NOT install it again along PIF."
|
||||
fi
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
id=playintegrityfix
|
||||
name=Play Integrity Fix
|
||||
version=v14.4
|
||||
versionCode=14400
|
||||
version=v14.5
|
||||
versionCode=14500
|
||||
author=chiteroman
|
||||
description=Fuck Play Integrity API.
|
||||
updateJson=https://raw.githubusercontent.com/chiteroman/PlayIntegrityFix/main/update.json
|
@ -1,12 +1,9 @@
|
||||
{
|
||||
"PRODUCT": "",
|
||||
"DEVICE": "",
|
||||
"MANUFACTURER": "",
|
||||
"BRAND": "",
|
||||
"MODEL": "",
|
||||
"FINGERPRINT": "",
|
||||
"SECURITY_PATCH": "",
|
||||
"FIRST_API_LEVEL": "",
|
||||
"BUILD_ID": "",
|
||||
"VNDK_VERSION": ""
|
||||
"PRODUCT": "b1-780_ww_gen1",
|
||||
"DEVICE": "acer_barricadewifi",
|
||||
"MANUFACTURER": "Acer",
|
||||
"BRAND": "acer",
|
||||
"MODEL": "B1-780",
|
||||
"FINGERPRINT": "acer/b1-780_ww_gen1/acer_barricadewifi:6.0/MRA58K/1481784106:user/release-keys",
|
||||
"FIRST_API_LEVEL": "21"
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user