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