HookFactory

Xposed 82 hook DSL 构造器。

通过 beforeafterreplace 等方法声明行为,最终由 helper API 触发创建。

Functions

Link copied to clipboard
fun after(callback: Consumer<HookParam>)

注册 Java Consumer 形式的 after 阶段回调。

fun after(callback: HookCallback)

注册 after 阶段回调。

Link copied to clipboard
fun before(callback: Consumer<HookParam>)

注册 Java Consumer 形式的 before 阶段回调。

fun before(callback: HookCallback)

注册 before 阶段回调。

Link copied to clipboard
fun interrupt()

中断原始调用并返回 null

Link copied to clipboard
fun replace(callback: Function<HookParam, Any?>)

用 Java Function 形式替换原始实现。

fun replace(callback: (HookParam) -> Any?)

用自定义返回值替换原始实现。

Link copied to clipboard
fun returnConstant(value: Any?)

中断原始调用并返回固定值。