From f443cbaa2baf2e334a844fd5ef5d76baf12fdf56 Mon Sep 17 00:00:00 2001 From: vvb2060 Date: Wed, 24 Nov 2021 16:51:18 +0800 Subject: [PATCH] Revert "Always run non disabled module post-fs-data scripts" This reverts commit 4dfb193d10f24fbc96a88c1d13821f471621ba81. --- native/jni/core/module.cpp | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/native/jni/core/module.cpp b/native/jni/core/module.cpp index 0a47cb5ce..10e8c6e79 100644 --- a/native/jni/core/module.cpp +++ b/native/jni/core/module.cpp @@ -695,13 +695,13 @@ static void collect_modules(bool open_zygisk) { return; module_info info; - if (open_zygisk) { - if (zygisk_enabled) { - // Riru and its modules are not compatible with zygisk - if (entry->d_name == "riru-core"sv || faccessat(modfd, "riru", F_OK, 0) == 0) { - LOGI("%s: ignore\n", entry->d_name); - return; - } + if (zygisk_enabled) { + // Riru and its modules are not compatible with zygisk + if (entry->d_name == "riru-core"sv || faccessat(modfd, "riru", F_OK, 0) == 0) { + LOGI("%s: ignore\n", entry->d_name); + return; + } + if (open_zygisk) { #if defined(__arm__) info.z32 = openat(modfd, "zygisk/armeabi-v7a.so", O_RDONLY | O_CLOEXEC); #elif defined(__aarch64__) @@ -715,18 +715,18 @@ static void collect_modules(bool open_zygisk) { #else #error Unsupported ABI #endif - } else { - // Ignore zygisk modules when zygisk is not enabled - if (faccessat(modfd, "zygisk", F_OK, 0) == 0) { - LOGI("%s: ignore\n", entry->d_name); - return; - } + } + } else { + // Ignore zygisk modules when zygisk is not enabled + if (faccessat(modfd, "zygisk", F_OK, 0) == 0) { + LOGI("%s: ignore\n", entry->d_name); + return; } } info.name = entry->d_name; module_list->push_back(info); }); - if (open_zygisk && zygisk_enabled) { + if (zygisk_enabled) { bool use_memfd = true; auto convert_to_memfd = [&](int fd) -> int { if (fd < 0)