Hooks

object Hooks

供 Java 调用的 hook 入口。

已经拿到 Method / Constructor 时使用 createHook。 想按名称和参数类型查找并立即 hook 时使用 findAndHookMethodfindAndHookConstructor

findAndHookMethodfindAndHookConstructor 的最后一个可变参数必须是 IMethodHookIReplaceHook 或 libxposed 的 Hooker

Functions

Link copied to clipboard
fun createConstructorHooks(constructors: Iterable<Constructor<*>>, callback: IMethodHook): List<XposedInterface.HookHandle>

为构造器列表批量创建普通 hook。

fun createConstructorHooks(constructors: Iterable<Constructor<*>>, callback: IReplaceHook): List<XposedInterface.HookHandle>

为构造器列表批量创建替换 hook。

fun createConstructorHooks(constructors: Iterable<Constructor<*>>, key: String, callback: IMethodHook): List<XposedInterface.HookHandle>

为构造器列表创建带同一稳定 reloadKey 的普通 hook。

fun createConstructorHooks(constructors: Iterable<Constructor<*>>, key: String, callback: IReplaceHook): List<XposedInterface.HookHandle>

为构造器列表创建带同一稳定 reloadKey 的替换 hook。

Link copied to clipboard
fun createHook(constructor: Constructor<*>, callback: IMethodHook): XposedInterface.HookHandle

为构造器创建普通 hook。

fun createHook(constructor: Constructor<*>, callback: IReplaceHook): XposedInterface.HookHandle

为构造器创建替换 hook。

fun createHook(method: Method, callback: IMethodHook): XposedInterface.HookHandle

为方法创建普通 hook。

fun createHook(method: Method, callback: IReplaceHook): XposedInterface.HookHandle

为方法创建替换 hook。

fun createHook(constructor: Constructor<*>, key: String, callback: IMethodHook): XposedInterface.HookHandle

为构造器创建带稳定 reloadKey 的普通 hook。

fun createHook(constructor: Constructor<*>, key: String, callback: IReplaceHook): XposedInterface.HookHandle

为构造器创建带稳定 reloadKey 的替换 hook。

fun createHook(method: Method, key: String, callback: IMethodHook): XposedInterface.HookHandle

为方法创建带显式 reloadKey 的普通 hook,可由 io.github.lingqiqi5211.ezhooktool.xposed.HotReloadSession 原子替换。

fun createHook(method: Method, key: String, callback: IReplaceHook): XposedInterface.HookHandle

为方法创建带稳定 reloadKey 的替换 hook。

Link copied to clipboard
fun createHooks(methods: Iterable<Method>, callback: IMethodHook): List<XposedInterface.HookHandle>

为方法列表批量创建普通 hook。

fun createHooks(methods: Iterable<Method>, callback: IReplaceHook): List<XposedInterface.HookHandle>

为方法列表批量创建替换 hook。

fun createHooks(methods: Iterable<Method>, key: String, callback: IMethodHook): List<XposedInterface.HookHandle>

为方法列表创建带同一稳定 reloadKey 的普通 hook。

fun createHooks(methods: Iterable<Method>, key: String, callback: IReplaceHook): List<XposedInterface.HookHandle>

为方法列表创建带同一稳定 reloadKey 的替换 hook。

Link copied to clipboard
fun findAndHookConstructor(clazz: Class<*>, vararg parameterTypesAndCallback: Any): XposedInterface.HookHandle

按参数类型查找构造器并立即创建 hook。

fun findAndHookConstructor(className: String, vararg parameterTypesAndCallback: Any): XposedInterface.HookHandle

按类名和参数类型查找构造器并立即创建 hook。

fun findAndHookConstructor(className: String, classLoader: ClassLoader, vararg parameterTypesAndCallback: Any): XposedInterface.HookHandle

按类名、指定 ClassLoader 和参数类型查找构造器并立即创建 hook。

Link copied to clipboard
fun findAndHookConstructorWithKey(clazz: Class<*>, key: String, vararg parameterTypesAndCallback: Any): XposedInterface.HookHandle

按参数类型查找并以稳定 reloadKey 安装构造器 hook。

fun findAndHookConstructorWithKey(className: String, key: String, vararg parameterTypesAndCallback: Any): XposedInterface.HookHandle

按类名查找并以稳定 reloadKey 安装构造器 hook。

fun findAndHookConstructorWithKey(className: String, classLoader: ClassLoader, key: String, vararg parameterTypesAndCallback: Any): XposedInterface.HookHandle

按类名和 ClassLoader 查找并以稳定 reloadKey 安装构造器 hook。

Link copied to clipboard
fun findAndHookMethod(clazz: Class<*>, methodName: String, vararg parameterTypesAndCallback: Any): XposedInterface.HookHandle

按方法名和参数类型查找方法并立即创建 hook。

fun findAndHookMethod(className: String, methodName: String, vararg parameterTypesAndCallback: Any): XposedInterface.HookHandle

按类名、方法名和参数类型查找方法并立即创建 hook。

fun findAndHookMethod(className: String, classLoader: ClassLoader, methodName: String, vararg parameterTypesAndCallback: Any): XposedInterface.HookHandle

按类名、指定 ClassLoader、方法名和参数类型查找方法并立即创建 hook。

Link copied to clipboard
fun findAndHookMethodWithKey(clazz: Class<*>, methodName: String, key: String, vararg parameterTypesAndCallback: Any): XposedInterface.HookHandle

按方法名查找并以稳定 reloadKey 安装 hook。

fun findAndHookMethodWithKey(className: String, methodName: String, key: String, vararg parameterTypesAndCallback: Any): XposedInterface.HookHandle

按类名查找并以稳定 reloadKey 安装方法 hook。

fun findAndHookMethodWithKey(className: String, classLoader: ClassLoader, methodName: String, key: String, vararg parameterTypesAndCallback: Any): XposedInterface.HookHandle

按类名和 ClassLoader 查找并以稳定 reloadKey 安装方法 hook。

Link copied to clipboard
fun intercept(constructor: Constructor<*>, callback: XposedInterface.Hooker): XposedInterface.HookHandle

为构造器创建 intercept hook。

fun intercept(method: Method, callback: XposedInterface.Hooker): XposedInterface.HookHandle

为方法创建 intercept hook。

fun intercept(constructor: Constructor<*>, key: String, callback: XposedInterface.Hooker): XposedInterface.HookHandle

为构造器创建带稳定 reloadKey 的 intercept hook。

fun intercept(method: Method, key: String, callback: XposedInterface.Hooker): XposedInterface.HookHandle

为方法创建带稳定 reloadKey 的 intercept hook。

Link copied to clipboard
fun replaceHook(handle: XposedInterface.HookHandle, callback: IMethodHook): XposedInterface.HookHandle

用 before / after 回调原子替换已有 hook。

fun replaceHook(handle: XposedInterface.HookHandle, callback: IReplaceHook): XposedInterface.HookHandle

用 replace 回调原子替换已有 hook。