diff --git a/native/jni/daemon/daemon.c b/native/jni/daemon/daemon.c index 397ec1154..2f7495f81 100644 --- a/native/jni/daemon/daemon.c +++ b/native/jni/daemon/daemon.c @@ -18,7 +18,6 @@ #include "utils.h" #include "daemon.h" #include "selinux.h" -#include "flags.h" int setup_done = 0; int seperate_vendor = 0; @@ -103,9 +102,6 @@ static void *request_handler(void *args) { static void main_daemon() { android_logging(); -#ifndef MAGISK_DEBUG - log_cb.d = nop_log; -#endif setsid(); setcon("u:r:"SEPOL_PROC_DOMAIN":s0"); int fd = xopen("/dev/null", O_RDWR | O_CLOEXEC); diff --git a/native/jni/magiskboot/main.cpp b/native/jni/magiskboot/main.cpp index ea755693a..6e114ee49 100644 --- a/native/jni/magiskboot/main.cpp +++ b/native/jni/magiskboot/main.cpp @@ -9,6 +9,7 @@ #include "magiskboot.h" #include "logging.h" #include "utils.h" +#include "flags.h" /******************** Patch Boot Image diff --git a/native/jni/magiskhide/magiskhide.c b/native/jni/magiskhide/magiskhide.c index 3a646e688..a7629863a 100644 --- a/native/jni/magiskhide/magiskhide.c +++ b/native/jni/magiskhide/magiskhide.c @@ -15,6 +15,7 @@ #include "magiskhide.h" #include "daemon.h" #include "resetprop.h" +#include "flags.h" struct vector *hide_list = NULL; diff --git a/native/jni/magiskpolicy/magiskpolicy.c b/native/jni/magiskpolicy/magiskpolicy.c index 0d489d47b..201339d8a 100644 --- a/native/jni/magiskpolicy/magiskpolicy.c +++ b/native/jni/magiskpolicy/magiskpolicy.c @@ -10,6 +10,7 @@ #include "vector.h" #include "magiskpolicy.h" #include "magisk.h" +#include "flags.h" static int syntax_err = 0; static char err_msg[ARG_MAX]; diff --git a/native/jni/resetprop/resetprop.c b/native/jni/resetprop/resetprop.c index 02a7bc634..814128704 100644 --- a/native/jni/resetprop/resetprop.c +++ b/native/jni/resetprop/resetprop.c @@ -22,6 +22,7 @@ #include "_resetprop.h" #include "vector.h" #include "utils.h" +#include "flags.h" int prop_verbose = 0; diff --git a/native/jni/utils/logging.c b/native/jni/utils/logging.c index 682fb7905..93bac9fec 100644 --- a/native/jni/utils/logging.c +++ b/native/jni/utils/logging.c @@ -3,6 +3,7 @@ #include #include "logging.h" +#include "flags.h" int nop_log(const char *fmt, va_list ap) { return 0; @@ -45,7 +46,11 @@ static int log_e(const char *fmt, va_list ap) { } void android_logging() { +#ifdef MAGISK_DEBUG log_cb.d = log_d; +#else + log_cb.d = nop_log; +#endif log_cb.i = log_i; log_cb.w = log_w; log_cb.e = log_e;