mirror of
https://github.com/inotia00/revanced-patches.git
synced 2025-06-13 13:47:42 +02:00
chore(Settings): Change the default value of the patch option RVX settings label
to RVX
This commit is contained in:
@ -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")
|
||||
|
||||
|
@ -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(
|
||||
|
@ -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")
|
||||
|
||||
|
Reference in New Issue
Block a user