Home | History | Annotate | Download | only in manual
      1 <!doctype html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
      2 <html>
      3 <head>
      4 <meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
      5 <meta http-equiv="content-style-type" content="text/css">
      6 <link rel="stylesheet" type="text/css" href="style.css">
      7 <title>ProGuard GUI</title>
      8 <script type="text/javascript" language="JavaScript">
      9 <!--
     10 if (window.self==window.top)
     11   window.top.location.replace("../index.html#"+window.location.pathname+window.location.hash);
     12 else {
     13   var hash="#"+window.location.pathname.replace(window.top.location.pathname.replace("index.html", ""), "");
     14   if (window.top.location.hash!=hash)
     15     window.top.location.hash=hash;
     16 }
     17 //-->
     18 </script>
     19 </head>
     20 <body>
     21 
     22 <h2>Graphical User Interface</h2>
     23 
     24 You can find the ProGuard GUI jar in the <code>lib</code> directory of the
     25 ProGuard distribution. To run the ProGuard graphical user interface, just type:
     26 <p class="code">
     27 <code><b>java -jar proguardgui.jar</b> [-nosplash] </code>[<i>configuration_file</i>]
     28 </p>
     29 Alternatively, the <code>bin</code> directory contains some short Linux and
     30 Windows scripts containing this command. The GUI will pop up in a window. With
     31 the <code>-nosplash</code> option, you can switch off the short opening
     32 animation. If you have specified a ProGuard configuration file, it will be
     33 loaded. The GUI works like a wizard. You can edit the configuration and
     34 execute ProGuard through a few tabs:
     35 <p>
     36 
     37 <table cellspacing="5" cellpadding="5">
     38 <tr><td class="button"><a href="#proguard">ProGuard</a></td>
     39     <td>Optionally load an existing configuration file.</td></tr>
     40 <tr><td class="button"><a href="#inputoutput">Input/Output</a></td>
     41     <td>Specify the program jars and library jars.</td></tr>
     42 <tr><td class="button"><a href="#shrinking">Shrinking</a></td>
     43     <td>Specify the shrinking options.</td></tr>
     44 <tr><td class="button"><a href="#obfuscation">Obfuscation</a></td>
     45     <td>Specify the obfuscation options.</td></tr>
     46 <tr><td class="button"><a href="#optimization">Optimization</a></td>
     47     <td>Specify the optimization options.</td></tr>
     48 <tr><td class="button"><a href="#information">Information</a></td>
     49     <td>Specify some options to get information.</td></tr>
     50 <tr><td class="button"><a href="#process">Process</a></td>
     51     <td>View and save the resulting configuration, and run ProGuard.</td></tr>
     52 </table>
     53 <p>
     54 
     55 In addition, there is a tab to execute ReTrace interactively:
     56 <p>
     57 
     58 <table cellspacing="5" cellpadding="5">
     59 <tr><td class="button"><a href="#retrace">ReTrace</a></td>
     60     <td>Set up and run ReTrace, to de-obfuscate stack traces.</td></tr>
     61 </table>
     62 <p>
     63 
     64 You can freely toggle between the tabs by means of the buttons on the
     65 left-hand side of the window, or by means of the <b>Previous</b> and
     66 <b>Next</b> buttons at the bottom of the tabs. Tool tips briefly explain the
     67 purpose of the numerous options and text fields, although a basic
     68 understanding of the shrinking/optimization/obfuscation/preverification
     69 process is assumed. Please refer to the <a
     70 href="introduction.html">Introduction</a> of this manual.
     71 <p>
     72 
     73 <h2><a name="proguard">The ProGuard Tab</a></h2>
     74 
     75 The <i>ProGuard</i> tab presents a welcome message and one important button at
     76 the bottom:
     77 <p>
     78 
     79 <table cellspacing="5" cellpadding="5">
     80 <tr><td class="button">Load configuration...</td>
     81     <td>opens a file chooser to load an existing ProGuard configuration
     82     file.</td></tr>
     83 </table>
     84 <p>
     85 
     86 If you don't want to load an existing configuration, you can just continue
     87 creating a new configuration from scratch.
     88 <p>
     89 
     90 <h2><a name="inputoutput">The Input/Output Tab</a></h2>
     91 
     92 The <i>Input/Output</i> tab contains two lists, respectively to specify the
     93 program jars (or wars, ears, zips, or directories), and the library jars (or
     94 wars, ears, zips, or directories).
     95 
     96 <ul>
     97 <li>The list of program jars contains input entries and output entries. Input
     98     entries contain the class files and resource files to be processed. Output
     99     entries specify the destinations to which the processed results will be
    100     written. They are preceded by arrows, to distinguish them from input
    101     entries. The results of each consecutive list of input entries will be
    102     written to the subsequent consecutive list of output entries.</li>
    103 
    104 <li>The library jars are not copied to the output jars; they contain class
    105     files that are used by class files in the program jars and that are
    106     necessary for correct processing. This list typically at least contains the
    107     targeted Java runtime jar.</li>
    108 </ul>
    109 <p>
    110 
    111 Each of these lists can be edited by means of a couple of buttons on the
    112 right-hand side:
    113 <p>
    114 
    115 <table cellspacing="5" cellpadding="5">
    116 <tr><td class="button">Add input...</td> <td>opens a file chooser to add an
    117     input entry to the list of program jars.</td></tr>
    118 <tr><td class="button">Add output...</td> <td>opens a file chooser to add an
    119     output entry to the list of program jars.</td></tr>
    120 <tr><td class="button">Add...</td>
    121     <td>opens a file chooser to add an entry to the list of library
    122     jars.</td></tr>
    123 <tr><td class="button">Edit...</td>
    124     <td>opens a file chooser to edit the selected entry in the list.</td></tr>
    125 <tr><td class="button">Filter...</td>
    126     <td>opens a text entry field to add or edit the filters of the selected
    127     entries in the list.</td></tr>
    128 <tr><td class="button">Remove</td>
    129     <td>removes the selected entries from the list.</td></tr>
    130 <tr><td class="button">Move up</td>
    131     <td>moves the selected entries one position up the list.</td></tr>
    132 <tr><td class="button">Move down</td>
    133     <td>moves the selected entries one position down the list.</td></tr>
    134 <tr><td class="button">Move to libraries</td>
    135     <td>moves the selected entries in the list of program jars to the list of
    136     library jars.</td></tr>
    137 <tr><td class="button">Move to program</td>
    138     <td>moves the selected entries in the list of library jars to the list of
    139     program jars.</td></tr>
    140 </table>
    141 <p>
    142 
    143 Filters allow to filter files based on their names. One can specify filters
    144 for class file names and resource file names, for jar file names, for war file
    145 names, for ear file names, and for zip file names. Multiple entries in the
    146 program list only make sense when combined with filters; each output file is
    147 written to the first entry with a matching filter.
    148 <p>
    149 
    150 Input entries that are currently not readable are colored red.
    151 <p>
    152 
    153 The order of the entries in each list may matter, as the first occurrence of
    154 any duplicate entries gets precedence, just as in conventional class paths.
    155 <p>
    156 
    157 Corresponding configuration options:
    158 <ul type="none">
    159 <li>-<a href="usage.html#injars">injars</a></li>
    160 <li>-<a href="usage.html#outjars">outjars</a></li>
    161 <li>-<a href="usage.html#libraryjars">libraryjars</a></li>
    162 <li><a href="usage.html#classpath"><i>class_path</i></a></li>
    163 <li><a href="usage.html#filters"><i>filters</i></a></li>
    164 </ul>
    165 <p>
    166 
    167 <h2><a name="shrinking">The Shrinking Tab</a></h2>
    168 
    169 The <i>Shrinking</i> tab presents a number of options that affect the
    170 shrinking step. The basic options are followed by a few lists of classes and
    171 class members (fields and methods) that must be protected from shrinking (and
    172 implicitly from obfuscation as well).
    173 <p>
    174 
    175 The fixed lists contain predefined entries that are typically useful for many
    176 applications. Each of these entries can be toggled by means of a check box.
    177 The text field following each entry allows to constrain the applicable classes
    178 by means of a comma-separated list of wildcarded, fully-qualified class
    179 names. The default is "*", which means that all input classes of the
    180 corresponding type are considered.
    181 <p>
    182 
    183 For example, checking the <b>Applications</b> entry and filling in
    184 "myapplications.**" after it would mean: keep all classes that have main
    185 methods in the "myapplications" package and all of its subpackages.
    186 <p>
    187 
    188 The variable list at the bottom allows to define additional entries
    189 yourself. The list can be edited by means of a couple of buttons on the
    190 right-hand side:
    191 <p>
    192 
    193 <table cellspacing="5" cellpadding="5">
    194 <tr><td class="button">Add...</td>
    195     <td>opens a window to add a new entry to the list.</td></tr>
    196 <tr><td class="button">Edit...</td>
    197     <td>opens a window to edit the selected entry in the list.</td></tr>
    198 <tr><td class="button">Remove</td>
    199     <td>removes the selected entries from the list.</td></tr>
    200 <tr><td class="button">Move up</td>
    201     <td>moves the selected entries one position up the list.</td></tr>
    202 <tr><td class="button">Move down</td>
    203     <td>moves the selected entries one position down the list.</td></tr>
    204 </table>
    205 <p>
    206 
    207 The interface windows allow to specify classes, fields, and methods. They
    208 contain text fields and check boxes to constrain these items. They have
    209 <b>Ok</b> and <b>Cancel</b> buttons to apply or to cancel the operation.
    210 <p>
    211 
    212 For example, your application may be creating some classes dynamically using
    213 <code>Class.forName</code>. You should then specify them here, so they are kept
    214 by their original names. Press the <b>Add...</b> button to open the class
    215 window. Fill out the fully-qualified class name in the <b>Code</b> text field,
    216 and press the <b>Ok</b> button. Repeat this for all required classes. Wildcards
    217 can be helpful to specify a large number of related classes in one go. If you
    218 want to specify all implementations of a certain interface, fill out the
    219 fully qualified interface name in the <b>Extends/implements class</b> instead.
    220 <p>
    221 
    222 For more advanced settings, it is advisable to become familiar with ProGuard's
    223 configuration options through the <a href="usage.html">Usage section</a> and
    224 the <a href="examples.html">Examples section</a>.  We'll suffice with a brief
    225 overview of the three dialogs provided by the GUI.
    226 <p>
    227 
    228 The <i>keep class</i> dialog appears when adding or editing new special keep
    229 entries. It has text fields and selections for specifying and constraining
    230 classes and class members to keep. The <b>Advanced options</b> / <b>Basic
    231 options</b> button at the bottom of the dialog allows to toggle showing the
    232 advanced options.
    233 
    234 <ul>
    235 <li>The <b>Comments</b> text field allows to add optional comments to this
    236     entry. The comments will identify the entry in the list and they will
    237     appear as comments in the configuration file.</li>
    238 
    239 <li>The <b>Keep</b> selection allows to specify whether you want to protect
    240     the specified classes and their specified class members, or just the
    241     specified class members from the specified classes, or the specified
    242     classes and the specified class members, if the class members are present.
    243     Note that class members will only be protected if they are explicitly
    244     specified, even if only by means of a wildcard.</li>
    245 
    246 <li>The <b>Allow</b> selection allows to specify whether you want to allow the
    247     the specified classes and their specified class members to be shrunk,
    248     optimized and/or obfuscated.</li>
    249 
    250 <li>The <b>Access</b> selections allows to specify constraints on the class or
    251     classes, based on their access modifiers.</li>
    252 
    253 <li>The <b>Annotation</b> text field takes the fully-qualified name of an
    254     annotation that is required for matching classes. The annotation name can
    255     contain wildcards. This is an advanced option for defining <i>keep</i>
    256     annotations.</li>
    257 
    258 <li>The <b>Class</b> text field takes the fully-qualified name of the class or
    259     classes. The class name can contain wildcards.</li>
    260 
    261 <li>The <b>Annotation</b> text field takes the fully-qualified name of an
    262     annotation that is required for the class or interface that the above
    263     class must extend. The annotation name can contain wildcards. This is an
    264     advanced option for defining <i>keep</i> annotations.</li>
    265 
    266 <li>The <b>Extends/implements class</b> text field takes the fully-qualified
    267     name of the class or interface that the above classes must extend.</li>
    268 
    269 <li>The <b>Class members</b> list allows to specify a list of fields and
    270     methods to keep. It can be edited by means of a list of buttons on the
    271     right-hand side.</li>
    272 </ul>
    273 <p>
    274 
    275 The <i>keep field</i> dialog appears when adding or editing fields within the
    276 above dialog. It has text fields and selections for specifying and
    277 constraining fields to keep. Again, the <b>Advanced options</b> / <b>Basic
    278 options</b> button at the bottom of the dialog allows to toggle showing the
    279 advanced options.
    280 
    281 <ul>
    282 <li>The <b>Access</b> selections allows to specify constraints on the field or
    283     fields, based on their access modifiers.</li>
    284 
    285 <li>The <b>Annotation</b> text field takes the fully-qualified name of an
    286     annotation that is required for matching fields. The annotation name can
    287     contain wildcards. This is an advanced option for defining <i>keep</i>
    288     annotations.</li>
    289 
    290 <li>The <b>Return type</b> text field takes the fully-qualified type of the
    291     field or fields. The type can contain wildcards.</li>
    292 
    293 <li>The <b>Name</b> text field takes the name of the field or fields. The field
    294     name can contain wildcards.</li>
    295 </ul>
    296 <p>
    297 
    298 Similarly, the <i>keep method</i> dialog appears when adding or editing
    299 methods within the keep class dialog. It has text fields and selections for
    300 specifying and constraining methods to keep. Again, the <b>Advanced
    301 options</b> / <b>Basic options</b> button at the bottom of the dialog allows
    302 to toggle showing the advanced options.
    303 
    304 <ul>
    305 <li>The <b>Access</b> selections allows to specify constraints on the method or
    306     methods, based on their access modifiers.</li>
    307 
    308 <li>The <b>Annotation</b> text field takes the fully-qualified name of an
    309     annotation that is required for matching methods. The annotation name can
    310     contain wildcards. This is an advanced option for defining <i>keep</i>
    311     annotations.</li>
    312 
    313 <li>The <b>Return type</b> text field takes the fully-qualified type of the         method or methods. The type can contain wildcards.</li>
    314 
    315 <li>The <b>Name</b> text field takes the name of the method or methods. The
    316     method name can contain wildcards.</li>
    317 
    318 <li>The <b>Arguments</b> text field takes the comma-separated list of
    319     fully-qualified method arguments. Each of these arguments can contain
    320     wildcards.</li>
    321 </ul>
    322 <p>
    323 
    324 Corresponding configuration options:
    325 <ul type="none">
    326 <li>-<a href="usage.html#dontshrink">dontshrink</a></li>
    327 <li>-<a href="usage.html#printusage">printusage</a></li>
    328 <li>-<a href="usage.html#keep">keep</a></li>
    329 <li>-<a href="usage.html#keepclassmembers">keepclassmembers</a></li>
    330 <li>-<a href="usage.html#keepclasseswithmembers">keepclasseswithmembers</a></li>
    331 </ul>
    332 <p>
    333 
    334 <h2><a name="obfuscation">The Obfuscation Tab</a></h2>
    335 
    336 The <i>Obfuscation</i> tab presents a number of options that affect the
    337 obfuscation step. The basic options are followed by a few lists of classes and
    338 class members (fields and methods) that must be protected from obfuscation
    339 (but not necessarily from shrinking).
    340 <p>
    341 
    342 The lists are manipulated in the same way as in the <a
    343 href="#shrinking">Shrinking Tab</a>.
    344 <p>
    345 
    346 Corresponding configuration options:
    347 <ul type="none">
    348 <li>-<a href="usage.html#dontobfuscate">dontobfuscate</a></li>
    349 <li>-<a href="usage.html#printmapping">printmapping</a></li>
    350 <li>-<a href="usage.html#applymapping">applymapping</a></li>
    351 <li>-<a href="usage.html#obfuscationdictionary">obfuscationdictionary</a></li>
    352 <li>-<a href="usage.html#classobfuscationdictionary">classobfuscationdictionary</a></li>
    353 <li>-<a href="usage.html#packageobfuscationdictionary">packageobfuscationdictionary</a></li>
    354 <li>-<a href="usage.html#overloadaggressively">overloadaggressively</a></li>
    355 <li>-<a href="usage.html#useuniqueclassmembernames">useuniqueclassmembernames</a></li>
    356 <li>-<a href="usage.html#dontusemixedcaseclassnames">dontusemixedcaseclassnames</a></li>
    357 <li>-<a href="usage.html#keeppackagenames">keeppackagenames</a></li>
    358 <li>-<a href="usage.html#flattenpackagehierarchy">flattenpackagehierarchy</a></li>
    359 <li>-<a href="usage.html#repackageclasses">repackageclasses</a></li>
    360 <li>-<a href="usage.html#keepattributes">keepattributes</a></li>
    361 <li>-<a href="usage.html#keepparameternames">keepparameternames</a></li>
    362 <li>-<a href="usage.html#renamesourcefileattribute">renamesourcefileattribute</a></li>
    363 <li>-<a href="usage.html#adaptclassstrings">adaptclassstrings</a></li>
    364 <li>-<a href="usage.html#adaptresourcefilenames">adaptresourcefilenames</a></li>
    365 <li>-<a href="usage.html#adaptresourcefilecontents">adaptresourcefilecontents</a></li>
    366 <li>-<a href="usage.html#keepnames">keepnames</a></li>
    367 <li>-<a href="usage.html#keepclassmembernames">keepclassmembernames</a></li>
    368 <li>-<a href="usage.html#keepclasseswithmembernames">keepclasseswithmembernames</a></li>
    369 <li><a href="usage.html#classspecification"><i>class_specification</i></a></li>
    370 </ul>
    371 <p>
    372 
    373 <h2><a name="optimization">The Optimization Tab</a></h2>
    374 
    375 The <i>Optimization</i> tab presents a number of options that affect the
    376 optimization step. The basic options are followed by a few lists of class
    377 method calls that can be removed if ProGuard can determine that their results
    378 are not being used.
    379 <p>
    380 
    381 The lists are manipulated in much the same way as in the <a
    382 href="#shrinking">Shrinking Tab</a>.
    383 <p>
    384 
    385 Corresponding configuration options:
    386 <ul type="none">
    387 <li>-<a href="usage.html#dontoptimize">dontoptimize</a></li>
    388 <li>-<a href="usage.html#optimizations">optimizations</a></li>
    389 <li>-<a href="usage.html#optimizationpasses">optimizationpasses</a></li>
    390 <li>-<a href="usage.html#allowaccessmodification">allowaccessmodification</a></li>
    391 <li>-<a href="usage.html#mergeinterfacesaggressively">mergeinterfacesaggressively</a></li>
    392 <li>-<a href="usage.html#assumenosideeffects">assumenosideeffects</a></li>
    393 <li><a href="usage.html#classspecification"><i>class_specification</i></a></li>
    394 </ul>
    395 <p>
    396 
    397 <h2><a name="information">The Information Tab</a></h2>
    398 
    399 The <i>Information</i> tab presents a number of options for preverification
    400 and targeting, and for the information that ProGuard returns when processing
    401 your code. The bottom list allows you to query ProGuard about why given
    402 classes and class members are being kept in the shrinking step.
    403 <p>
    404 
    405 Corresponding configuration options:
    406 <ul type="none">
    407 <li>-<a href="usage.html#dontpreverify">dontpreverify</a></li>
    408 <li>-<a href="usage.html#microedition">microedition</a></li>
    409 <li>-<a href="usage.html#target">target</a></li>
    410 <li>-<a href="usage.html#verbose">verbose</a></li>
    411 <li>-<a href="usage.html#dontnote">dontnote</a></li>
    412 <li>-<a href="usage.html#dontwarn">dontwarn</a></li>
    413 <li>-<a href="usage.html#ignorewarnings">ignorewarnings</a></li>
    414 <li>-<a href="usage.html#skipnonpubliclibraryclasses">skipnonpubliclibraryclasses</a></li>
    415 <li>-<a href="usage.html#dontskipnonpubliclibraryclasses">dontskipnonpubliclibraryclasses</a></li>
    416 <li>-<a href="usage.html#dontskipnonpubliclibraryclassmembers">dontskipnonpubliclibraryclassmembers</a></li>
    417 <li>-<a href="usage.html#keepdirectories">keepdirectories</a></li>
    418 <li>-<a href="usage.html#forceprocessing">forceprocessing</a></li>
    419 <li>-<a href="usage.html#printseeds">printseeds</a></li>
    420 <li>-<a href="usage.html#printconfiguration">printconfiguration</a></li>
    421 <li>-<a href="usage.html#dump">dump</a></li>
    422 <li>-<a href="usage.html#whyareyoukeeping">whyareyoukeeping</a></li>
    423 </ul>
    424 <p>
    425 
    426 <h2><a name="process">The Process Tab</a></h2>
    427 
    428 The <i>Process</i> tab has an output console for displaying the configuration
    429 and the messages while processing. There are three important buttons at the
    430 bottom:
    431 <p>
    432 
    433 <table cellspacing="5" cellpadding="5">
    434 <tr><td class="button">View configuration</td>
    435     <td>displays the current ProGuard configuration in the console.</td></tr>
    436 <tr><td class="button">Save configuration...</td>
    437     <td>opens a file chooser to save the current ProGuard
    438     configuration.</td></tr>
    439 <tr><td class="button">Process!</td>
    440     <td>executes ProGuard with the current configuration.</td></tr>
    441 </table>
    442 <p>
    443 
    444 <h2><a name="retrace">The ReTrace Tab</a></h2>
    445 
    446 The <i>ReTrace</i> tab has a panel with a few settings, an input text area for
    447 the obfuscated stack trace, and an output console to view the de-obfuscated
    448 stack trace:
    449 
    450 <ul>
    451 <li>The <b>Verbose</b> check box in the settings panel allows to toggle between
    452     normal mode and verbose mode.</li>
    453 
    454 <li>The <b>Mapping file</b> text field takes the name of the required mapping
    455     file that ProGuard wrote while processing the original code. The file name
    456     can be entered manually or by means of the <b>Browse...</b> button that
    457     opens a file chooser.</li>
    458 
    459 <li>The <b>Obfuscated stack trace</b> text area allows to enter the stack
    460     trace, typically by copying and pasting it from elsewhere. Alternatively,
    461     it can be loaded from a file by means of the load button below.</li>
    462 </ul>
    463 
    464 There are two buttons at the bottom:
    465 <p>
    466 
    467 <table cellspacing="5" cellpadding="5">
    468 <tr><td class="button">Load stack trace...</td>
    469     <td>opens a file chooser to load an obfuscated stack trace.</td></tr>
    470 <tr><td class="button">ReTrace!</td>
    471     <td>executes ReTrace with the current settings.</td></tr>
    472 </table>
    473 
    474 <hr />
    475 <noscript><div><a target="_top" href="../index.html" class="button">Show menu</a></div></noscript>
    476 <address>
    477 Copyright &copy; 2002-2013
    478 <a target="other" href="http://www.lafortune.eu/">Eric Lafortune</a>.
    479 </address>
    480 </body>
    481 </html>
    482