From d23d12aa9c380908e293ddddaf39bfb670901fd4 Mon Sep 17 00:00:00 2001 From: Konrad Pozniak Date: Sat, 8 Apr 2017 00:08:51 +0200 Subject: [PATCH] added proguard config --- app/build.gradle | 5 +++-- app/proguard-rules.pro | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+), 2 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index b05e88672..786685f03 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -14,8 +14,9 @@ android { } buildTypes { release { - minifyEnabled false - proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' + minifyEnabled true + shrinkResources true + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' } } } diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro index cf653532a..31f778d7e 100644 --- a/app/proguard-rules.pro +++ b/app/proguard-rules.pro @@ -15,3 +15,39 @@ #-keepclassmembers class fqcn.of.javascript.interface.for.webview { # public *; #} + +## for okhttp +-dontwarn okio.** + +## for picasso +-dontwarn com.squareup.okhttp.** + +## for retrofit +-dontwarn retrofit2.** +-keep class retrofit2.** { *; } +-keepattributes Signature +-keepattributes Exceptions +-keepattributes *Annotation* + +-keepclasseswithmembers class * { + @retrofit2.http.* ; +} + +-keep class com.keylesspalace.tusky.entity.** { *; } + +-keep public enum com.keylesspalace.tusky.entity.*$** { + **[] $VALUES; + public *; +} + + +# preserve line numbers for crash reporting +-keepattributes SourceFile,LineNumberTable + +# remove all logging from production apk +-assumenosideeffects class android.util.Log { + public static *** d(...); + public static *** w(...); + public static *** v(...); + public static *** i(...); +}