Skip to content

Commit afdaa79

Browse files
committed
docs: Update patch implementation guide
1 parent e2e1151 commit afdaa79

File tree

1 file changed

+20
-10
lines changed

1 file changed

+20
-10
lines changed

DEVELOPMENT.md

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,12 @@ Upstream patches are included via Git submodule for reference and to utilize sha
2121

2222
### Example: Patch Implementation (Contoso App)
2323

24+
#### Add Contoso to module scope
25+
26+
- `app/src/main/AndroidManifest.xml`: Query package for module settings
27+
- `app/src/main/res/values/arrays.xml`: Xposed scope recommendation
28+
- `README.md`
29+
2430
#### `Fingerprints.kt`
2531
```kotlin
2632
package io.github.chsbuffer.revancedxposed.contoso.misc.unlock.plus
@@ -40,9 +46,9 @@ val isPlusUnlockedFingerprint = fingerprint {
4046
package io.github.chsbuffer.revancedxposed.contoso.misc.unlock.plus
4147

4248
import static de.robv.android.xposed.XC_MethodReplacement.returnConstant
43-
import io.github.chsbuffer.revancedxposed.contoso.ContosoHook
49+
import io.github.chsbuffer.revancedxposed.patch
4450

45-
fun ContosoHook.UnlockPlus() {
51+
val UnlockPlus = patch(name = "Unlock Plus") {
4652
::isPlusUnlockedFingerprint.hookMethod(returnConstant(true))
4753
}
4854
```
@@ -51,16 +57,20 @@ fun ContosoHook.UnlockPlus() {
5157
```kotlin
5258
package io.github.chsbuffer.revancedxposed.contoso
5359

54-
import android.app.Application
55-
import de.robv.android.xposed.callbacks.XC_LoadPackage
56-
import io.github.chsbuffer.revancedxposed.BaseHook
5760
import io.github.chsbuffer.revancedxposed.contoso.misc.unlock.plus.UnlockPlus
5861

59-
class ContosoHook(app: Application, lpparam: XC_LoadPackage.LoadPackageParam) : BaseHook(
60-
app, lpparam
61-
) {
62-
override val hooks = arrayOf(::UnlockPlus)
63-
}
62+
val ContosoPatches = arrayOf(UnlockPlus)
63+
```
64+
65+
#### `AppPatchInfo.kt`
66+
```kotlin
67+
import io.github.chsbuffer.revancedxposed.contoso.ContosoPatches
68+
69+
val appPatchConfigurations = listOf(
70+
// ...
71+
AppPatchInfo("Contoso", "com.contoso.app", ContosoPatches)
72+
)
73+
6474
```
6575

6676
### Porting Upstream Patches

0 commit comments

Comments
 (0)