fix: patch options are not required in the RVX Manager

This commit is contained in:
inotia00 2024-06-11 23:32:57 +09:00
parent 672034ba24
commit 428c6b18fe
15 changed files with 50 additions and 22 deletions

View File

@ -78,7 +78,8 @@ object LayoutComponentsPatch : BaseBytecodePatch(
key = "ForceHideVoiceSearchButton",
default = false,
title = "Force hide voice search button",
description = "Permanently hide the voice search button with the legacy method."
description = "Permanently hide the voice search button with the legacy method.",
required = true
)
override fun execute(context: BytecodeContext) {

View File

@ -109,20 +109,23 @@ object CustomBrandingIconPatch : BaseResourcePatch(
${launcherIconResourceFileNames.joinToString("\n") { "- $it" }}
""".trimIndentMultiline(),
required = true
)
private val ChangeHeader by booleanPatchOption(
key = "ChangeHeader",
default = false,
title = "Change header",
description = "Apply the custom branding icon to the header."
description = "Apply the custom branding icon to the header.",
required = true
)
private val ChangeSplashIcon by booleanPatchOption(
key = "ChangeSplashIcon",
default = true,
title = "Change splash icons",
description = "Apply the custom branding icon to the splash screen."
description = "Apply the custom branding icon to the splash screen.",
required = true
)
override fun execute(context: ResourceContext) {

View File

@ -27,6 +27,7 @@ object CustomBrandingNamePatch : BaseResourcePatch(
),
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(
@ -40,6 +41,7 @@ object CustomBrandingNamePatch : BaseResourcePatch(
),
title = "App name in launcher",
description = "The name of the app as it appears in the launcher.",
required = true
)
override fun execute(context: ResourceContext) {

View File

@ -29,14 +29,16 @@ object TranslationsPatch : BaseResourcePatch(
description = """
The path to the 'strings.xml' file.
Please note that applying the 'strings.xml' file will overwrite all existing language translations.
""".trimIndent()
""".trimIndent(),
required = true
)
private var SelectedTranslations by stringPatchOption(
key = "SelectedTranslations",
default = TRANSLATIONS.joinToString(", "),
title = "Translations to add",
description = "A list of translations to be added for the RVX settings, separated by commas."
description = "A list of translations to be added for the RVX settings, separated by commas.",
required = true
)
private var SelectedStringResources by stringPatchOption(
@ -48,7 +50,8 @@ object TranslationsPatch : BaseResourcePatch(
String resources not in the list will be removed from the app.
Default string resource, English, is not removed.
""".trimIndent()
""".trimIndent(),
required = true
)
override fun execute(context: ResourceContext) {

View File

@ -25,7 +25,8 @@ object CustomBrandingNamePatch : BaseResourcePatch(
"Original" to ORIGINAL_APP_NAME,
),
title = "App name",
description = "The name of the app."
description = "The name of the app.",
required = true
)
override fun execute(context: ResourceContext) {

View File

@ -30,7 +30,8 @@ object ChangePackageNamePatch : BaseResourcePatch(
"Original" to PACKAGE_NAME_REDDIT,
),
title = "Package name of Reddit",
description = "The name of the package to rename the app to."
description = "The name of the package to rename the app to.",
required = true
)
override fun execute(context: ResourceContext) {

View File

@ -86,7 +86,8 @@ object ToolBarComponentsPatch : BaseBytecodePatch(
key = "ForceHideVoiceSearchButton",
default = false,
title = "Force hide voice search button",
description = "Permanently hide the voice search button with the legacy method."
description = "Permanently hide the voice search button with the legacy method.",
required = true
)
override fun execute(context: BytecodeContext) {

View File

@ -27,7 +27,8 @@ object ShortsActionButtonsPatch : BaseResourcePatch(
DEFAULT_ICON_KEY to "round"
),
title = "Shorts icon style ",
description = "The style of the icons for the action buttons in the Shorts player."
description = "The style of the icons for the action buttons in the Shorts player.",
required = true
)
override fun execute(context: ResourceContext) {

View File

@ -125,13 +125,15 @@ object CustomBrandingIconPatch : BaseResourcePatch(
${launcherIconResourceFileNames.joinToString("\n") { "- $it" }}
""".trimIndentMultiline(),
required = true
)
private val ChangeHeader by booleanPatchOption(
key = "ChangeHeader",
default = false,
title = "Change header",
description = "Apply the custom branding icon to the header."
description = "Apply the custom branding icon to the header.",
required = true
)
private val CustomHeader by stringPatchOption(
@ -152,20 +154,23 @@ object CustomBrandingIconPatch : BaseResourcePatch(
The image dimensions must be as follows:
${headerResourceDirectoryNames.map { (dpi, dim) -> "- $dpi: $dim" }.joinToString("\n")}
""".trimIndentMultiline(),
required = true
)
private val ChangeSplashIcon by booleanPatchOption(
key = "ChangeSplashIcon",
default = true,
title = "Change splash icons",
description = "Apply the custom branding icon to the splash screen."
description = "Apply the custom branding icon to the splash screen.",
required = true
)
private val RestoreOldSplashAnimation by booleanPatchOption(
key = "RestoreOldSplashAnimation",
default = false,
title = "Restore old splash animation",
description = "Restores old style splash animation."
description = "Restores old style splash animation.",
required = true
)
// endregion

View File

@ -28,7 +28,8 @@ object CustomBrandingNamePatch : BaseResourcePatch(
"YouTube" to "YouTube",
),
title = "App name",
description = "The name of the app."
description = "The name of the app.",
required = true
)
override fun execute(context: ResourceContext) {

View File

@ -71,6 +71,7 @@ object ThemePatch : BaseResourcePatch(
),
title = "Light theme background color",
description = "Can be a hex color (#AARRGGBB) or a color resource reference.",
required = true
)
private fun getThemeString(

View File

@ -28,14 +28,16 @@ object TranslationsPatch : BaseResourcePatch(
description = """
The path to the 'strings.xml' file.
Please note that applying the 'strings.xml' file will overwrite all existing translations.
""".trimIndent()
""".trimIndent(),
required = true
)
private var SelectedTranslations by stringPatchOption(
key = "SelectedTranslations",
default = TRANSLATIONS.joinToString(", "),
title = "Translations to add",
description = "A list of translations to be added for the RVX settings, separated by commas."
description = "A list of translations to be added for the RVX settings, separated by commas.",
required = true
)
private var SelectedStringResources by stringPatchOption(
@ -47,7 +49,8 @@ object TranslationsPatch : BaseResourcePatch(
String resources not in the list will be removed from the app.
Default string resource, English, is not removed.
""".trimIndent()
""".trimIndent(),
required = true
)
override fun execute(context: ResourceContext) {

View File

@ -32,7 +32,8 @@ object VisualPreferencesIconsPatch : BaseResourcePatch(
"ReVanced Colored" to "revanced_colored",
),
title = "RVX settings menu icon",
description = "Apply different icons for RVX settings menu."
description = "Apply different icons for RVX settings menu.",
required = true
)
override fun execute(context: ResourceContext) {

View File

@ -52,7 +52,8 @@ object OverlayButtonsPatch : BaseResourcePatch(
default = DEFAULT_ICON_KEY,
values = iconTypes,
title = "Icon type",
description = "The icon type."
description = "The icon type.",
required = true
)
// Option to set bottom margin
@ -64,7 +65,8 @@ object OverlayButtonsPatch : BaseResourcePatch(
"Default" to DEFAULT_MARGIN
),
title = "Bottom margin",
description = "The bottom margin for the overlay buttons and timestamp."
description = "The bottom margin for the overlay buttons and timestamp.",
required = true
)
/**

View File

@ -71,14 +71,16 @@ object SettingsPatch : BaseResourcePatch(
default = DEFAULT_ELEMENT,
values = SETTINGS_ELEMENTS_MAP,
title = "Insert position",
description = "The settings menu name that the RVX settings menu should be above."
description = "The settings menu name that the RVX settings menu should be above.",
required = true
)
private val RVXSettingsMenuName by stringPatchOption(
key = "RVXSettingsMenuName",
default = DEFAULT_NAME,
title = "RVX settings menu name",
description = "The name of the RVX settings menu."
description = "The name of the RVX settings menu.",
required = true
)
internal lateinit var contexts: ResourceContext