diff options
4 files changed, 19 insertions, 10 deletions
diff --git a/platform/android/MapboxGLAndroidSDK/proguard-rules.pro b/platform/android/MapboxGLAndroidSDK/proguard-rules.pro index ddd7730ac4..96f7bb95f3 100644 --- a/platform/android/MapboxGLAndroidSDK/proguard-rules.pro +++ b/platform/android/MapboxGLAndroidSDK/proguard-rules.pro @@ -1,7 +1,7 @@ # By default, the flags in this file are appended to flags specified # in ../sdk/tools/proguard/proguard-android.txt, # contents of this file will be appended into proguard-android.txt --keepattributes Signature, *Annotation* +-keepattributes Signature, *Annotation*, EnclosingMethod # Square okio, ignoring warnings, # see https://github.com/square/okio/issues/60 @@ -10,7 +10,7 @@ # Gesture package -keep class almeros.android.multitouch.gesturedetectors.** { *; } -# Package: annotations +# Package annotations -keep class com.mapbox.mapboxsdk.annotations.** { *; } # Package camera @@ -25,6 +25,9 @@ # Package maps -keep class com.mapbox.mapboxsdk.maps.** { *; } +# Package net +-keep class com.mapbox.mapboxsdk.net.** { *; } + # Package offline -keep class com.mapbox.mapboxsdk.offline.** { *; } diff --git a/platform/android/MapboxGLAndroidSDKTestApp/build.gradle b/platform/android/MapboxGLAndroidSDKTestApp/build.gradle index f247b41b24..859740e212 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/build.gradle +++ b/platform/android/MapboxGLAndroidSDKTestApp/build.gradle @@ -88,9 +88,9 @@ dependencies { compile "com.android.support:recyclerview-v7:${supportLibVersion}" // Leak Canary - androidTestCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.4-beta2' - debugCompile 'com.squareup.leakcanary:leakcanary-android:1.4-beta2' - releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.4-beta2' + debugCompile 'com.squareup.leakcanary:leakcanary-android:1.5' + releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5' + testCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5' // Mapbox Android Services compile('com.mapbox.mapboxsdk:mapbox-android-services:1.3.0@aar') { diff --git a/platform/android/MapboxGLAndroidSDKTestApp/proguard-rules.pro b/platform/android/MapboxGLAndroidSDKTestApp/proguard-rules.pro index fbeca9f23b..49c6038041 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/proguard-rules.pro +++ b/platform/android/MapboxGLAndroidSDKTestApp/proguard-rules.pro @@ -1,7 +1,5 @@ # Mapbox ProGuard configuration is handled in the SDK --keep class android.support.** { *; } --dontwarn com.squareup.** --dontwarn com.retrofit.** +-dontwarn android.support.** -dontwarn java.lang.** -dontwarn org.codehaus.** -keep class com.google.** diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/MapboxApplication.java b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/MapboxApplication.java index 16329f5d44..5b4c730cfb 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/MapboxApplication.java +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/MapboxApplication.java @@ -11,12 +11,18 @@ public class MapboxApplication extends Application { @Override public void onCreate() { super.onCreate(); - MapboxAccountManager.start(getApplicationContext(), getString(R.string.mapbox_access_token)); + + if (LeakCanary.isInAnalyzerProcess(this)) { + // This process is dedicated to LeakCanary for heap analysis. + // You should not init your app in this process. + return; + } LeakCanary.install(this); + StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder() .detectDiskReads() .detectDiskWrites() - .detectNetwork() // or .detectAll() for all detectable problems + .detectNetwork() .penaltyLog() .build()); StrictMode.setVmPolicy(new StrictMode.VmPolicy.Builder() @@ -24,5 +30,7 @@ public class MapboxApplication extends Application { .penaltyLog() .penaltyDeath() .build()); + + MapboxAccountManager.start(getApplicationContext(), getString(R.string.mapbox_access_token)); } } |