1- # Retrofit 2
1+ # Retrofit 2 (https://square.github.io/retrofit/#ProGuard)
22# Platform calls Class.forName on types which do not exist on Android to determine platform.
33-dontnote retrofit2.Platform
44# Platform used when running on RoboVM on iOS. Will not be used at runtime.
1010# Retain declared checked exceptions for use by a Proxy instance.
1111-keepattributes Exceptions
1212
13+ # Gson (https://github.com/google/gson/blob/master/examples/android-proguard-example/proguard.cfg)
14+ # Gson uses generic type information stored in a class file when working with fields. Proguard
15+ # removes such information by default, so configure it to keep all of it.
16+ -keepattributes Signature
17+
1318# For using GSON @Expose annotation
1419-keepattributes *Annotation*
20+
1521# Gson specific classes
16- -dontwarn sun.misc.**
22+ -keep class sun.misc.Unsafe { *; }
23+ #-keep class com.google.gson.stream.** { *; }
1724
1825# Prevent proguard from stripping interface information from TypeAdapterFactory,
1926# JsonSerializer, JsonDeserializer instances (so they can be used in @JsonAdapter)
2027-keep class * implements com.google.gson.TypeAdapterFactory
2128-keep class * implements com.google.gson.JsonSerializer
2229-keep class * implements com.google.gson.JsonDeserializer
2330
24- # MAS Data Models
25- -keep class com.mapbox.services.mapmatching.v4 .models.** { *; }
26- -keep class com.mapbox.services.distance.v1.models.** { *; }
27- -keep class com.mapbox.services.directions.v4 .models.** { *; }
28- -keep class com.mapbox.services.directions .v5.models.** { *; }
29- -keep class com.mapbox.services.geocoding.v5.models .** { *; }
31+ # MAS data models that will be serialized/deserialized over Gson
32+ -keep class com.mapbox.services.api.directions.v5 .models.** { *; }
33+ -keep class com.mapbox.services.api. distance.v1.models.** { *; }
34+ -keep class com.mapbox.services.api.geocoding.v5 .models.** { *; }
35+ -keep class com.mapbox.services.api.mapmatching .v5.models.** { *; }
36+ -keep class com.mapbox.services.commons.geojson .** { *; }
3037
3138-dontwarn javax.annotation.**
3239
33- -keepclassmembers class rx.internal.util.unsafe.** {
34- long producerIndex;
35- long consumerIndex;
36- }
37-
3840-keep class com.google.**
39- -dontwarn com.google.**
41+ -dontwarn com.google.**
0 commit comments