diff --git a/src/main/kotlin/app/revanced/patches/music/general/branding/name/CustomBrandingNamePatch.kt b/src/main/kotlin/app/revanced/patches/music/general/branding/name/CustomBrandingNamePatch.kt index 21693fbcf..8e865c5bb 100644 --- a/src/main/kotlin/app/revanced/patches/music/general/branding/name/CustomBrandingNamePatch.kt +++ b/src/main/kotlin/app/revanced/patches/music/general/branding/name/CustomBrandingNamePatch.kt @@ -25,6 +25,33 @@ import app.revanced.patcher.patch.options.PatchOption.PatchExtensions.stringPatc ) @Suppress("unused") object CustomBrandingNamePatch : ResourcePatch() { + private const val APP_NAME_NOTIFICATION = "ReVanced Extended Music" + private const val APP_NAME_LAUNCHER = "RVX Music" + + private val AppNameNotification by stringPatchOption( + key = "AppNameNotification", + default = APP_NAME_NOTIFICATION, + values = mapOf( + "Full name" to APP_NAME_NOTIFICATION, + "Short name" to APP_NAME_LAUNCHER + ), + title = "App name in notification panel", + description = "The name of the app as it appears in the notification panel.", + required = true + ) + + private val AppNameLauncher by stringPatchOption( + key = "AppNameLauncher", + default = APP_NAME_LAUNCHER, + values = mapOf( + "Full name" to APP_NAME_NOTIFICATION, + "Short name" to APP_NAME_LAUNCHER + ), + title = "App name in launcher", + description = "The name of the app as it appears in the launcher.", + required = true + ) + override fun execute(context: ResourceContext) { AppNameNotification?.let { notificationName -> @@ -48,29 +75,4 @@ object CustomBrandingNamePatch : ResourcePatch() { } ?: throw PatchException("Invalid app name.") } ?: throw PatchException("Invalid app name.") } - - private const val APP_NAME_NOTIFICATION = "ReVanced Extended Music" - private const val APP_NAME_LAUNCHER = "RVX Music" - - internal var AppNameNotification by stringPatchOption( - key = "AppNameNotification", - default = APP_NAME_NOTIFICATION, - values = mapOf( - "Full name" to APP_NAME_NOTIFICATION, - "Short name" to APP_NAME_LAUNCHER - ), - title = "App name in notification panel", - description = "The name of the app as it appears in the notification panel." - ) - - internal var AppNameLauncher by stringPatchOption( - key = "AppNameLauncher", - default = APP_NAME_LAUNCHER, - values = mapOf( - "Full name" to APP_NAME_NOTIFICATION, - "Short name" to APP_NAME_LAUNCHER - ), - title = "App name in launcher", - description = "The name of the app as it appears in the launcher." - ) } diff --git a/src/main/kotlin/app/revanced/patches/shared/patch/packagename/PackageNamePatch.kt b/src/main/kotlin/app/revanced/patches/shared/patch/packagename/PackageNamePatch.kt index 360a483ab..7d5fc8a04 100644 --- a/src/main/kotlin/app/revanced/patches/shared/patch/packagename/PackageNamePatch.kt +++ b/src/main/kotlin/app/revanced/patches/shared/patch/packagename/PackageNamePatch.kt @@ -22,7 +22,7 @@ object PackageNamePatch : ResourcePatch() { private const val CLONE_PACKAGE_NAME_YOUTUBE_MUSIC = "com.rvx.android.youtube" private const val DEFAULT_PACKAGE_NAME_YOUTUBE_MUSIC = "app.rvx.android.apps.youtube.music" - internal var PackageNameYouTube by stringPatchOption( + internal val PackageNameYouTube by stringPatchOption( key = "PackageNameYouTube", default = DEFAULT_PACKAGE_NAME_YOUTUBE, values = mapOf( @@ -30,10 +30,11 @@ object PackageNamePatch : ResourcePatch() { "Default" to DEFAULT_PACKAGE_NAME_YOUTUBE ), title = "Package name of YouTube", - description = "The name of the package to use in MicroG support" + description = "The name of the package to use in MicroG support", + required = true ) - internal var PackageNameYouTubeMusic by stringPatchOption( + internal val PackageNameYouTubeMusic by stringPatchOption( key = "PackageNameYouTubeMusic", default = DEFAULT_PACKAGE_NAME_YOUTUBE_MUSIC, values = mapOf( @@ -41,7 +42,8 @@ object PackageNamePatch : ResourcePatch() { "Default" to DEFAULT_PACKAGE_NAME_YOUTUBE_MUSIC ), title = "Package name of YouTube Music", - description = "The name of the package to use in MicroG support" + description = "The name of the package to use in MicroG support", + required = true ) override fun execute(context: ResourceContext) { diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/branding/name/CustomBrandingNamePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/branding/name/CustomBrandingNamePatch.kt index 5b0eea835..e4bb4cab9 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/branding/name/CustomBrandingNamePatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/branding/name/CustomBrandingNamePatch.kt @@ -41,6 +41,20 @@ import app.revanced.util.resources.ResourceHelper.updatePatchStatusLabel ) @Suppress("unused") object CustomBrandingNamePatch : ResourcePatch() { + private const val APP_NAME = "ReVanced Extended" + + private val AppName by stringPatchOption( + key = "AppName", + default = APP_NAME, + values = mapOf( + "Full name" to APP_NAME, + "Short name" to "RVX" + ), + title = "App name", + description = "The name of the app.", + required = true + ) + override fun execute(context: ResourceContext) { AppName?.let { @@ -61,17 +75,4 @@ object CustomBrandingNamePatch : ResourcePatch() { context.updatePatchStatusLabel(it) } ?: throw PatchException("Invalid app name.") } - - private const val APP_NAME = "ReVanced Extended" - - internal var AppName by stringPatchOption( - key = "AppName", - default = APP_NAME, - values = mapOf( - "Full name" to APP_NAME, - "Short name" to "RVX" - ), - title = "App name", - description = "The name of the app." - ) } diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/doubletaplength/DoubleTapLengthPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/doubletaplength/DoubleTapLengthPatch.kt index 87f41a1df..5951dc810 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/doubletaplength/DoubleTapLengthPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/doubletaplength/DoubleTapLengthPatch.kt @@ -40,6 +40,14 @@ import app.revanced.util.resources.ResourceUtils.copyResources ) @Suppress("unused") object DoubleTapLengthPatch : ResourcePatch() { + private val DoubleTapLengthArrays by stringPatchOption( + key = "DoubleTapLengthArrays", + default = "3, 5, 10, 15, 20, 30, 60, 120, 180", + title = "Double-tap to seek Values", + description = "A list of custom double-tap to seek lengths. Be sure to separate them with commas (,).", + required = true + ) + override fun execute(context: ResourceContext) { val arrayPath = "res/values-v21/arrays.xml" val entriesName = "double_tap_length_entries" @@ -70,11 +78,4 @@ object DoubleTapLengthPatch : ResourcePatch() { SettingsPatch.updatePatchStatus("Custom double tap length") } - - internal var DoubleTapLengthArrays by stringPatchOption( - key = "DoubleTapLengthArrays", - default = "3, 5, 10, 15, 20, 30, 60, 120, 180", - title = "Double-tap to seek Values", - description = "A list of custom double-tap to seek lengths. Be sure to separate them with commas (,)." - ) } \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/header/PremiumHeadingPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/header/PremiumHeadingPatch.kt index acb9c8054..856d6bd9e 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/header/PremiumHeadingPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/header/PremiumHeadingPatch.kt @@ -47,7 +47,7 @@ object PremiumHeadingPatch : ResourcePatch() { default = true, title = "Use premium heading", description = "Whether to use the premium heading.", - required = true, + required = true ) override fun execute(context: ResourceContext) { diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/theme/ThemePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/theme/ThemePatch.kt index 6448e9469..3f433f33c 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/theme/ThemePatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/theme/ThemePatch.kt @@ -52,8 +52,7 @@ object ThemePatch : ResourcePatch() { private const val DARK_ORANGE_COLOR = "#FF291800" private const val DARK_RED_COLOR = "#FF290000" - - internal var DarkThemeBackgroundColor by stringPatchOption( + private val DarkThemeBackgroundColor by stringPatchOption( key = "DarkThemeBackgroundColor", default = AMOLED_BLACK_COLOR, values = mapOf( @@ -68,6 +67,7 @@ object ThemePatch : ResourcePatch() { ), title = "Dark theme background color", description = "Can be a hex color (#AARRGGBB) or a color resource reference.", + required = true ) private fun getThemeString(darkThemeColor: String) = diff --git a/src/main/kotlin/app/revanced/patches/youtube/overlaybutton/general/OverlayButtonsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/overlaybutton/general/OverlayButtonsPatch.kt index d4fedea2b..b5070e810 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/overlaybutton/general/OverlayButtonsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/overlaybutton/general/OverlayButtonsPatch.kt @@ -60,11 +60,12 @@ import org.w3c.dom.Element ) @Suppress("unused") object OverlayButtonsPatch : ResourcePatch() { - internal var OutlineIcon by booleanPatchOption( + private val OutlineIcon by booleanPatchOption( key = "OutlineIcon", default = false, title = "Outline icons", - description = "Apply the outline icon" + description = "Apply the outline icon", + required = true ) override fun execute(context: ResourceContext) { diff --git a/src/main/kotlin/app/revanced/patches/youtube/utils/sponsorblock/SponsorBlockPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/utils/sponsorblock/SponsorBlockPatch.kt index f281378bf..0c280812c 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/utils/sponsorblock/SponsorBlockPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/utils/sponsorblock/SponsorBlockPatch.kt @@ -42,11 +42,12 @@ import app.revanced.util.resources.ResourceUtils.copyXmlNode ) @Suppress("unused") object SponsorBlockPatch : ResourcePatch() { - internal var OutlineIcon by booleanPatchOption( + private val OutlineIcon by booleanPatchOption( key = "OutlineIcon", default = false, title = "Outline icons", - description = "Apply the outline icon" + description = "Apply the outline icon", + required = true ) override fun execute(context: ResourceContext) {