disable stetho and add proguard-config to build release

This commit is contained in:
Felix 2017-11-05 19:24:25 +01:00
parent 641fafa417
commit 508cc8fd62
4 changed files with 53 additions and 9 deletions

View file

@ -35,7 +35,7 @@ ext{
constraintLayoutVersion = "1.0.2"
archCompVersion = "1.0.0-rc1"
minSDK = 22
targetSDK = 26
targetSDK = 27
}
task clean(type: Delete) {

View file

@ -22,6 +22,7 @@ android {
release {
shrinkResources true
minifyEnabled true
useProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'),
'proguard-rules.pro'
}
@ -81,16 +82,16 @@ dependencies {
implementation 'com.jakewharton:butterknife:8.5.1'
kapt 'com.jakewharton:butterknife-compiler:8.5.1'
debugCompile 'com.facebook.stetho:stetho:1.4.2'
debugCompile 'com.facebook.stetho:stetho-okhttp3:1.4.2'
debugImplementation 'com.facebook.stetho:stetho:1.4.2'
debugImplementation 'com.facebook.stetho:stetho-okhttp3:1.4.2'
implementation 'io.reactivex.rxjava2:rxjava:2.1.3'
implementation 'io.reactivex.rxjava2:rxandroid:2.0.1'
androidTestCompile('com.android.support.test:rules:0.5') {
androidTestImplementation('com.android.support.test:rules:0.5') {
exclude module: 'support-annotations'
}
androidTestCompile('com.android.support.test:runner:0.5') {
androidTestImplementation('com.android.support.test:runner:0.5') {
exclude module: 'support-annotations'
}
androidTestImplementation 'com.android.support.test.uiautomator:uiautomator-v18:2.1.3'

View file

@ -19,3 +19,47 @@
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
-dontwarn com.squareup.okhttp.**
# Proguard configuration for Jackson 2.x (fasterxml package instead of codehaus package)
-keep class com.fasterxml.jackson.databind.ObjectMapper {
public <methods>;
protected <methods>;
}
-keep class com.fasterxml.jackson.databind.ObjectWriter {
public ** writeValueAsString(**);
}
-keepnames class com.fasterxml.jackson.** { *; }
-dontwarn com.fasterxml.jackson.databind.**
-keep class org.jetbrains.kotlin.** { *; }
-keep class org.jetbrains.annotations.** { *; }
-keepclassmembers class ** {
@org.jetbrains.annotations.ReadOnly public *;
}
# Platform used when running on Java 8 VMs. Will not be used at runtime.
-dontwarn retrofit2.Platform$Java8
# Retain generic type information for use by reflection by converters and adapters.
-keepattributes Signature
# Retain declared checked exceptions for use by a Proxy instance.
-keepattributes Exceptions
-dontwarn javax.annotation.**
-dontwarn sun.misc.Unsafe
-dontwarn okio.**
-keep class de.nicidienase.chaosflix.common.entities.** { *; }
#retrofit
-dontwarn retrofit2.**
-keep class retrofit2.** { *; }
-keepattributes *Annotation*,Signature, Exceptions
-keepclasseswithmembers class * {
@retrofit2.http.* <methods>;
}
#endRetrofit
-keepclassmembers public class com.cypressworks.kotlinreflectionproguard.** {
public *;
}

View file

@ -1,16 +1,15 @@
package de.nicidienase.chaosflix.touch
//import com.facebook.stetho.Stetho
import android.app.Application
import android.content.Context
import com.facebook.stetho.Stetho
import de.nicidienase.chaosflix.BuildConfig
class ChaosflixApplication: Application(){
class ChaosflixApplication : Application() {
override fun onCreate() {
super.onCreate()
APPLICATION_CONTEXT = this
Stetho.initializeWithDefaults(this);
// Stetho.initializeWithDefaults(this);
}
companion object {