Skip to content

Commit f02d0b8

Browse files
aviraxpengstk
authored andcommitted
Strip JNI debug logs on release build (tiann#2732)
Add conditional logging to jni.cc for debug builds.
1 parent 2a1741d commit f02d0b8

File tree

1 file changed

+5
-1
lines changed
  • manager/app/src/main/cpp

1 file changed

+5
-1
lines changed

manager/app/src/main/cpp/jni.cc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@
88
#include "ksu.h"
99

1010
#define LOG_TAG "KernelSU"
11+
#ifdef NDEBUG
12+
#define LOGD(...) (void)0
13+
#else
1114
#define LOGD(...) __android_log_print(ANDROID_LOG_DEBUG, LOG_TAG, __VA_ARGS__)
15+
#endif
1216

1317
extern "C"
1418
JNIEXPORT jboolean JNICALL
@@ -305,4 +309,4 @@ extern "C"
305309
JNIEXPORT jboolean JNICALL
306310
Java_me_weishu_kernelsu_Natives_setSuEnabled(JNIEnv *env, jobject thiz, jboolean enabled) {
307311
return set_su_enabled(enabled);
308-
}
312+
}

0 commit comments

Comments
 (0)