From ffd8d77d6f92e230ca449f1f1e9065d3223d3bc0 Mon Sep 17 00:00:00 2001 From: simonpunk Date: Thu, 21 Aug 2025 21:34:21 +0800 Subject: [PATCH] Update fixes for detection - Details for detection and fix: https://github.com/JingMatrix/NeoZygisk/commit/76d54228c7e6fe14cca93338865008946b94f7e - Ensure no memory leaks related to local references - With the __cxa_atexit fix, Dobby should not be detected by user apps anymore --- app/src/main/cpp/main.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/app/src/main/cpp/main.cpp b/app/src/main/cpp/main.cpp index 98e6c94..e6f8435 100644 --- a/app/src/main/cpp/main.cpp +++ b/app/src/main/cpp/main.cpp @@ -310,7 +310,15 @@ private: LOGD("JNI %s: Calling EntryPoint.init", niceName); auto entryInit = env->GetStaticMethodID(entryClass, "init", "(IIII)V"); env->CallStaticVoidMethod(entryClass, entryInit, verboseLogs, spoofBuild, spoofProvider, spoofSignature); + env->DeleteLocalRef(javaStr); } + env->DeleteLocalRef(clClass); + env->DeleteLocalRef(dexClClass); + env->DeleteLocalRef(systemClassLoader); + env->DeleteLocalRef(dexCl); + env->DeleteLocalRef(buffer); + env->DeleteLocalRef(entryClassName); + env->DeleteLocalRef(entryClassObj); } }; @@ -356,6 +364,14 @@ static void companion(int fd) { jsonVector.clear(); } +/* + * - The fix is public now: https://github.com/JingMatrix/NeoZygisk/commit/76d54228c7e6fe14cca93338865008946b94f7ee + * - Remeber to add this for all other zygisk c++ library + */ +extern "C" int __cxa_atexit(void (*func)(void*), void* arg, void* dso) { + return 0; +} + REGISTER_ZYGISK_MODULE(PlayIntegrityFix) REGISTER_ZYGISK_COMPANION(companion)