Add invokeSpecial

Fix #2
This commit is contained in:
LoveSy 2023-01-24 19:55:31 +08:00
parent 50619e84ec
commit 9dbc7cb801
No known key found for this signature in database
2 changed files with 15 additions and 18 deletions

View File

@ -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> T newInstanceOrigin(@NonNull Constructor<T> 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> T newInstanceOrigin(@NonNull Constructor<T> constructor, Object... args) throws InvocationTargetException, IllegalArgumentException, IllegalAccessException, InstantiationException {
return getBaseContext().newInstanceOrigin(constructor, args);
}

View File

@ -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.
*
@ -537,7 +525,10 @@ 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.
@ -549,7 +540,7 @@ public interface XposedInterface {
* @throws IllegalAccessException the illegal access exception
*/
@Nullable
<T> T newInstanceOrigin(@NonNull Constructor<T> constructor, Object[] args) throws InvocationTargetException, IllegalAccessException, InstantiationException;
<T> T newInstanceOrigin(@NonNull Constructor<T> constructor, Object... args) throws InvocationTargetException, IllegalArgumentException, IllegalAccessException, InstantiationException;
/**
* Log.