diff --git a/native/jni/Android.mk b/native/jni/Android.mk index 93d06b0aa..82b91610d 100644 --- a/native/jni/Android.mk +++ b/native/jni/Android.mk @@ -4,8 +4,8 @@ LOCAL_PATH := $(call my-dir) # Binaries ######################## -# Global toggle for the WIP zygote injection features -ENABLE_INJECT := 1 +# Global toggle for Zygisk +DISABLE_ZYGISK := 0 ifdef B_MAGISK @@ -38,15 +38,17 @@ LOCAL_SRC_FILES := \ LOCAL_LDLIBS := -llog LOCAL_CPPFLAGS := -DENABLE_INJECT=$(ENABLE_INJECT) -ifeq ($(ENABLE_INJECT),1) +ifeq ($(DISABLE_ZYGISK),1) +LOCAL_SRC_FILES += magiskhide/proc_monitor.cpp +LOCAL_CPPFLAGS := -DENABLE_INJECT=0 +else LOCAL_STATIC_LIBRARIES += libxhook LOCAL_SRC_FILES += \ - inject/entry.cpp \ - inject/utils.cpp \ - inject/hook.cpp \ - inject/memory.cpp -else -LOCAL_SRC_FILES += magiskhide/proc_monitor.cpp + zygisk/entry.cpp \ + zygisk/utils.cpp \ + zygisk/hook.cpp \ + zygisk/memory.cpp +LOCAL_CPPFLAGS := -DENABLE_INJECT=1 endif include $(BUILD_EXECUTABLE) diff --git a/native/jni/inject/api.hpp b/native/jni/zygisk/api.hpp similarity index 100% rename from native/jni/inject/api.hpp rename to native/jni/zygisk/api.hpp diff --git a/native/jni/inject/entry.cpp b/native/jni/zygisk/entry.cpp similarity index 100% rename from native/jni/inject/entry.cpp rename to native/jni/zygisk/entry.cpp diff --git a/native/jni/inject/gen_jni_hooks.py b/native/jni/zygisk/gen_jni_hooks.py similarity index 100% rename from native/jni/inject/gen_jni_hooks.py rename to native/jni/zygisk/gen_jni_hooks.py diff --git a/native/jni/inject/hook.cpp b/native/jni/zygisk/hook.cpp similarity index 100% rename from native/jni/inject/hook.cpp rename to native/jni/zygisk/hook.cpp diff --git a/native/jni/inject/inject.hpp b/native/jni/zygisk/inject.hpp similarity index 100% rename from native/jni/inject/inject.hpp rename to native/jni/zygisk/inject.hpp diff --git a/native/jni/inject/jni_hooks.hpp b/native/jni/zygisk/jni_hooks.hpp similarity index 100% rename from native/jni/inject/jni_hooks.hpp rename to native/jni/zygisk/jni_hooks.hpp diff --git a/native/jni/inject/memory.cpp b/native/jni/zygisk/memory.cpp similarity index 100% rename from native/jni/inject/memory.cpp rename to native/jni/zygisk/memory.cpp diff --git a/native/jni/inject/memory.hpp b/native/jni/zygisk/memory.hpp similarity index 100% rename from native/jni/inject/memory.hpp rename to native/jni/zygisk/memory.hpp diff --git a/native/jni/inject/ptrace.cpp b/native/jni/zygisk/ptrace.cpp similarity index 100% rename from native/jni/inject/ptrace.cpp rename to native/jni/zygisk/ptrace.cpp diff --git a/native/jni/inject/ptrace.hpp b/native/jni/zygisk/ptrace.hpp similarity index 100% rename from native/jni/inject/ptrace.hpp rename to native/jni/zygisk/ptrace.hpp diff --git a/native/jni/inject/utils.cpp b/native/jni/zygisk/utils.cpp similarity index 100% rename from native/jni/inject/utils.cpp rename to native/jni/zygisk/utils.cpp