Skip to content

Lint Rules ​

To help developers discover potential problems at compile time and keep API usage consistent, YukiHook provides a built-in set of Android Lint rules.

Rule List ​

The following are all Lint rules currently in effect.

yukihook-core ​

Issue IDCategorySeverityPriorityBrief Description
YukiHookInternalApiCORRECTNESSERROR10YukiHook internal API must not be used directly
RequiresYukiHookRuntimeCORRECTNESSERROR10Incompatible YukiHook runtime or Xposed API version
NewXposedApiCORRECTNESSWARNING5Using a YukiHook API newer than the module's minimum Xposed API version
InvalidLibXposedApiVersionCORRECTNESSERROR10Invalid Xposed API version for module entry
InvalidLibXposedHotReloadCORRECTNESSERROR10Invalid hot reload configuration for module entry
InvalidModuleEntryClassNameCORRECTNESSERROR10Invalid generated entry class name for module entry
SystemFrameworkInScopeCORRECTNESSWARNING5Framework package used as the system framework scope
ModuleRegistrationOutsideOnInitCORRECTNESSERROR10Module registration must run during onInit
InvalidModuleHookLoadingCORRECTNESSERROR10Invalid module hook loading
InvalidModuleRetainedValueCORRECTNESSERROR10Invalid retained module value
LoadAppForSystemFrameworkCORRECTNESSWARNING5System framework loaded through loadApp
SystemFrameworkInLoadAppPackagesCORRECTNESSERROR10System framework mixed into loadApp package names
ProcessNameForSystemFrameworkCORRECTNESSERROR10Framework package name used as the system server process name
DataChannelForSystemFrameworkCORRECTNESSWARNING5System framework connected through dataChannel
NonReplayableCallInAppLifecycleCORRECTNESSWARNING5Non-replayable call in an app lifecycle callback
InvalidApplicationReadyNestingCORRECTNESSERROR10Invalid withApplicationReady nesting
ConflictingClassicHookCallbacksCORRECTNESSERROR10Conflicting classic hook callbacks
InvalidFieldHookTargetCORRECTNESSERROR10Field used as a hook target
UseModuleApplicationCORRECTNESSWARNING5Inherit ModuleApplication to enable full functionality
UseHookInvocationApiPRODUCTIVITYINFORMATIONAL5Use HookInvocation's API instead of casting
KavaRefWithoutHostClassLoaderCORRECTNESSWARNING5KavaRef class loaded without the host class loader

yukihook-extension-kavaref ​

Issue IDCategorySeverityPriorityBrief Description
ClassLoadingWithoutHostClassLoaderCORRECTNESSWARNING5KavaRef class loaded without the host class loader
ClassLoadingWithHostClassLoaderPRODUCTIVITYINFORMATIONAL5KavaRef 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
<?xml version="1.0" encoding="UTF-8"?>
<lint>
    <issue id="UseModuleApplication" severity="ignore" />
    <issue id="NewXposedApi" severity="error" />
</lint>

Common severity values are:

  • ignore
  • warning
  • error
  • fatal

You can also control them directly in Gradle.

The following example

kotlin
android {
    lint {
        disable += "UseModuleApplication"
        error += "NewXposedApi"
    }
}

If you only want to check part of the rules, you can also use checkOnly.

The following example

kotlin
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.

Released under the Apache-2.0 License