diff --git a/docs-source/src/en/guide/move-to-new-api.md b/docs-source/src/en/guide/move-to-new-api.md index 265a5367..714f2644 100644 --- a/docs-source/src/en/guide/move-to-new-api.md +++ b/docs-source/src/en/guide/move-to-new-api.md @@ -136,6 +136,8 @@ afterHook { result = ... // Remove the content of the return value resultNull() + // Get the data storage instance within the scope of the current callback method body + dataExtra // Throw an exception to the Hook app Throwable("Fatal").throwToApp() // Execute the original method without hook and call with the original method parameters, generics can be omitted @@ -174,6 +176,8 @@ override fun afterHookedMethod(param: MethodHookParam) { param.result = ... // Remove the content of the return value param.result = null + // Get the data storage instance within the scope of the current callback method body + param.extra // Throw an exception to the Hook app param.throwable = Throwable("Fatal") // Execute the original method without hooking diff --git a/docs-source/src/zh-cn/guide/move-to-new-api.md b/docs-source/src/zh-cn/guide/move-to-new-api.md index b14d1268..8b857975 100644 --- a/docs-source/src/zh-cn/guide/move-to-new-api.md +++ b/docs-source/src/zh-cn/guide/move-to-new-api.md @@ -136,6 +136,8 @@ afterHook { result = ... // 删除返回值内容 resultNull() + // 获取当前回调方法体范围内的数据存储实例 + dataExtra // 向 Hook APP 抛出异常 Throwable("Fatal").throwToApp() // 执行未经 Hook 的原始方法并使用原始方法参数调用,泛型可略 @@ -174,6 +176,8 @@ override fun afterHookedMethod(param: MethodHookParam) { param.result = ... // 删除返回值内容 param.result = null + // 获取当前回调方法体范围内的数据存储实例 + param.extra // 向 Hook APP 抛出异常 param.throwable = Throwable("Fatal") // 执行未经 Hook 的原始方法