fix bad code

This commit is contained in:
chiteroman 2025-01-15 21:11:31 +01:00
parent eea2f6bd3f
commit 9b4249424b
No known key found for this signature in database
4 changed files with 26 additions and 15 deletions

View File

@ -25,8 +25,8 @@ android {
applicationId = "es.chiteroman.playintegrityfix"
minSdk = 26
targetSdk = 35
versionCode = 18201
versionName = "v18.2.1-EXPERIMENTAL"
versionCode = 18300
versionName = "v18.3"
multiDexEnabled = false
externalNativeBuild {
@ -37,8 +37,19 @@ android {
)
arguments(
"-DCMAKE_BUILD_TYPE=MinSizeRel",
"-DANDROID_STL=none"
"-DCMAKE_BUILD_TYPE=Release",
"-DANDROID_STL=none",
"-DANDROID_SUPPORT_FLEXIBLE_PAGE_SIZES=ON",
"-DANDROID_ALLOW_UNDEFINED_SYMBOLS=ON",
"-DCMAKE_CXX_STANDARD=23",
"-DCMAKE_C_STANDARD=23",
"-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON",
"-DCMAKE_VISIBILITY_INLINES_HIDDEN=ON",
"-DCMAKE_CXX_VISIBILITY_PRESET=hidden",
"-DCMAKE_C_VISIBILITY_PRESET=hidden",
"-DCMAKE_ANDROID_EXCEPTIONS=OFF",
"-DCMAKE_ANDROID_RTTI=OFF",
"-DANDROID_CPP_FEATURES='no-rtti no-exceptions'"
)
cFlags(

View File

@ -241,7 +241,7 @@ void injectDex() {
extern "C" {
[[gnu::visibility("default"), maybe_unused]]
void init(const char *dir, JavaVM *jvm) {
void init(const char *dir, JavaVM *jvm, jint jni_version) {
if (dir) {
LOGD("[INJECT] GMS dir: %s", dir);
@ -251,18 +251,18 @@ void init(const char *dir, JavaVM *jvm) {
}
if (jvm) {
auto result = jvm->GetEnv(reinterpret_cast<void **>(&env), JNI_VERSION_1_6);
LOGD("[INJECT] JVM: %d", result);
if (result == JNI_EDETACHED) {
result = jvm->AttachCurrentThread(&env, nullptr);
LOGD("[INJECT] (JNI_EDETACHED) JVM: %d", result);
auto result = jvm->GetEnv(reinterpret_cast<void **>(&env), jni_version);
if (result != JNI_OK) {
LOGE("[INJECT] GetEnv error: %d", result);
return;
}
} else {
LOGE("[INJECT] jvm is null!");
return;
}
if (env) {
LOGD("[INJECT] JNIEnv: %d", env->GetVersion());
LOGD("[INJECT] JNIEnv version: %x", env->GetVersion());
} else {
LOGE("[INJECT] env is null!");
return;

View File

@ -263,7 +263,7 @@ public:
dlerror();
typedef void (*init_t)(const char *, JavaVM *);
typedef void (*init_t)(const char *, JavaVM *, jint);
auto init_func = reinterpret_cast<init_t>(dlsym(handle, "init"));
const char *error = dlerror();
@ -281,7 +281,7 @@ public:
return;
}
init_func(gmsDir.c_str(), jvm);
init_func(gmsDir.c_str(), jvm, env->GetVersion());
}
void preServerSpecialize(ServerSpecializeArgs *args) override {

View File

@ -1,7 +1,7 @@
id=playintegrityfix
name=Play Integrity Fix
version=v18.2.1-EXPERIMENTAL
versionCode=18201
version=v18.3
versionCode=18300
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