Re-enable proguard for release builds

It can be disabled for stables if it's not reliable.

Also enabled for debugging so that bugs don't slip into release builds.
This commit is contained in:
Daniel Martí 2015-08-15 13:18:40 -07:00
parent 3c35927085
commit 7bff114602
3 changed files with 42 additions and 5 deletions

3
.gitignore vendored
View File

@ -45,6 +45,3 @@ out
# Imported libs # Imported libs
extern/*/libs/ extern/*/libs/
extern/*/*/libs/ extern/*/*/libs/
# We don't use proguard anywhere
proguard-project.txt

View File

@ -153,8 +153,9 @@ android {
buildTypes { buildTypes {
all { all {
minifyEnabled false minifyEnabled true
shrinkResources false // requires minify (proguard) shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
} }
debug { debug {
debuggable true debuggable true

39
F-Droid/proguard-rules.pro vendored Normal file
View File

@ -0,0 +1,39 @@
-dontobfuscate
-dontoptimize
-keepattributes SourceFile,LineNumberTable,Exceptions
-keep class org.fdroid.fdroid.** {*;}
-dontskipnonpubliclibraryclassmembers
-dontwarn android.test.**
-dontwarn com.android.support.test.**
-dontwarn javax.naming.**
-dontnote android.support.**
-dontnote **ILicensingService
# The nature of the Java security suite implementations are that they use a
# lot of reflection to instantiate classes. The end result is that proguard
# excludes classes which may be required, depending on the security algorithms
# required by certain certificates.
# Reference: https://gitlab.com/fdroid/fdroidclient/issues/88
-keep class org.spongycastle.crypto.* {*;}
-keep class org.spongycastle.crypto.digests.* {*;}
-keep class org.spongycastle.crypto.encodings.* {*;}
-keep class org.spongycastle.crypto.engines.* {*;}
-keep class org.spongycastle.crypto.macs.* {*;}
-keep class org.spongycastle.crypto.modes.* {*;}
-keep class org.spongycastle.crypto.paddings.* {*;}
-keep class org.spongycastle.crypto.params.* {*;}
-keep class org.spongycastle.crypto.prng.* {*;}
-keep class org.spongycastle.crypto.signers.* {*;}
-keep class org.spongycastle.jcajce.provider.digest.** {*;}
-keep class org.spongycastle.jcajce.provider.keystore.** {*;}
-keep class org.spongycastle.jcajce.provider.symmetric.** {*;}
-keep class org.spongycastle.jcajce.spec.* {*;}
-keep class org.spongycastle.jce.** {*;}
# This keeps class members used for SystemInstaller IPC.
# Reference: https://gitlab.com/fdroid/fdroidclient/issues/79
-keepclassmembers class * implements android.os.IInterface {
public *;
}