Added HookCallback when catch the throwable make it throw to app function

This commit is contained in:
2022-08-16 03:57:25 +08:00
parent ca1fc60ab7
commit a6a781121a
3 changed files with 135 additions and 5 deletions

View File

@@ -429,13 +429,17 @@ inline fun HookParam.injectMember(priority: Int, tag: String, initiate: MemberHo
#### beforeHook [method]
```kotlin
fun beforeHook(initiate: HookParam.() -> Unit)
fun beforeHook(initiate: HookParam.() -> Unit): HookCallback
```
**变更记录**
`v1.0` `添加`
`v1.0.93` `修改`
新增 `HookCallback` 返回类型
**功能描述**
> 在方法执行完成前 Hook。
@@ -443,13 +447,17 @@ fun beforeHook(initiate: HookParam.() -> Unit)
#### afterHook [method]
```kotlin
fun afterHook(initiate: HookParam.() -> Unit)
fun afterHook(initiate: HookParam.() -> Unit): HookCallback
```
**变更记录**
`v1.0` `添加`
`v1.0.93` `修改`
新增 `HookCallback` 返回类型
**功能描述**
> 在方法执行完成后 Hook。
@@ -562,6 +570,34 @@ fun removeSelf(result: (Boolean) -> Unit)
!> 你只能在 Hook 回调方法中使用此功能。
#### HookCallback [class]
```kotlin
inner class HookCallback internal constructor()
```
**变更记录**
`v1.0.93` `新增`
**功能描述**
> Hook 方法体回调实现类。
##### onFailureThrowToApp [method]
```kotlin
fun onFailureThrowToApp()
```
**变更记录**
`v1.0.93` `新增`
**功能描述**
> 当回调方法体内发生异常时将异常抛出给当前 Hook APP。
#### Result [class]
```kotlin