2

I read the android documentation for using proguard that says "if we specify proguard.config property it will run proguard " However I have specified this property, to confirm i checked this in echoproperties but still my files are not obfuscated. I am not sure if I am missing something. Any help is appreciated.

Thanks, Manan

CommonMan
  • 3,868
  • 2
  • 24
  • 35
  • How are you validating that it is not obfuscated? Did you build as 'release'? – cistearns Mar 08 '12 at 08:32
  • I think if proguard is run it will generate mapping.txt etc files and also my apk filesize should be somewhat lesser – CommonMan Mar 08 '12 at 08:33
  • What does your proguard.cfg file look like? The output from the build should have some information if it tried to run and encountered a problem with the config file. – cistearns Mar 08 '12 at 08:55

4 Answers4

3

The documentation on android.developer.com about proguard is not complete. You may also need to set

android:debuggable="false" 

in the AndroidManifest.xml file

I found that I needed to do this in addition to specifying the config file in project.properties

Then after running ant release it will run proguard. The manual only says that android debug will not generate proguard, but it does not make it clear that you cannot even have debuggable set to true.

Code Droid
  • 10,344
  • 17
  • 72
  • 112
0

My guess is that you're using Eclipse. Simply add the following line to your project.propeties file:

proguard.config=proguard.cfg
Vaiden
  • 15,728
  • 7
  • 61
  • 91
0

here are the steps

  1. Enable the proguard.config in project.properties file

    enter image description here

  2. create proguard-project.txt file, it should be shown as below

    enter image description here

  3. run "ant release"

Community
  • 1
  • 1
Mustafa Güven
  • 15,526
  • 11
  • 63
  • 83
0

Check this link.it will help you about Proguard and how to build [Proguard]

ANT build for Android Proguard obfuscation

Community
  • 1
  • 1
  • While that does cover some details, it is not really up to date with the latest tools. The current SDK has ProGuard support built into the auto generated ANT build files (using the android command). http://developer.android.com/guide/developing/tools/proguard.html – cistearns Mar 08 '12 at 08:51