Graphical User Interface

You can find the ProGuard GUI jar in the lib directory of the ProGuard distribution. To run the ProGuard graphical user interface, just type:

java -jar proguardgui.jar [-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 Optionally load an existing configuration file.
Input/Output Specify the program jars and library jars.
Shrinking Specify the shrinking options.
Obfuscation Specify the obfuscation options.
Optimization Specify the optimization options.
Information Specify some options to get information.
Process View and save the resulting configuration, and run ProGuard.

In addition, there is a tab to execute ReTrace interactively:

ReTrace Set up and run ReTrace, to de-obfuscate stack traces.

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

The ProGuard tab presents a welcome message and one important button at the bottom:

Load configuration... opens a file chooser to load an existing ProGuard configuration file.

If you don't want to load an existing configuration, you can just continue creating a new configuration from scratch.

The Input/Output Tab

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... opens a file chooser to add an input entry to the list of program jars.
Add output... opens a file chooser to add an output entry to the list of program jars.
Add... opens a file chooser to add an entry to the list of library jars.
Edit... opens a file chooser to edit the selected entry in the list.
Filter... opens a text entry field to add or edit the filters of the selected entries in the list.
Remove removes the selected entries from the list.
Move up moves the selected entries one position up the list.
Move down moves the selected entries one position down the list.
Move to libraries moves the selected entries in the list of program jars to the list of library jars.
Move to program moves the selected entries in the list of library jars to the list of program jars.

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

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... opens a window to add a new entry to the list.
Edit... opens a window to edit the selected entry in the list.
Remove removes the selected entries from the list.
Move up moves the selected entries one position up the list.
Move down moves the selected entries one position down the list.

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

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

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

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

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 displays the current ProGuard configuration in the console.
Save configuration... opens a file chooser to save the current ProGuard configuration.
Process! executes ProGuard with the current configuration.

The ReTrace Tab

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... opens a file chooser to load an obfuscated stack trace.
ReTrace! executes ReTrace with the current settings.


Copyright © 2002-2014 Eric Lafortune @ Saikoa.