diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/theme/bytecode/patch/ThemeBytecodePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/theme/bytecode/patch/ThemeBytecodePatch.kt index 1b23a13d25..6ad060057e 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/theme/bytecode/patch/ThemeBytecodePatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/theme/bytecode/patch/ThemeBytecodePatch.kt @@ -8,9 +8,7 @@ import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.data.toMethodWalker import app.revanced.patcher.extensions.addInstructions import app.revanced.patcher.extensions.instruction -import app.revanced.patcher.patch.BytecodePatch -import app.revanced.patcher.patch.PatchResult -import app.revanced.patcher.patch.PatchResultSuccess +import app.revanced.patcher.patch.* import app.revanced.patcher.patch.annotations.DependsOn import app.revanced.patcher.patch.annotations.Patch import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod @@ -71,7 +69,25 @@ class ThemeBytecodePatch : BytecodePatch( return PatchResultSuccess() } - private companion object { + companion object : OptionsContainer() { private const val INTEGRATIONS_CLASS_DESCRIPTOR = "Lapp/revanced/integrations/patches/theme/ThemePatch;" + + var darkThemeBackgroundColor: String? by option( + PatchOption.StringOption( + key = "darkThemeBackgroundColor", + default = "@android:color/black", + title = "Background color for the dark theme", + description = "The background color of the dark theme. Can be a hex color or a resource reference.", + ) + ) + + var lightThemeBackgroundColor: String? by option( + PatchOption.StringOption( + key = "lightThemeBackgroundColor", + default = "@android:color/white", + title = "Background color for the light theme", + description = "The background color of the light theme. Can be a hex color or a resource reference.", + ) + ) } } diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/theme/resource/ThemeResourcePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/theme/resource/ThemeResourcePatch.kt index 599ae3d990..2c45e70f1c 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/theme/resource/ThemeResourcePatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/theme/resource/ThemeResourcePatch.kt @@ -1,12 +1,17 @@ package app.revanced.patches.youtube.layout.theme.resource import app.revanced.patcher.data.ResourceContext -import app.revanced.patcher.patch.* +import app.revanced.patcher.patch.PatchResult +import app.revanced.patcher.patch.PatchResultError +import app.revanced.patcher.patch.PatchResultSuccess +import app.revanced.patcher.patch.ResourcePatch import app.revanced.patcher.patch.annotations.DependsOn import app.revanced.patches.shared.mapping.misc.patch.ResourceMappingPatch import app.revanced.patches.shared.settings.preference.impl.InputType import app.revanced.patches.shared.settings.preference.impl.StringResource import app.revanced.patches.shared.settings.preference.impl.TextPreference +import app.revanced.patches.youtube.layout.theme.bytecode.patch.ThemeBytecodePatch.Companion.darkThemeBackgroundColor +import app.revanced.patches.youtube.layout.theme.bytecode.patch.ThemeBytecodePatch.Companion.lightThemeBackgroundColor import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch import app.revanced.util.resources.ResourceUtils import app.revanced.util.resources.ResourceUtils.copyResources @@ -67,25 +72,7 @@ class ThemeResourcePatch : ResourcePatch { return PatchResultSuccess() } - companion object : OptionsContainer() { - internal var inlineTimeBarColorizedBarPlayedColorDarkId = -1L - - var darkThemeBackgroundColor: String? by option( - PatchOption.StringOption( - key = "darkThemeBackgroundColor", - default = "@android:color/black", - title = "Background color for the dark theme", - description = "The background color of the dark theme. Can be a hex color or a resource reference.", - ) - ) - - var lightThemeBackgroundColor: String? by option( - PatchOption.StringOption( - key = "lightThemeBackgroundColor", - default = "@android:color/white", - title = "Background color for the light theme", - description = "The background color of the light theme. Can be a hex color or a resource reference.", - ) - ) + internal companion object { + var inlineTimeBarColorizedBarPlayedColorDarkId = -1L } }