mirror of
https://github.com/LSPosed/LSPlant.git
synced 2025-05-05 14:06:37 +08:00
No more requires logging.hpp for exported headers
This commit is contained in:
parent
5bab7a0e38
commit
87af5e7985
@ -2,9 +2,7 @@
|
|||||||
|
|
||||||
#include <concepts>
|
#include <concepts>
|
||||||
|
|
||||||
#include "hook_helper.hpp"
|
|
||||||
#include "jni_helper.hpp"
|
#include "jni_helper.hpp"
|
||||||
#include "logging.hpp"
|
|
||||||
|
|
||||||
#define CONCATENATE(a, b) a##b
|
#define CONCATENATE(a, b) a##b
|
||||||
|
|
||||||
@ -181,7 +179,14 @@ inline static bool HookSym(const HookHandler &handler, T &arg) {
|
|||||||
template <HookerType T, HookerType... Args>
|
template <HookerType T, HookerType... Args>
|
||||||
inline static bool HookSyms(const HookHandler &handle, T &first, Args &...rest) {
|
inline static bool HookSyms(const HookHandler &handle, T &first, Args &...rest) {
|
||||||
if (!(HookSym(handle, first) || ... || HookSym(handle, rest))) {
|
if (!(HookSym(handle, first) || ... || HookSym(handle, rest))) {
|
||||||
LOGW("Hook Fails: %*s", static_cast<int>(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<int>(first.sym.size()),
|
||||||
|
first.sym.data());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
@ -6,8 +6,7 @@
|
|||||||
#include <jni.h>
|
#include <jni.h>
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
#include <string_view>
|
||||||
#include "logging.hpp"
|
|
||||||
|
|
||||||
#define DISALLOW_COPY_AND_ASSIGN(TypeName) \
|
#define DISALLOW_COPY_AND_ASSIGN(TypeName) \
|
||||||
TypeName(const TypeName &) = delete; \
|
TypeName(const TypeName &) = delete; \
|
||||||
@ -214,7 +213,13 @@ requires(std::is_function_v<Func>)
|
|||||||
|
|
||||||
~finally() {
|
~finally() {
|
||||||
if (auto exception = ClearException(env_)) {
|
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());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user