Re-enable minification and add a custom proguard-android-optimize ruleset

Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
This commit is contained in:
Harsh Shandilya
2021-03-27 13:41:28 +05:30
parent a489aefead
commit 7df8b04521
2 changed files with 38 additions and 0 deletions

View File

@@ -96,8 +96,10 @@ android {
}
release {
minifyEnabled true
shrinkResources true
versionNameSuffix ".release"
proguardFiles "proguard-android-optimize.txt", "proguard.flags"
}
}

View File

@@ -0,0 +1,36 @@
-allowaccessmodification
-dontpreverify
-dontusemixedcaseclassnames
-dontskipnonpubliclibraryclasses
-verbose
-keepattributes *Annotation*
-keepclasseswithmembernames class * {
native <methods>;
}
-keepclassmembers enum * {
public static **[] values();
public static ** valueOf(java.lang.String);
}
-keepclassmembers class * implements android.os.Parcelable {
public static final ** CREATOR;
}
-keep class androidx.annotation.Keep
-keep @androidx.annotation.Keep class * {*;}
-keepclasseswithmembers class * {
@androidx.annotation.Keep <methods>;
}
-keepclasseswithmembers class * {
@androidx.annotation.Keep <fields>;
}
-keepclasseswithmembers class * {
@androidx.annotation.Keep <init>(...);
}