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 @Nullable
@Override @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); return getBaseContext().invokeOrigin(method, thisObject, args);
} }
@Nullable @Nullable
@Override @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); return getBaseContext().newInstanceOrigin(constructor, args);
} }

View File

@ -123,18 +123,6 @@ public interface XposedInterface {
*/ */
void throwAndSkip(@Nullable Throwable throwable); 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. * Invoke origin object.
* *
@ -529,7 +517,7 @@ public interface XposedInterface {
/** /**
* Invoke origin object. * Invoke origin object.
* *
* @param method the method * @param method the method
* @param thisObject the this object * @param thisObject the this object
* @param args the args * @param args the args
* @return the object * @return the object
@ -537,19 +525,22 @@ public interface XposedInterface {
* @throws IllegalAccessException the illegal access exception * @throws IllegalAccessException the illegal access exception
*/ */
@Nullable @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. * new origin object.
* *
* @param constructor the constructor * @param constructor the constructor
* @param args the args * @param args the args
* @return the object * @return the object
* @throws InvocationTargetException the invocation target exception * @throws InvocationTargetException the invocation target exception
* @throws IllegalAccessException the illegal access exception * @throws IllegalAccessException the illegal access exception
*/ */
@Nullable @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. * Log.