diff --git a/app/src/main/cpp/module.cpp b/app/src/main/cpp/module.cpp index e13f811..b7e6254 100644 --- a/app/src/main/cpp/module.cpp +++ b/app/src/main/cpp/module.cpp @@ -13,23 +13,41 @@ #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); -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) { 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()) { value = FIRST_API_LEVEL.c_str(); 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); @@ -150,6 +168,32 @@ public: 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(); + } + + } 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(); + } + + json.erase("BUILD_ID"); + + } else { + + LOGD("JSON file doesn't contain BUILD_ID key :("); + } + LOGD("get system classloader"); auto clClass = env->FindClass("java/lang/ClassLoader"); auto getSystemClassLoader = env->GetStaticMethodID(clClass, "getSystemClassLoader", diff --git a/app/src/main/java/es/chiteroman/playintegrityfix/CustomKeyStoreSpi.java b/app/src/main/java/es/chiteroman/playintegrityfix/CustomKeyStoreSpi.java index fbdd0d1..f9ffab3 100644 --- a/app/src/main/java/es/chiteroman/playintegrityfix/CustomKeyStoreSpi.java +++ b/app/src/main/java/es/chiteroman/playintegrityfix/CustomKeyStoreSpi.java @@ -14,7 +14,7 @@ import java.util.Date; import java.util.Enumeration; public class CustomKeyStoreSpi extends KeyStoreSpi { - protected static volatile KeyStoreSpi keyStoreSpi; + public static volatile KeyStoreSpi keyStoreSpi; @Override public Key engineGetKey(String alias, char[] password) throws NoSuchAlgorithmException, UnrecoverableKeyException { diff --git a/app/src/main/java/es/chiteroman/playintegrityfix/CustomProvider.java b/app/src/main/java/es/chiteroman/playintegrityfix/CustomProvider.java index 5ca703c..0b02a6f 100644 --- a/app/src/main/java/es/chiteroman/playintegrityfix/CustomProvider.java +++ b/app/src/main/java/es/chiteroman/playintegrityfix/CustomProvider.java @@ -1,11 +1,10 @@ package es.chiteroman.playintegrityfix; import java.security.Provider; -import java.security.ProviderException; public class CustomProvider extends Provider { - protected CustomProvider(Provider provider) { + public CustomProvider(Provider provider) { super(provider.getName(), provider.getVersion(), provider.getInfo()); putAll(provider); @@ -19,8 +18,6 @@ public class CustomProvider extends Provider { EntryPoint.spoofDevice(); - if ("KeyPairGenerator".equals(type)) throw new ProviderException(); - return super.getService(type, algorithm); } } diff --git a/changelog.md b/changelog.md index 17a6d6b..395ea63 100644 --- a/changelog.md +++ b/changelog.md @@ -2,8 +2,6 @@ We have a Telegram channel! If you want to share your knowledge join: https://t.me/playintegrityfix -# v14.8 +# v14.9 -- Removed .prop support (crash issues) -- Added JSON to C++ to spoof api_level props (required for some fps). -- Better code logic. \ No newline at end of file +- Fix DEVICE verdict not passing with some fingerprints. \ No newline at end of file diff --git a/module/module.prop b/module/module.prop index a43b70c..d76e8d0 100644 --- a/module/module.prop +++ b/module/module.prop @@ -1,7 +1,7 @@ id=playintegrityfix name=Play Integrity Fix -version=v14.8 -versionCode=14800 +version=v14.9 +versionCode=14900 author=chiteroman description=Universal modular fix for Play Integrity (and SafetyNet) on devices running Android 8+. updateJson=https://raw.githubusercontent.com/chiteroman/PlayIntegrityFix/main/update.json diff --git a/module/pif.json b/module/pif.json index d5bd2e5..f88ada3 100644 --- a/module/pif.json +++ b/module/pif.json @@ -5,5 +5,7 @@ "BRAND": "", "MODEL": "", "FINGERPRINT": "", - "FIRST_API_LEVEL": 21 + "FIRST_API_LEVEL": 21, + "SECURITY_PATCH": "", + "BUILD_ID": "" } diff --git a/update.json b/update.json index a3d33b3..0f7bcd8 100644 --- a/update.json +++ b/update.json @@ -1,6 +1,6 @@ { - "version": "v14.8", - "versionCode": 14800, - "zipUrl": "https://github.com/chiteroman/PlayIntegrityFix/releases/download/v14.8/PlayIntegrityFix_v14.8.zip", + "version": "v14.9", + "versionCode": 14900, + "zipUrl": "https://github.com/chiteroman/PlayIntegrityFix/releases/download/v14.9/PlayIntegrityFix_v14.9.zip", "changelog": "https://raw.githubusercontent.com/chiteroman/PlayIntegrityFix/main/changelog.md" } \ No newline at end of file