mirror of
https://github.com/chiteroman/PlayIntegrityFix.git
synced 2025-01-18 11:02:40 +02:00
fix bad code
This commit is contained in:
parent
eea2f6bd3f
commit
9b4249424b
@ -25,8 +25,8 @@ android {
|
|||||||
applicationId = "es.chiteroman.playintegrityfix"
|
applicationId = "es.chiteroman.playintegrityfix"
|
||||||
minSdk = 26
|
minSdk = 26
|
||||||
targetSdk = 35
|
targetSdk = 35
|
||||||
versionCode = 18201
|
versionCode = 18300
|
||||||
versionName = "v18.2.1-EXPERIMENTAL"
|
versionName = "v18.3"
|
||||||
multiDexEnabled = false
|
multiDexEnabled = false
|
||||||
|
|
||||||
externalNativeBuild {
|
externalNativeBuild {
|
||||||
@ -37,8 +37,19 @@ android {
|
|||||||
)
|
)
|
||||||
|
|
||||||
arguments(
|
arguments(
|
||||||
"-DCMAKE_BUILD_TYPE=MinSizeRel",
|
"-DCMAKE_BUILD_TYPE=Release",
|
||||||
"-DANDROID_STL=none"
|
"-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(
|
cFlags(
|
||||||
|
@ -241,7 +241,7 @@ void injectDex() {
|
|||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
[[gnu::visibility("default"), maybe_unused]]
|
[[gnu::visibility("default"), maybe_unused]]
|
||||||
void init(const char *dir, JavaVM *jvm) {
|
void init(const char *dir, JavaVM *jvm, jint jni_version) {
|
||||||
|
|
||||||
if (dir) {
|
if (dir) {
|
||||||
LOGD("[INJECT] GMS dir: %s", dir);
|
LOGD("[INJECT] GMS dir: %s", dir);
|
||||||
@ -251,18 +251,18 @@ void init(const char *dir, JavaVM *jvm) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (jvm) {
|
if (jvm) {
|
||||||
auto result = jvm->GetEnv(reinterpret_cast<void **>(&env), JNI_VERSION_1_6);
|
auto result = jvm->GetEnv(reinterpret_cast<void **>(&env), jni_version);
|
||||||
LOGD("[INJECT] JVM: %d", result);
|
if (result != JNI_OK) {
|
||||||
if (result == JNI_EDETACHED) {
|
LOGE("[INJECT] GetEnv error: %d", result);
|
||||||
result = jvm->AttachCurrentThread(&env, nullptr);
|
return;
|
||||||
LOGD("[INJECT] (JNI_EDETACHED) JVM: %d", result);
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
LOGE("[INJECT] jvm is null!");
|
LOGE("[INJECT] jvm is null!");
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (env) {
|
if (env) {
|
||||||
LOGD("[INJECT] JNIEnv: %d", env->GetVersion());
|
LOGD("[INJECT] JNIEnv version: %x", env->GetVersion());
|
||||||
} else {
|
} else {
|
||||||
LOGE("[INJECT] env is null!");
|
LOGE("[INJECT] env is null!");
|
||||||
return;
|
return;
|
||||||
|
@ -263,7 +263,7 @@ public:
|
|||||||
|
|
||||||
dlerror();
|
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"));
|
auto init_func = reinterpret_cast<init_t>(dlsym(handle, "init"));
|
||||||
const char *error = dlerror();
|
const char *error = dlerror();
|
||||||
@ -281,7 +281,7 @@ public:
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
init_func(gmsDir.c_str(), jvm);
|
init_func(gmsDir.c_str(), jvm, env->GetVersion());
|
||||||
}
|
}
|
||||||
|
|
||||||
void preServerSpecialize(ServerSpecializeArgs *args) override {
|
void preServerSpecialize(ServerSpecializeArgs *args) override {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
id=playintegrityfix
|
id=playintegrityfix
|
||||||
name=Play Integrity Fix
|
name=Play Integrity Fix
|
||||||
version=v18.2.1-EXPERIMENTAL
|
version=v18.3
|
||||||
versionCode=18201
|
versionCode=18300
|
||||||
author=chiteroman
|
author=chiteroman
|
||||||
description=Universal modular fix for Play Integrity (and SafetyNet) on devices running Android 8-15
|
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
|
updateJson=https://raw.githubusercontent.com/chiteroman/PlayIntegrityFix/main/update.json
|
||||||
|
Loading…
Reference in New Issue
Block a user