Package io.github.libxposed.api
Interface XposedInterface.Invoker<T extends XposedInterface.Invoker<T,U>,U extends Executable>
- All Known Subinterfaces:
XposedInterface.CtorInvoker<T>
- Enclosing interface:
XposedInterface
public static interface XposedInterface.Invoker<T extends XposedInterface.Invoker<T,U>,U extends Executable>
Invoker for a method or constructor. Invocations through invokers will bypass access checks.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceType of the invoker, which determines the hook chain to be invoked -
Method Summary
Modifier and TypeMethodDescriptionInvokes the method (or the constructor as a method) through the hook chain determined by the invoker's type.invokeSpecial(Object thisObject, Object... args) Invokes the special (non-virtual) method (or the constructor as a method) on a given object instance, similar to the functionality ofCallNonVirtual<type>Methodin JNI, which invokes an instance (nonstatic) method on a Java object.Sets the type of the invoker, which determines the hook chain to be invoked
-
Method Details
-
setType
Sets the type of the invoker, which determines the hook chain to be invoked -
invoke
Object invoke(Object thisObject, Object... args) throws InvocationTargetException, IllegalArgumentException, IllegalAccessException Invokes the method (or the constructor as a method) through the hook chain determined by the invoker's type.- Parameters:
thisObject- For non-static calls, thethispointer, otherwisenullargs- The arguments used for the method call- Returns:
- The result returned from the invoked method
For void methods and constructors, always returns
null. - Throws:
InvocationTargetExceptionIllegalArgumentExceptionIllegalAccessException- See Also:
-
invokeSpecial
Object invokeSpecial(@NonNull Object thisObject, Object... args) throws InvocationTargetException, IllegalArgumentException, IllegalAccessException Invokes the special (non-virtual) method (or the constructor as a method) on a given object instance, similar to the functionality ofCallNonVirtual<type>Methodin JNI, which invokes an instance (nonstatic) method on a Java object. This method is useful when you need to call a specific method on an object, bypassing any overridden methods in subclasses and directly invoking the method defined in the specified class.This method is useful when you need to call
super.xxx()in a hooked constructor.- Parameters:
thisObject- Thethispointerargs- The arguments used for the method call- Returns:
- The result returned from the invoked method
For void methods and constructors, always returns
null. - Throws:
InvocationTargetExceptionIllegalArgumentExceptionIllegalAccessException- See Also:
-