mirror of
https://github.com/revanced/revanced-patches
synced 2025-01-10 22:45:50 +01:00
refactor: update to patcher 4.2.2
This commit is contained in:
parent
5cfb618022
commit
7dbe4f54c7
@ -75,7 +75,7 @@ class CustomBrandingPatch : ResourcePatch() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
companion object : OptionsContainer() {
|
companion object : OptionsContainer() {
|
||||||
private var appName: String by option(
|
private var appName: String? by option(
|
||||||
PatchOption.StringOption(
|
PatchOption.StringOption(
|
||||||
key = "appName",
|
key = "appName",
|
||||||
default = "YouTube ReVanced",
|
default = "YouTube ReVanced",
|
||||||
|
@ -20,7 +20,7 @@ import org.w3c.dom.Element
|
|||||||
@Version("0.0.1")
|
@Version("0.0.1")
|
||||||
class ThemePatch : ResourcePatch() {
|
class ThemePatch : ResourcePatch() {
|
||||||
override fun execute(data: ResourceData): PatchResult {
|
override fun execute(data: ResourceData): PatchResult {
|
||||||
val theme = Themes.of(theme) ?: return PatchResultError("Theme '$theme' not found.")
|
val theme = Themes.of(theme!!) ?: return PatchResultError("Theme '$theme' not found.")
|
||||||
|
|
||||||
data.xmlEditor["res/values/colors.xml"].use { editor ->
|
data.xmlEditor["res/values/colors.xml"].use { editor ->
|
||||||
val resourcesNode = editor.file.getElementsByTagName("resources").item(0) as Element
|
val resourcesNode = editor.file.getElementsByTagName("resources").item(0) as Element
|
||||||
@ -35,7 +35,7 @@ class ThemePatch : ResourcePatch() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
companion object : OptionsContainer() {
|
companion object : OptionsContainer() {
|
||||||
var theme: String by option(
|
var theme: String? by option(
|
||||||
PatchOption.StringListOption(
|
PatchOption.StringListOption(
|
||||||
key = "theme",
|
key = "theme",
|
||||||
default = null,
|
default = null,
|
||||||
|
Loading…
Reference in New Issue
Block a user