mirror of
https://github.com/HighCapable/YukiHookAPI.git
synced 2025-09-04 09:45:19 +08:00
Update api-exception documentation
This commit is contained in:
@@ -400,6 +400,29 @@ method {
|
||||
|
||||
::: danger loggerE
|
||||
|
||||
Can't find this Class in \[**CLASSLOADER**\]: **CONTENT** Generated by YukiHookAPI#ReflectionTool
|
||||
|
||||
:::
|
||||
|
||||
**异常原因**
|
||||
|
||||
通过 `ClassLoader.searchClass` 或 `PackageParam.searchClass` 找不到需要查找的 `Class` 对象。
|
||||
|
||||
> 示例如下
|
||||
|
||||
```kotlin
|
||||
customClassLoader?.searchClass {
|
||||
from(...)
|
||||
// ...
|
||||
}.get()
|
||||
```
|
||||
|
||||
**解决方案**
|
||||
|
||||
这是一个安全异常,请检查你设置的条件,使用相关工具查看所在 **Dex** 中的 `Class` 以及字节码对象特征,并再试一次。
|
||||
|
||||
::: danger loggerE
|
||||
|
||||
Can't find this Method/Constructor/Field in \[**CLASS**\]: **CONTENT** Generated by YukiHookAPI#ReflectionTool
|
||||
|
||||
:::
|
||||
@@ -817,6 +840,20 @@ Can't find this Class in \[**CLASSLOADER**\]: **CONTENT** Generated by YukiHookA
|
||||
|
||||
::: danger IllegalStateException
|
||||
|
||||
ClassLoader \[**CLASSLOADER**\] is not a DexClassLoader
|
||||
|
||||
:::
|
||||
|
||||
**异常原因**
|
||||
|
||||
使用 `ClassLoader.searchClass` 或 `PackageParam.searchClass` 查找 `Class` 但是当前 `ClassLoader` 并不继承于 `BaseDexClassLoader`。
|
||||
|
||||
**解决方案**
|
||||
|
||||
这种情况基本不存在,除非当前 APP 引用了非 ART 平台的可执行文件 (但是这种情况还是不会存在) 或当前 `ClassLoader` 为空。
|
||||
|
||||
::: danger IllegalStateException
|
||||
|
||||
Failed to got SystemContext
|
||||
|
||||
:::
|
||||
@@ -1549,3 +1586,28 @@ context.applyTheme(R.style.Theme_AppCompat).applyTheme(R.style.Theme_AppCompat)
|
||||
**解决方案**
|
||||
|
||||
在 `Context` 中只能创建一次 `ModuleContextThemeWrapper`,请检查代码是否有循环调用问题。
|
||||
|
||||
::: danger IllegalStateException
|
||||
|
||||
Cannot create classes cache for "android", please remove "name" param
|
||||
|
||||
:::
|
||||
|
||||
**异常原因**
|
||||
|
||||
在系统框架 (android) 宿主使用了 `DexClassFinder` 的缓存功能 `searchClass(name = ...)`。
|
||||
|
||||
> 示例如下
|
||||
|
||||
```kotlin
|
||||
loadSystem {
|
||||
searchClass(name = "test") {
|
||||
from(...)
|
||||
// ...
|
||||
}.get()
|
||||
}
|
||||
```
|
||||
|
||||
**解决方案**
|
||||
|
||||
由于缓存会将找到的 `Class` 名称存入 `SharedPreferences`,但是系统框架不存在 data 目录,所以请不要在系统框架中使用此功能。
|
Reference in New Issue
Block a user