import{_ as o,o as s,c as e,a}from"./app-BpUB8-Q8.js";const n={},l=a(`
Notice
Due to maintenance costs, the YukiHookAPI
will no longer update this document from version 1.3.0
and switch to the API document automatically generated by the Dokka plugin in version 2.0.0
.
Notice
The English translation of this page has not been completed, you are welcome to contribute translations to us.
You can use the Chrome Translation Plugin to translate entire pages for reference.
class YukiMemberHookCreator internal constructor(private val packageParam: PackageParam, private val hookClass: HookClass)
Change Records
v1.0
first
v1.0.80
modified
对 hookClass
进行 inline 处理
v1.1.0
modified
修正拼写错误的 Creater 命名到 Creator
v1.1.5
modified
私有化构造方法
Function Illustrate
YukiHookAPI
的Member
核心 Hook 实现类。
Change Records
v1.0.80
added
v1.2.0
deprecated
请迁移到 YukiHookPriority
Change Records
v1.0.80
added
v1.2.0
deprecated
请迁移到 YukiHookPriority
Change Records
v1.0.80
added
v1.2.0
deprecated
请迁移到 YukiHookPriority
Change Records
v1.0
first
v1.0.2
modified
更名为 thisClass
instanceClass
v1.2.0
deprecated
不再推荐使用
Change Records
v1.0
first
v1.0.80
modified
将方法体进行 inline
增加 priority
Hook 优先级
v1.2.0
deprecated
请迁移到另一个 injectMember
inline fun injectMember(priority: YukiHookPriority, initiate: MemberHookCreator.LegacyCreator.() -> Unit): MemberHookCreator.Result
Change Records
v1.2.0
added
Function Illustrate
注入要 Hook 的
Method
、Constructor
。
Change Records
v1.1.0
added
v1.2.0
deprecated
此功能已被弃用
inner class MemberHookCreator internal constructor(private val priority: YukiHookPriority, private val hookMode: HookMode)
Change Records
v1.0
first
v1.0.80
modified
增加 priority
Hook 优先级
v1.0.81
modified
增加 packageName
当前 Hook 的 APP 包名
v1.1.0
modified
移除 packageName
修正拼写错误的 Creater 命名到 Creator
v1.2.0
modified
移除 tag
priority
类型由 Int
变更为 YukiHookPriority
增加 hookMode
Hook 模式
Function Illustrate
Hook 核心功能实现类,查找和处理需要 Hook 的
Method
、Constructor
。
fun before(initiate: HookParam.() -> Unit): HookCallback
Change Records
v1.2.0
added
Function Illustrate
在
Member
执行完成前 Hook。
fun after(initiate: HookParam.() -> Unit): HookCallback
Change Records
v1.2.0
added
Function Illustrate
在
Member
执行完成后 Hook。
fun replaceAny(initiate: HookParam.() -> Any?)
Change Records
v1.0
first
Function Illustrate
拦截并替换此
Member
内容,给出返回值。
fun replaceUnit(initiate: HookParam.() -> Unit)
Change Records
v1.0
first
Function Illustrate
拦截并替换此
Member
内容,没有返回值,可以称为Void
。
fun replaceTo(any: Any?)
Change Records
v1.0
first
Function Illustrate
拦截并替
Member
返回值。
fun replaceToTrue()
Change Records
v1.0
first
Function Illustrate
拦截并替换
Member
返回值为true
。
Pay Attention
确保替换 Member 的返回对象为 Boolean。
fun replaceToFalse()
Change Records
v1.0
first
Function Illustrate
拦截并替换
Member
返回值为false
。
Pay Attention
确保替换 Member 的返回对象为 Boolean。
fun intercept()
Change Records
v1.0
first
Function Illustrate
拦截此
Member
。
这将会禁止此 Member
执行并返回 null
。
Pay Attention
例如 Int、Long、Boolean 常量返回值的 Member 一旦被设置为 null 可能会造成 Hook APP 抛出异常。
fun removeSelf(result: (Boolean) -> Unit)
Change Records
v1.1.0
added
Function Illustrate
移除当前注入的 Hook
Method
、Constructor
(解除 Hook)。
Pay Attention
你只能在 Hook 回调方法中使用此功能。
inner class LegacyCreator internal constructor()
Change Records
v1.2.0
added
Function Illustrate
使用
injectMember
创建的 Hook 核心功能实现类 (旧版本)。
Notice
大部分旧版 API 已被迁移至此处,将不再特殊说明其中包含的旧版 API。
inner class HookCallback internal constructor()
Change Records
v1.1.0
added
Function Illustrate
Hook 方法体回调实现类。
fun onFailureThrowToApp()
Change Records
v1.1.0
added
Function Illustrate
当回调方法体内发生异常时将异常抛出给当前 Hook APP。
inner class Result internal constructor()
Change Records
v1.0
first
Function Illustrate
监听 Hook 结果实现类。
inline fun result(initiate: Result.() -> Unit): Result
Change Records
v1.0
first
v1.0.5
modified
修改为 failures
result
v1.0.80
modified
将方法体进行 inline
Function Illustrate
创建监听失败事件方法体。
inline fun by(condition: () -> Boolean): Result
Change Records
v1.0.5
added
v1.0.80
modified
将方法体进行 inline
Function Illustrate
添加执行 Hook 需要满足的条件,不满足条件将直接停止 Hook。
fun onHooked(result: (Member) -> Unit): Result
Change Records
v1.0.70
added
Function Illustrate
监听
members
Hook 成功的回调方法。
在首次 Hook 成功后回调。
在重复 Hook 时会回调 onAlreadyHooked
。
fun onAlreadyHooked(result: (Member) -> Unit): Result
Change Records
v1.0.89
added
Function Illustrate
监听
members
重复 Hook 的回调方法。
Notice
同一个 hookClass 中的同一个 members 不会被 API 重复 Hook,若由于各种原因重复 Hook 会回调此方法。
fun onNoSuchMemberFailure(result: (Throwable) -> Unit): Result
Change Records
v1.0.5
added
Function Illustrate
监听
members
不存在发生错误的回调方法。
fun onConductFailure(result: (HookParam, Throwable) -> Unit): Result
Change Records
v1.0
first
Function Illustrate
监听 Hook 进行过程中发生错误的回调方法。
fun onHookingFailure(result: (Throwable) -> Unit): Result
Change Records
v1.0
first
Function Illustrate
监听 Hook 开始时发生的错误的回调方法。
fun onAllFailure(result: (Throwable) -> Unit): Result
Change Records
v1.0
first
Function Illustrate
监听全部 Hook 过程发生错误的回调方法。
fun ignoredNoSuchMemberFailure(): Result
Change Records
v1.0.5
added
Function Illustrate
忽略
members
不存在发生的错误。
fun ignoredConductFailure(): Result
Change Records
v1.0
first
Function Illustrate
忽略 Hook 进行过程中发生的错误。
fun ignoredHookingFailure(): Result
Change Records
v1.0
first
Function Illustrate
忽略 Hook 开始时发生的错误。
fun ignoredAllFailure(): Result
Change Records
v1.0
first
Function Illustrate
忽略全部 Hook 过程发生的错误。
fun remove(result: (Boolean) -> Unit)
Change Records
v1.1.0
added
Function Illustrate
移除当前注入的 Hook
Method
、Constructor
(解除 Hook)。
Notice
你只能在 Hook 成功后才能解除 Hook,可监听 onHooked 事件。
inner class Result internal constructor()
Change Records
v1.0.3
added
Function Illustrate
监听全部 Hook 结果实现类。
inline fun result(initiate: Result.() -> Unit): Result
Change Records
v1.0.3
added
v1.0.5
modified
修改为 failures
result
v1.0.80
modified
将方法体进行 inline
Function Illustrate
创建监听事件方法体。
inline fun by(condition: () -> Boolean): Result
Change Records
v1.0.5
added
v1.0.80
modified
将方法体进行 inline
Function Illustrate
添加执行 Hook 需要满足的条件,不满足条件将直接停止 Hook。
fun onPrepareHook(callback: () -> Unit): Result
Change Records
v1.0.70
added
Function Illustrate
监听
hookClass
存在时准备开始 Hook 的操作。
fun onHookClassNotFoundFailure(result: (Throwable) -> Unit): Result
Change Records
v1.0.3
added
Function Illustrate
监听
hookClass
找不到时发生错误的回调方法。
fun ignoredHookClassNotFoundFailure(): Result
Change Records
v1.0.3
added
Function Illustrate
`,286),t=[l];function c(p,r){return s(),e("div",null,t)}const i=o(n,[["render",c],["__file","YukiMemberHookCreator.html.vue"]]);export{i as default};忽略
hookClass
找不到时出现的错误。