'My Request JSON keys (Data class propertis) are getting changed to "a", "b" autometically when I install my app from playstore

Issue Details: I recently developed and uploaded my Android app to the play store. When I install my app through Android-Studio (simply by running the project) it works fine, also if I creates signed APK locally and intalls it manually on my device, then also it works fine. But, when I installs same app from playstore, I found my reuest JSON's keys are getting changed and thats why login API is failing and users are not able to login to the app.

Below is the expected request JSON-

{"customer_password":"pass1234","mobile_number":"9876543210"}

Below is the request JSON when I installs app from play-store-

 {"a":"9876543210","b":"pass123456"}

Below is my Data/Model class

data class LoginRequest(
    var mobile_number: String,
    var customer_password: String,
)

Is it happening because of "minifyEnabled true"?

Also, please let me know in case you need more details on the same. Thank you!



Solution 1:[1]

yes it was happening because you minifyEnable = true and your proguard rules to prevent this you can use @keep annotation on your class

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 rizkidzulkarnain