Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions library/src/main/java/org/lsposed/hiddenapibypass/LSPass.java
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,9 @@ public static Object newInstance(@NonNull Class<?> clazz, Object... initargs) th
* @see Method#invoke(Object, Object...)
*/
public static Object invoke(@NonNull Class<?> clazz, @Nullable Object thiz, @NonNull String methodName, Object... args) throws NoSuchMethodException, InvocationTargetException, IllegalAccessException {
if (thiz != null && !clazz.isInstance(thiz)) {
throw new IllegalArgumentException("this object is not an instance of the given class");
}
var methods = getDeclaredMethods(clazz);
for (var method : methods) {
if (!method.getName().equals(methodName)) continue;
Expand Down
Loading