Skip to content

Commit 7523a50

Browse files
authored
remove instance check
1 parent 9a11ea7 commit 7523a50

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

library/src/main/java/org/lsposed/hiddenapibypass/HiddenApiBypass.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,9 +161,6 @@ public static Object newInstance(@NonNull Class<?> clazz, Object... initargs) th
161161
* @see Method#invoke(Object, Object...)
162162
*/
163163
public static Object invoke(@NonNull Class<?> clazz, @Nullable Object thiz, @NonNull String methodName, Object... args) throws NoSuchMethodException, InvocationTargetException, IllegalAccessException {
164-
if (thiz != null && !clazz.isInstance(thiz)) {
165-
throw new IllegalArgumentException("this object is not an instance of the given class");
166-
}
167164
Method stub = Helper.InvokeStub.class.getDeclaredMethod("invoke", Object[].class);
168165
stub.setAccessible(true);
169166
long methods = unsafe.getLong(clazz, methodsOffset);

0 commit comments

Comments
 (0)