mirror of
https://github.com/HighCapable/YukiHookAPI.git
synced 2025-09-06 10:45:47 +08:00
Update api-exception documentation
This commit is contained in:
@@ -1016,54 +1016,6 @@ YukiHookAPI cannot support current Hook API or cannot found any available Hook A
|
||||
|
||||
###### exception
|
||||
|
||||
::: danger RuntimeException
|
||||
|
||||
!!!DO NOT ALLOWED!!! You cannot hook or reflection to call the internal class of the YukiHookAPI itself, The called class is \[**CLASS**\]
|
||||
|
||||
:::
|
||||
|
||||
**异常原因**
|
||||
|
||||
你使用 `YukiHookAPI` 的相关反射或 Hook 功能调用了 API 自身的 `Class` 对象。
|
||||
|
||||
> 示例如下
|
||||
|
||||
```kotlin
|
||||
// <情景1>
|
||||
YukiHookAPI.current()
|
||||
// <情景2>
|
||||
PackageParam::class.java.hook {
|
||||
// ...
|
||||
}
|
||||
// <情景3>
|
||||
MethodFinder::class.java.method {
|
||||
name = "name"
|
||||
param(StringClass)
|
||||
}.get().call("name")
|
||||
// ...
|
||||
```
|
||||
|
||||
**解决方案**
|
||||
|
||||
请检查代码部分是否有错误,例如下面的情况。
|
||||
|
||||
> 示例如下
|
||||
|
||||
```kotlin
|
||||
YourClass.method {
|
||||
// ...
|
||||
// ❗ 没有调用方法执行,这里实际调用的是 MethodFinder.Result 对象
|
||||
}.get(instance).current()
|
||||
YourClass.method {
|
||||
// ...
|
||||
// ✅ 正确的使用方法,假设此方法无参
|
||||
}.get(instance).call().current()
|
||||
```
|
||||
|
||||
不允许内联、反射、Hook `YukiHookAPI` 自身的 `Class` 以及内部功能,防止发生错误。
|
||||
|
||||
###### exception
|
||||
|
||||
::: danger UnsupportedOperationException
|
||||
|
||||
!!!DANGEROUS!!! Hook \[**CLASS**\] Class is a dangerous behavior! \[**CONTENT**\] \[**SOLVE**\]
|
||||
|
Reference in New Issue
Block a user