Fix proguard removing too much.

Signed-off-by: Yahor Berdnikau <egorr.berd@gmail.com>
This commit is contained in:
Yahor Berdnikau 2018-03-21 22:10:37 +01:00
parent 5f77cf40dc
commit 52a5ceb5d6
5 changed files with 35 additions and 2 deletions

View File

@ -21,16 +21,19 @@ android {
release { release {
minifyEnabled true minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), proguardFiles getDefaultProguardFile('proguard-android.txt'),
'minify/proguard-main.pro',
'minify/proguard-okhttp.pro', 'minify/proguard-okhttp.pro',
'minify/proguard-retrofit.pro', 'minify/proguard-retrofit.pro',
'minify/proguard-jackson.pro' 'minify/proguard-jackson.pro',
'minify/proguard-kotlin-reflect.pro',
'minify/proguard-kotlin.pro'
} }
debug { debug {
minifyEnabled false minifyEnabled false
testCoverageEnabled true testCoverageEnabled true
applicationIdSuffix ".debug"
} }
} }
sourceSets { sourceSets {
main.java.srcDirs += "${projectDir}/src/main/kotlin" main.java.srcDirs += "${projectDir}/src/main/kotlin"
test.java.srcDirs += "${projectDir}/src/test/kotlin" test.java.srcDirs += "${projectDir}/src/test/kotlin"

View File

@ -9,3 +9,13 @@
} }
-dontwarn com.fasterxml.jackson.databind.** -dontwarn com.fasterxml.jackson.databind.**
-keep class org.codehaus.** { *; } -keep class org.codehaus.** { *; }
-keepclassmembers class * extends com.fasterxml.jackson.databind.JsonDeserializer {
*;
}
-keepclassmembers public class * {
@com.fasterxml.jackson.annotation.JsonCreator *;
@com.fasterxml.jackson.annotation.JsonProperty *;
@com.fasterxml.jackson.databind.annotation.JsonDeserialize *;
}

View File

@ -0,0 +1,12 @@
-keep class kotlin.Metadata { *; }
-keep class kotlin.reflect.** { *; }
-keepclassmembers public class com.company[obfuscated].domain.api.models.** {
public synthetic <methods>;
}
-keep class org.jetbrains.kotlin.** { *; }
-keep class org.jetbrains.annotations.** { *; }
-keepclassmembers class ** {
@org.jetbrains.annotations.ReadOnly public *;
}

View File

@ -0,0 +1,4 @@
-dontwarn kotlin.**
-keepclassmembers class **$WhenMappings {
<fields>;
}

View File

@ -0,0 +1,4 @@
-dontobfuscate
### Don't remove subsonic api serializers/entities
-keep class org.moire.ultrasonic.api.subsonic.response.** { *; }