fix(reddit/reddit-settings): use boolean as the type of json options

This commit is contained in:
inotia00
2023-07-07 15:37:45 +09:00
parent 30a980d354
commit e681add7cb
4 changed files with 8 additions and 8 deletions

View File

@ -30,7 +30,7 @@ class ChatButtonPatch : BytecodePatch() {
updateSettingsStatus("ChatButtons") updateSettingsStatus("ChatButtons")
if (SettingsPatch.AddRedditSettings == "true") if (SettingsPatch.RedditSettings == true)
context.setValue("ChatButtons") context.setValue("ChatButtons")
return PatchResultSuccess() return PatchResultSuccess()

View File

@ -30,7 +30,7 @@ class CreateButtonPatch : BytecodePatch() {
updateSettingsStatus("CreateButtons") updateSettingsStatus("CreateButtons")
if (SettingsPatch.AddRedditSettings == "true") if (SettingsPatch.RedditSettings == true)
context.setValue("CreateButtons") context.setValue("CreateButtons")
return PatchResultSuccess() return PatchResultSuccess()

View File

@ -30,7 +30,7 @@ class DiscoverButtonPatch : BytecodePatch() {
updateSettingsStatus("DiscoverButtons") updateSettingsStatus("DiscoverButtons")
if (SettingsPatch.AddRedditSettings == "true") if (SettingsPatch.RedditSettings == true)
context.setValue("DiscoverButtons") context.setValue("DiscoverButtons")
return PatchResultSuccess() return PatchResultSuccess()

View File

@ -39,7 +39,7 @@ class SettingsPatch : ResourcePatch {
* It is presumed to be an APKTOOL issue, but it cannot be fixed right now * It is presumed to be an APKTOOL issue, but it cannot be fixed right now
* So it has been changed so that settings can be added only through options.json * So it has been changed so that settings can be added only through options.json
*/ */
if (!AddRedditSettings.equals("true")) if (RedditSettings != true)
return PatchResultSuccess() return PatchResultSuccess()
@ -110,10 +110,10 @@ class SettingsPatch : ResourcePatch {
} }
companion object : OptionsContainer() { companion object : OptionsContainer() {
internal var AddRedditSettings: String? by option( internal var RedditSettings: Boolean? by option(
PatchOption.StringOption( PatchOption.BooleanOption(
key = "AddRedditSettings", key = "RedditSettings",
default = "false", default = false,
title = "Add settings to Reddit", title = "Add settings to Reddit",
description = "Defaults to false to avoid exceptions in ReVanced Manager" description = "Defaults to false to avoid exceptions in ReVanced Manager"
) )