From fef44bd24f817e4d605249dca9c979014395f80d Mon Sep 17 00:00:00 2001 From: topjohnwu Date: Sat, 20 Nov 2021 13:05:15 -0800 Subject: [PATCH] Allow boot scripts to know Zygisk status --- native/jni/core/scripting.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/native/jni/core/scripting.cpp b/native/jni/core/scripting.cpp index 388f80849..b9c735193 100644 --- a/native/jni/core/scripting.cpp +++ b/native/jni/core/scripting.cpp @@ -5,6 +5,7 @@ #include #include #include +#include #include "core.hpp" @@ -24,6 +25,8 @@ static void set_script_env() { char new_path[4096]; sprintf(new_path, "%s:%s", getenv("PATH"), MAGISKTMP.data()); setenv("PATH", new_path, 1); + if (zygisk_enabled) + setenv("ZYGISK_ENABLED", "1", 1); }; void exec_script(const char *script) {