1
<!doctype html PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
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 Reference Card</title>
11
<h1>ProGuard Reference Card</h1>
15
<code><b>java -jar proguard.jar </b></code><i>options</i> ...
17
Typically:
19
<code><b>java -jar proguard.jar @myconfig.pro</b></code>
24
<table cellspacing="10">
27
<td valign="top"><code><b>@</b></code><i>filename</i></td>
29
<td>Short for '<code>-include</code> <i>filename</i>'.</td>
33
<td valign="top"><code><b>-include</b></code> <i>filename</i></td>
35
<td>Read configuration options from the given file.</td>
39
<td valign="top"><code><b>-injars</b></code> <i>class_path</i></td>
40
<td>Specifies the program jars (or wars, ears, zips, or directories).</td>
44
<td valign="top"><code><b>-outjars</b></code> <i>class_path</i></td>
45
<td>Specifies the name of the output jars (or wars, ears, zips, or
50
<td valign="top"><code><b>-libraryjars</b></code> <i>class_path</i></td>
51
<td>Specifies the library jars (or wars, ears, zips, or directories).</td>
55
<td valign="top"><code><b>-dontskipnonpubliclibraryclasses</b></code></td>
56
<td>Don't ignore non-public library classes.</td>
60
<td valign="top"><code><b>-dontskipnonpubliclibraryclassmembers</b></code></td>
61
<td>Don't ignore package visible library class members.</td>
65
<td valign="top"><code><b>-keep</b></code> <i>class_specification</i></td>
66
<td>Preserve the specified classes <i>and</i> class members.</td>
70
<td valign="top"><code><b>-keepclassmembers</b></code>
71
<i>class_specification</i></td>
72
<td>Preserve the specified class members, if their classes are preserved as
77
<td valign="top"><code><b>-keepclasseswithmembers</b></code>
78
<i>class_specification</i></td>
79
<td>Preserve the specified classes <i>and</i> class members, if all of the
80
specified class members are present.</td>
84
<td valign="top"><code><b>-keepnames</b></code>
85
<i>class_specification</i></td>
86
<td>Preserve the names of the specified classes <i>and</i> class members (if
87
they aren't removed in the shrinking step).</td>
91
<td valign="top"><code><b>-keepclassmembernames</b></code>
92
<i>class_specification</i></td>
93
<td>Preserve the names of the specified class members (if they aren't removed
94
in the shrinking step).</td>
98
<td valign="top"><code><b>-keepclasseswithmembernames</b></code>
99
<i>class_specification</i></td>
100
<td>Preserve the names of the specified classes <i>and</i> class members, if
101
all of the specified class members are present (after the shrinking
106
<td valign="top"><code><b>-printseeds</b></code> [<i>filename</i>]</td>
107
<td>List classes and class members matched by the various <code>-keep</code>
108
options, to the standard output or to the given file.</td>
112
<td valign="top"><code><b>-dontshrink</b></code></td>
113
<td>Don't shrink the input class files.</td>
117
<td valign="top"><code><b>-printusage</b></code> [<i>filename</i>]</td>
118
<td>List dead code of the input class files, to the standard output or to the
123
<td valign="top"><code><b>-dontoptimize</b></code></td>
124
<td>Don't optimize the input class files.</td>
128
<td valign="top"><code><b>-assumenosideeffects</b></code>
129
<i>class_specification</i></td>
130
<td>Assume that the specified methods don't have any side effects, while
135
<td valign="top"><code><b>-allowaccessmodification</b></code></td>
136
<td>Allow the access modifiers of classes and class members to be modified,
137
while optimizing.</td>
141
<td valign="top"><code><b>-dontobfuscate</b></code></td>
142
<td>Don't obfuscate the input class files.</td>
146
<td valign="top"><code><b>-printmapping</b></code> [<i>filename</i>]</td>
147
<td>Print the mapping from old names to new names for classes and class members
148
that have been renamed, to the standard output or to the given file.</td>
152
<td valign="top"><code><b>-applymapping</b></code> <i>filename</i></td>
153
<td>Reuse the given mapping, for incremental obfuscation.</td>
157
<td valign="top"><code><b>-obfuscationdictionary</b></code>
159
<td>Use the words in the given text file as obfuscated method names.</td>
163
<td valign="top"><code><b>-overloadaggressively</b></code></td>
164
<td>Apply aggressive overloading while obfuscating.</td>
168
<td valign="top"><code><b>-defaultpackage</b></code> [<i>package_name</i>]</td>
169
<td>Repackage all class files that are renamed into the single given
174
<td valign="top"><code><b>-dontusemixedcaseclassnames</b></code></td>
175
<td>Don't generate mixed-case class names while obfuscating.</td>
179
<td valign="top"><code><b>-keepattributes</b></code>
180
[<i>attribute_name<b>,</b>...</i>]</td>
181
<td>Preserve the given optional attributes; typically
182
<code>LineNumberTable</code>, <code>LocalVariableTable</code>,
183
<code>SourceFile</code>, <code>Deprecated</code>, <code>Synthetic</code>,
184
<code>Signature</code>, and <code>InnerClasses</code>.</td>
188
<td valign="top"><code><b>-renamesourcefileattribute</b></code>
190
<td>Put the given constant string in the <code>SourceFile</code>
195
<td valign="top"><code><b>-verbose</b></code></td>
196
<td>Write out some more information during processing.</td>
200
<td valign="top"><code><b>-dontnote</b></code></td>
201
<td>Don't print notes about class casts of variable dynamically created
206
<td valign="top"><code><b>-dontwarn</b></code></td>
207
<td>Don't warn about unresolved references at all.</td>
211
<td valign="top"><code><b>-ignorewarnings</b></code></td>
212
<td>Print warnings about unresolved references, but continue processing
217
<td valign="top"><code><b>-dump</b></code> [<i>filename</i>]</td>
218
<td>Write out the internal structure of the processed class files, to the
219
standard output or to the given file.</td>
227
<li><i>class_path</i> is a list of jars, wars, ears, zips, and directories,
228
with optional filters, separated by path separators.
229
<li><i>filename</i> can contain Java system properties delimited by
230
'<b><</b>' and '<b>></b>'.
231
<li>If <i>filename</i> contains special characters, the entire name
232
should be quoted with single or double quotes.
236
<h2>Overview of <code>Keep</code> Options</h2>
238
<table cellpadding="5">
242
<td>From being removed or renamed</td>
243
<td>From being renamed</td>
247
<td>Classes and class members</td>
248
<td bgcolor="#E0E0E0"><code>-keep</code></td>
249
<td bgcolor="#E0E0E0"><code>-keepnames</code></td>
253
<td>Class members only</td>
254
<td bgcolor="#E0E0E0"><code>-keepclassmembers</code></td>
255
<td bgcolor="#E0E0E0"><code>-keepclassmembernames</code></td>
259
<td>Classes and class members, if class members present</td>
260
<td bgcolor="#E0E0E0"><code>-keepclasseswithmembers</code></td>
261
<td bgcolor="#E0E0E0"><code>-keepclasseswithmembernames</code></td>
267
<h2>Class Specifications</h2>
270
[[<b>!</b>]<b>public</b>|<b>final</b>|<b>abstract</b> ...] ([<b>!</b>]<b>interface</b>)|<b>class</b> <i>classname</i>
271
[<b>extends</b>|<b>implements</b> <i>classname</i>]
273
[[<b>!</b>]<b>public</b>|<b>private</b>|<b>protected</b>|<b>static</b>|<b>volatile</b>|<b>transient</b> ...] <b><fields></b> |
274
(<i>fieldtype fieldname</i>)<b>;</b>
275
[[<b>!</b>]<b>public</b>|<b>private</b>|<b>protected</b>|<b>static</b>|<b>synchronized</b>|<b>native</b>|<b>abstract</b>|<b>strictfp</b> ...] <b><methods></b> |
276
<b><init>(</b><i>argumenttype,...</i><b>)</b> |
277
<i>classname</i><b>(</b><i>argumenttype,...</i><b>)</b> |
278
(<i>returntype methodname</i><b>(</b><i>argumenttype,...</i><b>)</b>)<b>;</b>
279
[[<b>!</b>]<b>public</b>|<b>private</b>|<b>protected</b>|<b>static</b> ... ] <b>*;</b>
286
<li>Class names must always be fully qualified, i.e. including their package
288
<li>Types in <i>classname</i>, <i>returntype</i>, and <i>argumenttype</i> can
289
contain wildcards: '<code><b>?</b></code>' for a single character,
290
'<code><b>*</b></code>' for any number of characters (but not the package
291
separator), '<code><b>**</b></code>' for any number of (any)
292
characters, and '<code><b>%</b></code>' for any primitive type.
293
<li><i>fieldname</i> and <i>methodname</i> can contain wildcards as well:
294
'<code><b>?</b></code>' for a single character and '<code><b>*</b></code>'
295
for any number of characters.
301
Copyright © 2002-2004
302
<a href="http://www.graphics.cornell.edu/~eric/">Eric Lafortune</a>.