From 401090d6fe4a42ecb8c72e08fc81b1f5c8a7cbc1 Mon Sep 17 00:00:00 2001 From: LoveSy Date: Sun, 17 Dec 2023 00:07:52 +0800 Subject: [PATCH] Avoid zygiskd restarts when boot-complete --- native/src/core/zygisk/entry.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/native/src/core/zygisk/entry.cpp b/native/src/core/zygisk/entry.cpp index 86fdab8b6..b4dbead4a 100644 --- a/native/src/core/zygisk/entry.cpp +++ b/native/src/core/zygisk/entry.cpp @@ -229,9 +229,11 @@ void zygisk_handler(int client, const sock_cred *cred) { void reset_zygisk(bool restore) { if (!zygisk_enabled) return; static atomic_uint zygote_start_count{1}; - close(zygiskd_sockets[0]); - close(zygiskd_sockets[1]); - zygiskd_sockets[0] = zygiskd_sockets[1] = -1; + if (!restore) { + close(zygiskd_sockets[0]); + close(zygiskd_sockets[1]); + zygiskd_sockets[0] = zygiskd_sockets[1] = -1; + } if (restore) { zygote_start_count = 1; } else if (zygote_start_count.fetch_add(1) > 3) {