android 混淆打包后 Gson拿到的实体类转换异常
16lz
2021-01-23
配置gson混淆(复制下面这段到混淆文件):##---------------Begin: proguard configuration for Gson ----------# Gson uses generic type information stored in a class file when working with fields. Proguard# removes such information by default, so configure it to keep all of it.-keepattributes Signature# For using GSON @Expose annotation-keepattributes *Annotation*# Gson specific classes-keep class sun.misc.Unsafe { *; }#-keep class com.google.gson.stream.** { *; }# Application classes that will be serialized/deserialized over Gson-keep class com.xxx.entity.** { *; }##---------------End: proguard configuration for Gson ----------
注意:上面倒数第二行是防止你的实体类被混淆, com.xxx.entity. 是你实体类的包路径
更多相关文章
- android 根据Uri获取文件绝对路径
- android: content URI的真实路径获取
- Android将Uri转化为文件路径的方法
- 安卓各文件存储路径汇总(Android file path)
- Android Bluetooth 文件接收路径修改方法
- android获取各种系统路径的方法
- 关于android中的各种路径对应的方法
- Delphi处理Android的路径信息
- Android根据文件路径加载指定文件