~ubuntu-branches/ubuntu/breezy/proguard/breezy

« back to all changes in this revision

Viewing changes to docs/manual/refcard.html

  • Committer: Bazaar Package Importer
  • Author(s): Sam Clegg
  • Date: 2005-06-17 14:25:24 UTC
  • Revision ID: james.westby@ubuntu.com-20050617142524-thz2yfa3vemy3j9d
Tags: upstream-3.2
ImportĀ upstreamĀ versionĀ 3.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<!doctype html PUBLIC "-//W3C//DTD HTML 3.2 Final//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 Reference Card</title>
 
8
</head>
 
9
<body>
 
10
 
 
11
<h1>ProGuard Reference Card</h1>
 
12
 
 
13
<h2>Usage</h2>
 
14
 
 
15
<code><b>java -jar proguard.jar </b></code><i>options</i> ...
 
16
<p>
 
17
&nbsp;&nbsp;Typically:
 
18
<p>
 
19
<code><b>java -jar proguard.jar @myconfig.pro</b></code>
 
20
<p>
 
21
 
 
22
<h2>Options</h2>
 
23
 
 
24
<table cellspacing="10">
 
25
 
 
26
<tr>
 
27
<td valign="top"><code><b>@</b></code><i>filename</i></td>
 
28
 
 
29
<td>Short for '<code>-include</code> <i>filename</i>'.</td>
 
30
</tr>
 
31
 
 
32
<tr>
 
33
<td valign="top"><code><b>-include</b></code> <i>filename</i></td>
 
34
 
 
35
<td>Read configuration options from the given file.</td>
 
36
</tr>
 
37
 
 
38
<tr>
 
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>
 
41
</tr>
 
42
 
 
43
<tr>
 
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
 
46
    directories).</td>
 
47
</tr>
 
48
 
 
49
<tr>
 
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>
 
52
</tr>
 
53
 
 
54
<tr>
 
55
<td valign="top"><code><b>-dontskipnonpubliclibraryclasses</b></code></td>
 
56
<td>Don't ignore non-public library classes.</td>
 
57
</tr>
 
58
 
 
59
<tr>
 
60
<td valign="top"><code><b>-dontskipnonpubliclibraryclassmembers</b></code></td>
 
61
<td>Don't ignore package visible library class members.</td>
 
62
</tr>
 
63
 
 
64
<tr>
 
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>
 
67
 
 
68
</tr>
 
69
<tr>
 
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
 
73
    well.</td>
 
74
</tr>
 
75
 
 
76
<tr>
 
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>
 
81
</tr>
 
82
 
 
83
<tr>
 
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>
 
88
</tr>
 
89
 
 
90
<tr>
 
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>
 
95
</tr>
 
96
 
 
97
<tr>
 
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
 
102
    step).</td>
 
103
</tr>
 
104
 
 
105
<tr>
 
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>
 
109
</tr>
 
110
 
 
111
<tr>
 
112
<td valign="top"><code><b>-dontshrink</b></code></td>
 
113
<td>Don't shrink the input class files.</td>
 
114
</tr>
 
115
 
 
116
<tr>
 
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
 
119
    given file.</td>
 
120
</tr>
 
121
 
 
122
<tr>
 
123
<td valign="top"><code><b>-dontoptimize</b></code></td>
 
124
<td>Don't optimize the input class files.</td>
 
125
</tr>
 
126
 
 
127
<tr>
 
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
 
131
    optimizing.</td>
 
132
</tr>
 
133
 
 
134
<tr>
 
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>
 
138
</tr>
 
139
 
 
140
<tr>
 
141
<td valign="top"><code><b>-dontobfuscate</b></code></td>
 
142
<td>Don't obfuscate the input class files.</td>
 
143
</tr>
 
144
 
 
145
<tr>
 
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>
 
149
</tr>
 
150
 
 
151
<tr>
 
152
<td valign="top"><code><b>-applymapping</b></code> <i>filename</i></td>
 
153
<td>Reuse the given mapping, for incremental obfuscation.</td>
 
154
</tr>
 
155
 
 
156
<tr>
 
157
<td valign="top"><code><b>-obfuscationdictionary</b></code>
 
158
    <i>filename</i></td>
 
159
<td>Use the words in the given text file as obfuscated method names.</td>
 
160
</tr>
 
161
 
 
162
<tr>
 
163
<td valign="top"><code><b>-overloadaggressively</b></code></td>
 
164
<td>Apply aggressive overloading while obfuscating.</td>
 
165
</tr>
 
166
 
 
167
<tr>
 
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
 
170
    package.</td>
 
171
</tr>
 
172
 
 
173
<tr>
 
174
<td valign="top"><code><b>-dontusemixedcaseclassnames</b></code></td>
 
175
<td>Don't generate mixed-case class names while obfuscating.</td>
 
176
</tr>
 
177
 
 
178
<tr>
 
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>
 
185
</tr>
 
186
 
 
187
<tr>
 
188
<td valign="top"><code><b>-renamesourcefileattribute</b></code>
 
189
    [<i>string</i>]</td>
 
190
<td>Put the given constant string in the <code>SourceFile</code>
 
191
    attributes.</td>
 
192
</tr>
 
193
 
 
194
<tr>
 
195
<td valign="top"><code><b>-verbose</b></code></td>
 
196
<td>Write out some more information during processing.</td>
 
197
</tr>
 
198
 
 
199
<tr>
 
200
<td valign="top"><code><b>-dontnote</b></code></td>
 
201
<td>Don't print notes about class casts of variable dynamically created
 
202
    objects.</td>
 
203
</tr>
 
204
 
 
205
<tr>
 
206
<td valign="top"><code><b>-dontwarn</b></code></td>
 
207
<td>Don't warn about unresolved references at all.</td>
 
208
</tr>
 
209
 
 
210
<tr>
 
211
<td valign="top"><code><b>-ignorewarnings</b></code></td>
 
212
<td>Print warnings about unresolved references, but continue processing
 
213
    anyhow.</td>
 
214
</tr>
 
215
 
 
216
<tr>
 
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>
 
220
</tr>
 
221
 
 
222
</table>
 
223
<p>
 
224
Notes:
 
225
<ul>
 
226
 
 
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>&lt;</b>' and '<b>&gt;</b>'.
 
231
<li>If <i>filename</i> contains special characters, the entire name
 
232
    should be quoted with single or double quotes.
 
233
</ul>
 
234
<p>
 
235
 
 
236
<h2>Overview of <code>Keep</code> Options</h2>
 
237
 
 
238
<table cellpadding="5">
 
239
 
 
240
<tr>
 
241
<th>Keep</th>
 
242
<td>From being removed or renamed</td>
 
243
<td>From being renamed</td>
 
244
</tr>
 
245
 
 
246
<tr>
 
247
<td>Classes and class members</td>
 
248
<td bgcolor="#E0E0E0"><code>-keep</code></td>
 
249
<td bgcolor="#E0E0E0"><code>-keepnames</code></td>
 
250
</tr>
 
251
 
 
252
<tr>
 
253
<td>Class members only</td>
 
254
<td bgcolor="#E0E0E0"><code>-keepclassmembers</code></td>
 
255
<td bgcolor="#E0E0E0"><code>-keepclassmembernames</code></td>
 
256
</tr>
 
257
 
 
258
<tr>
 
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>
 
262
</tr>
 
263
 
 
264
</table>
 
265
<p>
 
266
 
 
267
<h2>Class Specifications</h2>
 
268
 
 
269
<pre>
 
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>]
 
272
[<b>{</b>
 
273
    [[<b>!</b>]<b>public</b>|<b>private</b>|<b>protected</b>|<b>static</b>|<b>volatile</b>|<b>transient</b> ...] <b>&lt;fields&gt;</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>&lt;methods&gt;</b> |
 
276
                                                                                           <b>&lt;init&gt;(</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>
 
280
    ...
 
281
<b>}</b>]
 
282
</pre>
 
283
<p>
 
284
Notes:
 
285
<ul>
 
286
<li>Class names must always be fully qualified, i.e. including their package
 
287
    names.
 
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.
 
296
</ul>
 
297
<p>
 
298
 
 
299
<hr>
 
300
<address>
 
301
Copyright &copy; 2002-2004
 
302
<a href="http://www.graphics.cornell.edu/~eric/">Eric Lafortune</a>.
 
303
</address>
 
304
</body>
 
305
</html>