mirror of
https://github.com/ReVanced/revanced-patcher.git
synced 2026-01-18 00:43:56 +00:00
feat: patch options (#81)
* feat: Patch Options * refactor: remove delegate property * feat: List patch options * refactor: add setter example to PatchOptionsUsage.kt * docs: add docs for PatchOptions * docs: tidy docs
This commit is contained in:
@@ -7,6 +7,7 @@ import app.revanced.patcher.data.impl.BytecodeData
|
||||
import app.revanced.patcher.extensions.addInstructions
|
||||
import app.revanced.patcher.extensions.or
|
||||
import app.revanced.patcher.extensions.replaceInstruction
|
||||
import app.revanced.patcher.patch.PatchOption
|
||||
import app.revanced.patcher.patch.PatchResult
|
||||
import app.revanced.patcher.patch.PatchResultSuccess
|
||||
import app.revanced.patcher.patch.annotations.DependencyType
|
||||
@@ -162,4 +163,19 @@ class ExampleBytecodePatch : BytecodePatch(listOf(ExampleFingerprint)) {
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
override val options = listOf(
|
||||
PatchOption.StringOption(
|
||||
"key", "default", "title", "description", true
|
||||
),
|
||||
PatchOption.BooleanOption(
|
||||
"key", true, "title", "description" // required defaults to false
|
||||
),
|
||||
PatchOption.StringListOption(
|
||||
"key", "TEST", listOf("TEST", "TEST1", "TEST2"), "title", "description"
|
||||
),
|
||||
PatchOption.IntListOption(
|
||||
"key", 1, listOf(1, 2, 3), "title", "description"
|
||||
),
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user