Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
3 tasks done
oSumAtrIX opened this issue Apr 17, 2024 · 0 comments · Fixed by ReVanced/revanced-patcher#298
Open
3 tasks done
Labels
Bug report Something isn't working

Comments

@oSumAtrIX
Copy link
Member

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

  • This issue is not a duplicate of an existing bug report.
  • I have chosen an appropriate title.
  • All requested information has been provided properly.
@oSumAtrIX oSumAtrIX added the Bug report Something isn't working label Apr 17, 2024
@oSumAtrIX oSumAtrIX linked a pull request Jun 10, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug report Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant