diff --git a/api/src/main/java/io/github/libxposed/api/XposedContextWrapper.java b/api/src/main/java/io/github/libxposed/api/XposedContextWrapper.java index 5b7f9a5..4a015b3 100644 --- a/api/src/main/java/io/github/libxposed/api/XposedContextWrapper.java +++ b/api/src/main/java/io/github/libxposed/api/XposedContextWrapper.java @@ -216,13 +216,19 @@ public class XposedContextWrapper extends ContextWrapper implements XposedInterf @Nullable @Override - public Object invokeOrigin(@NonNull Method method, @Nullable Object thisObject, Object[] args) throws InvocationTargetException, IllegalAccessException { + public Object invokeOrigin(@NonNull Method method, @Nullable Object thisObject, Object... args) throws InvocationTargetException, IllegalArgumentException, IllegalAccessException { return getBaseContext().invokeOrigin(method, thisObject, args); } @Nullable @Override - public T newInstanceOrigin(@NonNull Constructor constructor, Object[] args) throws InvocationTargetException, IllegalAccessException, InstantiationException { + public Object invokeSpecial(@NonNull Method method, @NonNull Object thisObject, Object... args) throws InvocationTargetException, IllegalArgumentException, IllegalAccessException { + return getBaseContext().invokeSpecial(method, thisObject, args); + } + + @Nullable + @Override + public T newInstanceOrigin(@NonNull Constructor constructor, Object... args) throws InvocationTargetException, IllegalArgumentException, IllegalAccessException, InstantiationException { return getBaseContext().newInstanceOrigin(constructor, args); } diff --git a/api/src/main/java/io/github/libxposed/api/XposedInterface.java b/api/src/main/java/io/github/libxposed/api/XposedInterface.java index 69b833d..fbb935e 100644 --- a/api/src/main/java/io/github/libxposed/api/XposedInterface.java +++ b/api/src/main/java/io/github/libxposed/api/XposedInterface.java @@ -123,18 +123,6 @@ public interface XposedInterface { */ void throwAndSkip(@Nullable Throwable throwable); - /** - * Invoke origin object. - * - * @param thisObject the this object - * @param args the args - * @return the object - * @throws InvocationTargetException the invocation target exception - * @throws IllegalAccessException the illegal access exception - */ - @Nullable - Object invokeOrigin(@Nullable Object thisObject, Object[] args) throws InvocationTargetException, IllegalAccessException; - /** * Invoke origin object. * @@ -529,7 +517,7 @@ public interface XposedInterface { /** * Invoke origin object. * - * @param method the method + * @param method the method * @param thisObject the this object * @param args the args * @return the object @@ -537,19 +525,22 @@ public interface XposedInterface { * @throws IllegalAccessException the illegal access exception */ @Nullable - Object invokeOrigin(@NonNull Method method, @Nullable Object thisObject, Object[] args) throws InvocationTargetException, IllegalAccessException; + Object invokeOrigin(@NonNull Method method, @Nullable Object thisObject, Object... args) throws InvocationTargetException, IllegalArgumentException, IllegalAccessException; + + @Nullable + Object invokeSpecial(@NonNull Method method, @NonNull Object thisObject, Object... args) throws InvocationTargetException, IllegalArgumentException, IllegalAccessException; /** * new origin object. * * @param constructor the constructor - * @param args the args + * @param args the args * @return the object * @throws InvocationTargetException the invocation target exception * @throws IllegalAccessException the illegal access exception */ @Nullable - T newInstanceOrigin(@NonNull Constructor constructor, Object[] args) throws InvocationTargetException, IllegalAccessException, InstantiationException; + T newInstanceOrigin(@NonNull Constructor constructor, Object... args) throws InvocationTargetException, IllegalArgumentException, IllegalAccessException, InstantiationException; /** * Log.