Interface XposedInterface.HookBuilder

Enclosing interface:
XposedInterface

public static interface XposedInterface.HookBuilder
Builder for configuring a hook.
  • Method Details

    • setPriority

      XposedInterface.HookBuilder setPriority(int priority)
      Sets the priority of the hook. Hooks with higher priority will be called before hooks with lower priority. The default priority is XposedInterface.PRIORITY_DEFAULT.
      Parameters:
      priority - The priority of the hook
      Returns:
      The builder itself for chaining
    • setExceptionMode

      Sets the exception handling mode for the hook. The default mode is XposedInterface.ExceptionMode.DEFAULT.
      Parameters:
      mode - The exception handling mode
      Returns:
      The builder itself for chaining
    • intercept

      @NonNull XposedInterface.HookHandle intercept(@NonNull XposedInterface.Hooker hooker)
      Sets the hooker for the method / constructor and builds the hook.
      Parameters:
      hooker - The hooker object
      Returns:
      The handle for the hook
      Throws:
      IllegalArgumentException - if origin is framework internal or Constructor.newInstance(java.lang.Object...), or hooker is invalid
      HookFailedError - if hook fails due to framework internal error
    • setId

      @SinceApi(102) XposedInterface.HookBuilder setId(@Nullable String id)
      Sets a unique id for the hook, default to null. An id is used for exclusively identifying a hook in the same module on the executable. A new hook with the same id in the same module on the executable will replace the old one atomically, and the old hook handle will be invalid. Hook ids are isolated between modules.

      The hook chain is snapshot based. Replacing or adding a hook while a call is running does not affect that in-flight call.

      Parameters:
      id - The id for the hook. It can be null if you don't care about replacing the hook later.
      Returns:
      The builder itself for chaining