mirror of
https://github.com/LSPosed/LSPlant.git
synced 2025-05-05 14:06:37 +08:00
Fix some bugs
This commit is contained in:
parent
bc20e3cf11
commit
88bef4d96c
@ -33,7 +33,7 @@ public:
|
|||||||
if (!RETRIEVE_MEM_FUNC_SYMBOL(SetJavaDebuggable, "_ZN3art7Runtime17SetJavaDebuggableEb")) {
|
if (!RETRIEVE_MEM_FUNC_SYMBOL(SetJavaDebuggable, "_ZN3art7Runtime17SetJavaDebuggableEb")) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -111,7 +111,7 @@ public:
|
|||||||
jmethodID get_declared_constructors = JNI_GetMethodID(env, clazz, "getDeclaredConstructors",
|
jmethodID get_declared_constructors = JNI_GetMethodID(env, clazz, "getDeclaredConstructors",
|
||||||
"()[Ljava/lang/reflect/Constructor;");
|
"()[Ljava/lang/reflect/Constructor;");
|
||||||
auto constructors = JNI_Cast<jobjectArray>(
|
auto constructors = JNI_Cast<jobjectArray>(
|
||||||
JNI_CallObjectMethod(env, clazz, get_declared_constructors));
|
JNI_CallObjectMethod(env, throwable, get_declared_constructors));
|
||||||
auto length = JNI_GetArrayLength(env, constructors);
|
auto length = JNI_GetArrayLength(env, constructors);
|
||||||
if (length < 2) {
|
if (length < 2) {
|
||||||
LOGE("Throwable has less than 2 constructors");
|
LOGE("Throwable has less than 2 constructors");
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
#pragma clang diagnostic push
|
#pragma clang diagnostic push
|
||||||
#pragma clang diagnostic ignored "-Wunknown-pragmas"
|
#pragma clang diagnostic ignored "-Wunknown-pragmas"
|
||||||
#pragma ide diagnostic ignored "ConstantConditionsOC"
|
#pragma ide diagnostic ignored "ConstantConditionsOC"
|
||||||
|
#pragma ide diagnostic ignored "Simplify"
|
||||||
#pragma ide diagnostic ignored "UnreachableCode"
|
#pragma ide diagnostic ignored "UnreachableCode"
|
||||||
namespace lsplant {
|
namespace lsplant {
|
||||||
|
|
||||||
@ -139,8 +140,9 @@ inline void UpdateTrampoline(decltype(entry_point_offset) offset) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool InitNative(JNIEnv *env, const HookHandler &handler) {
|
bool InitNative(JNIEnv *env, const HookHandler &handler) {
|
||||||
if (!handler.inline_hooker || !handler.inline_unhooker || !handler.art_symbol_resolver)
|
if (!handler.inline_hooker || !handler.inline_unhooker || !handler.art_symbol_resolver) {
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
if (!Runtime::Init(handler)) {
|
if (!Runtime::Init(handler)) {
|
||||||
LOGE("Failed to init runtime");
|
LOGE("Failed to init runtime");
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user