Using GSON with proguard enabled

前端 未结 5 1850
太阳男子
太阳男子 2020-12-01 03:45

My code works perfectly without proguard, but GSON doesn\'t work when proguard is enabled.

This is the part of code where it doesn\'t works

JSONArray         


        
5条回答
  •  Happy的楠姐
    2020-12-01 04:20

    You need to exclude obfuscating of your model classes like below where I excluded all model classes in package in.intellicode.webservices.models

    -keep class in.intellicode.webservices.models.** { *; }
    -keep class in.intellicode.models.** { *; }
    -keep class in.intellicode.events.*{ *; }
    
    -keepattributes Signature
    -keepattributes *Annotation*
    -keep class sun.misc.Unsafe { *; }
    

提交回复
热议问题