diff --git a/docs-source/src/en/config/xposed-using.md b/docs-source/src/en/config/xposed-using.md index 878d8bcb..098f5aa2 100644 --- a/docs-source/src/en/config/xposed-using.md +++ b/docs-source/src/en/config/xposed-using.md @@ -66,6 +66,32 @@ If you want to use the module package name to be automatically generated, you ne ::: +::: danger + +In Android Gradle Plugin **8+** versions, you need to manually enable **buildConfig** in the project's **build.gradle** or **build.gradle.kts**. + +> Groovy DSL + +```groovy +android { + buildFeatures { + buildConfig true + } +} +``` + +> Kotlin DSL + +```kt +android { + buildFeatures { + buildConfig = true + } +} +``` + +::: + Example namespace `com.example.demo`, any one of the following definitions. The following definitions are for reference only, usually **as long as your project can generate the `BuildConfig.java` file normally, no additional operations are required**. @@ -101,6 +127,12 @@ If your module package name is automatically generated by unconventional means, @InjectYukiHookWithXposed(modulePackageName = "com.example.demo") ``` +:::danger + +Please do not fill in **BuildConfig.APPLICATION_ID** in **modulePackageName**, this will get an empty string during compilation, depending on the behavior of the Android Gradle Plugin. + +::: + As long as you customize the `modulePackageName` parameter, you will get a warning at compile time. > The following example diff --git a/docs-source/src/zh-cn/config/xposed-using.md b/docs-source/src/zh-cn/config/xposed-using.md index 91ccb3e9..af531ad7 100644 --- a/docs-source/src/zh-cn/config/xposed-using.md +++ b/docs-source/src/zh-cn/config/xposed-using.md @@ -62,6 +62,32 @@ annotation class InjectYukiHookWithXposed( ::: +::: danger + +在 Android Gradle Plugin **8+** 版本中,你需要手动在项目的 **build.gradle** 或 **build.gradle.kts** 中启用 **buildConfig**。 + +> Groovy DSL + +```groovy +android { + buildFeatures { + buildConfig true + } +} +``` + +> Kotlin DSL + +```kt +android { + buildFeatures { + buildConfig = true + } +} +``` + +::: + 示例命名空间 `com.example.demo`,以下定义方式任选其一。 以下定义方式仅供参考,通常情况下**只要你的项目能够正常生成 `BuildConfig.java` 文件,就不需要做额外操作**。 @@ -97,6 +123,12 @@ android { @InjectYukiHookWithXposed(modulePackageName = "com.example.demo") ``` +::: danger + +请不要在 **modulePackageName** 中填写 **BuildConfig.APPLICATION_ID**,这会在编译过程中获取到空字符串,这取决于 Android Gradle Plugin 的行为。 + +::: + 只要你自定义了 `modulePackageName` 的参数,你就会在编译时收到警告。 > 示例如下