From 508cc8fd628dfa1da33119ee4d21fc9245fea3bc Mon Sep 17 00:00:00 2001 From: Felix Date: Sun, 5 Nov 2017 19:24:25 +0100 Subject: [PATCH] disable stetho and add proguard-config to build release --- build.gradle | 2 +- touch/build.gradle | 9 ++-- touch/proguard-rules.pro | 44 +++++++++++++++++++ .../chaosflix/touch/ChaosflixApplication.kt | 7 ++- 4 files changed, 53 insertions(+), 9 deletions(-) diff --git a/build.gradle b/build.gradle index 2611b9dd..bd825f93 100644 --- a/build.gradle +++ b/build.gradle @@ -35,7 +35,7 @@ ext{ constraintLayoutVersion = "1.0.2" archCompVersion = "1.0.0-rc1" minSDK = 22 - targetSDK = 26 + targetSDK = 27 } task clean(type: Delete) { diff --git a/touch/build.gradle b/touch/build.gradle index f45c5709..fc833f39 100644 --- a/touch/build.gradle +++ b/touch/build.gradle @@ -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' diff --git a/touch/proguard-rules.pro b/touch/proguard-rules.pro index f1b42451..94668a66 100644 --- a/touch/proguard-rules.pro +++ b/touch/proguard-rules.pro @@ -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 ; + protected ; +} +-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.* ; +} +#endRetrofit + +-keepclassmembers public class com.cypressworks.kotlinreflectionproguard.** { + public *; +} \ No newline at end of file diff --git a/touch/src/main/java/de/nicidienase/chaosflix/touch/ChaosflixApplication.kt b/touch/src/main/java/de/nicidienase/chaosflix/touch/ChaosflixApplication.kt index 4151908c..d797373b 100644 --- a/touch/src/main/java/de/nicidienase/chaosflix/touch/ChaosflixApplication.kt +++ b/touch/src/main/java/de/nicidienase/chaosflix/touch/ChaosflixApplication.kt @@ -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 {