add more aggressive proguard config (#741)
* add more aggressive proguard config * even more optimizations
This commit is contained in:
parent
b9e433c77f
commit
418c76d677
2 changed files with 45 additions and 17 deletions
|
@ -28,7 +28,7 @@ android {
|
|||
release {
|
||||
minifyEnabled true
|
||||
shrinkResources true
|
||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||
proguardFiles 'proguard-rules.pro'
|
||||
}
|
||||
debug { }
|
||||
}
|
||||
|
|
60
app/proguard-rules.pro
vendored
60
app/proguard-rules.pro
vendored
|
@ -1,20 +1,47 @@
|
|||
# Add project specific ProGuard rules here.
|
||||
# By default, the flags in this file are appended to flags specified
|
||||
# in /home/andrew/Android/Sdk/tools/proguard/proguard-android.txt
|
||||
# You can edit the include path and order by changing the proguardFiles
|
||||
# directive in build.gradle.
|
||||
#
|
||||
# For more details, see
|
||||
# http://developer.android.com/guide/developing/tools/proguard.html
|
||||
# GENERAL OPTIONS
|
||||
|
||||
# Add any project specific keep options here:
|
||||
# turn on all optimizations except those that are known to cause problems on Android
|
||||
-optimizations !code/simplification/cast,!field/*,!class/merging/*
|
||||
-optimizationpasses 6
|
||||
-allowaccessmodification
|
||||
-dontpreverify
|
||||
|
||||
# If your project uses WebView with JS, uncomment the following
|
||||
# and specify the fully qualified class name to the JavaScript interface
|
||||
# class:
|
||||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
|
||||
# public *;
|
||||
#}
|
||||
-dontusemixedcaseclassnames
|
||||
-dontskipnonpubliclibraryclasses
|
||||
-keepattributes *Annotation*
|
||||
|
||||
# For native methods, see http://proguard.sourceforge.net/manual/examples.html#native
|
||||
-keepclasseswithmembernames class * {
|
||||
native <methods>;
|
||||
}
|
||||
# keep setters in Views so that animations can still work.
|
||||
# see http://proguard.sourceforge.net/manual/examples.html#beans
|
||||
-keepclassmembers public class * extends android.view.View {
|
||||
void set*(***);
|
||||
*** get*();
|
||||
}
|
||||
# We want to keep methods in Activity that could be used in the XML attribute onClick
|
||||
-keepclassmembers class * extends android.app.Activity {
|
||||
public void *(android.view.View);
|
||||
}
|
||||
# For enumeration classes, see http://proguard.sourceforge.net/manual/examples.html#enumerations
|
||||
-keepclassmembers enum * {
|
||||
public static **[] values();
|
||||
public static ** valueOf(java.lang.String);
|
||||
}
|
||||
-keepclassmembers class * implements android.os.Parcelable {
|
||||
public static final android.os.Parcelable$Creator CREATOR;
|
||||
}
|
||||
-keepclassmembers class **.R$* {
|
||||
public static <fields>;
|
||||
}
|
||||
# The support library contains references to newer platform versions.
|
||||
# Don't warn about those in case this app is linking against an older
|
||||
# platform version. We know about them, and they are safe.
|
||||
-dontwarn android.support.**
|
||||
|
||||
|
||||
# TUSKY SPECIFIC OPTIONS
|
||||
|
||||
## for okhttp
|
||||
-dontwarn okio.**
|
||||
|
@ -50,6 +77,7 @@
|
|||
|
||||
# preserve line numbers for crash reporting
|
||||
-keepattributes SourceFile,LineNumberTable
|
||||
-renamesourcefileattribute SourceFile
|
||||
|
||||
# remove all logging from production apk
|
||||
-assumenosideeffects class android.util.Log {
|
||||
|
@ -65,4 +93,4 @@
|
|||
static void checkParameterIsNotNull(java.lang.Object, java.lang.String);
|
||||
}
|
||||
|
||||
-dontwarn com.google.errorprone.annotations.*
|
||||
-dontwarn com.google.errorprone.annotations.*
|
||||
|
|
Loading…
Reference in a new issue