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
YukiMemberHookCreatorclass 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 实现类。
PRIORITY_DEFAULT - field
Change Records
v1.0.80
added
v1.2.0
deprecated
请迁移到 YukiHookPriority
PRIORITY_LOWEST - field
Change Records
v1.0.80
added
v1.2.0
deprecated
请迁移到 YukiHookPriority
PRIORITY_HIGHEST - field
Change Records
v1.0.80
added
v1.2.0
deprecated
请迁移到 YukiHookPriority
instanceClass - field
Change Records
v1.0
first
v1.0.2
modified
更名为 thisClass
instanceClass
v1.2.0
deprecated
不再推荐使用
injectMember - method
Change Records
v1.0
first
v1.0.80
modified
将方法体进行 inline
增加 priority
Hook 优先级
v1.2.0
deprecated
请迁移到另一个 injectMember
- method
injectMemberinline fun injectMember(priority: YukiHookPriority, initiate: MemberHookCreator.LegacyCreator.() -> Unit): MemberHookCreator.Result
Change Records
v1.2.0
added
Function Illustrate
注入要 Hook 的
Method
、Constructor
。
useDangerousOperation - method
Change Records
v1.1.0
added
v1.2.0
deprecated
此功能已被弃用
- class
MemberHookCreatorinner 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
。
- method
beforefun before(initiate: HookParam.() -> Unit): HookCallback
Change Records
v1.2.0
added
Function Illustrate
在
Member
执行完成前 Hook。
- method
afterfun after(initiate: HookParam.() -> Unit): HookCallback
Change Records
v1.2.0
added
Function Illustrate
在
Member
执行完成后 Hook。
- method
replaceAnyfun replaceAny(initiate: HookParam.() -> Any?)
Change Records
v1.0
first
Function Illustrate
拦截并替换此
Member
内容,给出返回值。
- method
replaceUnitfun replaceUnit(initiate: HookParam.() -> Unit)
Change Records
v1.0
first
Function Illustrate
拦截并替换此
Member
内容,没有返回值,可以称为Void
。
- method
replaceTofun replaceTo(any: Any?)
Change Records
v1.0
first
Function Illustrate
拦截并替
Member
返回值。
- method
replaceToTruefun replaceToTrue()
Change Records
v1.0
first
Function Illustrate
拦截并替换
Member
返回值为true
。
Pay Attention
确保替换 Member 的返回对象为 Boolean。
- method
replaceToFalsefun replaceToFalse()
Change Records
v1.0
first
Function Illustrate
拦截并替换
Member
返回值为false
。
Pay Attention
确保替换 Member 的返回对象为 Boolean。
- method
interceptfun intercept()
Change Records
v1.0
first
Function Illustrate
拦截此
Member
。
这将会禁止此 Member
执行并返回 null
。
Pay Attention
例如 Int、Long、Boolean 常量返回值的 Member 一旦被设置为 null 可能会造成 Hook APP 抛出异常。
- method
removeSelffun removeSelf(result: (Boolean) -> Unit)
Change Records
v1.1.0
added
Function Illustrate
移除当前注入的 Hook
Method
、Constructor
(解除 Hook)。
Pay Attention
你只能在 Hook 回调方法中使用此功能。
- class
LegacyCreatorinner class LegacyCreator internal constructor()
Change Records
v1.2.0
added
Function Illustrate
使用
injectMember
创建的 Hook 核心功能实现类 (旧版本)。
Notice
大部分旧版 API 已被迁移至此处,将不再特殊说明其中包含的旧版 API。
- class
HookCallbackinner class HookCallback internal constructor()
Change Records
v1.1.0
added
Function Illustrate
Hook 方法体回调实现类。
- method
onFailureThrowToAppfun onFailureThrowToApp()
Change Records
v1.1.0
added
Function Illustrate
当回调方法体内发生异常时将异常抛出给当前 Hook APP。
- class
Resultinner class Result internal constructor()
Change Records
v1.0
first
Function Illustrate
监听 Hook 结果实现类。
- method
resultinline fun result(initiate: Result.() -> Unit): Result
Change Records
v1.0
first
v1.0.5
modified
修改为 failures
result
v1.0.80
modified
将方法体进行 inline
Function Illustrate
创建监听失败事件方法体。
- method
byinline fun by(condition: () -> Boolean): Result
Change Records
v1.0.5
added
v1.0.80
modified
将方法体进行 inline
Function Illustrate
添加执行 Hook 需要满足的条件,不满足条件将直接停止 Hook。
- method
onHookedfun onHooked(result: (Member) -> Unit): Result
Change Records
v1.0.70
added
Function Illustrate
监听
members
Hook 成功的回调方法。
在首次 Hook 成功后回调。
在重复 Hook 时会回调 onAlreadyHooked
。
- method
onAlreadyHookedfun onAlreadyHooked(result: (Member) -> Unit): Result
Change Records
v1.0.89
added
Function Illustrate
监听
members
重复 Hook 的回调方法。
Notice
同一个 hookClass 中的同一个 members 不会被 API 重复 Hook,若由于各种原因重复 Hook 会回调此方法。
- method
onNoSuchMemberFailurefun onNoSuchMemberFailure(result: (Throwable) -> Unit): Result
Change Records
v1.0.5
added
Function Illustrate
监听
members
不存在发生错误的回调方法。
- method
onConductFailurefun onConductFailure(result: (HookParam, Throwable) -> Unit): Result
Change Records
v1.0
first
Function Illustrate
监听 Hook 进行过程中发生错误的回调方法。
- method
onHookingFailurefun onHookingFailure(result: (Throwable) -> Unit): Result
Change Records
v1.0
first
Function Illustrate
监听 Hook 开始时发生的错误的回调方法。
- method
onAllFailurefun onAllFailure(result: (Throwable) -> Unit): Result
Change Records
v1.0
first
Function Illustrate
监听全部 Hook 过程发生错误的回调方法。
- method
ignoredNoSuchMemberFailurefun ignoredNoSuchMemberFailure(): Result
Change Records
v1.0.5
added
Function Illustrate
忽略
members
不存在发生的错误。
- method
ignoredConductFailurefun ignoredConductFailure(): Result
Change Records
v1.0
first
Function Illustrate
忽略 Hook 进行过程中发生的错误。
- method
ignoredHookingFailurefun ignoredHookingFailure(): Result
Change Records
v1.0
first
Function Illustrate
忽略 Hook 开始时发生的错误。
- method
ignoredAllFailurefun ignoredAllFailure(): Result
Change Records
v1.0
first
Function Illustrate
忽略全部 Hook 过程发生的错误。
- method
removefun remove(result: (Boolean) -> Unit)
Change Records
v1.1.0
added
Function Illustrate
移除当前注入的 Hook
Method
、Constructor
(解除 Hook)。
Notice
你只能在 Hook 成功后才能解除 Hook,可监听 onHooked 事件。
- class
Resultinner class Result internal constructor()
Change Records
v1.0.3
added
Function Illustrate
监听全部 Hook 结果实现类。
- method
resultinline 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
创建监听事件方法体。
- method
byinline fun by(condition: () -> Boolean): Result
Change Records
v1.0.5
added
v1.0.80
modified
将方法体进行 inline
Function Illustrate
添加执行 Hook 需要满足的条件,不满足条件将直接停止 Hook。
- method
onPrepareHookfun onPrepareHook(callback: () -> Unit): Result
Change Records
v1.0.70
added
Function Illustrate
监听
hookClass
存在时准备开始 Hook 的操作。
- method
onHookClassNotFoundFailurefun onHookClassNotFoundFailure(result: (Throwable) -> Unit): Result
Change Records
v1.0.3
added
Function Illustrate
监听
hookClass
找不到时发生错误的回调方法。
- method
ignoredHookClassNotFoundFailurefun ignoredHookClassNotFoundFailure(): Result
Change Records
v1.0.3
added
Function Illustrate
忽略
hookClass
找不到时出现的错误。