This commit is contained in:
LoveSy 2022-07-04 15:12:55 +08:00 committed by GitHub
parent 666e8780c7
commit f29c797200
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View File

@ -79,7 +79,7 @@ public final class XposedBridge {
public static volatile ClassLoader dummyClassLoader = null;
private static final ClassCastException castException = new ClassCastException("Return value's type from hook callback does not match the hooked method");
private static final String castException = "Return value's type from hook callback does not match the hooked method";
private static final Method getCause;
@ -499,7 +499,7 @@ public final class XposedBridge {
else {
var result = param.getResult();
if (returnType != null && !returnType.isPrimitive() && !HookBridge.instanceOf(result, returnType)) {
throw castException;
throw new ClassCastException(castException);
}
return result;
}

View File

@ -73,6 +73,8 @@ LSP_DEF_NATIVE_METHOD(jboolean, HookBridge, hookMethod, jobject hookMethod,
ptr = std::make_unique<HookItem>();
hook_item = ptr.get();
newHook = true;
} else {
hook_item = ptr.get();
}
}
if (newHook) {