Graphical User Interface

To run the ProGuard graphical user interface, just type:

java -jar proguardgui.jar [-nosplash] [configuration_file]

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 Load an existing configuration file.
Input Specify the input jars, resource jars, and library jars.
Keep Specify what ProGuard should keep.
Output Specify the output jars and any special options.
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.

 

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 Tab

The Input tab has three lists, respectively to specify the input jars (or directories), the resource jars (or directories), and the library jars (or directories):

Each of these lists can be edited by means of a couple of buttons on the right-hand side:

Add... opens a file chooser to add a jar or directory to the list.
Edit... opens a file chooser to edit the selected entry in the list.
Filter... opens a text entry field to add or edit the filter 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.
Copy to resources copies the selected entries in the list of program jars to the list of resource jars.
Move to program moves the selected entries in the list of library jars to the list of program jars.

Filters allow to filter the files from the specified jars or directories, based on the file names.

The order of the jars and directories 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 Keep Tab

The Keep tab has a fixed list and a variable list of classes and class members (fields and methods) that must be protected from shrinking and/or from obfuscation.

The fixed list contains 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 a main method in the "myapplications" package and any of its subpackages.

The Special 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 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.

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.

Corresponding configuration options:

 

The Output Tab

The Output tab has a list the specify the output jars or directories, and a couple of panels with various settings.

The list of output jars can be edited by means of a couple of buttons on the right-hand side, identical to those on the Keep tab. Filters allow to filter the output files, based on their names. Multiple entries in this list only make sense when combined with filters; each output file is written to the first entry with a matching filter.

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-2003 Eric Lafortune.