docs: update xposed-using

This commit is contained in:
2023-10-05 02:15:25 +08:00
parent b38d2b63ea
commit 545f7f92ab
2 changed files with 64 additions and 0 deletions

View File

@@ -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

View File

@@ -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` 的参数,你就会在编译时收到警告。
> 示例如下