This commit is contained in:
chiteroman 2023-12-25 10:01:56 +01:00
parent 7d04e447f1
commit 325fbdc2f5
No known key found for this signature in database
GPG Key ID: 19171A27D600CC72
7 changed files with 59 additions and 18 deletions

View File

@ -13,23 +13,41 @@
#define PIF_JSON "/data/adb/pif.json" #define PIF_JSON "/data/adb/pif.json"
static std::string FIRST_API_LEVEL; static std::string FIRST_API_LEVEL, SECURITY_PATCH, BUILD_ID;
typedef void (*T_Callback)(void *, const char *, const char *, uint32_t); typedef void (*T_Callback)(void *, const char *, const char *, uint32_t);
static volatile T_Callback o_callback = nullptr; static T_Callback o_callback = nullptr;
static void modify_callback(void *cookie, const char *name, const char *value, uint32_t serial) { static void modify_callback(void *cookie, const char *name, const char *value, uint32_t serial) {
if (cookie == nullptr || name == nullptr || o_callback == nullptr) return; if (cookie == nullptr || name == nullptr || o_callback == nullptr) return;
if (std::string_view(name).ends_with("api_level")) { std::string_view prop(name);
if (prop.ends_with("security_patch")) {
if (!SECURITY_PATCH.empty()) {
value = SECURITY_PATCH.c_str();
LOGD("Set '%s' to '%s'", name, value);
}
} else if (prop.ends_with("api_level")) {
if (!FIRST_API_LEVEL.empty()) { if (!FIRST_API_LEVEL.empty()) {
value = FIRST_API_LEVEL.c_str(); value = FIRST_API_LEVEL.c_str();
LOGD("Set '%s' to '%s'", name, value); LOGD("Set '%s' to '%s'", name, value);
} }
} else if (prop == "ro.build.id") {
if (!BUILD_ID.empty()) {
value = BUILD_ID.c_str();
LOGD("Set '%s' to '%s'", name, value);
}
} }
return o_callback(cookie, name, value, serial); return o_callback(cookie, name, value, serial);
@ -150,6 +168,32 @@ public:
LOGD("JSON file doesn't contain FIRST_API_LEVEL key :("); LOGD("JSON file doesn't contain FIRST_API_LEVEL key :(");
} }
if (json.contains("SECURITY_PATCH")) {
if (json["SECURITY_PATCH"].is_string()) {
SECURITY_PATCH = json["SECURITY_PATCH"].get<std::string>();
}
} else {
LOGD("JSON file doesn't contain SECURITY_PATCH key :(");
}
if (json.contains("BUILD_ID")) {
if (json["BUILD_ID"].is_string()) {
BUILD_ID = json["BUILD_ID"].get<std::string>();
}
json.erase("BUILD_ID");
} else {
LOGD("JSON file doesn't contain BUILD_ID key :(");
}
LOGD("get system classloader"); LOGD("get system classloader");
auto clClass = env->FindClass("java/lang/ClassLoader"); auto clClass = env->FindClass("java/lang/ClassLoader");
auto getSystemClassLoader = env->GetStaticMethodID(clClass, "getSystemClassLoader", auto getSystemClassLoader = env->GetStaticMethodID(clClass, "getSystemClassLoader",

View File

@ -14,7 +14,7 @@ import java.util.Date;
import java.util.Enumeration; import java.util.Enumeration;
public class CustomKeyStoreSpi extends KeyStoreSpi { public class CustomKeyStoreSpi extends KeyStoreSpi {
protected static volatile KeyStoreSpi keyStoreSpi; public static volatile KeyStoreSpi keyStoreSpi;
@Override @Override
public Key engineGetKey(String alias, char[] password) throws NoSuchAlgorithmException, UnrecoverableKeyException { public Key engineGetKey(String alias, char[] password) throws NoSuchAlgorithmException, UnrecoverableKeyException {

View File

@ -1,11 +1,10 @@
package es.chiteroman.playintegrityfix; package es.chiteroman.playintegrityfix;
import java.security.Provider; import java.security.Provider;
import java.security.ProviderException;
public class CustomProvider extends Provider { public class CustomProvider extends Provider {
protected CustomProvider(Provider provider) { public CustomProvider(Provider provider) {
super(provider.getName(), provider.getVersion(), provider.getInfo()); super(provider.getName(), provider.getVersion(), provider.getInfo());
putAll(provider); putAll(provider);
@ -19,8 +18,6 @@ public class CustomProvider extends Provider {
EntryPoint.spoofDevice(); EntryPoint.spoofDevice();
if ("KeyPairGenerator".equals(type)) throw new ProviderException();
return super.getService(type, algorithm); return super.getService(type, algorithm);
} }
} }

View File

@ -2,8 +2,6 @@ We have a Telegram channel!
If you want to share your knowledge join: If you want to share your knowledge join:
https://t.me/playintegrityfix https://t.me/playintegrityfix
# v14.8 # v14.9
- Removed .prop support (crash issues) - Fix DEVICE verdict not passing with some fingerprints.
- Added JSON to C++ to spoof api_level props (required for some fps).
- Better code logic.

View File

@ -1,7 +1,7 @@
id=playintegrityfix id=playintegrityfix
name=Play Integrity Fix name=Play Integrity Fix
version=v14.8 version=v14.9
versionCode=14800 versionCode=14900
author=chiteroman author=chiteroman
description=Universal modular fix for Play Integrity (and SafetyNet) on devices running Android 8+. description=Universal modular fix for Play Integrity (and SafetyNet) on devices running Android 8+.
updateJson=https://raw.githubusercontent.com/chiteroman/PlayIntegrityFix/main/update.json updateJson=https://raw.githubusercontent.com/chiteroman/PlayIntegrityFix/main/update.json

View File

@ -5,5 +5,7 @@
"BRAND": "", "BRAND": "",
"MODEL": "", "MODEL": "",
"FINGERPRINT": "", "FINGERPRINT": "",
"FIRST_API_LEVEL": 21 "FIRST_API_LEVEL": 21,
"SECURITY_PATCH": "",
"BUILD_ID": ""
} }

View File

@ -1,6 +1,6 @@
{ {
"version": "v14.8", "version": "v14.9",
"versionCode": 14800, "versionCode": 14900,
"zipUrl": "https://github.com/chiteroman/PlayIntegrityFix/releases/download/v14.8/PlayIntegrityFix_v14.8.zip", "zipUrl": "https://github.com/chiteroman/PlayIntegrityFix/releases/download/v14.9/PlayIntegrityFix_v14.9.zip",
"changelog": "https://raw.githubusercontent.com/chiteroman/PlayIntegrityFix/main/changelog.md" "changelog": "https://raw.githubusercontent.com/chiteroman/PlayIntegrityFix/main/changelog.md"
} }