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

@Id obfuscated by proguard even after excluding the annotation #236

Open
SivaramSS opened this issue Apr 1, 2020 · 2 comments
Open

@Id obfuscated by proguard even after excluding the annotation #236

SivaramSS opened this issue Apr 1, 2020 · 2 comments

Comments

@SivaramSS
Copy link

Hi,
I'm using jsonapi-converter in my Android Project. I have used @id annotation in many of my model classes. I'm facing the following issue in my network calls with Proguard enabled App.

com.fasterxml.jackson.databind.JsonMappingException: Can not find a (Map) Key deserializer for type [simple type, class java.lang.reflect.Field]

Upon decompiling the APK, i find that the @id annotation is obfuscated into com.github.jasminb.jsonapi.annotations.C0899Id even after excluding it from ProGuard.

Screenshot 2020-04-01 at 6 59 00 PM

Here are my ProGuard rules:

# jsonapi -keepclassmembers class * { @com.github.jasminb.jsonapi.annotations.Id <fields>; @com.github.jasminb.jsonapi.annotations.Meta <fields>; @com.github.jasminb.jsonapi.annotations.Type <fields>; @com.github.jasminb.jsonapi.annotations.Relationship <fields>; @com.github.jasminb.jsonapi.annotations.Links <fields>; } -keep class com.siva.screenrecorder.model.** {*;}

Kindly help in resolving this issue. Thanks in advance.

@jasminb
Copy link
Owner

jasminb commented Apr 1, 2020

Please see proguard tips in README.md.

@SivaramSS
Copy link
Author

@jasminb Thanks for getting back

I have changed the rules according to the README.md to following. The Issue still pesists.

-keepclassmembers class * { @com.github.jasminb.jsonapi.annotations.Id <fields>; } -keep class * implements com.github.jasminb.jsonapi.ResourceIdHandler -keep class com.siva.screenrecorder.model.** {*;}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants