title: How to obfuscate an Android library (.jar file) using Proguard in Eclipse
body: <p>I have seen many posts about how to obfuscate an Android application (.apk file) using ProGuard in Eclipse.  Also see <a href="http://developer.android.com/guide/developing/tools/proguard.html">http://developer.android.com/guide/developing/tools/proguard.html</a>:</p>
  
  <p>"When you <strong>build your application</strong> in release mode, either by running ant release or by using the Export Wizard in Eclipse, the build system automatically checks to see if the proguard.config property is set. If it is, ProGuard automatically processes the application's bytecode before packaging everything into <strong>an .apk file</strong>."</p>
  
  <p>But in case of exporting an Android project in a .jar file using Eclipse Export Wizard, following the described steps (of creating a file proguard.cfg, configuring proguard.config property to proguard.cfg in the file default.properties, using Export Wizard etc.) does not seem to work - I see no obfuscation of class names, etc. in the resulting jar file.  I also have the following settings in my proguard.cfg file, but I don't see any output files in my project directory or in the proguard directory (that directory is not even created).</p>
  
  <pre><code>-dump class_files.txt 
  -printseeds seeds.txt 
  -printusage unused.txt 
  -printmapping mapping.txt
  </code></pre>
  
  <p>I have even created a file project.properties in my project directory with the following line but that did not seem to entice ProGuard into action:</p>
  
  <pre><code>proguard.config=proguard.cfg
  </code></pre>
  
  <p>There are no activities defined in this project.  I am using Android 2.3.1 and Eclipse Galileo 3.5.2 on Windows.  Same results with Android 3.0.  Seems like the obfuscation step has to be somehow interjected explicitly in the Eclipse Export Wizard. I will appreciate any help or insight.  Thanks. </p>