BearND has uploaded a new change for review. https://gerrit.wikimedia.org/r/179174
Change subject: Enable basic ProGuard minification ...................................................................... Enable basic ProGuard minification We can make the ProGuard config more aggressive later. Want to keep it on the lighter side initially. This is mainly driven by the desire to fix the bugs mentioned below. Bug: T78197 Bug: T76279 Change-Id: Ic91e83e6dc4d25780dc8815318aba2e2a0c009fb --- M wikipedia/build.gradle M wikipedia/proguard-rules.pro 2 files changed, 60 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/apps/android/wikipedia refs/changes/74/179174/1 diff --git a/wikipedia/build.gradle b/wikipedia/build.gradle index a4f3329..90f2360 100644 --- a/wikipedia/build.gradle +++ b/wikipedia/build.gradle @@ -17,7 +17,7 @@ } buildTypes { release { - minifyEnabled false + minifyEnabled true proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' signingConfig signingConfigs.release } diff --git a/wikipedia/proguard-rules.pro b/wikipedia/proguard-rules.pro index 200fdff..a5c166b 100644 --- a/wikipedia/proguard-rules.pro +++ b/wikipedia/proguard-rules.pro @@ -15,3 +15,62 @@ #-keepclassmembers class fqcn.of.javascript.interface.for.webview { # public *; #} + +### +# from https://github.com/ACRA/acra/wiki/ProGuard +#ACRA specifics +# Restore some Source file names and restore approximate line numbers in the stack traces, +# otherwise the stack traces are pretty useless +-keepattributes SourceFile,LineNumberTable + +# ACRA needs "annotations" so add this... +# Note: This may already be defined in the default "proguard-android-optimize.txt" +# file in the SDK. If it is, then you don't need to duplicate it. See your +# "project.properties" file to get the path to the default "proguard-android-optimize.txt". +-keepattributes *Annotation* + +-keepattributes Signature + +## instead of the remaining ACRA proguard config: just keep all classes for now +-keep class org.acra.** {*;} + +### +# Other libraries: + +# https://github.com/square/okio/issues/60 +-dontwarn okio.** + +-dontwarn com.squareup.okhttp.** +-dontnote com.squareup.okhttp.internal.Platform + +-keep class com.nineoldandroids.animation.** {*;} +-keep class com.nineoldandroids.util.Property {*;} + +-keep class com.mobsandgeeks.saripaar.** {*;} + +-keep class com.squareup.picasso.** {*;} + +-keep class uk.co.senab.photoview.** {*;} + +-keep class com.github.kevinsawicki.http.** {*;} + +### +# Android support libraries: + +# https://phabricator.wikimedia.org/T78197: +# NoClassDefFoundError: android.support.v7.internal.view.menu.MenuBuilder +# http://stackoverflow.com/questions/26657348/appcompat-v7-v21-0-0-causing-crash-on-samsung-devices-with-android-v4-2-2 +# Allow obfuscation of android.support.v7.internal.view.menu.** but not the rest of android.support +# to avoid problem on Samsung 4.2.2 devices with appcompat v21 +# see https://code.google.com/p/android/issues/detail?id=78377#hc150 +-keep class !android.support.v7.internal.view.menu.MenuBuilder +-keep class !android.support.v7.internal.view.menu.SubMenuBuilder + +-dontnote android.support.v4.text.ICUCompatIcs + +#-dontwarn android.support.** + +### +# Our code: +-keep class org.wikipedia.** {*;} +-keep class org.mediawiki.api.json.** {*;} -- To view, visit https://gerrit.wikimedia.org/r/179174 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic91e83e6dc4d25780dc8815318aba2e2a0c009fb Gerrit-PatchSet: 1 Gerrit-Project: apps/android/wikipedia Gerrit-Branch: master Gerrit-Owner: BearND <bsitzm...@wikimedia.org> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits