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")
if (SettingsPatch.AddRedditSettings == "true")
if (SettingsPatch.RedditSettings == true)
context.setValue("ChatButtons")
return PatchResultSuccess()

View File

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

View File

@ -30,7 +30,7 @@ class DiscoverButtonPatch : BytecodePatch() {
updateSettingsStatus("DiscoverButtons")
if (SettingsPatch.AddRedditSettings == "true")
if (SettingsPatch.RedditSettings == true)
context.setValue("DiscoverButtons")
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
* So it has been changed so that settings can be added only through options.json
*/
if (!AddRedditSettings.equals("true"))
if (RedditSettings != true)
return PatchResultSuccess()
@ -110,10 +110,10 @@ class SettingsPatch : ResourcePatch {
}
companion object : OptionsContainer() {
internal var AddRedditSettings: String? by option(
PatchOption.StringOption(
key = "AddRedditSettings",
default = "false",
internal var RedditSettings: Boolean? by option(
PatchOption.BooleanOption(
key = "RedditSettings",
default = false,
title = "Add settings to Reddit",
description = "Defaults to false to avoid exceptions in ReVanced Manager"
)