Lint Rules
To help developers discover potential problems at compile time and keep API usage consistent,
YukiHookprovides a built-in set of Android Lint rules.
Rule List
The following are all Lint rules currently in effect.
yukihook-core
| Issue ID | Category | Severity | Priority | Brief Description |
|---|---|---|---|---|
| YukiHookInternalApi | CORRECTNESS | ERROR | 10 | YukiHook internal API must not be used directly |
| RequiresYukiHookRuntime | CORRECTNESS | ERROR | 10 | Incompatible YukiHook runtime or Xposed API version |
| NewXposedApi | CORRECTNESS | WARNING | 5 | Using a YukiHook API newer than the module's minimum Xposed API version |
| InvalidLibXposedApiVersion | CORRECTNESS | ERROR | 10 | Invalid Xposed API version for module entry |
| InvalidLibXposedHotReload | CORRECTNESS | ERROR | 10 | Invalid hot reload configuration for module entry |
| InvalidModuleEntryClassName | CORRECTNESS | ERROR | 10 | Invalid generated entry class name for module entry |
| SystemFrameworkInScope | CORRECTNESS | WARNING | 5 | Framework package used as the system framework scope |
| ModuleRegistrationOutsideOnInit | CORRECTNESS | ERROR | 10 | Module registration must run during onInit |
| InvalidModuleHookLoading | CORRECTNESS | ERROR | 10 | Invalid module hook loading |
| InvalidModuleRetainedValue | CORRECTNESS | ERROR | 10 | Invalid retained module value |
| LoadAppForSystemFramework | CORRECTNESS | WARNING | 5 | System framework loaded through loadApp |
| SystemFrameworkInLoadAppPackages | CORRECTNESS | ERROR | 10 | System framework mixed into loadApp package names |
| ProcessNameForSystemFramework | CORRECTNESS | ERROR | 10 | Framework package name used as the system server process name |
| DataChannelForSystemFramework | CORRECTNESS | WARNING | 5 | System framework connected through dataChannel |
| NonReplayableCallInAppLifecycle | CORRECTNESS | WARNING | 5 | Non-replayable call in an app lifecycle callback |
| InvalidApplicationReadyNesting | CORRECTNESS | ERROR | 10 | Invalid withApplicationReady nesting |
| ConflictingClassicHookCallbacks | CORRECTNESS | ERROR | 10 | Conflicting classic hook callbacks |
| InvalidFieldHookTarget | CORRECTNESS | ERROR | 10 | Field used as a hook target |
| UseModuleApplication | CORRECTNESS | WARNING | 5 | Inherit ModuleApplication to enable full functionality |
| UseHookInvocationApi | PRODUCTIVITY | INFORMATIONAL | 5 | Use HookInvocation's API instead of casting |
| KavaRefWithoutHostClassLoader | CORRECTNESS | WARNING | 5 | KavaRef class loaded without the host class loader |
yukihook-extension-kavaref
| Issue ID | Category | Severity | Priority | Brief Description |
|---|---|---|---|---|
| ClassLoadingWithoutHostClassLoader | CORRECTNESS | WARNING | 5 | KavaRef class loaded without the host class loader |
| ClassLoadingWithHostClassLoader | PRODUCTIVITY | INFORMATIONAL | 5 | KavaRef class loaded with an explicit host class loader |
How to Disable or Adjust Rules
If you want to disable a specific rule or change its severity, you can create a lint.xml file in the project root.
The following example
<?xml version="1.0" encoding="UTF-8"?>
<lint>
<issue id="UseModuleApplication" severity="ignore" />
<issue id="NewXposedApi" severity="error" />
</lint>Common severity values are:
ignorewarningerrorfatal
You can also control them directly in Gradle.
The following example
android {
lint {
disable += "UseModuleApplication"
error += "NewXposedApi"
}
}If you only want to check part of the rules, you can also use checkOnly.
The following example
android {
lint {
checkOnly += setOf(
"UseModuleApplication",
"NewXposedApi"
)
}
}Feedback
Currently, most Lint detectors are completed by AI Agent, and there may still be issues, such as complex UAST scenarios that have not been tested. If you find that a Lint rule is misreporting or the Quick Fix cannot correctly fix the problem during use, you can provide an Issue ID to directly feedback to us on GitHub Issues.
If you think some rules are not reasonable and overly restrictive on the code, or if you have some new rule suggestions, please also feel free to provide feedback to us, and we will evaluate and adjust them.