diff --git a/patches/src/main/kotlin/app/revanced/patches/music/utils/settings/SettingsPatch.kt b/patches/src/main/kotlin/app/revanced/patches/music/utils/settings/SettingsPatch.kt index ce7fab878..5f017a0d7 100644 --- a/patches/src/main/kotlin/app/revanced/patches/music/utils/settings/SettingsPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/music/utils/settings/SettingsPatch.kt @@ -123,12 +123,11 @@ private val settingsBytecodePatch = bytecodePatch( EXTENSION_UTILS_CLASS_DESCRIPTOR, "setActivity" ) - } } -private const val DEFAULT_LABEL = "ReVanced Extended" -private lateinit var customName: String +private const val DEFAULT_LABEL = "RVX" +private lateinit var settingsLabel: String val settingsPatch = resourcePatch( SETTINGS_FOR_YOUTUBE_MUSIC.title, @@ -140,9 +139,13 @@ val settingsPatch = resourcePatch( settingsBytecodePatch, ) - val settingsLabel = stringOption( - key = "settingsLabel", + val rvxSettingsLabel = stringOption( + key = "rvxSettingsLabel", default = DEFAULT_LABEL, + values = mapOf( + "ReVanced Extended" to "ReVanced Extended", + "RVX" to DEFAULT_LABEL, + ), title = "RVX settings label", description = "The name of the RVX settings menu.", required = true, @@ -152,7 +155,7 @@ val settingsPatch = resourcePatch( /** * check patch options */ - customName = settingsLabel + settingsLabel = rvxSettingsLabel .valueOrThrow() /** @@ -220,13 +223,13 @@ val settingsPatch = resourcePatch( * change RVX settings menu name * since it must be invoked after the Translations patch, it must be the last in the order. */ - if (customName != DEFAULT_LABEL) { + if (settingsLabel != DEFAULT_LABEL) { removeStringsElements( arrayOf("revanced_extended_settings_title") ) document("res/values/strings.xml").use { document -> mapOf( - "revanced_extended_settings_title" to customName + "revanced_extended_settings_title" to settingsLabel ).forEach { (k, v) -> val stringElement = document.createElement("string") diff --git a/patches/src/main/kotlin/app/revanced/patches/reddit/utils/settings/SettingsPatch.kt b/patches/src/main/kotlin/app/revanced/patches/reddit/utils/settings/SettingsPatch.kt index ae28725f9..c1f775a53 100644 --- a/patches/src/main/kotlin/app/revanced/patches/reddit/utils/settings/SettingsPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/reddit/utils/settings/SettingsPatch.kt @@ -137,7 +137,7 @@ internal fun updatePatchStatus( updatePatchStatus(patch) } -private const val DEFAULT_LABEL = "ReVanced Extended" +private const val DEFAULT_LABEL = "RVX" val settingsPatch = resourcePatch( SETTINGS_FOR_REDDIT.title, @@ -150,9 +150,13 @@ val settingsPatch = resourcePatch( settingsBytecodePatch ) - val settingsLabelOption = stringOption( + val rvxSettingsLabel = stringOption( key = "settingsLabel", default = DEFAULT_LABEL, + values = mapOf( + "ReVanced Extended" to "ReVanced Extended", + "RVX" to DEFAULT_LABEL, + ), title = "RVX settings menu name", description = "The name of the RVX settings menu.", required = true @@ -162,7 +166,7 @@ val settingsPatch = resourcePatch( /** * Replace settings icon and label */ - val settingsLabel = settingsLabelOption + val settingsLabel = rvxSettingsLabel .valueOrThrow() arrayOf( diff --git a/patches/src/main/kotlin/app/revanced/patches/youtube/utils/settings/SettingsPatch.kt b/patches/src/main/kotlin/app/revanced/patches/youtube/utils/settings/SettingsPatch.kt index 5a0854b44..e3cb03bdd 100644 --- a/patches/src/main/kotlin/app/revanced/patches/youtube/utils/settings/SettingsPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/youtube/utils/settings/SettingsPatch.kt @@ -79,7 +79,7 @@ private val settingsBytecodePatch = bytecodePatch( } private const val DEFAULT_ELEMENT = "@string/about_key" -private const val DEFAULT_LABEL = "ReVanced Extended" +private const val DEFAULT_LABEL = "RVX" private val SETTINGS_ELEMENTS_MAP = mapOf( "Parent settings" to "@string/parent_tools_key", @@ -106,7 +106,7 @@ private val SETTINGS_ELEMENTS_MAP = mapOf( "About" to DEFAULT_ELEMENT ) -private lateinit var customName: String +private lateinit var settingsLabel: String val settingsPatch = resourcePatch( SETTINGS_FOR_YOUTUBE.title, @@ -131,9 +131,13 @@ val settingsPatch = resourcePatch( required = true, ) - val settingsLabel = stringOption( - key = "settingsLabel", + val rvxSettingsLabel = stringOption( + key = "rvxSettingsLabel", default = DEFAULT_LABEL, + values = mapOf( + "ReVanced Extended" to "ReVanced Extended", + "RVX" to DEFAULT_LABEL, + ), title = "RVX settings label", description = "The name of the RVX settings menu.", required = true, @@ -143,7 +147,7 @@ val settingsPatch = resourcePatch( /** * check patch options */ - customName = settingsLabel + settingsLabel = rvxSettingsLabel .valueOrThrow() val insertKey = insertPosition @@ -258,13 +262,13 @@ val settingsPatch = resourcePatch( * change RVX settings menu name * since it must be invoked after the Translations patch, it must be the last in the order. */ - if (customName != DEFAULT_LABEL) { + if (settingsLabel != DEFAULT_LABEL) { removeStringsElements( arrayOf("revanced_extended_settings_title") ) document("res/values/strings.xml").use { document -> mapOf( - "revanced_extended_settings_title" to customName + "revanced_extended_settings_title" to settingsLabel ).forEach { (k, v) -> val stringElement = document.createElement("string") diff --git a/patches/src/main/resources/music/settings/host/values/strings.xml b/patches/src/main/resources/music/settings/host/values/strings.xml index 012bc0f24..bd6dc52d8 100644 --- a/patches/src/main/resources/music/settings/host/values/strings.xml +++ b/patches/src/main/resources/music/settings/host/values/strings.xml @@ -1,7 +1,7 @@ - ReVanced Extended + RVX Reset to default values. diff --git a/patches/src/main/resources/youtube/settings/host/values/strings.xml b/patches/src/main/resources/youtube/settings/host/values/strings.xml index 5d837ef61..cf61a1fc3 100644 --- a/patches/src/main/resources/youtube/settings/host/values/strings.xml +++ b/patches/src/main/resources/youtube/settings/host/values/strings.xml @@ -5,7 +5,7 @@ Your controls are modified because an accessibility service is on. - ReVanced Extended + RVX Search %s Reset to default values.