From eff20178ebc9ab6975f7539af7ff1c0c151ab974 Mon Sep 17 00:00:00 2001 From: chiteroman Date: Thu, 19 Sep 2024 01:31:11 +0200 Subject: [PATCH] v17.6 --- app/build.gradle.kts | 11 ++++++----- app/src/main/cpp/CMakeLists.txt | 4 ++-- app/src/main/cpp/main.cpp | 30 ++++++++++++++++++------------ changelog.md | 7 +++++-- module/module.prop | 4 ++-- module/sepolicy.rule | 1 + update.json | 6 +++--- 7 files changed, 37 insertions(+), 26 deletions(-) create mode 100644 module/sepolicy.rule diff --git a/app/build.gradle.kts b/app/build.gradle.kts index f389fdd..2bb2492 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -6,7 +6,7 @@ android { namespace = "es.chiteroman.playintegrityfix" compileSdk = 35 buildToolsVersion = "35.0.0" - ndkVersion = "27.0.12077973" + ndkVersion = "27.1.12297006" buildFeatures { prefab = true @@ -22,8 +22,8 @@ android { applicationId = "es.chiteroman.playintegrityfix" minSdk = 26 targetSdk = 35 - versionCode = 17500 - versionName = "v17.5" + versionCode = 17600 + versionName = "v17.6" multiDexEnabled = false externalNativeBuild { @@ -34,7 +34,8 @@ android { ) arguments( - "-DCMAKE_BUILD_TYPE=MinSizeRel", + "-DCMAKE_BUILD_TYPE=Release", + "-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON", "-DANDROID_STL=none", "-DANDROID_SUPPORT_FLEXIBLE_PAGE_SIZES=ON" ) @@ -75,7 +76,7 @@ android { externalNativeBuild { cmake { path = file("src/main/cpp/CMakeLists.txt") - version = "3.22.1" + version = "3.30.3" } } } diff --git a/app/src/main/cpp/CMakeLists.txt b/app/src/main/cpp/CMakeLists.txt index 22c7bbf..d0a86eb 100644 --- a/app/src/main/cpp/CMakeLists.txt +++ b/app/src/main/cpp/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.22.1) +cmake_minimum_required(VERSION 3.30.3) project("playintegrityfix") @@ -25,7 +25,7 @@ add_library(${CMAKE_PROJECT_NAME} SHARED ) target_include_directories(${CMAKE_PROJECT_NAME} PRIVATE - shadowhook/. + shadowhook shadowhook/arch/${ARCH} shadowhook/include shadowhook/common diff --git a/app/src/main/cpp/main.cpp b/app/src/main/cpp/main.cpp index 1a74d65..a0519c2 100644 --- a/app/src/main/cpp/main.cpp +++ b/app/src/main/cpp/main.cpp @@ -47,12 +47,14 @@ static std::string DEVICE_INITIAL_SDK_INT, 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 *o_cookie = nullptr; static void modify_callback(void *cookie, const char *name, const char *value, uint32_t serial) { - if (cookie == nullptr || name == nullptr || value == nullptr || o_callback == nullptr) - return; + if (!cookie || !name || !value || !o_callback || !o_cookie) return; + + if (cookie != o_cookie) return; std::string_view prop(name); @@ -68,26 +70,30 @@ static void modify_callback(void *cookie, const char *name, const char *value, u if (!BUILD_ID.empty()) { value = BUILD_ID.c_str(); } - } else { - if (DEBUG) LOGD("[%s]: '%s'", name, value); - return o_callback(cookie, name, value, serial); } - LOGD("[%s]: '%s'", name, value); + if (DEBUG) LOGD("[%s]: '%s'", name, value); return o_callback(cookie, name, value, serial); } -static void (*o_system_property_read_callback)(const prop_info *, T_Callback, void *) = nullptr; +static void (*o_system_property_read_callback)(prop_info *, T_Callback, void *) = nullptr; -static void -my_system_property_read_callback(const prop_info *pi, T_Callback callback, void *cookie) { - if (pi && callback && cookie) o_callback = callback; +static void my_system_property_read_callback(prop_info *pi, T_Callback callback, void *cookie) { + if (pi && callback && cookie) { + o_callback = callback; + o_cookie = cookie; + } return o_system_property_read_callback(pi, modify_callback, cookie); } static bool doHook() { - shadowhook_init(SHADOWHOOK_MODE_UNIQUE, false); + if (shadowhook_init(SHADOWHOOK_MODE_UNIQUE, true) != 0) { + LOGE("shadowhook failed to init!"); + return false; + } + + LOGD("loaded shadowhook version: %s", SHADOWHOOK_VERSION); void *ptr = shadowhook_hook_sym_name( "libc.so", diff --git a/changelog.md b/changelog.md index 2133e50..67b9708 100644 --- a/changelog.md +++ b/changelog.md @@ -15,7 +15,10 @@ If you are using TrickyStore and you have a valid keybox, but Strong isn't passing, maybe you should change the ROM. Stock ROMs gives the best results. -# v17.5 +# v17.6 -- Update fingerprint +- Remove keybox logic +- Update AGP, NDK & CMake +- Change build from MinSizeRel to Release (better performance) +- Enable LTO - Refactor code diff --git a/module/module.prop b/module/module.prop index 24ae3be..4a930c0 100644 --- a/module/module.prop +++ b/module/module.prop @@ -1,7 +1,7 @@ id=playintegrityfix name=Play Integrity Fix -version=v17.5 -versionCode=17500 +version=v17.6 +versionCode=17600 author=chiteroman description=Universal modular fix for Play Integrity (and SafetyNet) on devices running Android 8-15 updateJson=https://raw.githubusercontent.com/chiteroman/PlayIntegrityFix/main/update.json diff --git a/module/sepolicy.rule b/module/sepolicy.rule new file mode 100644 index 0000000..2e00a01 --- /dev/null +++ b/module/sepolicy.rule @@ -0,0 +1 @@ +allow gmscore_app gmscore_app process execmem diff --git a/update.json b/update.json index 71096cb..498d5e4 100644 --- a/update.json +++ b/update.json @@ -1,6 +1,6 @@ { - "version": "v17.5", - "versionCode": 17500, - "zipUrl": "https://github.com/chiteroman/PlayIntegrityFix/releases/download/v17.5/PlayIntegrityFix_v17.5.zip", + "version": "v17.6", + "versionCode": 17600, + "zipUrl": "https://github.com/chiteroman/PlayIntegrityFix/releases/download/v17.6/PlayIntegrityFix_v17.6.zip", "changelog": "https://raw.githubusercontent.com/chiteroman/PlayIntegrityFix/main/changelog.md" }