revanced-library icon indicating copy to clipboard operation
revanced-library copied to clipboard

bug: Array options can't be set due to type casting error

Open oSumAtrIX opened this issue 1 year ago • 0 comments

Bug description

Arrays from the options JSON file are cast as List, but options with value type StringArray are Array. This causes an exception being thrown due to types: https://github.com/ReVanced/revanced-library/blob/main/src/main/kotlin/app/revanced/library/Options.kt#L84to be

Error logs

No response

Solution

Instead of dynamically deserializing the JSON with gson, a typed serializer can be used such as Kotlinx.serializer. Instead of dynamically deserializing the JSON with son, a typed serializer can be used, such as Kotlinx.serializer.

Additional context

No response

Acknowledgements

  • [X] This issue is not a duplicate of an existing bug report.
  • [X] I have chosen an appropriate title.
  • [X] All requested information has been provided properly.

oSumAtrIX avatar Apr 17 '24 22:04 oSumAtrIX