Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to automatically generate proguard-android.txt?

Reading all the wonderful things the new ProGuard Improvements for Android do, I switched to to the new scheme by uncommenting the following line in a newly created project:

proguard.config=${sdk.dir}\tools\proguard\proguard-android.txt;proguard-project.txt

But when I try to export this project's APK, I am greeted with the following message:

Invalid proguard configuration file path C:\android-sdk-windows\tools\proguard\proguard-android.txt does not exist or is not a regular file

Well, I checked the directory C:\android-sdk-windows\tools\proguard and, sure enough, while this directory exists and has subdirectories and even a README file, proguard-android.txt is nowhere to be found.

BTW, I tried it with : instead of ; but that didn't seem to change anything.

Isn't Eclipse+ADT+Proguard supposed to generate this file automatically for me? What am I missing?

Also, where can I find a "standard" default set of rules for Android proguard-android.txt so that I can copy it over to its missing slot?

like image 323
Regex Rookie Avatar asked Jun 13 '12 17:06

Regex Rookie


People also ask

What is ProGuard-Android txt?

ProGuard is a tool to help minify, obfuscate, and optimize your code. It is not only especially useful for reducing the overall size of your Android application as well as removing unused classes and methods that contribute towards the intrinsic 64k method limit of Android applications.

Where can I find ProGuard-Android txt?

The getDefaultProguardFile('proguard-android. txt') method obtains the default ProGuard settings from the Android SDK tools/proguard/ folder. The proguard-android-optimize. txt file is also available in this Android SDK folder with the same rules but with optimizations enabled.

Where ProGuard-Android optimize txt?

The getDefaultProguardFile() refers default file “proguard-android. txt” which gets from the Android SDK tools/proguard/ folder. You can also use “proguard-android-optimize. txt” file for more code shrinking located on the same folder.


1 Answers

It should either be generated or come with your sdk (I think). However, here is a link to the one that I have (tools r19). http://pastebin.com/7rNJkns0

like image 103
matt5784 Avatar answered Nov 12 '22 06:11

matt5784