From 87af5e798534a037f16165895f327b6ee4201896 Mon Sep 17 00:00:00 2001 From: LoveSy Date: Sat, 19 Feb 2022 03:59:06 +0800 Subject: [PATCH] No more requires logging.hpp for exported headers --- library/jni/include/utils/hook_helper.hpp | 11 ++++++++--- library/jni/include/utils/jni_helper.hpp | 11 ++++++++--- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/library/jni/include/utils/hook_helper.hpp b/library/jni/include/utils/hook_helper.hpp index b3daa9b..8008f25 100644 --- a/library/jni/include/utils/hook_helper.hpp +++ b/library/jni/include/utils/hook_helper.hpp @@ -2,9 +2,7 @@ #include -#include "hook_helper.hpp" #include "jni_helper.hpp" -#include "logging.hpp" #define CONCATENATE(a, b) a##b @@ -181,7 +179,14 @@ inline static bool HookSym(const HookHandler &handler, T &arg) { template inline static bool HookSyms(const HookHandler &handle, T &first, Args &...rest) { if (!(HookSym(handle, first) || ... || HookSym(handle, rest))) { - LOGW("Hook Fails: %*s", static_cast(first.sym.size()), first.sym.data()); + __android_log_print(ANDROID_LOG_ERROR, +#ifdef LOG_TAG + LOG_TAG, +#else + "HookHelper", +#endif + "Hook Fails: %*s", static_cast(first.sym.size()), + first.sym.data()); return false; } return true; diff --git a/library/jni/include/utils/jni_helper.hpp b/library/jni/include/utils/jni_helper.hpp index 4ef9c47..c2502e2 100644 --- a/library/jni/include/utils/jni_helper.hpp +++ b/library/jni/include/utils/jni_helper.hpp @@ -6,8 +6,7 @@ #include #include - -#include "logging.hpp" +#include #define DISALLOW_COPY_AND_ASSIGN(TypeName) \ TypeName(const TypeName &) = delete; \ @@ -214,7 +213,13 @@ requires(std::is_function_v) ~finally() { if (auto exception = ClearException(env_)) { - LOGE("%s", JUTFString(env_, exception.get()).get()); + __android_log_print(ANDROID_LOG_ERROR, +#ifdef LOG_TAG + LOG_TAG, +#else + "JNIHelper", +#endif + "%s", JUTFString(env_, exception.get()).get()); } }