Enable proguard's minify and fix warnings to be able to create the apks.

This commit is contained in:
Severiano Jaramillo 2019-02-11 15:21:24 -06:00
parent 21c6b776af
commit 5465dcaa44
3 changed files with 56 additions and 13 deletions

View file

@ -28,15 +28,12 @@ android {
} }
buildTypes { buildTypes {
release { release {
// TODO Fix minify issues and enable again minifyEnabled true
minifyEnabled false
shrinkResources false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
// enable crashlytics // enable crashlytics
ext.enableCrashlytics = true ext.enableCrashlytics = true
} }
debug { debug {
// TODO enabling minify breaks the debugger breakpoints, find a way to fix it and enable minify again
minifyEnabled false minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
resValue("string", "PORT_NUMBER", "8082") resValue("string", "PORT_NUMBER", "8082")

View file

@ -20,13 +20,59 @@
# hide the original source file name. # hide the original source file name.
#-renamesourcefileattribute SourceFile #-renamesourcefileattribute SourceFile
-dontwarn sun.misc.Unsafe ###### itextpdf & opencsv
-dontwarn org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement -dontwarn java.awt.**
-dontwarn org.bitcoinj.store** -dontwarn javax.security.**
-dontwarn org.slf4j.** -dontwarn java.beans.**
-dontwarn okhttp3.internal.platform.*
# Firabase Crashlytics -dontwarn com.itextpdf.awt.**
-dontwarn javax.imageio.**
-keep class org.bouncycastle.**
-dontwarn org.bouncycastle.**
-keep class org.spongycastle.** { *; }
-dontwarn org.spongycastle.**
-keep class javax.xml.crypto.dsig.** { *; }
-dontwarn javax.xml.crypto.dsig.**
-keep class org.apache.jcp.xml.dsig.internal.dom.** { *; }
-dontwarn org.apache.jcp.xml.dsig.internal.dom.**
-keep class javax.xml.crypto.dom.** { *; }
-dontwarn javax.xml.crypto.dom.**
-keep class org.apache.xml.security.utils.** { *; }
-dontwarn org.apache.xml.security.utils.**
-keep class javax.xml.crypto.XMLStructure
-dontwarn javax.xml.crypto.XMLStructure
###### OkHttp
# JSR 305 annotations are for embedding nullability information.
-dontwarn javax.annotation.**
# A resource is loaded with a relative path so the package of this class must be preserved.
-keepnames class okhttp3.internal.publicsuffix.PublicSuffixDatabase
# Animal Sniffer compileOnly dependency to ensure APIs are compatible with older versions of Java.
-dontwarn org.codehaus.mojo.animal_sniffer.*
# OkHttp platform used only on JVM and when Conscrypt dependency is available.
-dontwarn okhttp3.internal.platform.ConscryptPlatform
###### bitcoinj
-dontwarn org.bitcoinj.store**
###### ???
-dontwarn org.slf4j.**
###### Firabase Crashlytics
-keepattributes *Annotation* -keepattributes *Annotation*
-keepattributes SourceFile,LineNumberTable -keepattributes SourceFile,LineNumberTable
-keep public class * extends java.lang.Exception -keep public class * extends java.lang.Exception

View file

@ -1,7 +1,7 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules. // Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript { buildscript {
ext.kotlin_version = '1.3.20' ext.kotlin_version = '1.3.21'
ext.nav_version = '1.0.0-beta01' ext.nav_version = '1.0.0-beta01'
repositories { repositories {
google() google()
@ -12,11 +12,11 @@ buildscript {
} }
dependencies { dependencies {
classpath 'com.android.tools.build:gradle:3.3.0' classpath 'com.android.tools.build:gradle:3.3.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "android.arch.navigation:navigation-safe-args-gradle-plugin:$nav_version" classpath "android.arch.navigation:navigation-safe-args-gradle-plugin:$nav_version"
classpath 'com.google.gms:google-services:4.2.0' classpath 'com.google.gms:google-services:4.2.0'
classpath 'io.fabric.tools:gradle:1.27.0' classpath 'io.fabric.tools:gradle:1.27.1'
// NOTE: Do not place your application dependencies here; they belong // NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files // in the individual module build.gradle files