Interface XposedInterface.Chain

Enclosing interface:
XposedInterface

public static interface XposedInterface.Chain
Interceptor chain for a method or constructor. Chain objects cannot be shared among threads or reused after XposedInterface.Hooker.intercept(Chain) ends.
  • Method Summary

    Modifier and Type
    Method
    Description
    getArg(int index)
    Gets the argument at the given index.
    Gets the arguments.
    Gets the method / constructor being hooked.
    Gets the this pointer for the call, or null for static methods.
    Proceeds to the next interceptor in the chain with the same arguments and this pointer.
    proceed(Object[] args)
    Proceeds to the next interceptor in the chain with the given arguments and the same this pointer.
    proceedWith(Object thisObject)
    Proceeds to the next interceptor in the chain with the same arguments and given this pointer.
    proceedWith(Object thisObject, Object[] args)
    Proceeds to the next interceptor in the chain with the given arguments and this pointer.
  • Method Details

    • getExecutable

      @NonNull Executable getExecutable()
      Gets the method / constructor being hooked.
    • getThisObject

      Object getThisObject()
      Gets the this pointer for the call, or null for static methods.
    • getArgs

      @NonNull List<Object> getArgs()
      Gets the arguments. The returned list is immutable. If you want to change the arguments, you should call proceed(Object...) or proceedWith(Object, Object...) with the new arguments.
    • getArg

      Gets the argument at the given index.
      Parameters:
      index - The argument index
      Returns:
      The argument at the given index
      Throws:
      IndexOutOfBoundsException - if index is out of bounds
      ClassCastException - if the argument cannot be cast to the expected type
    • proceed

      Object proceed() throws Throwable
      Proceeds to the next interceptor in the chain with the same arguments and this pointer.
      Returns:
      The result returned from next interceptor or the original executable if current interceptor is the last one in the chain.

      For void methods and constructors, always returns null.

      Throws:
      Throwable - if any interceptor or the original executable throws an exception
    • proceed

      Object proceed(@NonNull Object[] args) throws Throwable
      Proceeds to the next interceptor in the chain with the given arguments and the same this pointer.
      Parameters:
      args - The arguments used for the call
      Returns:
      The result returned from next interceptor or the original executable if current interceptor is the last one in the chain.

      For void methods and constructors, always returns null.

      Throws:
      Throwable - if any interceptor or the original executable throws an exception
    • proceedWith

      Object proceedWith(@NonNull Object thisObject) throws Throwable
      Proceeds to the next interceptor in the chain with the same arguments and given this pointer. Static method interceptors should not call this.
      Parameters:
      thisObject - The this pointer for the call
      Returns:
      The result returned from next interceptor or the original executable if current interceptor is the last one in the chain.

      For void methods and constructors, always returns null.

      Throws:
      Throwable - if any interceptor or the original executable throws an exception
    • proceedWith

      Object proceedWith(@NonNull Object thisObject, @NonNull Object[] args) throws Throwable
      Proceeds to the next interceptor in the chain with the given arguments and this pointer. Static method interceptors should not call this.
      Parameters:
      thisObject - The this pointer for the call
      args - The arguments used for the call
      Returns:
      The result returned from next interceptor or the original executable if current interceptor is the last one in the chain.

      For void methods and constructors, always returns null.

      Throws:
      Throwable - if any interceptor or the original executable throws an exception