Update quick-start, xposed-using documentation

This commit is contained in:
2022-12-31 23:27:59 +08:00
parent 6254c451cf
commit 3c97d8097c
4 changed files with 24 additions and 12 deletions

View File

@@ -126,7 +126,7 @@ Suppose this is your entry class.
```kotlin
@InjectYukiHookWithXposed
class HookEntry: IYukiHookXposedInit
object HookEntry : IYukiHookXposedInit
```
The Xposed entry class is handled as follows.
@@ -134,7 +134,7 @@ The Xposed entry class is handled as follows.
> The following example
```kotlin:no-line-numbers
class HookEntry_YukiHookXposedInit: IXposedHookZygoteInit, IXposedHookLoadPackage, ...
class HookEntry_YukiHookXposedInit : IXposedHookZygoteInit, IXposedHookLoadPackage, ...
```
The compiled class name structure is as follows.
@@ -153,7 +153,7 @@ We now define the entry class name as `HookXposedEntry`.
```kotlin
@InjectYukiHookWithXposed(entryClassName = "HookXposedEntry")
class HookEntry: IYukiHookXposedInit
object HookEntry : IYukiHookXposedInit
```
The Xposed entry class is handled as follows.
@@ -161,7 +161,7 @@ The Xposed entry class is handled as follows.
> The following example
```kotlin:no-line-numbers
class HookXposedEntry: IXposedHookZygoteInit, IXposedHookLoadPackage, ...
class HookXposedEntry : IXposedHookZygoteInit, IXposedHookLoadPackage, ...
```
The compiled class name structure is as follows.
@@ -174,6 +174,12 @@ The compiled class name structure is as follows.
...hook.HookXposedEntry ← Automatically generated Xposed entry class
```
::: tip
The entry class can be defined using **class** or **object**, but it is recommended to use **object** definition to ensure that each injected process is a single instance.
:::
::: danger
The **entryClassName** you define must not be the same as the class name in **xposed_init**, otherwise the automatic builder <u>**throws an exception at compile time**</u>.
@@ -254,7 +260,7 @@ If your current Xposed Module uses third-party resources, but may not be able to
```kotlin
@InjectYukiHookWithXposed
class HookEntry: IYukiHookXposedInit {
object HookEntry : IYukiHookXposedInit {
override fun onHook() {
// Your code here.

View File

@@ -144,7 +144,7 @@ Create a Hook entry class in your project, implements `IYukiHookXposedInit` and
```kotlin
@InjectYukiHookWithXposed
class HookEntry : IYukiHookXposedInit {
object HookEntry : IYukiHookXposedInit {
override fun onHook() = YukiHookAPI.encase {
// Your code here.