You can find the ProGuard GUI jar in the lib
directory of the ProGuard distribution. To run the ProGuard graphical user interface, just type:
proguardgui [-nosplash]
[configuration_file]
Alternatively, the bin
directory contains some short Linux and Windows scripts containing this command. The GUI will pop up in a window. With the -nosplash
option, you can switch off the short opening animation. If you have specified a ProGuard configuration file, it will be loaded. The GUI works like a wizard. You can edit the configuration and execute ProGuard through a few tabs:
ProGuard |
Input/Output |
Shrinking |
Obfuscation |
Optimization |
Information |
Process |
In addition, there is a tab to execute ReTrace interactively:
ReTrace |
You can freely toggle between the tabs by means of the buttons on the left-hand side of the window, or by means of the Previous and Next buttons at the bottom of the tabs. Tool tips briefly explain the purpose of the numerous options and text fields, although a basic understanding of the shrinking/optimization/obfuscation/preverification process is assumed. Please refer to the Introduction of this manual.
The ProGuard tab presents a welcome message and one important button at the bottom:
Load configuration... |
If you don't want to load an existing configuration, you can just continue creating a new configuration from scratch.
The Input/Output tab contains two lists, respectively to specify the program jars (or aars, wars, ears, zips, apks, or directories), and the library jars (or aars, wars, ears, zips, apks, or directories).
Each of these lists can be edited by means of a couple of buttons on the right-hand side:
Add input... |
Add output... |
Add... |
Edit... |
Filter... |
Remove |
Move up |
Move down |
Move to libraries |
Move to program |
Filters allow to filter files based on their names. You can specify filters for class file names and resource file names, for jar file names, for aar file names, for war file names, for ear file names, for zip file names, and for apk file names. Multiple entries in the program list only make sense when combined with filters; each output file is written to the first entry with a matching filter.
Input entries that are currently not readable are colored red.
The order of the entries in each list may matter, as the first occurrence of any duplicate entries gets precedence, just as in conventional class paths.
Corresponding configuration options:
The Shrinking tab presents a number of options that affect the shrinking step. The basic options are followed by a few lists of classes and class members (fields and methods) that must be protected from shrinking (and implicitly from obfuscation as well).
The fixed lists contain predefined entries that are typically useful for many applications. Each of these entries can be toggled by means of a check box. The text field following each entry allows to constrain the applicable classes by means of a comma-separated list of wildcarded, fully-qualified class names. The default is “*”, which means that all input classes of the corresponding type are considered.
For example, checking the Applications entry and filling in “myapplications.**” after it would mean: keep all classes that have main methods in the “myapplications” package and all of its subpackages.
The variable list at the bottom allows to define additional entries yourself. The list can be edited by means of a couple of buttons on the right-hand side:
Add... |
Edit... |
Remove |
Move up |
Move down |
The interface windows allow to specify classes, fields, and methods. They contain text fields and check boxes to constrain these items. They have Ok and Cancel buttons to apply or to cancel the operation.
For example, your application may be creating some classes dynamically using Class.forName
. You should then specify them here, so they are kept by their original names. Press the Add... button to open the class window. Fill out the fully-qualified class name in the Code text field, and press the Ok button. Repeat this for all required classes. Wildcards can be helpful to specify a large number of related classes in one go. If you want to specify all implementations of a certain interface, fill out the fully qualified interface name in the Extends/implements class instead.
For more advanced settings, it is advisable to become familiar with ProGuard‘s configuration options through the Usage section and the Examples section. We’ll suffice with a brief overview of the three dialogs provided by the GUI.
The keep class dialog appears when adding or editing new special keep entries. It has text fields and selections for specifying and constraining classes and class members to keep. The Advanced options / Basic options button at the bottom of the dialog allows to toggle showing the advanced options.
The keep field dialog appears when adding or editing fields within the above dialog. It has text fields and selections for specifying and constraining fields to keep. Again, the Advanced options / Basic options button at the bottom of the dialog allows to toggle showing the advanced options.
Similarly, the keep method dialog appears when adding or editing methods within the keep class dialog. It has text fields and selections for specifying and constraining methods to keep. Again, the Advanced options / Basic options button at the bottom of the dialog allows to toggle showing the advanced options.
Corresponding configuration options:
The Obfuscation tab presents a number of options that affect the obfuscation step. The basic options are followed by a few lists of classes and class members (fields and methods) that must be protected from obfuscation (but not necessarily from shrinking).
The lists are manipulated in the same way as in the Shrinking tab.
Corresponding configuration options:
The Optimization tab presents a number of options that affect the optimization step. The basic options are followed by a few lists of class method calls that can be removed if ProGuard can determine that their results are not being used.
The lists are manipulated in much the same way as in the Shrinking tab.
Corresponding configuration options:
The Information tab presents a number of options for preverification and targeting, and for the information that ProGuard returns when processing your code. The bottom list allows you to query ProGuard about why given classes and class members are being kept in the shrinking step.
Corresponding configuration options:
The Process tab has an output console for displaying the configuration and the messages while processing. There are three important buttons at the bottom:
View configuration |
Save configuration... |
Process! |
The ReTrace tab has a panel with a few settings, an input text area for the obfuscated stack trace, and an output console to view the de-obfuscated stack trace:
There are two buttons at the bottom:
Load stack trace... |
ReTrace! |