Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request standardizes the serialization and deserialization of data models throughout the codebase by adding
@Keepand@SerializedNameannotations to all relevant data classes and enums. These changes ensure that fields are preserved during code shrinking/obfuscation and that JSON keys are correctly mapped to Kotlin properties, improving reliability when working with Gson or similar serialization libraries.Key changes include:
Serialization/Deserialization Enhancements:
@SerializedNameannotations to all fields in data classes and enums in the following files, ensuring explicit mapping between JSON keys and Kotlin properties:DeviceSpecs.kt,Automation.kt,AppSelection.kt,DnsPreset.kt,LocationAlarm.kt,MapsChannel.kt,SnoozeChannel.kt,TrackedRepo.kt,UpdateInfo.kt,GitHubModels.kt,GitHubUser.kt[1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11]@SerializedNamefor each value, ensuring proper serialization of enum values (e.g.,Automation.Type,Action.SoundModeType) [1] [2].Obfuscation and Code Shrinking Safeguards:
@Keepannotation to all major data classes, enums, and sealed interfaces to prevent their removal or renaming during code shrinking (ProGuard/R8), which is critical for reflection-based serialization/deserialization (All references above, especially [1] [2] [3].Domain Model Consistency:
Sealed Interface Updates:
@Keepand@SerializedNameto sealed interface implementations (objects, data classes) forAction,State, andTrigger, making sure all automation logic components are serialization-safe [1] [2] [3] [4].These changes collectively make the codebase more robust and ready for safe serialization/deserialization, especially in environments where code shrinking or obfuscation is enabled.