~ubuntu-branches/ubuntu/maverick/proguard/maverick

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
<!doctype html PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
<meta http-equiv="content-style-type" content="text/css">
<link rel="stylesheet" type="text/css" href="style.css">
<title>ProGuard Reference Card</title>
</head>
<body>

<h1>ProGuard Reference Card</h1>

<h2>Usage</h2>

<code><b>java -jar proguard.jar </b></code><i>options</i> ...
<p>
&nbsp;&nbsp;Typically:
<p>
<code><b>java -jar proguard.jar @myconfig.pro</b></code>
<p>

<h2>Options</h2>

<table cellspacing="10">

<tr>
<td valign="top"><code><b>@</b></code><i>filename</i></td>

<td>Short for '<code>-include</code> <i>filename</i>'.</td>
</tr>

<tr>
<td valign="top"><code><b>-include</b></code> <i>filename</i></td>

<td>Read configuration options from the given file.</td>
</tr>

<tr>
<td valign="top"><code><b>-basedirectory</b></code> <i>directoryname</i></td>

<td>Specifies the base directory for subsequent relative file names.</td>
</tr>

<tr>
<td valign="top"><code><b>-injars</b></code> <i>class_path</i></td>
<td>Specifies the program jars (or wars, ears, zips, or directories).</td>
</tr>

<tr>
<td valign="top"><code><b>-outjars</b></code> <i>class_path</i></td>
<td>Specifies the name of the output jars (or wars, ears, zips, or
    directories).</td>
</tr>

<tr>
<td valign="top"><code><b>-libraryjars</b></code> <i>class_path</i></td>
<td>Specifies the library jars (or wars, ears, zips, or directories).</td>
</tr>

<tr>
<td valign="top"><code><b>-dontskipnonpubliclibraryclasses</b></code></td>
<td>Don't ignore non-public library classes.</td>
</tr>

<tr>
<td valign="top"><code><b>-dontskipnonpubliclibraryclassmembers</b></code></td>
<td>Don't ignore package visible library class members.</td>
</tr>

<tr>
<td valign="top"><code><b>-keep</b></code> <i>class_specification</i></td>
<td>Preserve the specified classes <i>and</i> class members.</td>

</tr>
<tr>
<td valign="top"><code><b>-keepclassmembers</b></code>
    <i>class_specification</i></td>
<td>Preserve the specified class members, if their classes are preserved as
    well.</td>
</tr>

<tr>
<td valign="top"><code><b>-keepclasseswithmembers</b></code>
    <i>class_specification</i></td>
<td>Preserve the specified classes <i>and</i> class members, if all of the
    specified class members are present.</td>
</tr>

<tr>
<td valign="top"><code><b>-keepnames</b></code>
    <i>class_specification</i></td>
<td>Preserve the names of the specified classes <i>and</i> class members (if
    they aren't removed in the shrinking step).</td>
</tr>

<tr>
<td valign="top"><code><b>-keepclassmembernames</b></code>
    <i>class_specification</i></td>
<td>Preserve the names of the specified class members (if they aren't removed
    in the shrinking step).</td>
</tr>

<tr>
<td valign="top"><code><b>-keepclasseswithmembernames</b></code>
    <i>class_specification</i></td>
<td>Preserve the names of the specified classes <i>and</i> class members, if
    all of the specified class members are present (after the shrinking
    step).</td>
</tr>

<tr>
<td valign="top"><code><b>-printseeds</b></code> [<i>filename</i>]</td>
<td>List classes and class members matched by the various <code>-keep</code>
    options, to the standard output or to the given file.</td>
</tr>

<tr>
<td valign="top"><code><b>-dontshrink</b></code></td>
<td>Don't shrink the input class files.</td>
</tr>

<tr>
<td valign="top"><code><b>-printusage</b></code> [<i>filename</i>]</td>
<td>List dead code of the input class files, to the standard output or to the
    given file.</td>
</tr>

<tr>
<td valign="top"><code><b>-whyareyoukeeping</b></code>
    <i>class_specification</i></td>
<td>Print details on why the given classes and class members are being kept in
    the shrinking step.</td>
</tr>

<tr>
<td valign="top"><code><b>-dontoptimize</b></code></td>
<td>Don't optimize the input class files.</td>
</tr>

<tr>
<td valign="top"><code><b>-assumenosideeffects</b></code>
    <i>class_specification</i></td>
<td>Assume that the specified methods don't have any side effects, while
    optimizing.</td>
</tr>

<tr>
<td valign="top"><code><b>-allowaccessmodification</b></code></td>
<td>Allow the access modifiers of classes and class members to be modified,
    while optimizing.</td>
</tr>

<tr>
<td valign="top"><code><b>-dontobfuscate</b></code></td>
<td>Don't obfuscate the input class files.</td>
</tr>

<tr>
<td valign="top"><code><b>-printmapping</b></code> [<i>filename</i>]</td>
<td>Print the mapping from old names to new names for classes and class members
    that have been renamed, to the standard output or to the given file.</td>
</tr>

<tr>
<td valign="top"><code><b>-applymapping</b></code> <i>filename</i></td>
<td>Reuse the given mapping, for incremental obfuscation.</td>
</tr>

<tr>
<td valign="top"><code><b>-obfuscationdictionary</b></code>
    <i>filename</i></td>
<td>Use the words in the given text file as obfuscated method names.</td>
</tr>

<tr>
<td valign="top"><code><b>-overloadaggressively</b></code></td>
<td>Apply aggressive overloading while obfuscating.</td>
</tr>

<tr>
<td valign="top"><code><b>-defaultpackage</b></code> [<i>package_name</i>]</td>
<td>Repackage all class files that are renamed into the single given
    package.</td>
</tr>

<tr>
<td valign="top"><code><b>-dontusemixedcaseclassnames</b></code></td>
<td>Don't generate mixed-case class names while obfuscating.</td>
</tr>

<tr>
<td valign="top"><code><b>-keepattributes</b></code>
    [<i>attribute_name<b>,</b>...</i>]</td>
<td>Preserve the given optional attributes; typically
    <code>LineNumberTable</code>, <code>LocalVariableTable</code>,
    <code>SourceFile</code>, <code>Deprecated</code>, <code>Synthetic</code>,
    <code>Signature</code>, and <code>InnerClasses</code>.</td>
</tr>

<tr>
<td valign="top"><code><b>-renamesourcefileattribute</b></code>
    [<i>string</i>]</td>
<td>Put the given constant string in the <code>SourceFile</code>
    attributes.</td>
</tr>

<tr>
<td valign="top"><code><b>-verbose</b></code></td>
<td>Write out some more information during processing.</td>
</tr>

<tr>
<td valign="top"><code><b>-dontnote</b></code></td>
<td>Don't print notes about class casts of variable dynamically created
    objects.</td>
</tr>

<tr>
<td valign="top"><code><b>-dontwarn</b></code></td>
<td>Don't warn about unresolved references at all.</td>
</tr>

<tr>
<td valign="top"><code><b>-ignorewarnings</b></code></td>
<td>Print warnings about unresolved references, but continue processing
    anyhow.</td>
</tr>

<tr>
<td valign="top"><code><b>-dump</b></code> [<i>filename</i>]</td>
<td>Write out the internal structure of the processed class files, to the
    standard output or to the given file.</td>
</tr>

</table>
<p>
Notes:
<ul>

<li><i>class_path</i> is a list of jars, wars, ears, zips, and directories,
    with optional filters, separated by path separators.
<li><i>filename</i> can contain Java system properties delimited by
    '<b>&lt;</b>' and '<b>&gt;</b>'.
<li>If <i>filename</i> contains special characters, the entire name
    should be quoted with single or double quotes.
</ul>
<p>

<h2>Overview of <code>Keep</code> Options</h2>

<table cellpadding="5">

<tr>
<th>Keep</th>
<td>From being removed or renamed</td>
<td>From being renamed</td>
</tr>

<tr>
<td>Classes and class members</td>
<td bgcolor="#E0E0E0"><code>-keep</code></td>
<td bgcolor="#E0E0E0"><code>-keepnames</code></td>
</tr>

<tr>
<td>Class members only</td>
<td bgcolor="#E0E0E0"><code>-keepclassmembers</code></td>
<td bgcolor="#E0E0E0"><code>-keepclassmembernames</code></td>
</tr>

<tr>
<td>Classes and class members, if class members present</td>
<td bgcolor="#E0E0E0"><code>-keepclasseswithmembers</code></td>
<td bgcolor="#E0E0E0"><code>-keepclasseswithmembernames</code></td>
</tr>

</table>
<p>

<h2>Class Specifications</h2>

<pre>
[[<b>!</b>]<b>public</b>|<b>final</b>|<b>abstract</b> ...] ([<b>!</b>]<b>interface</b>)|<b>class</b> <i>classname</i>
    [<b>extends</b>|<b>implements</b> <i>classname</i>]
[<b>{</b>
    [[<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> |
                                                                      (<i>fieldtype fieldname</i>)<b>;</b>
    [[<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> |
                                                                                           <b>&lt;init&gt;(</b><i>argumenttype,...</i><b>)</b> |
                                                                                           <i>classname</i><b>(</b><i>argumenttype,...</i><b>)</b> |
                                                                                           (<i>returntype methodname</i><b>(</b><i>argumenttype,...</i><b>)</b>)<b>;</b>
    [[<b>!</b>]<b>public</b>|<b>private</b>|<b>protected</b>|<b>static</b> ... ] <b>*;</b>
    ...
<b>}</b>]
</pre>
<p>
Notes:
<ul>
<li>Class names must always be fully qualified, i.e. including their package
    names.
<li>Types in <i>classname</i>, <i>returntype</i>, and <i>argumenttype</i> can
    contain wildcards: '<code><b>?</b></code>' for a single character,
    '<code><b>*</b></code>' for any number of characters (but not the package
    separator), '<code><b>**</b></code>' for any number of (any)
    characters, and  '<code><b>%</b></code>' for any primitive type.
<li><i>fieldname</i> and <i>methodname</i> can contain wildcards as well:
    '<code><b>?</b></code>' for a single character and '<code><b>*</b></code>'
    for any number of characters.
</ul>
<p>

<hr>
<address>
Copyright &copy; 2002-2005
<a href="http://www.graphics.cornell.edu/~eric/">Eric Lafortune</a>.
</address>
</body>
</html>