summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCameron Mace <cameron@mapbox.com>2016-12-13 15:20:15 -0500
committerGitHub <noreply@github.com>2016-12-13 15:20:15 -0500
commit642b9692aeaf348abef7d75cfbd9117d6d7d7dd4 (patch)
tree87169b391bb58d1130c2c7047fb59265f043a2a7
parente40cdc6e8b64b555e82429df16653f7658d4da4e (diff)
downloadqtlocation-mapboxgl-642b9692aeaf348abef7d75cfbd9117d6d7d7dd4.tar.gz
Fixed proguard rules (#7389) (#7407)
* fixed proguard rules * disabled proguard for debug testapp builds * removed dontobfuscate and fixed gson issue
-rw-r--r--platform/android/MapboxGLAndroidSDK/proguard-rules.pro48
-rw-r--r--platform/android/MapboxGLAndroidSDKTestApp/build.gradle2
2 files changed, 47 insertions, 3 deletions
diff --git a/platform/android/MapboxGLAndroidSDK/proguard-rules.pro b/platform/android/MapboxGLAndroidSDK/proguard-rules.pro
index 96f7bb95f3..92ef05df68 100644
--- a/platform/android/MapboxGLAndroidSDK/proguard-rules.pro
+++ b/platform/android/MapboxGLAndroidSDK/proguard-rules.pro
@@ -5,6 +5,7 @@
# Square okio, ignoring warnings,
# see https://github.com/square/okio/issues/60
+-dontwarn okhttp3.**
-dontwarn okio.**
# Gesture package
@@ -38,7 +39,48 @@
# Package telemetry
-keep class com.mapbox.mapboxsdk.telemetry.** { *; }
-# Keep external project mapbox-java,
-# Needs to be removed after https://github.com/mapbox/mapbox-java/issues/178 is resolved
--keep class com.mapbox.services.** { *; }
+#
+# Mapbox-java Proguard rules
+# We include these rules since libjava is a Jar file not AAR
+#
+# Retrofit 2
+# Platform calls Class.forName on types which do not exist on Android to determine platform.
+-dontnote retrofit2.Platform
+# Platform used when running on RoboVM on iOS. Will not be used at runtime.
+-dontnote retrofit2.Platform$IOS$MainThreadExecutor
+# Platform used when running on Java 8 VMs. Will not be used at runtime.
+-dontwarn retrofit2.Platform$Java8
+# Retain generic type information for use by reflection by converters and adapters.
+-keepattributes Signature
+# Retain declared checked exceptions for use by a Proxy instance.
+-keepattributes Exceptions
+
+# For using GSON @Expose annotation
+-keepattributes *Annotation*
+# Gson specific classes
+-dontwarn sun.misc.**
+
+# Prevent proguard from stripping interface information from TypeAdapterFactory,
+# JsonSerializer, JsonDeserializer instances (so they can be used in @JsonAdapter)
+-keep class * implements com.google.gson.TypeAdapterFactory
+-keep class * implements com.google.gson.JsonSerializer
+-keep class * implements com.google.gson.JsonDeserializer
+
+# MAS Data Models
+-keep class com.mapbox.services.commons.geojson.** { *; }
+-keep class com.mapbox.services.mapmatching.v4.models.** { *; }
+-keep class com.mapbox.services.distance.v1.models.** { *; }
+-keep class com.mapbox.services.directions.v4.models.** { *; }
+-keep class com.mapbox.services.directions.v5.models.** { *; }
+-keep class com.mapbox.services.geocoding.v5.models.** { *; }
+
+-dontwarn javax.annotation.**
+
+-keepclassmembers class rx.internal.util.unsafe.** {
+ long producerIndex;
+ long consumerIndex;
+}
+
+-keep class com.google.** { *; }
+-dontwarn com.google.** \ No newline at end of file
diff --git a/platform/android/MapboxGLAndroidSDKTestApp/build.gradle b/platform/android/MapboxGLAndroidSDKTestApp/build.gradle
index f5f4ec3f54..40a2186d65 100644
--- a/platform/android/MapboxGLAndroidSDKTestApp/build.gradle
+++ b/platform/android/MapboxGLAndroidSDKTestApp/build.gradle
@@ -67,6 +67,8 @@ android {
debug {
// run code coverage reports
testCoverageEnabled = true
+ minifyEnabled false
+ proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
release {
minifyEnabled false