From e22e81d79244e90dcaf2c06264e8fe05c0a5d103 Mon Sep 17 00:00:00 2001 From: snake-4 <18491360+snake-4@users.noreply.github.com> Date: Tue, 16 Apr 2024 23:16:21 +0200 Subject: [PATCH] Updated AGP to 8.3.2... and misc changes. --- gradle/libs.versions.toml | 2 +- module/jni/main.cpp | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 15c4554..1d1cab1 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,5 +1,5 @@ [versions] -agp = "8.3.1" +agp = "8.3.2" [plugins] agp-lib = { id = "com.android.library", version.ref = "agp" } diff --git a/module/jni/main.cpp b/module/jni/main.cpp index bec5af0..64a93f6 100644 --- a/module/jni/main.cpp +++ b/module/jni/main.cpp @@ -94,6 +94,7 @@ public: ASSERT_EXIT("preAppSpecialize", hookPLTByName("libandroid_runtime.so", "unshare", new_unshare, &old_unshare), return); ASSERT_EXIT("preAppSpecialize", hookPLTByName("libandroid_runtime.so", "setresuid", new_setresuid, &old_setresuid), return); + int companionFd = -1; ASSERT_LOG("preAppSpecialize", (companionFd = api->connectCompanion()) != -1); callbackFunction = [fd = companionFd]() @@ -144,7 +145,6 @@ public: } private: - int companionFd = -1; Api *api; JNIEnv *env; }; @@ -155,10 +155,9 @@ void zygisk_companion_handler(int fd) { pid_t pid; ASSERT_EXIT("zygisk_companion_handler", read(fd, &pid, sizeof(pid)) == sizeof(pid), return false); - LOGD("zygisk_companion_handler received pid=%d", pid); - ASSERT_EXIT("zygisk_companion_handler", unshare(CLONE_NEWNS) != -1, return false); ASSERT_EXIT("zygisk_companion_handler", switchMountNS(pid), return false); + LOGD("zygisk_companion_handler processing namespace of pid=%d", pid); doUnmount(); doRemount();