diff --git a/corelibrary/build.gradle b/corelibrary/build.gradle index 68c3504..1c09787 100644 --- a/corelibrary/build.gradle +++ b/corelibrary/build.gradle @@ -18,7 +18,7 @@ android { buildTypes { release { - minifyEnabled false + minifyEnabled true proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' } } diff --git a/corelibrary/proguard-rules.pro b/corelibrary/proguard-rules.pro index f1b4245..0ade3e0 100644 --- a/corelibrary/proguard-rules.pro +++ b/corelibrary/proguard-rules.pro @@ -19,3 +19,118 @@ # If you keep the line number information, uncomment this to # hide the original source file name. #-renamesourcefileattribute SourceFile +-verbose +-optimizationpasses 5 + +# Kotlin +# COMMON KOTLIN +-dontnote kotlin.** +-dontwarn kotlin.** +-keepclassmembernames class kotlinx.** { + volatile ; +} +-dontnote kotlinx.** +-keep class kotlinx.coroutines.** + +# retrofit +-keepattributes Signature +-dontwarn retrofit2.** +-keep class retrofit2.** { *; } +-keepattributes Exceptions +-keepclasseswithmembers class * { + @retrofit2.http.* ; +} +-dontnote retrofit2.Platform +-dontnote retrofit2.Platform$IOS$MainThreadExecutor +-dontwarn retrofit2.Platform$Java8 +-dontwarn retrofit.RxSupport* +-dontwarn retrofit.appengine.UrlFetchClient +-dontnote retrofit.http.RestMethod +-keepclasseswithmembers class * { + @retrofit2.* ; +} +-keepclasseswithmembers interface * { + @retrofit2.* ; +} + +# okhttp +-dontwarn okio.** +-dontwarn javax.annotation.Nullable +-dontwarn javax.annotation.ParametersAreNonnullByDefault +-dontwarn javax.annotation.** + +#rxjava +-dontwarn sun.misc.** + +#crashlytic +-keepattributes *Annotation* +-keepattributes SourceFile,LineNumberTable +-keep class com.crashlytics.** { *; } +-dontwarn com.crashlytics.** + +-keepclassmembers class rx.internal.util.unsafe.*ArrayQueue*Field* { + long producerIndex; + long consumerIndex; +} + +#dagger +-dontwarn com.google.errorprone.annotations.* + +-keepclassmembers class rx.internal.util.unsafe.BaseLinkedQueueProducerNodeRef { + rx.internal.util.atomic.LinkedQueueNode producerNode; +} + +-keepclassmembers class rx.internal.util.unsafe.BaseLinkedQueueConsumerNodeRef { + rx.internal.util.atomic.LinkedQueueNode consumerNode; +} + +-dontnote rx.internal.util.PlatformDependent + +#-keep class id.co.binar.binarapp.model.** {*;} +#-keep class id.co.binar.binarapp.utils.CommonUtil {*;} +#-keep class id.co.binar.binarapp.utils.BinarSignature {*;} + +#gson +-keep class com.google.gson.stream.** { *; } +-keep class com.google.gson.* { *; } +-keep public class com.google.gson.** { + public private protected *; +} +-keep class com.google.appengine.** { *; } +-keep class * implements com.google.gson.TypeAdapterFactory +-keep class * implements com.google.gson.JsonSerializer +-keep class * implements com.google.gson.JsonDeserializer +-keep class com.google.gson.* { *; } +-keep class com.google.inject.* { *; } +-keep class sun.misc.Unsafe { *; } +-keep class com.google.gson.stream.** { *; } +-keepclassmembers enum * { *; } +-keep,allowobfuscation @interface com.google.gson.annotations.* +-dontnote com.google.gson.annotations.Expose +-keepclassmembers class * { + @com.google.gson.annotations.Expose ; +} +-keepclasseswithmembers,allowobfuscation,includedescriptorclasses class * { + @com.google.gson.annotations.Expose ; +} +-dontnote com.google.gson.annotations.SerializedName +-keepclasseswithmembers,allowobfuscation,includedescriptorclasses class * { + @com.google.gson.annotations.SerializedName ; +} +-keepclassmembers enum * { + @com.google.gson.annotations.SerializedName ; +} + +## RX2 +-dontnote io.reactivex.** + +#OKHTTP3 +-dontwarn okhttp3.** + +-keep public class * implements com.bumptech.glide.module.GlideModule +-keep public enum com.bumptech.glide.load.resource.bitmap.ImageHeaderParser$** { + **[] $VALUES; + public *; +} + + diff --git a/gradle.properties b/gradle.properties index 85be9ea..b75ae29 100644 --- a/gradle.properties +++ b/gradle.properties @@ -12,4 +12,8 @@ org.gradle.jvmargs=-Xmx1536m # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects # org.gradle.parallel=true # Kotlin code style for this project: "official" or "obsolete": +org.gradle.daemon=false +org.gradle.parallel=true +org.gradle.configureondemand=true +android.enableBuildScriptClasspathCheck=false kotlin.code.style=official