From 6b4ea7140446ca8aa28793f9d7b4368f8243e504 Mon Sep 17 00:00:00 2001 From: Rodrigo Damazio Date: Fri, 10 Dec 2010 15:39:48 -0200 Subject: [PATCH] Enabling Proguard to reduce APK size. --- .hgignore | 1 + MyTracks/default.properties | 1 + MyTracks/proguard.cfg | 10 ++++++++++ SignalStrengthSampler/default.properties | 1 + 4 files changed, 13 insertions(+) diff --git a/.hgignore b/.hgignore index 7220e4cb0..3bf9706a8 100644 --- a/.hgignore +++ b/.hgignore @@ -2,5 +2,6 @@ syntax:glob */bin */gen/** +*/proguard/** .metadata MyTracksTest/annotations.log diff --git a/MyTracks/default.properties b/MyTracks/default.properties index fcf640319..8a7ac55df 100644 --- a/MyTracks/default.properties +++ b/MyTracks/default.properties @@ -11,4 +11,5 @@ split.density=false # Project target. target=Google Inc.:Google APIs:9 +proguard.config=proguard.cfg android.library.reference.1=../MyTracksLib/ diff --git a/MyTracks/proguard.cfg b/MyTracks/proguard.cfg index 8ad7d3352..7a2867d7e 100644 --- a/MyTracks/proguard.cfg +++ b/MyTracks/proguard.cfg @@ -1,3 +1,4 @@ +-target 6 -optimizationpasses 5 -dontusemixedcaseclassnames -dontskipnonpubliclibraryclasses @@ -5,9 +6,18 @@ -verbose -optimizations !code/simplification/arithmetic,!field/*,!class/merging/* +# Add the libraries, but ignore warnings about them +-libraryjars libs +-libraryjars ../MyTracksLib/libs +-dontwarn com.google.android.googleapps.** +-dontwarn com.android.common.** +-dontwarn com.google.android.gsf.** + +# Keep everything android references from XMLs -keep public class * extends android.app.Activity -keep public class * extends android.app.Application -keep public class * extends android.app.Service +-keep public class * extends android.app,backup.BackupAgent -keep public class * extends android.content.BroadcastReceiver -keep public class * extends android.content.ContentProvider -keep public class com.android.vending.licensing.ILicensingService diff --git a/SignalStrengthSampler/default.properties b/SignalStrengthSampler/default.properties index a74312af5..903536e41 100644 --- a/SignalStrengthSampler/default.properties +++ b/SignalStrengthSampler/default.properties @@ -9,4 +9,5 @@ # Project target. target=Google Inc.:Google APIs:9 +proguard.config=proguard.cfg android.library.reference.1=../MyTracksLib/