From 81268b568f7d5f3eb7b169d7d9704f3054ad60b6 Mon Sep 17 00:00:00 2001 From: JingMatrix Date: Sun, 7 Sep 2025 09:44:44 +0200 Subject: [PATCH] Figure out why atexit interposition is needed In my pull-request https://github.com/JingMatrix/NeoZygisk/pull/44, I believed that interposing atexit in NeoZygisk is sufficient to remove this detection points in any Zygisk modules. Loading and unloading Zygisk modules are done via dlopen and dlclose, which should correctly reset the AtexitArray g_array. It is interesting to figure out why. --- app/src/main/cpp/main.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/src/main/cpp/main.cpp b/app/src/main/cpp/main.cpp index d440ebd..e476d2e 100644 --- a/app/src/main/cpp/main.cpp +++ b/app/src/main/cpp/main.cpp @@ -509,3 +509,7 @@ static void companion(int fd) { REGISTER_ZYGISK_MODULE(PlayIntegrityFix) REGISTER_ZYGISK_COMPANION(companion) + +extern "C" int __cxa_atexit(void (*func)(void*), void* arg, void* dso) { + return 0; +}