Skip to content

Commit

Permalink
setAccessible
Browse files Browse the repository at this point in the history
  • Loading branch information
vvb2060 committed Jan 30, 2025
1 parent bfd45d7 commit 20b8976
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions library/src/main/java/org/lsposed/hiddenapibypass/LSPass.java
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ public static Object newInstance(@NonNull Class<?> clazz, Object... initargs) th
for (Constructor<?> constructor : constructors) {
Class<?>[] params = constructor.getParameterTypes();
if (!checkArgsForInvokeMethod(params, initargs)) continue;
constructor.setAccessible(true);
return constructor.newInstance(initargs);
}
throw new NoSuchMethodException("Cannot find matching constructor");
Expand All @@ -148,6 +149,7 @@ public static Object invoke(@NonNull Class<?> clazz, @Nullable Object thiz, @Non
if (!method.getName().equals(methodName)) continue;
Class<?>[] params = method.getParameterTypes();
if (!checkArgsForInvokeMethod(params, args)) continue;
method.setAccessible(true);
return method.invoke(thiz, args);
}
throw new NoSuchMethodException("Cannot find matching method");
Expand Down

0 comments on commit 20b8976

Please sign in to comment.