Added proguard 4.7 files

please note that proguard is not yet implmented
refs #17
This commit is contained in:
2012-04-27 10:17:38 -04:00
parent e7b30ea692
commit bff7ed4848
66 changed files with 9695 additions and 0 deletions

View File

@@ -0,0 +1,634 @@
<!doctype html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//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>Ant Task</title>
<script type="text/javascript" language="JavaScript">
<!--
if (window.self==window.top)
window.top.location.replace("../index.html#"+window.location.pathname+window.location.hash);
else {
var hash="#"+window.location.pathname.replace(window.top.location.pathname.replace("index.html", ""), "");
if (window.top.location.hash!=hash)
window.top.location.hash=hash;
}
//-->
</script>
</head>
<body>
<h2>Ant Task</h2>
<b>ProGuard</b> can be run as a task in the Java-based build tool Ant (version
1.6.0 or higher).
<p>
Before you can use the <code>proguard</code> task, you have to tell Ant about
this new task. The easiest way is to add the following line to your
<code>build.xml</code> file:
<p>
<pre>
&lt;taskdef resource="proguard/ant/task.properties"
classpath="/usr/local/java/proguard/lib/proguard.jar" /&gt;
</pre>
<p>
Please make sure the class path is set correctly for your system.
<p>
There are three ways to configure the ProGuard task: using an external
configuration file, using embedded ProGuard configuration options, or using
the equivalent XML configuration tags. These three ways can be combined,
depending on practical circumstances and personal preference.
<p>
<h3>1. An external ProGuard configuration file</h3>
The simplest way to use the ProGuard task in an Ant build file is to keep your
ProGuard configuration file, and include it from Ant. You can include your
ProGuard configuration file by setting
the <a href="#configuration_attribute"><code>configuration</code></a>
attribute of your
<code>proguard</code> task. Your ant build file will then look like this:
<p>
<pre>
&lt;taskdef resource="proguard/ant/task.properties"
classpath="/usr/local/java/proguard/lib/proguard.jar" /&gt;
&lt;proguard configuration="myconfigfile.pro"/&gt;
</pre>
<p>
This is a convenient option if you prefer ProGuard's configuration style over
XML, if you want to keep your build file small, or if you have to share your
configuration with developers who don't use Ant.
<p>
<h3>2. Embedded ProGuard configuration options</h3>
Instead of keeping an external ProGuard configuration file, you can also copy
the contents of the file into the nested text of the <code>proguard</code> task
(the PCDATA area). Your Ant build file will then look like this:
<p>
<pre>
&lt;taskdef resource="proguard/ant/task.properties"
classpath="/usr/local/java/proguard/lib/proguard.jar" /&gt;
&lt;proguard&gt;
-libraryjars ${java.home}/lib/rt.jar
-injars in.jar
-outjars out.jar
-keepclasseswithmembers public class * {
public static void main(java.lang.String[]);
}
&lt;/proguard&gt;
</pre>
<p>
Some minor syntactical changes are required in order to conform with the XML
standard.
<p>
Firstly, the <code>#</code> character cannot be used for comments in an XML
file. Comments must be enclosed by an opening <code>&lt;!--</code> and a
closing <code>--&gt;</code>. All occurrences of the <code>#</code> character
can be removed.
<p>
Secondly, the use of <code>&lt;</code> and <code>&gt;</code> characters would
upset the structure of the XML build file. Environment variables are now
enclosed by an opening <code>${</code> and a closing <code>}</code>. This
syntax also allows you to use Ant properties within the ProGuard
configuration. Other occurrences of <code>&lt;</code> and <code>&gt;</code>
have to be encoded as <code>&amp;lt;</code> and <code>&amp;gt;</code>.
<p>
<h3>3. XML configuration tags</h3>
If you really prefer a full-blown XML configuration, you can replace the
ProGuard configuration options by XML configuration tags. The resulting
configuration will be equivalent, but much more verbose and difficult to read,
as XML goes. The remainder of this page presents the supported tags. For a
more extensive discussion of their meaning, please consult the traditional <a
href="usage.html">Usage</a> section. You can find some sample configuration
files in the <code>examples/ant</code> directory of the ProGuard distribution.
<p>
<h2><a name="proguard">Task Attributes and Nested Elements</a></h2>
The <code><b>&lt;proguard&gt;</b></code> task and the
<code><b>&lt;proguardconfiguration&gt;</b></code> task can have the following
attributes (only for <code>&lt;proguard&gt;</code>) and nested
elements:
<dl>
<dt><a name="configuration_attribute"><code><b>configuration</b></code></a>
= "<i>filename</i>"</dt>
<dd>Read and merge options from the given ProGuard-style configuration
file. Note: for reading XML-style configurations, use the <a
href="#configuration_element"><code>configuration</code></a>
<i>element</i>.</dd>
<dt><a href="usage.html#skipnonpubliclibraryclasses"><code><b>skipnonpubliclibraryclasses</b></code></a>
= "<i>boolean</i>"
(default = false)</dt>
<dd>Ignore non-public library classes.</dd>
<dt><a href="usage.html#dontskipnonpubliclibraryclassmembers"><code><b>skipnonpubliclibraryclassmembers</b></code></a>
= "<i>boolean</i>"
(default = true)</dt>
<dd>Ignore package visible library class members.</dd>
<dt><a href="usage.html#target"><code><b>target</b></code></a>
= "<i>version</i>"
(default = none)</dt>
<dd>Set the given version number in the processed classes.</dd>
<dt><a href="usage.html#forceprocessing"><code><b>forceprocessing</b></code></a>
= "<i>boolean</i>"
(default = false)</dt>
<dd>Process the input, even if the output seems up to date.</dd>
<dt><a href="usage.html#printseeds"><code><b>printseeds</b></code></a>
= "<i>boolean or filename</i>"
(default = false)</dt>
<dd>List classes and class members matched by the various <code>keep</code>
commands, to the standard output or to the given file.</dd>
<dt><a href="usage.html#dontshrink"><code><b>shrink</b></code></a>
= "<i>boolean</i>"
(default = true)</dt>
<dd>Shrink the input class files.</dd>
<dt><a href="usage.html#printusage"><code><b>printusage</b></code></a>
= "<i>boolean or filename</i>"
(default = false)</dt>
<dd>List dead code of the input class files, to the standard output or to the
given file.</dd>
<dt><a href="usage.html#dontoptimize"><code><b>optimize</b></code></a>
= "<i>boolean</i>"
(default = true)</dt>
<dd>Optimize the input class files.</dd>
<dt><a href="usage.html#optimizationpasses"><code><b>optimizationpasses</b></code></a>
= "<i>n</i>"
(default = 1)</dt>
<dd>The number of optimization passes to be performed.</dd>
<dt><a href="usage.html#allowaccessmodification"><code><b>allowaccessmodification</b></code></a>
= "<i>boolean</i>"
(default = false)</dt>
<dd>Allow the access modifiers of classes and class members to be modified,
while optimizing.</dd>
<dt><a href="usage.html#mergeinterfacesaggressively"><code><b>mergeinterfacesaggressively</b></code></a>
= "<i>boolean</i>"
(default = false)</dt>
<dd>Allow any interfaces to be merged, while optimizing.</dd>
<dt><a href="usage.html#dontobfuscate"><code><b>obfuscate</b></code></a>
= "<i>boolean</i>"
(default = true)</dt>
<dd>Obfuscate the input class files.</dd>
<dt><a href="usage.html#printmapping"><code><b>printmapping</b></code></a>
= "<i>boolean or filename</i>"
(default = false)</dt>
<dd>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.</dd>
<dt><a href="usage.html#applymapping"><code><b>applymapping</b></code></a>
= "<i>filename</i>"
(default = none)</dt>
<dd>Reuse the given mapping, for incremental obfuscation.</dd>
<dt><a href="usage.html#obfuscationdictionary"><code><b>obfuscationdictionary</b></code></a>
= "<i>filename</i>"
(default = none)</dt>
<dd>Use the words in the given text file as obfuscated field names and method
names.</dd>
<dt><a href="usage.html#classobfuscationdictionary"><code><b>classobfuscationdictionary</b></code></a>
= "<i>filename</i>"
(default = none)</dt>
<dd>Use the words in the given text file as obfuscated class names.</dd>
<dt><a href="usage.html#packageobfuscationdictionary"><code><b>packageobfuscationdictionary</b></code></a>
= "<i>filename</i>"
(default = none)</dt>
<dd>Use the words in the given text file as obfuscated package names.</dd>
<dt><a href="usage.html#overloadaggressively"><code><b>overloadaggressively</b></code></a>
= "<i>boolean</i>"
(default = false)</dt>
<dd>Apply aggressive overloading while obfuscating.</dd>
<dt><a href="usage.html#useuniqueclassmembernames"><code><b>useuniqueclassmembernames</b></code></a>
= "<i>boolean</i>"
(default = false)</dt>
<dd>Ensure uniform obfuscated class member names for subsequent incremental
obfuscation.</dd>
<dt><a href="usage.html#dontusemixedcaseclassnames"><code><b>usemixedcaseclassnames</b></code></a>
= "<i>boolean</i>"
(default = true)</dt>
<dd>Generate mixed-case class names while obfuscating.</dd>
<dt><a href="usage.html#flattenpackagehierarchy"><code><b>flattenpackagehierarchy</b></code></a>
= "<i>package_name</i>"
(default = none)</dt>
<dd>Repackage all packages that are renamed into the single given parent
package.</dd>
<dt><a href="usage.html#repackageclasses"><code><b>repackageclasses</b></code></a>
= "<i>package_name</i>"
(default = none)</dt>
<dd>Repackage all class files that are renamed into the single given
package.</dd>
<dt><a href="usage.html#keepparameternames"><code><b>keepparameternames</b></code></a>
= "<i>boolean</i>"
(default = false)</dt>
<dd>Keep the parameter names and types of methods that are kept.</dd>
<dt><a href="usage.html#renamesourcefileattribute"><code><b>renamesourcefileattribute</b></code></a>
= "<i>string</i>"
(default = none)</dt>
<dd>Put the given constant string in the <code>SourceFile</code>
attributes.</dd>
<dt><a href="usage.html#dontpreverify"><code><b>preverify</b></code></a>
= "<i>boolean</i>"
(default = true)</dt>
<dd>Preverify the processed class files if they are targeted at Java Micro
Edition or at Java 6 or higher.</dd>
<dt><a href="usage.html#microedition"><code><b>microedition</b></code></a>
= "<i>boolean</i>"
(default = false)</dt>
<dd>Targets the processed class files at Java Micro Edition.</dd>
<dt><a href="usage.html#verbose"><code><b>verbose</b></code></a>
= "<i>boolean</i>"
(default = false)</dt>
<dd>Write out some more information during processing.</dd>
<dt><a href="usage.html#dontnote"><code><b>note</b></code></a>
= "<i>boolean</i>"
(default = true)</dt>
<dd>Print notes about potential mistakes or omissions in the configuration.
Use the nested element <a href="#dontnote">dontnote</a> for more
fine-grained control.</dd>
<dt><a href="usage.html#dontwarn"><code><b>warn</b></code></a>
= "<i>boolean</i>"
(default = true)</dt>
<dd>Print warnings about unresolved references. Use the nested
element <a href="#dontwarn">dontwarn</a> for more fine-grained
control. <i>Only use this option if you know what you're doing!</i></dd>
<dt><a href="usage.html#ignorewarnings"><code><b>ignorewarnings</b></code></a>
= "<i>boolean</i>"
(default = false)</dt>
<dd>Print warnings about unresolved references, but continue processing
anyhow. <i>Only use this option if you know what you're doing!</i></dd>
<dt><a href="usage.html#printconfiguration"><code><b>printconfiguration</b></code></a>
= "<i>boolean or filename</i>"
(default = false)</dt>
<dd>Write out the entire configuration in traditional ProGuard style, to the
standard output or to the given file. Useful to replace unreadable
XML configurations.</dd>
<dt><a href="usage.html#dump"><code><b>dump</b></code></a>
= "<i>boolean or filename</i>"
(default = false)</dt>
<dd>Write out the internal structure of the processed class files, to the
standard output or to the given file.</dd>
<dt><a href="usage.html#injars"><code><b>&lt;injar</b></code></a>
<a href="#classpath"><i>class_path</i></a>
<code><b>/&gt;</b></code></dt>
<dd>Specifies the program jars (or wars, ears, zips, or directories).</dd>
<dt><a href="usage.html#outjars"><code><b>&lt;outjar</b></code></a>
<a href="#classpath"><i>class_path</i></a>
<code><b>/&gt;</b></code></dt>
<dd>Specifies the name of the output jars (or wars, ears, zips, or
directories).</dd>
<dt><a href="usage.html#libraryjars"><code><b>&lt;libraryjar</b></code></a>
<a href="#classpath"><i>class_path</i></a>
<code><b>/&gt;</b></code></dt>
<dd>Specifies the library jars (or wars, ears, zips, or directories).</dd>
<dt><a href="usage.html#keepdirectories"><code><b>&lt;keepdirectory name = </b></code></a>"<i>directory_name</i>"
<code><b>/&gt;</b></code><br/>
<a href="usage.html#keepdirectories"><code><b>&lt;keepdirectories filter = </b></code></a>"<a href="usage.html#filefilters"><i>directory_filter</i></a>"
<code><b>/&gt;</b></code></dt>
<dd>Keep the specified directories in the output jars (or wars, ears, zips, or
directories).</dd>
<dt><a href="usage.html#keep"><code><b>&lt;keep</b></code></a>
<a href="#keepmodifier"><i>modifiers</i></a>
<a href="#classspecification"><i>class_specification</i></a>
<code><b>&gt;</b></code>
<a href="#classmemberspecification"><i>class_member_specifications</i></a>
<code><b>&lt;/keep&gt;</b></code></dt>
<dd>Preserve the specified classes <i>and</i> class members.</dd>
<dt><a href="usage.html#keepclassmembers"><code><b>&lt;keepclassmembers</b></code></a>
<a href="#keepmodifier"><i>modifiers</i></a>
<a href="#classspecification"><i>class_specification</i></a>
<code><b>&gt;</b></code>
<a href="#classmemberspecification"><i>class_member_specifications</i></a>
<code><b>&lt;/keepclassmembers&gt;</b></code></dt>
<dd>Preserve the specified class members, if their classes are preserved as
well.</dd>
<dt><a href="usage.html#keepclasseswithmembers"><code><b>&lt;keepclasseswithmembers</b></code></a>
<a href="#keepmodifier"><i>modifiers</i></a>
<a href="#classspecification"><i>class_specification</i></a>
<code><b>&gt;</b></code>
<a href="#classmemberspecification"><i>class_member_specifications</i></a>
<code><b>&lt;/keepclasseswithmembers&gt;</b></code></dt>
<dd>Preserve the specified classes <i>and</i> class members, if all of the
specified class members are present.</dd>
<dt><a href="usage.html#keepnames"><code><b>&lt;keepnames</b></code></a>
<a href="#classspecification"><i>class_specification</i></a>
<code><b>&gt;</b></code>
<a href="#classmemberspecification"><i>class_member_specifications</i></a>
<code><b>&lt;/keepnames&gt;</b></code></dt>
<dd>Preserve the names of the specified classes <i>and</i> class members (if
they aren't removed in the shrinking step).</dd>
<dt><a href="usage.html#keepclassmembernames"><code><b>&lt;keepclassmembernames</b></code></a>
<a href="#classspecification"><i>class_specification</i></a>
<code><b>&gt;</b></code>
<a href="#classmemberspecification"><i>class_member_specifications</i></a>
<code><b>&lt;/keepclassmembernames&gt;</b></code></dt>
<dd>Preserve the names of the specified class members (if they aren't removed
in the shrinking step).</dd>
<dt><a href="usage.html#keepclasseswithmembernames"><code><b>&lt;keepclasseswithmembernames</b></code></a>
<a href="#classspecification"><i>class_specification</i></a>
<code><b>&gt;</b></code>
<a href="#classmemberspecification"><i>class_member_specifications</i></a>
<code><b>&lt;/keepclasseswithmembernames&gt;</b></code></dt>
<dd>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).</dd>
<dt><a href="usage.html#whyareyoukeeping"><code><b>&lt;whyareyoukeeping</b></code></a>
<a href="#classspecification"><i>class_specification</i></a>
<code><b>&gt;</b></code>
<a href="#classmemberspecification"><i>class_member_specifications</i></a>
<code><b>&lt;/whyareyoukeeping&gt;</b></code></dt>
<dd>Print details on why the given classes and class members are being kept in
the shrinking step.</dd>
<dt><a href="usage.html#assumenosideeffects"><code><b>&lt;assumenosideeffects</b></code></a>
<a href="#classspecification"><i>class_specification</i></a>
<code><b>&gt;</b></code>
<a href="#classmemberspecification"><i>class_member_specifications</i></a>
<code><b>&lt;/assumenosideeffects&gt;</b></code></dt>
<dd>Assume that the specified methods don't have any side effects, while
optimizing. <i>Only use this option if you know what you're
doing!</i></dd>
<dt><a href="usage.html#optimizations"><code><b>&lt;optimization name = </b></code></a>"<a href="optimizations.html"><i>optimization_name</i></a>"
<code><b>/&gt;</b></code><br/>
<a href="usage.html#optimizations"><code><b>&lt;optimizations filter = </b></code></a>""<a href="optimizations.html"><i>optimization_filter</i></a>"
<code><b>/&gt;</b></code></dt>
<dd>Perform only the specified optimizations.</dd>
<dt><a href="usage.html#keeppackagenames"><code><b>&lt;keeppackagename name = </b></code></a>"<i>package_name</i>"
<code><b>/&gt;</b></code><br/>
<a href="usage.html#keeppackagenames"><code><b>&lt;keeppackagenames filter = </b></code></a>"<a href="usage.html#filters"><i>package_filter</i></a>"
<code><b>/&gt;</b></code></dt>
<dd>Keep the specified package names from being obfuscated. If no name is
given, all package names are preserved.</dd>
<dt><a href="usage.html#keepattributes"><code><b>&lt;keepattribute name = </b></code></a>"<i>attribute_name</i>"
<code><b>/&gt;</b></code><br/>
<a href="usage.html#keepattributes"><code><b>&lt;keepattributes filter = </b></code></a>"<a href="usage.html#filters"><i>attribute_filter</i></a>"
<code><b>/&gt;</b></code></dt>
<dd>Preserve the specified optional Java bytecode attributes, with optional
wildcards. If no name is given, all attributes are preserved.</dd>
<dt><a href="usage.html#adaptclassstrings"><code><b>&lt;adaptclassstrings filter = </b></code></a>"<a href="usage.html#filters"><i>class_filter</i></a>"
<code><b>/&gt;</b></code></dt>
<dd>Adapt string constants in the specified classes, based on the obfuscated
names of any corresponding classes.</dd>
<dt><a href="usage.html#adaptresourcefilenames"><code><b>&lt;adaptresourcefilenames filter = </b></code></a>"<a href="usage.html#filefilters"><i>file_filter</i></a>"
<code><b>/&gt;</b></code></dt>
<dd>Rename the specified resource files, based on the obfuscated names of the
corresponding class files.</dd>
<dt><a href="usage.html#adaptresourcefilecontents"><code><b>&lt;adaptresourcefilecontents filter = </b></code></a>"<a href="usage.html#filefilters"><i>file_filter</i></a>"
<code><b>/&gt;</b></code></dt>
<dd>Update the contents of the specified resource files, based on the
obfuscated names of the processed classes.</dd>
<dt><a name="dontnote" />
<a href="usage.html#dontnote"><code><b>&lt;dontnote filter = </b></code></a>"<a href="usage.html#filters"><i>class_filter</i></a>"
<code><b>/&gt;</b></code></dt>
<dd>Don't print notes about classes matching the specified class name
filter.</dd>
<dt><a name="dontwarn" />
<a href="usage.html#dontwarn"><code><b>&lt;dontwarn filter = </b></code></a>"<a href="usage.html#filters"><i>class_filter</i></a>"
<code><b>/&gt;</b></code></dt>
<dd>Don't print warnings about classes matching the specified class name
filter. <i>Only use this option if you know what you're doing!</i></dd>
<dt><a name="configuration_element"><code><b>&lt;configuration refid = </b></code></a>"<i>ref_id</i>"
<code><b>/&gt;</b></code></dt>
<dd>Includes the configuration specified in the
<code>&lt;proguardconfiguration&gt;</code> task (or
<code>&lt;proguard&gt;</code> task) with the attribute <code>id</code> =
"<i>ref_id</i>". Note that only the nested elements of this configuration
are considered, not the attributes. Also note: for reading ProGuard-style
configuration files, use the <a
href="#configuration_attribute"><code>configuration</code></a>
<i>attribute</i>.</dd>
</dl>
<h2><a name="classpath">Class Path Attributes and Nested Elements</a></h2>
The jar tags are path tags, so they can have any of the path attributes (or
nested elements). The most common attributes are:
<dl>
<dt><code><b>path</b></code> = "<i>path</i>"</dt>
<dd>The names of the jars (or wars, ears, zips, or directories), separated by
the path separator.</dd>
<dt><code><b>location</b></code> = "<i>name</i>" (or <code><b>file</b></code>
= "<i>name</i>", or <code><b>dir</b></code> = "<i>name</i>", or
<code><b>name</b></code> = "<i>name</i>")</dt>
<dd>Alternatively, the name of a single jar (or war, ear, zip, or
directory).</dd>
<dt><code><b>refid</b></code> = "<i>ref_id</i>"</dt>
<dd>Alternatively, a reference to the path or file set with the attribute
<code>id</code> = "<i>ref_id</i>".</dd>
</dl>
In addition, the jar tags can have ProGuard-style filter attributes:
<dl>
<dt><code><b>filter</b></code> =
"<a href="usage.html#filefilters"><i>file_filter</i></a>"</dt>
<dd>An optional filter for all class file names and resource file names that
are encountered.</dd>
<dt><code><b>jarfilter</b></code> =
"<a href="usage.html#filefilters"><i>file_filter</i></a>"</dt>
<dd>An optional filter for all jar names that are encountered.</dd>
<dt><code><b>warfilter</b></code> =
"<a href="usage.html#filefilters"><i>file_filter</i></a>"</dt>
<dd>An optional filter for all war names that are encountered.</dd>
<dt><code><b>earfilter</b></code> =
"<a href="usage.html#filefilters"><i>file_filter</i></a>"</dt>
<dd>An optional filter for all ear names that are encountered.</dd>
<dt><code><b>zipfilter</b></code> =
"<a href="usage.html#filefilters"><i>file_filter</i></a>"</dt>
<dd>An optional filter for all zip names that are encountered.</dd>
</dl>
<h2><a name="keepmodifier">Keep Modifier Attributes</a></h2>
The keep tags can have the following <i>modifier</i> attributes:
<dl>
<dt><a href="usage.html#allowshrinking"><code><b>allowshrinking</b></code></a>
= "<i>boolean</i>"
(default = false)</dt>
<dd>Specifies whether the entry points specified in the keep tag may be
shrunk.</dd>
<dt><a href="usage.html#allowoptimization"><code><b>allowoptimization</b></code></a>
= "<i>boolean</i>"
(default = false)</dt>
<dd>Specifies whether the entry points specified in the keep tag may be
optimized.</dd>
<dt><a href="usage.html#allowobfuscation"><code><b>allowobfuscation</b></code></a>
= "<i>boolean</i>"
(default = false)</dt>
<dd>Specifies whether the entry points specified in the keep tag may be
obfuscated.</dd>
</dl>
<h2><a name="classspecification">Class Specification Attributes and Nested Elements</a></h2>
The keep tags can have the following <i>class_specification</i> attributes and
<i>class_member_specifications</i> nested elements:
<dl>
<dt><code><b>access</b></code> = "<i>access_modifiers</i>"</dt>
<dd>The optional access modifiers of the class. Any space-separated list of
"public", "final", and "abstract", with optional negators "!".</dd>
<dt><code><b>annotation</b></code> = "<i>annotation_name</i>"</dt>
<dd>The optional fully qualified name of an annotation of the class, with
optional wildcards.</dd>
<dt><code><b>type</b></code> = "<i>type</i>"</dt>
<dd>The optional type of the class: one of "class", "interface", or
"!interface".</dd>
<dt><code><b>name</b></code> = "<i>class_name</i>"</dt>
<dd>The optional fully qualified name of the class, with optional
wildcards.</dd>
<dt><code><b>extendsannotation</b></code> = "<i>annotation_name</i>"</dt>
<dd>The optional fully qualified name of an annotation of the the class that
the specified classes must extend, with optional wildcards.</dd>
<dt><code><b>extends</b></code> = "<i>class_name</i>"</dt>
<dd>The optional fully qualified name of the class the specified classes
must extend, with optional wildcards.</dd>
<dt><code><b>implements</b></code> = "<i>class_name</i>"</dt>
<dd>The optional fully qualified name of the class the specified classes
must implement, with optional wildcards.</dd>
<dt><code><b>&lt;field</b></code>
<a href="#classmemberspecification"><i>class_member_specification</i></a>
<code><b>/&gt;</b></code></dt>
<dd>Specifies a field.</dd>
<dt><code><b>&lt;method</b></code>
<a href="#classmemberspecification"><i>class_member_specification</i></a>
<code><b>/&gt;</b></code></dt>
<dd>Specifies a method.</dd>
<dt><code><b>&lt;constructor</b></code>
<a href="#classmemberspecification"><i>class_member_specification</i></a>
<code><b>/&gt;</b></code></dt>
<dd>Specifies a constructor.</dd>
</dl>
<h2><a name="classmemberspecification">Class Member Specification Attributes</a></h2>
The class member tags can have the following <i>class_member_specification</i>
attributes:
<dl>
<dt><code><b>access</b></code> = "<i>access_modifiers</i>"</dt>
<dd>The optional access modifiers of the class. Any space-separated list of
"public", "protected", "private", "static", etc., with optional negators
"!".</dd>
<dt><code><b>annotation</b></code> = "<i>annotation_name</i>"</dt>
<dd>The optional fully qualified name of an annotation of the class member,
with optional wildcards.</dd>
<dt><code><b>type</b></code> = "<i>type</i>"</dt>
<dd>The optional fully qualified type of the class member, with optional
wildcards. Not applicable for constructors, but required for methods for
which the <code>parameters</code> attribute is specified.</dd>
<dt><code><b>name</b></code> = "<i>name</i>"</dt>
<dd>The optional name of the class member, with optional wildcards. Not
applicable for constructors.</dd>
<dt><code><b>parameters</b></code> = "<i>parameters</i>"</dt>
<dd>The optional comma-separated list of fully qualified method parameters,
with optional wildcards. Not applicable for fields, but required for
constructors, and for methods for which the <code>type</code> attribute is
specified.</dd>
</dl>
<hr />
<noscript><div><a target="_top" href="../index.html" class="button">Show menu</a></div></noscript>
<address>
Copyright &copy; 2002-2011
<a target="other" href="http://www.lafortune.eu/">Eric Lafortune</a>.
</address>
</body>
</html>

Binary file not shown.

After

Width:  |  Height:  |  Size: 896 B

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,479 @@
<!doctype html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//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 GUI</title>
<script type="text/javascript" language="JavaScript">
<!--
if (window.self==window.top)
window.top.location.replace("../index.html#"+window.location.pathname+window.location.hash);
else {
var hash="#"+window.location.pathname.replace(window.top.location.pathname.replace("index.html", ""), "");
if (window.top.location.hash!=hash)
window.top.location.hash=hash;
}
//-->
</script>
</head>
<body>
<h2>Graphical User Interface</h2>
You can find the ProGuard GUI jar in the <code>lib</code> directory of the
ProGuard distribution. To run the ProGuard graphical user interface, just type:
<p class="code">
<code><b>java -jar proguardgui.jar</b> [-nosplash] </code>[<i>configuration_file</i>]
</p>
The GUI will pop up in a window. With the <code>-nosplash</code> option, you
can switch off the short opening animation. If you have specified a ProGuard
configuration file, it will be loaded. The GUI works like a wizard. You can
edit the configuration and execute ProGuard through a few tabs:
<p>
<table cellspacing="5" cellpadding="5">
<tr><td class="button"><a href="#proguard">ProGuard</a></td>
<td>Optionally load an existing configuration file.</td></tr>
<tr><td class="button"><a href="#inputoutput">Input/Output</a></td>
<td>Specify the program jars and library jars.</td></tr>
<tr><td class="button"><a href="#shrinking">Shrinking</a></td>
<td>Specify the shrinking options.</td></tr>
<tr><td class="button"><a href="#obfuscation">Obfuscation</a></td>
<td>Specify the obfuscation options.</td></tr>
<tr><td class="button"><a href="#optimization">Optimization</a></td>
<td>Specify the optimization options.</td></tr>
<tr><td class="button"><a href="#information">Information</a></td>
<td>Specify some options to get information.</td></tr>
<tr><td class="button"><a href="#process">Process</a></td>
<td>View and save the resulting configuration, and run ProGuard.</td></tr>
</table>
<p>
In addition, there is a tab to execute ReTrace interactively:
<p>
<table cellspacing="5" cellpadding="5">
<tr><td class="button"><a href="#retrace">ReTrace</a></td>
<td>Set up and run ReTrace, to de-obfuscate stack traces.</td></tr>
</table>
<p>
You can freely toggle between the tabs by means of the buttons on the
left-hand side of the window, or by means of the <b>Previous</b> and
<b>Next</b> buttons at the bottom of the tabs. Tool tips briefly explain the
purpose of the numerous options and text fields, although a basic
understanding of the shrinking/optimization/obfuscation/preverification
process is assumed. Please refer to the <a
href="introduction.html">Introduction</a> of this manual.
<p>
<h2><a name="proguard">The ProGuard Tab</a></h2>
The <i>ProGuard</i> tab presents a welcome message and one important button at
the bottom:
<p>
<table cellspacing="5" cellpadding="5">
<tr><td class="button">Load configuration...</td>
<td>opens a file chooser to load an existing ProGuard configuration
file.</td></tr>
</table>
<p>
If you don't want to load an existing configuration, you can just continue
creating a new configuration from scratch.
<p>
<h2><a name="inputoutput">The Input/Output Tab</a></h2>
The <i>Input/Output</i> tab contains two lists, respectively to specify the
program jars (or wars, ears, zips, or directories), and the library jars (or
wars, ears, zips, or directories).
<ul>
<li>The list of program jars contains input entries and output entries. Input
entries contain the class files and resource files to be processed. Output
entries specify the destinations to which the processed results will be
written. They are preceded by arrows, to distinguish them from input
entries. The results of each consecutive list of input entries will be
written to the subsequent consecutive list of output entries.</li>
<li>The library jars are not copied to the output jars; they contain class
files that are used by class files in the program jars and that are
necessary for correct processing. This list typically at least contains the
targeted Java runtime jar.</li>
</ul>
<p>
Each of these lists can be edited by means of a couple of buttons on the
right-hand side:
<p>
<table cellspacing="5" cellpadding="5">
<tr><td class="button">Add input...</td> <td>opens a file chooser to add an
input entry to the list of program jars.</td></tr>
<tr><td class="button">Add output...</td> <td>opens a file chooser to add an
output entry to the list of program jars.</td></tr>
<tr><td class="button">Add...</td>
<td>opens a file chooser to add an entry to the list of library
jars.</td></tr>
<tr><td class="button">Edit...</td>
<td>opens a file chooser to edit the selected entry in the list.</td></tr>
<tr><td class="button">Filter...</td>
<td>opens a text entry field to add or edit the filters of the selected
entries in the list.</td></tr>
<tr><td class="button">Remove</td>
<td>removes the selected entries from the list.</td></tr>
<tr><td class="button">Move up</td>
<td>moves the selected entries one position up the list.</td></tr>
<tr><td class="button">Move down</td>
<td>moves the selected entries one position down the list.</td></tr>
<tr><td class="button">Move to libraries</td>
<td>moves the selected entries in the list of program jars to the list of
library jars.</td></tr>
<tr><td class="button">Move to program</td>
<td>moves the selected entries in the list of library jars to the list of
program jars.</td></tr>
</table>
<p>
Filters allow to filter files based on their names. One can specify filters
for class file names and resource file names, for jar file names, for war file
names, for ear file names, and for zip file names. Multiple entries in the
program list only make sense when combined with filters; each output file is
written to the first entry with a matching filter.
<p>
Input entries that are currently not readable are colored red.
<p>
The order of the entries in each list may matter, as the first occurrence of
any duplicate entries gets precedence, just as in conventional class paths.
<p>
Corresponding configuration options:
<ul type="none">
<li>-<a href="usage.html#injars">injars</a></li>
<li>-<a href="usage.html#outjars">outjars</a></li>
<li>-<a href="usage.html#libraryjars">libraryjars</a></li>
<li><a href="usage.html#classpath"><i>class_path</i></a></li>
<li><a href="usage.html#filters"><i>filters</i></a></li>
</ul>
<p>
<h2><a name="shrinking">The Shrinking Tab</a></h2>
The <i>Shrinking</i> tab presents a number of options that affect the
shrinking step. The basic options are followed by a few lists of classes and
class members (fields and methods) that must be protected from shrinking (and
implicitly from obfuscation as well).
<p>
The fixed lists contain predefined entries that are typically useful for many
applications. Each of these entries can be toggled by means of a check box.
The text field following each entry allows to constrain the applicable classes
by means of a comma-separated list of wildcarded, fully-qualified class
names. The default is "*", which means that all input classes of the
corresponding type are considered.
<p>
For example, checking the <b>Applications</b> entry and filling in
"myapplications.**" after it would mean: keep all classes that have main
methods in the "myapplications" package and all of its subpackages.
<p>
The variable list at the bottom allows to define additional entries
yourself. The list can be edited by means of a couple of buttons on the
right-hand side:
<p>
<table cellspacing="5" cellpadding="5">
<tr><td class="button">Add...</td>
<td>opens a window to add a new entry to the list.</td></tr>
<tr><td class="button">Edit...</td>
<td>opens a window to edit the selected entry in the list.</td></tr>
<tr><td class="button">Remove</td>
<td>removes the selected entries from the list.</td></tr>
<tr><td class="button">Move up</td>
<td>moves the selected entries one position up the list.</td></tr>
<tr><td class="button">Move down</td>
<td>moves the selected entries one position down the list.</td></tr>
</table>
<p>
The interface windows allow to specify classes, fields, and methods. They
contain text fields and check boxes to constrain these items. They have
<b>Ok</b> and <b>Cancel</b> buttons to apply or to cancel the operation.
<p>
For example, your application may be creating some classes dynamically using
<code>Class.forName</code>. You should then specify them here, so they are kept
by their original names. Press the <b>Add...</b> button to open the class
window. Fill out the fully-qualified class name in the <b>Code</b> text field,
and press the <b>Ok</b> button. Repeat this for all required classes. Wildcards
can be helpful to specify a large number of related classes in one go. If you
want to specify all implementations of a certain interface, fill out the
fully qualified interface name in the <b>Extends/implements class</b> instead.
<p>
For more advanced settings, it is advisable to become familiar with ProGuard's
configuration options through the <a href="usage.html">Usage section</a> and
the <a href="examples.html">Examples section</a>. We'll suffice with a brief
overview of the three dialogs provided by the GUI.
<p>
The <i>keep class</i> dialog appears when adding or editing new special keep
entries. It has text fields and selections for specifying and constraining
classes and class members to keep. The <b>Advanced options</b> / <b>Basic
options</b> button at the bottom of the dialog allows to toggle showing the
advanced options.
<ul>
<li>The <b>Comments</b> text field allows to add optional comments to this
entry. The comments will identify the entry in the list and they will
appear as comments in the configuration file.</li>
<li>The <b>Keep</b> selection allows to specify whether you want to protect
the specified classes and their specified class members, or just the
specified class members from the specified classes, or the specified
classes and the specified class members, if the class members are present.
Note that class members will only be protected if they are explicitly
specified, even if only by means of a wildcard.</li>
<li>The <b>Allow</b> selection allows to specify whether you want to allow the
the specified classes and their specified class members to be shrunk,
optimized and/or obfuscated.</li>
<li>The <b>Access</b> selections allows to specify constraints on the class or
classes, based on their access modifiers.</li>
<li>The <b>Annotation</b> text field takes the fully-qualified name of an
annotation that is required for matching classes. The annotation name can
contain wildcards. This is an advanced option for defining <i>keep</i>
annotations.</li>
<li>The <b>Class</b> text field takes the fully-qualified name of the class or
classes. The class name can contain wildcards.</li>
<li>The <b>Annotation</b> text field takes the fully-qualified name of an
annotation that is required for the class or interface that the above
class must extend. The annotation name can contain wildcards. This is an
advanced option for defining <i>keep</i> annotations.</li>
<li>The <b>Extends/implements class</b> text field takes the fully-qualified
name of the class or interface that the above classes must extend.</li>
<li>The <b>Class members</b> list allows to specify a list of fields and
methods to keep. It can be edited by means of a list of buttons on the
right-hand side.</li>
</ul>
<p>
The <i>keep field</i> dialog appears when adding or editing fields within the
above dialog. It has text fields and selections for specifying and
constraining fields to keep. Again, the <b>Advanced options</b> / <b>Basic
options</b> button at the bottom of the dialog allows to toggle showing the
advanced options.
<ul>
<li>The <b>Access</b> selections allows to specify constraints on the field or
fields, based on their access modifiers.</li>
<li>The <b>Annotation</b> text field takes the fully-qualified name of an
annotation that is required for matching fields. The annotation name can
contain wildcards. This is an advanced option for defining <i>keep</i>
annotations.</li>
<li>The <b>Return type</b> text field takes the fully-qualified type of the
field or fields. The type can contain wildcards.</li>
<li>The <b>Name</b> text field takes the name of the field or fields. The field
name can contain wildcards.</li>
</ul>
<p>
Similarly, the <i>keep method</i> dialog appears when adding or editing
methods within the keep class dialog. It has text fields and selections for
specifying and constraining methods to keep. Again, the <b>Advanced
options</b> / <b>Basic options</b> button at the bottom of the dialog allows
to toggle showing the advanced options.
<ul>
<li>The <b>Access</b> selections allows to specify constraints on the method or
methods, based on their access modifiers.</li>
<li>The <b>Annotation</b> text field takes the fully-qualified name of an
annotation that is required for matching methods. The annotation name can
contain wildcards. This is an advanced option for defining <i>keep</i>
annotations.</li>
<li>The <b>Return type</b> text field takes the fully-qualified type of the method or methods. The type can contain wildcards.</li>
<li>The <b>Name</b> text field takes the name of the method or methods. The
method name can contain wildcards.</li>
<li>The <b>Arguments</b> text field takes the comma-separated list of
fully-qualified method arguments. Each of these arguments can contain
wildcards.</li>
</ul>
<p>
Corresponding configuration options:
<ul type="none">
<li>-<a href="usage.html#dontshrink">dontshrink</a></li>
<li>-<a href="usage.html#printusage">printusage</a></li>
<li>-<a href="usage.html#keep">keep</a></li>
<li>-<a href="usage.html#keepclassmembers">keepclassmembers</a></li>
<li>-<a href="usage.html#keepclasseswithmembers">keepclasseswithmembers</a></li>
</ul>
<p>
<h2><a name="obfuscation">The Obfuscation Tab</a></h2>
The <i>Obfuscation</i> tab presents a number of options that affect the
obfuscation step. The basic options are followed by a few lists of classes and
class members (fields and methods) that must be protected from obfuscation
(but not necessarily from shrinking).
<p>
The lists are manipulated in the same way as in the <a
href="#shrinking">Shrinking Tab</a>.
<p>
Corresponding configuration options:
<ul type="none">
<li>-<a href="usage.html#dontobfuscate">dontobfuscate</a></li>
<li>-<a href="usage.html#printmapping">printmapping</a></li>
<li>-<a href="usage.html#applymapping">applymapping</a></li>
<li>-<a href="usage.html#obfuscationdictionary">obfuscationdictionary</a></li>
<li>-<a href="usage.html#classobfuscationdictionary">classobfuscationdictionary</a></li>
<li>-<a href="usage.html#packageobfuscationdictionary">packageobfuscationdictionary</a></li>
<li>-<a href="usage.html#overloadaggressively">overloadaggressively</a></li>
<li>-<a href="usage.html#useuniqueclassmembernames">useuniqueclassmembernames</a></li>
<li>-<a href="usage.html#dontusemixedcaseclassnames">dontusemixedcaseclassnames</a></li>
<li>-<a href="usage.html#keeppackagenames">keeppackagenames</a></li>
<li>-<a href="usage.html#flattenpackagehierarchy">flattenpackagehierarchy</a></li>
<li>-<a href="usage.html#repackageclasses">repackageclasses</a></li>
<li>-<a href="usage.html#keepattributes">keepattributes</a></li>
<li>-<a href="usage.html#keepparameternames">keepparameternames</a></li>
<li>-<a href="usage.html#renamesourcefileattribute">renamesourcefileattribute</a></li>
<li>-<a href="usage.html#adaptclassstrings">adaptclassstrings</a></li>
<li>-<a href="usage.html#adaptresourcefilenames">adaptresourcefilenames</a></li>
<li>-<a href="usage.html#adaptresourcefilecontents">adaptresourcefilecontents</a></li>
<li>-<a href="usage.html#keepnames">keepnames</a></li>
<li>-<a href="usage.html#keepclassmembernames">keepclassmembernames</a></li>
<li>-<a href="usage.html#keepclasseswithmembernames">keepclasseswithmembernames</a></li>
<li><a href="usage.html#classspecification"><i>class_specification</i></a></li>
</ul>
<p>
<h2><a name="optimization">The Optimization Tab</a></h2>
The <i>Optimization</i> tab presents a number of options that affect the
optimization step. The basic options are followed by a few lists of class
method calls that can be removed if ProGuard can determine that their results
are not being used.
<p>
The lists are manipulated in much the same way as in the <a
href="#shrinking">Shrinking Tab</a>.
<p>
Corresponding configuration options:
<ul type="none">
<li>-<a href="usage.html#dontoptimize">dontoptimize</a></li>
<li>-<a href="usage.html#optimizations">optimizations</a></li>
<li>-<a href="usage.html#optimizationpasses">optimizationpasses</a></li>
<li>-<a href="usage.html#allowaccessmodification">allowaccessmodification</a></li>
<li>-<a href="usage.html#mergeinterfacesaggressively">mergeinterfacesaggressively</a></li>
<li>-<a href="usage.html#assumenosideeffects">assumenosideeffects</a></li>
<li><a href="usage.html#classspecification"><i>class_specification</i></a></li>
</ul>
<p>
<h2><a name="information">The Information Tab</a></h2>
The <i>Information</i> tab presents a number of options for preverification
and targeting, and for the information that ProGuard returns when processing
your code. The bottom list allows you to query ProGuard about why given
classes and class members are being kept in the shrinking step.
<p>
Corresponding configuration options:
<ul type="none">
<li>-<a href="usage.html#dontpreverify">dontpreverify</a></li>
<li>-<a href="usage.html#microedition">microedition</a></li>
<li>-<a href="usage.html#target">target</a></li>
<li>-<a href="usage.html#verbose">verbose</a></li>
<li>-<a href="usage.html#dontnote">dontnote</a></li>
<li>-<a href="usage.html#dontwarn">dontwarn</a></li>
<li>-<a href="usage.html#ignorewarnings">ignorewarnings</a></li>
<li>-<a href="usage.html#skipnonpubliclibraryclasses">skipnonpubliclibraryclasses</a></li>
<li>-<a href="usage.html#dontskipnonpubliclibraryclasses">dontskipnonpubliclibraryclasses</a></li>
<li>-<a href="usage.html#dontskipnonpubliclibraryclassmembers">dontskipnonpubliclibraryclassmembers</a></li>
<li>-<a href="usage.html#keepdirectories">keepdirectories</a></li>
<li>-<a href="usage.html#forceprocessing">forceprocessing</a></li>
<li>-<a href="usage.html#printseeds">printseeds</a></li>
<li>-<a href="usage.html#printconfiguration">printconfiguration</a></li>
<li>-<a href="usage.html#dump">dump</a></li>
<li>-<a href="usage.html#whyareyoukeeping">whyareyoukeeping</a></li>
</ul>
<p>
<h2><a name="process">The Process Tab</a></h2>
The <i>Process</i> tab has an output console for displaying the configuration
and the messages while processing. There are three important buttons at the
bottom:
<p>
<table cellspacing="5" cellpadding="5">
<tr><td class="button">View configuration</td>
<td>displays the current ProGuard configuration in the console.</td></tr>
<tr><td class="button">Save configuration...</td>
<td>opens a file chooser to save the current ProGuard
configuration.</td></tr>
<tr><td class="button">Process!</td>
<td>executes ProGuard with the current configuration.</td></tr>
</table>
<p>
<h2><a name="retrace">The ReTrace Tab</a></h2>
The <i>ReTrace</i> tab has a panel with a few settings, an input text area for
the obfuscated stack trace, and an output console to view the de-obfuscated
stack trace:
<ul>
<li>The <b>Verbose</b> check box in the settings panel allows to toggle between
normal mode and verbose mode.</li>
<li>The <b>Mapping file</b> text field takes the name of the required mapping
file that ProGuard wrote while processing the original code. The file name
can be entered manually or by means of the <b>Browse...</b> button that
opens a file chooser.</li>
<li>The <b>Obfuscated stack trace</b> text area allows to enter the stack
trace, typically by copying and pasting it from elsewhere. Alternatively,
it can be loaded from a file by means of the load button below.</li>
</ul>
There are two buttons at the bottom:
<p>
<table cellspacing="5" cellpadding="5">
<tr><td class="button">Load stack trace...</td>
<td>opens a file chooser to load an obfuscated stack trace.</td></tr>
<tr><td class="button">ReTrace!</td>
<td>executes ReTrace with the current settings.</td></tr>
</table>
<hr />
<noscript><div><a target="_top" href="../index.html" class="button">Show menu</a></div></noscript>
<address>
Copyright &copy; 2002-2011
<a target="other" href="http://www.lafortune.eu/">Eric Lafortune</a>.
</address>
</body>
</html>

View File

@@ -0,0 +1,51 @@
<!doctype html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//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 Manual</title>
<script type="text/javascript" language="JavaScript">
<!--
if (window.self==window.top)
window.top.location.replace("../index.html#"+window.location.pathname+window.location.hash);
else {
var hash="#"+window.location.pathname.replace(window.top.location.pathname.replace("index.html", ""), "");
if (window.top.location.hash!=hash)
window.top.location.hash=hash;
}
//-->
</script>
</head>
<body>
<h2>ProGuard</h2>
<ol>
<li><a href="introduction.html">Introduction</a></li>
<li><a href="usage.html">Usage</a></li>
<li><a href="limitations.html">Limitations</a></li>
<li><a href="examples.html">Examples</a></li>
<li><a href="troubleshooting.html">Troubleshooting</a></li>
<li><a href="refcard.html">Reference Card</a></li>
<li><a href="gui.html">Graphical User Interface</a></li>
<li><a href="ant.html">Ant Task</a></li>
<li><a href="wtk.html">JME Wireless Toolkit Integration</a></li>
</ol>
<h2>ReTrace</h2>
<ol>
<li><a href="retrace/introduction.html">Introduction</a></li>
<li><a href="retrace/usage.html">Usage</a></li>
<li><a href="retrace/examples.html">Examples</a></li>
</ol>
<hr />
<noscript><div><a target="_top" href="../index.html" class="button">Show menu</a></div></noscript>
<address>
Copyright &copy; 2002-2011
<a target="other" href="http://www.lafortune.eu/">Eric Lafortune</a>.
</address>
</body>
</html>

View File

@@ -0,0 +1,173 @@
<!doctype html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//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 Introduction</title>
<script type="text/javascript" language="JavaScript">
<!--
if (window.self==window.top)
window.top.location.replace("../index.html#"+window.location.pathname+window.location.hash);
else {
var hash="#"+window.location.pathname.replace(window.top.location.pathname.replace("index.html", ""), "");
if (window.top.location.hash!=hash)
window.top.location.hash=hash;
}
//-->
</script>
</head>
<body>
<h2>Introduction</h2>
<b>ProGuard</b> is a Java class file shrinker, optimizer, obfuscator, and
preverifier. The shrinking step detects and removes unused classes, fields,
methods, and attributes. The optimization step analyzes and optimizes the
bytecode of the methods. The obfuscation step renames the remaining classes,
fields, and methods using short meaningless names. These first steps make the
code base smaller, more efficient, and harder to reverse-engineer. The final
preverification step adds preverification information to the classes, which is
required for Java Micro Edition or which improves the start-up time for Java
6.
<p>
Each of these steps is optional. For instance, ProGuard can also be used to
just list dead code in an application, or to preverify class files for
efficient use in Java 6.
<p>
<table class="diagram" align="center">
<tr>
<td rowspan="4" class="lightblock">Input jars</td>
<td colspan="8" class="transparentblock"></td>
</tr>
<tr>
<td rowspan="2" class="transparentblock"></td>
<td rowspan="3" class="lightblock">Shrunk code</td>
<td colspan="6" class="transparentblock"></td>
</tr>
<tr>
<td class="transparentblock"></td>
<td rowspan="2" class="lightblock">Optim. code</td>
<td colspan="3" class="transparentblock"></td>
<td rowspan="2" class="lightblock">Output jars</td>
</tr>
<tr>
<td class="transparentblock">- shrink &rarr;</td>
<td class="transparentblock">- optimize &rarr;</td>
<td class="transparentblock">- obfuscate &rarr;</td>
<td class="lightblock">Obfusc. code</td>
<td class="transparentblock">- preverify &rarr;</td>
</tr>
<tr>
<td class="darkblock">Library jars</td>
<td colspan="7" class="transparentblock">------------------------------- (unchanged) -------------------------------&rarr;</td>
<td class="darkblock">Library jars</td>
</tr>
</table>
<p>
ProGuard typically reads the <b>input jars</b> (or wars, ears, zips, or
directories). It then shrinks, optimizes, obfuscates, and preverifies them.
Optionally, multiple optimization passes can be performed, each typically
followed by another shrinking step. ProGuard writes the processed results to
one or more <b>output jars</b> (or wars, ears, zips, or directories). The
input may contain resource files, whose names and contents can optionally be
updated to reflect the obfuscated class names.
<p>
ProGuard requires the <b>library jars</b> (or wars, ears, zips, or
directories) of the input jars to be specified. These are essentially the
libraries that you would need for compiling the code. ProGuard uses them to
reconstruct the class dependencies that are necessary for proper processing.
The library jars themselves always remain unchanged. You should still put them
in the class path of your final application.
<h3>Entry points</h3>
In order to determine which code has to be preserved and which code can be
discarded or obfuscated, you have to specify one or more <i>entry points</i> to
your code. These entry points are typically classes with main methods, applets,
midlets, etc.
<ul>
<li>In the <b>shrinking step</b>, ProGuard starts from these seeds and
recursively determines which classes and class members are used. All other
classes and class members are discarded.</li>
<li>In the <b>optimization step</b>, ProGuard further optimizes the code.
Among other optimizations, classes and methods that are not entry points
can be made private, static, or final, unused parameters can be removed,
and some methods may be inlined.</li>
<li>In the <b>obfuscation step</b>, ProGuard renames classes and class members
that are not entry points. In this entire process, keeping the entry
points ensures that they can still be accessed by their original names.</li>
<li>The <b>preverification step</b> is the only step that doesn't have to know
the entry points.</li>
</ul>
<p>
The <a href="usage.html">Usage section</a> of this manual describes the
necessary <a href="usage.html#keepoptions"><code>-keep</code> options</a> and
the <a href="examples.html">Examples section</a> provides plenty of examples.
<h3>Reflection</h3>
Reflection and introspection present particular problems for any automatic
processing of code. In ProGuard, classes or class members in your code that
are created or invoked dynamically (that is, by name) have to be specified as
entry points too. For example, <code>Class.forName()</code> constructs may
refer to any class at run-time. It is generally impossible to foresee which
classes have to be preserved (with their original names), since the class
names might be read from a configuration file, for instance. You therefore
have to specify them in your ProGuard configuration, with the same
simple <code>-keep</code> options.
<p>
However, ProGuard will already detect and handle the following cases for you:
<ul>
<li><code>Class.forName("SomeClass")</code></li>
<li><code>SomeClass.class</code></li>
<li><code>SomeClass.class.getField("someField")</code></li>
<li><code>SomeClass.class.getDeclaredField("someField")</code></li>
<li><code>SomeClass.class.getMethod("someMethod", new Class[] {})</code></li>
<li><code>SomeClass.class.getMethod("someMethod", new Class[] { A.class })</code></li>
<li><code>SomeClass.class.getMethod("someMethod", new Class[] { A.class, B.class })</code></li>
<li><code>SomeClass.class.getDeclaredMethod("someMethod", new Class[] {})</code></li>
<li><code>SomeClass.class.getDeclaredMethod("someMethod", new Class[] { A.class })</code></li>
<li><code>SomeClass.class.getDeclaredMethod("someMethod", new Class[] { A.class, B.class })</code></li>
<li><code>AtomicIntegerFieldUpdater.newUpdater(SomeClass.class, "someField")</code></li>
<li><code>AtomicLongFieldUpdater.newUpdater(SomeClass.class, "someField")</code></li>
<li><code>AtomicReferenceFieldUpdater.newUpdater(SomeClass.class, SomeType.class, "someField")</code></li>
</ul>
The names of the classes and class members may of course be different, but the
constructs should be literally the same for ProGuard to recognize them. The
referenced classes and class members are preserved in the shrinking phase, and
the string arguments are properly updated in the obfuscation phase.
<p>
Furthermore, ProGuard will offer some suggestions if keeping some classes or
class members appears necessary. For example, ProGuard will note constructs
like "<code>(SomeClass)Class.forName(variable).newInstance()</code>". These
might be an indication that the class or interface <code>SomeClass</code>
and/or its implementations may need to be preserved. You can then adapt your
configuration accordingly.
<p>
For proper results, you should at least be somewhat familiar with the code
that you are processing. Obfuscating code that performs a lot of reflection
may require trial and error, especially without the necessary information
about the internals of the code.
<hr />
<noscript><div><a target="_top" href="../index.html" class="button">Show menu</a></div></noscript>
<address>
Copyright &copy; 2002-2011
<a target="other" href="http://www.lafortune.eu/">Eric Lafortune</a>.
</address>
</body>
</html>

View File

@@ -0,0 +1,69 @@
<!doctype html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//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 Limitations</title>
<script type="text/javascript" language="JavaScript">
<!--
if (window.self==window.top)
window.top.location.replace("../index.html#"+window.location.pathname+window.location.hash);
else {
var hash="#"+window.location.pathname.replace(window.top.location.pathname.replace("index.html", ""), "");
if (window.top.location.hash!=hash)
window.top.location.hash=hash;
}
//-->
</script>
</head>
<body>
<h2>Limitations</h2>
When using ProGuard, you should be aware of a few technical issues, all of
which are easily avoided or resolved:
<p>
<ul class="spacious">
<li>For best results, ProGuard's optimization algorithms assume that the
processed code never <b>intentionally throws NullPointerExceptions</b> or
ArrayIndexOutOfBoundsExceptions, or even OutOfMemoryErrors or
StackOverflowErrors, in order to achieve something useful. For instance,
it may remove a method call <code>myObject.myMethod()</code> if that call
wouldn't have any effect. It ignores the possibility that
<code>myObject</code> might be null, causing a NullPointerException. In
some way this is a good thing: optimized code may throw fewer exceptions.
Should this entire assumption be false, you'll have to switch off
optimization using the <code>-dontoptimize</code> option.</li>
<li>ProGuard's optimization algorithms currently also assume that the
processed code never creates <b>busy-waiting loops</b> without at least
testing on a volatile field. Again, it may remove such loops. Should this
assumption be false, you'll have to switch off optimization using
the <code>-dontoptimize</code> option.</li>
<li>If an input jar and a library jar contain classes in the <b>same
package</b>, the obfuscated output jar may contain class names that
overlap with class names in the library jar. This is most likely if the
library jar has been obfuscated before, as it will then probably contain
classes named 'a', 'b', etc. Packages should therefore never be split
across input jars and library jars.</li>
<li>When obfuscating, ProGuard writes out class files named
"<code>a.class</code>", "<code>b.class</code>", etc. If a package contains
a large number of classes, ProGuard may also write out
<b>"<code>aux.class</code>"</b>. Inconveniently, Windows refuses to create
files with this reserved name (among a few other names). It's generally
better to write the output to a jar, in order to avoid such problems.</li>
</ul>
<hr />
<noscript><div><a target="_top" href="../index.html" class="button">Show menu</a></div></noscript>
<address>
Copyright &copy; 2002-2011
<a target="other" href="http://www.lafortune.eu/">Eric Lafortune</a>.
</address>
</body>
</html>

View File

@@ -0,0 +1,172 @@
<!doctype html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//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>Optimizations</title>
<script type="text/javascript" language="JavaScript">
<!--
if (window.self==window.top)
window.top.location.replace("../index.html#"+window.location.pathname+window.location.hash);
else {
var hash="#"+window.location.pathname.replace(window.top.location.pathname.replace("index.html", ""), "");
if (window.top.location.hash!=hash)
window.top.location.hash=hash;
}
//-->
</script>
</head>
<body>
<h2>Optimizations</h2>
The optimization step of ProGuard can be switched off with the
<a href="usage.html#dontoptimize"><code>-dontoptimize</code></a> option. For
more fine-grained control over individual optimizations, experts can use the
<a href="usage.html#optimizations"><code>-optimizations</code></a> option,
with a filter based on the optimization names listed below. The filter works
like any <a href="usage.html#filters">filter</a> in ProGuard.
<p>
The following wildcards are supported:
<table cellspacing="10">
<tr><td valign="top"><code><b>?</b></code></td>
<td>matches any single character in an optimization name.</td></tr>
<tr><td valign="top"><code><b>*</b></code></td>
<td>matches any part of an optimization name.</td></tr>
</table>
An optimization that is preceded by an exclamation mark '<b>!</b>' is
<i>excluded</i> from further attempts to match with <i>subsequent</i>
optimization names in the filter. Make sure to specify filters correctly,
since they are not checked for potential typos.
<p>
For example,
"<code>code/simplification/variable,code/simplification/arithmetic</code>"
only performs the two specified peephole optimizations.
<p>
For example, "<code>!method/propagation/*</code>" performs all optimizations,
except the ones that propagate values between methods.
<p>
For example,
"<code>!code/simplification/advanced,code/simplification/*</code>" only
performs all peephole optimizations.
<p>
Some optimizations necessarily imply other optimizations. These are then
indicated. Note that the list is likely to change over time, as optimizations
are added and reorganized.
<p>
<dl>
<dt><code><b>class/marking/final</b></code></dt>
<dd>Marks classes as final, whenever possible.</dd>
<dt><code><b>class/merging/vertical</b></code></dt>
<dd>Merges classes vertically in the class hierarchy, whenever possible.</dd>
<dt><code><b>class/merging/horizontal</b></code></dt>
<dd>Merges classes horizontally in the class hierarchy, whenever possible.</dd>
<dt><div>(&rArr; <code>code/removal/advanced</code>)</div>
<code><b>field/removal/writeonly</b></code></dt>
<dd>Removes write-only fields.</dd>
<dt><code><b>field/marking/private</b></code></dt>
<dd>Marks fields as private, whenever possible.</dd>
<dt><div>(&rArr; <code>code/simplification/advanced</code>)</div>
<code><b>field/propagation/value</b></code></dt>
<dd>Propagates the values of fields across methods.</dd>
<dt><code><b>method/marking/private</b></code></dt>
<dd>Marks methods as private, whenever possible (<i>devirtualization</i>).</dd>
<dt><div>(&rArr; <code>code/removal/advanced</code>)</div>
<code><b>method/marking/static</b></code></dt>
<dd>Marks methods as static, whenever possible (<i>devirtualization</i>).</dd>
<dt><code><b>method/marking/final</b></code></dt>
<dd>Marks methods as final, whenever possible.</dd>
<dt><div>(&rArr; <code>code/removal/advanced</code>)</div>
<code><b>method/removal/parameter</b></code></dt>
<dd>Removes unused method parameters.</dd>
<dt><div>(&rArr; <code>code/simplification/advanced</code>)</div>
<code><b>method/propagation/parameter</b></code></dt>
<dd>Propagates the values of method parameters from method invocations to
the invoked methods.</dd>
<dt><div>(&rArr; <code>code/simplification/advanced</code>)</div>
<code><b>method/propagation/returnvalue</b></code></dt>
<dd>Propagates the values of method return values from methods to their
invocations.</dd>
<dt><code><b>method/inlining/short</b></code></dt>
<dd>Inlines short methods.</dd>
<dt><code><b>method/inlining/unique</b></code></dt>
<dd>Inlines methods that are only called once.</dd>
<dt><code><b>method/inlining/tailrecursion</b></code></dt>
<dd>Simplifies tail recursion calls, whenever possible.</dd>
<dt><code><b>code/merging</b></code></dt>
<dd>Merges identical blocks of code by modifying branch targets.</dd>
<dt><code><b>code/simplification/variable</b></code></dt>
<dd>Performs peephole optimizations for variable loading and storing.</dd>
<dt><code><b>code/simplification/arithmetic</b></code></dt>
<dd>Performs peephole optimizations for arithmetic instructions.</dd>
<dt><code><b>code/simplification/cast</b></code></dt>
<dd>Performs peephole optimizations for casting operations.</dd>
<dt><code><b>code/simplification/field</b></code></dt>
<dd>Performs peephole optimizations for field loading and storing.</dd>
<dt><div>(&rArr; <code>code/removal/simple</code>)</div>
<code><b>code/simplification/branch</b></code></dt>
<dd>Performs peephole optimizations for branch instructions.</dd>
<dt><code><b>code/simplification/string</b></code></dt>
<dd>Performs peephole optimizations for constant strings.</dd>
<dt><div>(<i>best used with</i> <code>code/removal/advanced</code>)</div>
<code><b>code/simplification/advanced</b></code></dt>
<dd>Simplifies code based on control flow analysis and data flow
analysis.</dd>
<dt><div>(&rArr; <code>code/removal/exception</code>)</div>
<code><b>code/removal/advanced</b></code></dt>
<dd>Removes dead code based on control flow analysis and data flow
analysis.</dd>
<dt><div>(&rArr; <code>code/removal/exception</code>)</div>
<code><b>code/removal/simple</b></code></dt>
<dd>Removes dead code based on a simple control flow analysis.</dd>
<dt><code><b>code/removal/variable</b></code></dt>
<dd>Removes unused variables from the local variable frame.</dd>
<dt><code><b>code/removal/exception</b></code></dt>
<dd>Removes exceptions with empty try blocks.</dd>
<dt><code><b>code/allocation/variable</b></code></dt>
<dd>Optimizes variable allocation on the local variable frame.</dd>
</dl>
<hr />
<noscript><div><a target="_top" href="../index.html" class="button">Show menu</a></div></noscript>
<address>
Copyright &copy; 2002-2011
<a target="other" href="http://www.lafortune.eu/">Eric Lafortune</a>.
</address>
</body>
</html>

View File

@@ -0,0 +1,486 @@
<!doctype html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//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>
<script type="text/javascript" language="JavaScript">
<!--
if (window.self==window.top)
window.top.location.replace("../index.html#"+window.location.pathname+window.location.hash);
else {
var hash="#"+window.location.pathname.replace(window.top.location.pathname.replace("index.html", ""), "");
if (window.top.location.hash!=hash)
window.top.location.hash=hash;
}
//-->
</script>
</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"><a href="usage.html#at"><code><b>@</b></code></a><a href="usage.html#filename"><i>filename</i></a></td>
<td>Short for '<code>-include</code> <i>filename</i>'.</td>
</tr>
<tr>
<td valign="top"><a href="usage.html#include"><code><b>-include</b></code></a>
<a href="usage.html#filename"><i>filename</i></a></td>
<td>Read configuration options from the given file.</td>
</tr>
<tr>
<td valign="top"><a href="usage.html#basedirectory"><code><b>-basedirectory</b></code></a>
<a href="usage.html#filename"><i>directoryname</i></a></td>
<td>Specifies the base directory for subsequent relative file names.</td>
</tr>
<tr>
<td valign="top"><a href="usage.html#injars"><code><b>-injars</b></code></a>
<a href="usage.html#classpath"><i>class_path</i></a></td>
<td>Specifies the program jars (or wars, ears, zips, or directories).</td>
</tr>
<tr>
<td valign="top"><a href="usage.html#outjars"><code><b>-outjars</b></code></a>
<a href="usage.html#classpath"><i>class_path</i></a></td>
<td>Specifies the name of the output jars (or wars, ears, zips, or
directories).</td>
</tr>
<tr>
<td valign="top"><a href="usage.html#libraryjars"><code><b>-libraryjars</b></code></a>
<a href="usage.html#classpath"><i>class_path</i></a></td>
<td>Specifies the library jars (or wars, ears, zips, or directories).</td>
</tr>
<tr>
<td valign="top"><a href="usage.html#skipnonpubliclibraryclasses"><code><b>-skipnonpubliclibraryclasses</b></code></a></td>
<td>Ignore non-public library classes.</td>
</tr>
<tr>
<td valign="top"><a href="usage.html#dontskipnonpubliclibraryclasses"><code><b>-dontskipnonpubliclibraryclasses</b></code></a></td>
<td>Don't ignore non-public library classes (the default).</td>
</tr>
<tr>
<td valign="top"><a href="usage.html#dontskipnonpubliclibraryclassmembers"><code><b>-dontskipnonpubliclibraryclassmembers</b></code></a></td>
<td>Don't ignore package visible library class members.</td>
</tr>
<tr>
<td valign="top"><a href="usage.html#keepdirectories"><code><b>-keepdirectories</b></code></a>
[<a href="usage.html#filters"><i>directory_filter</i></a>]</td>
<td>Keep the specified directories in the output jars (or wars, ears, zips, or
directories).</td>
</tr>
<tr>
<td valign="top"><a href="usage.html#target"><code><b>-target</b></code></a>
<i>version</i></td>
<td>Set the given version number in the processed classes.</td>
</tr>
<tr>
<td valign="top"><a href="usage.html#forceprocessing"><code><b>-forceprocessing</b></code></a></td>
<td>Process the input, even if the output seems up to date.</td>
</tr>
<tr>
<td valign="top"><a href="usage.html#keep"><code><b>-keep</b></code></a>
[<a href="usage.html#keepoptionmodifiers">,<i>modifier</i></a>,...]
<a href="usage.html#classspecification"><i>class_specification</i></a></td>
<td>Preserve the specified classes <i>and</i> class members.</td>
</tr>
<tr>
<td valign="top"><a href="usage.html#keepclassmembers"><code><b>-keepclassmembers</b></code></a>
[<a href="usage.html#keepoptionmodifiers">,<i>modifier</i></a>,...]
<a href="usage.html#classspecification"><i>class_specification</i></a></td>
<td>Preserve the specified class members, if their classes are preserved as
well.</td>
</tr>
<tr>
<td valign="top"><a href="usage.html#keepclasseswithmembers"><code><b>-keepclasseswithmembers</b></code></a>
[<a href="usage.html#keepoptionmodifiers">,<i>modifier</i></a>,...]
<a href="usage.html#classspecification"><i>class_specification</i></a></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"><a href="usage.html#keepnames"><code><b>-keepnames</b></code></a>
<a href="usage.html#classspecification"><i>class_specification</i></a></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"><a href="usage.html#keepclassmembernames"><code><b>-keepclassmembernames</b></code></a>
<a href="usage.html#classspecification"><i>class_specification</i></a></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"><a href="usage.html#keepclasseswithmembernames"><code><b>-keepclasseswithmembernames</b></code></a>
<a href="usage.html#classspecification"><i>class_specification</i></a></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"><a href="usage.html#printseeds"><code><b>-printseeds</b></code></a>
[<a href="usage.html#filename"><i>filename</i></a>]</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"><a href="usage.html#dontshrink"><code><b>-dontshrink</b></code></a></td>
<td>Don't shrink the input class files.</td>
</tr>
<tr>
<td valign="top"><a href="usage.html#printusage"><code><b>-printusage</b></code></a>
[<a href="usage.html#filename"><i>filename</i></a>]</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"><a href="usage.html#whyareyoukeeping"><code><b>-whyareyoukeeping</b></code></a>
<a href="usage.html#classspecification"><i>class_specification</i></a></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"><a href="usage.html#dontoptimize"><code><b>-dontoptimize</b></code></a></td>
<td>Don't optimize the input class files.</td>
</tr>
<tr>
<td valign="top"><a href="usage.html#optimizations"><code><b>-optimizations</b></code></a>
<a href="optimizations.html"><i>optimization_filter</i></a></td>
<td>The optimizations to be enabled and disabled.</td>
</tr>
<tr>
<td valign="top"><a href="usage.html#optimizationpasses"><code><b>-optimizationpasses</b></code></a>
<i>n</i></td>
<td>The number of optimization passes to be performed.</td>
</tr>
<tr>
<td valign="top"><a href="usage.html#assumenosideeffects"><code><b>-assumenosideeffects</b></code></a>
<a href="usage.html#classspecification"><i>class_specification</i></a></td>
<td>Assume that the specified methods don't have any side effects, while
optimizing.</td>
</tr>
<tr>
<td valign="top"><a href="usage.html#allowaccessmodification"><code><b>-allowaccessmodification</b></code></a></td>
<td>Allow the access modifiers of classes and class members to be modified,
while optimizing.</td>
</tr>
<tr>
<td valign="top"><a href="usage.html#mergeinterfacesaggressively"><code><b>-mergeinterfacesaggressively</b></code></a></td>
<td>Allow any interfaces to be merged, while optimizing.</td>
</tr>
<tr>
<td valign="top"><a href="usage.html#dontobfuscate"><code><b>-dontobfuscate</b></code></a></td>
<td>Don't obfuscate the input class files.</td>
</tr>
<tr>
<td valign="top"><a href="usage.html#printmapping"><code><b>-printmapping</b></code></a>
[<a href="usage.html#filename"><i>filename</i></a>]</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"><a href="usage.html#applymapping"><code><b>-applymapping</b></code></a>
<a href="usage.html#filename"><i>filename</i></a></td>
<td>Reuse the given mapping, for incremental obfuscation.</td>
</tr>
<tr>
<td valign="top"><a href="usage.html#obfuscationdictionary"><code><b>-obfuscationdictionary</b></code></a>
<a href="usage.html#filename"><i>filename</i></a></td>
<td>Use the words in the given text file as obfuscated field names and method names.</td>
</tr>
<tr>
<td valign="top"><a href="usage.html#classobfuscationdictionary"><code><b>-classobfuscationdictionary</b></code></a>
<a href="usage.html#filename"><i>filename</i></a></td>
<td>Use the words in the given text file as obfuscated class names.</td>
</tr>
<tr>
<td valign="top"><a href="usage.html#packageobfuscationdictionary"><code><b>-packageobfuscationdictionary</b></code></a>
<a href="usage.html#filename"><i>filename</i></a></td>
<td>Use the words in the given text file as obfuscated package names.</td>
</tr>
<tr>
<td valign="top"><a href="usage.html#overloadaggressively"><code><b>-overloadaggressively</b></code></a></td>
<td>Apply aggressive overloading while obfuscating.</td>
</tr>
<tr>
<td valign="top"><a href="usage.html#useuniqueclassmembernames"><code><b>-useuniqueclassmembernames</b></code></a></td>
<td>Ensure uniform obfuscated class member names for subsequent incremental
obfuscation.</td> </tr>
<tr>
<td valign="top"><a href="usage.html#dontusemixedcaseclassnames"><code><b>-dontusemixedcaseclassnames</b></code></a></td>
<td>Don't generate mixed-case class names while obfuscating.</td>
</tr>
<tr>
<td valign="top"><a href="usage.html#keeppackagenames"><code><b>-keeppackagenames</b></code></a>
[<i><a href="usage.html#filters">package_filter</a></i>]</td>
<td>Keep the specified package names from being obfuscated.</td>
</tr>
<tr>
<td valign="top"><a href="usage.html#flattenpackagehierarchy"><code><b>-flattenpackagehierarchy</b></code></a>
[<i>package_name</i>]</td>
<td>Repackage all packages that are renamed into the single given parent
package.</td>
</tr>
<tr>
<td valign="top"><a href="usage.html#repackageclasses"><code><b>-repackageclasses</b></code></a>
[<i>package_name</i>]</td>
<td>Repackage all class files that are renamed into the single given
package.</td>
</tr>
<tr>
<td valign="top"><a href="usage.html#keepattributes"><code><b>-keepattributes</b></code></a>
[<i><a href="usage.html#filters">attribute_filter</a></i>]</td>
<td>Preserve the given optional attributes; typically
<code>Exceptions</code>, <code>InnerClasses</code>,
<code>Signature</code>, <code>Deprecated</code>,
<code>SourceFile</code>, <code>SourceDir</code>,
<code>LineNumberTable</code>,
<code>LocalVariableTable</code>, <code>LocalVariableTypeTable</code>,
<code>Synthetic</code>, <code>EnclosingMethod</code>, and
<code>*Annotation*</code>.</td>
</tr>
<tr>
<td valign="top"><a href="usage.html#keepparameternames"><code><b>-keepparameternames</b></code></a></td>
<td>Keep the parameter names and types of methods that are kept.</td>
</tr>
<tr>
<td valign="top"><a href="usage.html#renamesourcefileattribute"><code><b>-renamesourcefileattribute</b></code></a>
[<i>string</i>]</td>
<td>Put the given constant string in the <code>SourceFile</code>
attributes.</td>
</tr>
<tr>
<td valign="top"><a href="usage.html#adaptclassstrings"><code><b>-adaptclassstrings</b></code></a>
[<a href="usage.html#filters"><i>class_filter</i></a>]</td>
<td>Adapt string constants in the specified classes, based on the obfuscated
names of any corresponding classes.</td>
</tr>
<tr>
<td valign="top"><a href="usage.html#adaptresourcefilenames"><code><b>-adaptresourcefilenames</b></code></a>
[<a href="usage.html#filefilters"><i>file_filter</i></a>]</td>
<td>Rename the specified resource files, based on the obfuscated names of the
corresponding class files.</td>
</tr>
<tr>
<td valign="top"><a href="usage.html#adaptresourcefilecontents"><code><b>-adaptresourcefilecontents</b></code></a>
[<a href="usage.html#filefilters"><i>file_filter</i></a>]</td>
<td>Update the contents of the specified resource files, based on the
obfuscated names of the processed classes.</td>
</tr>
<tr>
<td valign="top"><a href="usage.html#dontpreverify"><code><b>-dontpreverify</b></code></a></td>
<td>Don't preverify the processed class files.</td>
</tr>
<tr>
<td valign="top"><a href="usage.html#microedition"><code><b>-microedition</b></code></a></td>
<td>Target the processed class files at Java Micro Edition.</td>
</tr>
<tr>
<td valign="top"><a href="usage.html#verbose"><code><b>-verbose</b></code></a></td>
<td>Write out some more information during processing.</td>
</tr>
<tr>
<td valign="top"><a href="usage.html#dontnote"><code><b>-dontnote</b></code></a>
[<a href="usage.html#filters"><i>class_filter</i></a>]</td>
<td>Don't print notes about potential mistakes or omissions in the
configuration.</td>
</tr>
<tr>
<td valign="top"><a href="usage.html#dontwarn"><code><b>-dontwarn</b></code></a>
[<a href="usage.html#filters"><i>class_filter</i></a>]</td>
<td>Don't warn about unresolved references at all.</td>
</tr>
<tr>
<td valign="top"><a href="usage.html#ignorewarnings"><code><b>-ignorewarnings</b></code></a></td>
<td>Print warnings about unresolved references, but continue processing
anyhow.</td>
</tr>
<tr>
<td valign="top"><a href="usage.html#printconfiguration"><code><b>-printconfiguration</b></code></a>
[<a href="usage.html#filename"><i>filename</i></a>]</td>
<td>Write out the internal structure of the processed class files, to the
standard output or to the given file.</td>
</tr>
<tr>
<td valign="top"><a href="usage.html#dump"><code><b>-dump</b></code></a>
[<a href="usage.html#filename"><i>filename</i></a>]</td>
<td>Write out the entire configuration in traditional ProGuard style, 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>
<li><i>filename</i> can contain Java system properties delimited by
'<b>&lt;</b>' and '<b>&gt;</b>'.</li>
<li>If <i>filename</i> contains special characters, the entire name
should be quoted with single or double quotes.</li>
</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"><a href="usage.html#keep"><code>-keep</code></a></td>
<td bgcolor="#E0E0E0"><a href="usage.html#keepnames"><code>-keepnames</code></a></td>
</tr>
<tr>
<td>Class members only</td>
<td bgcolor="#E0E0E0"><a href="usage.html#keepclassmembers"><code>-keepclassmembers</code></a></td>
<td bgcolor="#E0E0E0"><a href="usage.html#keepclassmembernames"><code>-keepclassmembernames</code></a></td>
</tr>
<tr>
<td>Classes and class members, if class members present</td>
<td bgcolor="#E0E0E0"><a href="usage.html#keepclasseswithmembers"><code>-keepclasseswithmembers</code></a></td>
<td bgcolor="#E0E0E0"><a href="usage.html#keepclasseswithmembernames"><code>-keepclasseswithmembernames</code></a></td>
</tr>
</table>
<p>
<h2>Keep Option Modifiers</h2>
<table cellspacing="10">
<tr>
<td valign="top"><a href="usage.html#allowshrinking"><code><b>allowshrinking</b></code></a></td>
<td>The entry points specified in the keep tag may be shrunk.</td>
</tr>
<tr>
<td valign="top"><a href="usage.html#allowoptimization"><code><b>allowoptimization</b></code></a></td>
<td>The entry points specified in the keep tag may be optimized.</td>
</tr>
<tr>
<td valign="top"><a href="usage.html#allowobfuscation"><code><b>allowobfuscation</b></code></a></td>
<td>The entry points specified in the keep tag may be obfuscated.</td>
</tr>
</table>
<p>
<h2>Class Specifications</h2>
<pre>
[<b>@</b><i>annotationtype</i>] [[<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> [<b>@</b><i>annotationtype</i>] <i>classname</i>]
[<b>{</b>
[<b>@</b><i>annotationtype</i>] [[<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><i>annotationtype</i>] [[<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><i>annotationtype</i>] [[<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>
<li>Types in <i>classname</i>, <i>annotationtype</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, '<code><b>%</b></code>' for any primitive type,
'<code><b>***</b></code>' for any type, and '<code><b>...</b></code>' for any number of arguments.</li>
<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.</li>
</ul>
<hr />
<noscript><div><a target="_top" href="../index.html" class="button">Show menu</a></div></noscript>
<address>
Copyright &copy; 2002-2011
<a target="other" href="http://www.lafortune.eu/">Eric Lafortune</a>.
</address>
</body>
</html>

View File

@@ -0,0 +1,345 @@
<!doctype html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//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>ReTrace Examples</title>
<script type="text/javascript" language="JavaScript">
<!--
if (window.self==window.top)
window.top.location.replace("../../index.html#"+window.location.pathname+window.location.hash);
else {
var hash="#"+window.location.pathname.replace(window.top.location.pathname.replace("index.html", ""), "");
if (window.top.location.hash!=hash)
window.top.location.hash=hash;
}
//-->
</script>
</head>
<body>
<h2>Examples</h2>
Some typical example uses:
<ol>
<li><a href="#with">Restoring a stack trace with line numbers</a></li>
<li><a href="#withverbose">Restoring a stack trace with line numbers
(verbose)</a></li>
<li><a href="#without">Restoring a stack trace without line numbers</a></li>
</ol>
<h3><a name="with">Restoring a stack trace with line numbers</a></h3>
Assume for instance ProGuard itself has been obfuscated using the following
extra options:
<pre>
-printmapping proguard.map
-renamesourcefileattribute ProGuard
-keepattributes SourceFile,LineNumberTable
</pre>
<p>
Now assume the processed application throws an exception, and we have saved the
stack trace in <code>proguard.trace</code>, shown below. Of course, in real
life ProGuard rarely throws exceptions, so this is a purposely generated
exception. :)
<pre>
Exception in thread "main" java.lang.Error: Random exception
at pro.bY.a(ProGuard:576)
at pro.bO.a(ProGuard:431)
at pro.bj.a(ProGuard:145)
at pro.bY.a(ProGuard:522)
at pro.bj.a(ProGuard:129)
at pro.bN.a(ProGuard:125)
at pro.bY.a(ProGuard:251)
at pro.bY.a(ProGuard:229)
at pro.l.a(ProGuard:55)
at pro.bo.b(ProGuard:405)
at pro.ci.a(ProGuard:51)
at pro.bo.a(ProGuard:356)
at pro.be.a(ProGuard:109)
at pro.bo.a(ProGuard:356)
at pro.be.a(ProGuard:186)
at pro.bg.a(ProGuard:369)
at pro.bY.a(ProGuard:286)
at pro.bh.a(ProGuard:55)
at pro.bg.b(ProGuard:408)
at pro.bY.a(ProGuard:190)
at pro.bg.a(ProGuard:369)
at pro.M.a(ProGuard:110)
at pro.bY.a(ProGuard:449)
at pro.M.a(ProGuard:99)
at pro.bo.a(ProGuard:372)
at pro.bY.a(ProGuard:649)
at pro.bY.a(ProGuard:112)
at pro.P.a(ProGuard:66)
at pro.p.a(ProGuard:83)
at pro.bU.a(ProGuard:69)
at pro.bo.a(ProGuard:356)
at pro.J.a(ProGuard:149)
at pro.I.a(ProGuard:49)
at pro.J.a(ProGuard:105)
at pro.cf.c(ProGuard:370)
at pro.cf.a(ProGuard:317)
at pro.bc.a(ProGuard:55)
at proguard.ProGuard.a(ProGuard:363)
at proguard.ProGuard.c(ProGuard:187)
at proguard.ProGuard.b(ProGuard:385)
at proguard.ProGuard.main(ProGuard:429)
</pre>
<p>
We can then use the following command to recover the stack trace:
<pre>
<b>java -jar retrace.jar proguard.map proguard.trace</b>
</pre>
<p>
The output will look as follows:
<pre>
Exception in thread "main" java.lang.Error: Random exception
at proguard.shrink.UsageMarker.visitInstruction(ProGuard:576)
at proguard.classfile.instruction.GenericInstruction.accept(ProGuard:431)
at proguard.classfile.CodeAttrInfo.instructionsAccept(ProGuard:145)
at proguard.shrink.UsageMarker.visitCodeAttrInfo(ProGuard:522)
at proguard.classfile.CodeAttrInfo.accept(ProGuard:129)
at proguard.classfile.ProgramMemberInfo.attributesAccept(ProGuard:125)
at proguard.shrink.UsageMarker.visitMemberInfo(ProGuard:251)
at proguard.shrink.UsageMarker.visitProgramMethodInfo(ProGuard:229)
at proguard.classfile.ProgramMethodInfo.accept(ProGuard:55)
at proguard.classfile.ProgramClassFile.methodAccept(ProGuard:405)
at proguard.classfile.visitor.NamedMethodVisitor.visitProgramClassFile(ProGuard:51)
at proguard.classfile.ProgramClassFile.accept(ProGuard:356)
at proguard.classfile.visitor.ClassFileUpDownTraveler.visitProgramClassFile(ProGuard:109)
at proguard.classfile.ProgramClassFile.accept(ProGuard:356)
at proguard.classfile.visitor.ClassFileUpDownTraveler.visitLibraryClassFile(ProGuard:186)
at proguard.classfile.LibraryClassFile.accept(ProGuard:369)
at proguard.shrink.UsageMarker.visitLibraryMethodInfo(ProGuard:286)
at proguard.classfile.LibraryMethodInfo.accept(ProGuard:55)
at proguard.classfile.LibraryClassFile.methodsAccept(ProGuard:408)
at proguard.shrink.UsageMarker.visitLibraryClassFile(ProGuard:190)
at proguard.classfile.LibraryClassFile.accept(ProGuard:369)
at proguard.classfile.ClassCpInfo.referencedClassAccept(ProGuard:110)
at proguard.shrink.UsageMarker.visitClassCpInfo(ProGuard:449)
at proguard.classfile.ClassCpInfo.accept(ProGuard:99)
at proguard.classfile.ProgramClassFile.constantPoolEntryAccept(ProGuard:372)
at proguard.shrink.UsageMarker.markCpEntry(ProGuard:649)
at proguard.shrink.UsageMarker.visitProgramClassFile(ProGuard:112)
at proguard.classfile.visitor.VariableClassFileVisitor.visitProgramClassFile(ProGuard:66)
at proguard.classfile.visitor.MultiClassFileVisitor.visitProgramClassFile(ProGuard:83)
at proguard.classfile.visitor.FilteredClassFileVisitor.visitProgramClassFile(ProGuard:69)
at proguard.classfile.ProgramClassFile.accept(ProGuard:356)
at proguard.classfile.ClassPool.classFileAccept(ProGuard:149)
at proguard.classfile.visitor.NamedClassFileVisitor.visitClassPool(ProGuard:49)
at proguard.classfile.ClassPool.accept(ProGuard:105)
at proguard.KeepCommand.executeShrinkingPhase(ProGuard:370)
at proguard.KeepCommand.execute(ProGuard:317)
at proguard.CompoundCommand.execute(ProGuard:55)
at proguard.ProGuard.executeCommands(ProGuard:363)
at proguard.ProGuard.shrink(ProGuard:187)
at proguard.ProGuard.execute(ProGuard:385)
at proguard.ProGuard.main(ProGuard:429)
</pre>
<h3><a name="withverbose">Restoring a stack trace with line numbers (verbose)</a></h3>
In the previous example, we could also use the verbose flag:
<pre>
<b>java -jar retrace.jar -verbose proguard.map proguard.trace</b>
</pre>
<p>
The output will then look as follows:
<pre>
Exception in thread "main" java.lang.Error: Random exception
at proguard.shrink.UsageMarker.void visitInstruction(proguard.classfile.ClassFile,proguard.classfile.instruction.Instruction)(ProGuard:576)
at proguard.classfile.instruction.GenericInstruction.void accept(proguard.classfile.ClassFile,proguard.classfile.instruction.InstructionVisitor)(ProGuard:431)
at proguard.classfile.CodeAttrInfo.void instructionsAccept(proguard.classfile.ClassFile,proguard.classfile.instruction.InstructionVisitor)(ProGuard:145)
at proguard.shrink.UsageMarker.void visitCodeAttrInfo(proguard.classfile.ClassFile,proguard.classfile.CodeAttrInfo)(ProGuard:522)
at proguard.classfile.CodeAttrInfo.void accept(proguard.classfile.ClassFile,proguard.classfile.visitor.AttrInfoVisitor)(ProGuard:129)
at proguard.classfile.ProgramMemberInfo.void attributesAccept(proguard.classfile.ProgramClassFile,proguard.classfile.visitor.AttrInfoVisitor)(ProGuard:125)
at proguard.shrink.UsageMarker.void visitMemberInfo(proguard.classfile.ProgramClassFile,proguard.classfile.ProgramMemberInfo)(ProGuard:251)
at proguard.shrink.UsageMarker.void visitProgramMethodInfo(proguard.classfile.ProgramClassFile,proguard.classfile.ProgramMethodInfo)(ProGuard:229)
at proguard.classfile.ProgramMethodInfo.void accept(proguard.classfile.ProgramClassFile,proguard.classfile.visitor.MemberInfoVisitor)(ProGuard:55)
at proguard.classfile.ProgramClassFile.void methodAccept(proguard.classfile.visitor.MemberInfoVisitor,java.lang.String,java.lang.String)(ProGuard:405)
at proguard.classfile.visitor.NamedMethodVisitor.void visitProgramClassFile(proguard.classfile.ProgramClassFile)(ProGuard:51)
at proguard.classfile.ProgramClassFile.void accept(proguard.classfile.visitor.ClassFileVisitor)(ProGuard:356)
at proguard.classfile.visitor.ClassFileUpDownTraveler.void visitProgramClassFile(proguard.classfile.ProgramClassFile)(ProGuard:109)
at proguard.classfile.ProgramClassFile.void accept(proguard.classfile.visitor.ClassFileVisitor)(ProGuard:356)
at proguard.classfile.visitor.ClassFileUpDownTraveler.void visitLibraryClassFile(proguard.classfile.LibraryClassFile)(ProGuard:186)
at proguard.classfile.LibraryClassFile.void accept(proguard.classfile.visitor.ClassFileVisitor)(ProGuard:369)
at proguard.shrink.UsageMarker.void visitLibraryMethodInfo(proguard.classfile.LibraryClassFile,proguard.classfile.LibraryMethodInfo)(ProGuard:286)
at proguard.classfile.LibraryMethodInfo.void accept(proguard.classfile.LibraryClassFile,proguard.classfile.visitor.MemberInfoVisitor)(ProGuard:55)
at proguard.classfile.LibraryClassFile.void methodsAccept(proguard.classfile.visitor.MemberInfoVisitor)(ProGuard:408)
at proguard.shrink.UsageMarker.void visitLibraryClassFile(proguard.classfile.LibraryClassFile)(ProGuard:190)
at proguard.classfile.LibraryClassFile.void accept(proguard.classfile.visitor.ClassFileVisitor)(ProGuard:369)
at proguard.classfile.ClassCpInfo.void referencedClassAccept(proguard.classfile.visitor.ClassFileVisitor)(ProGuard:110)
at proguard.shrink.UsageMarker.void visitClassCpInfo(proguard.classfile.ClassFile,proguard.classfile.ClassCpInfo)(ProGuard:449)
at proguard.classfile.ClassCpInfo.void accept(proguard.classfile.ClassFile,proguard.classfile.visitor.CpInfoVisitor)(ProGuard:99)
at proguard.classfile.ProgramClassFile.void constantPoolEntryAccept(proguard.classfile.visitor.CpInfoVisitor,int)(ProGuard:372)
at proguard.shrink.UsageMarker.void markCpEntry(proguard.classfile.ClassFile,int)(ProGuard:649)
at proguard.shrink.UsageMarker.void visitProgramClassFile(proguard.classfile.ProgramClassFile)(ProGuard:112)
at proguard.classfile.visitor.VariableClassFileVisitor.void visitProgramClassFile(proguard.classfile.ProgramClassFile)(ProGuard:66)
at proguard.classfile.visitor.MultiClassFileVisitor.void visitProgramClassFile(proguard.classfile.ProgramClassFile)(ProGuard:83)
at proguard.classfile.visitor.FilteredClassFileVisitor.void visitProgramClassFile(proguard.classfile.ProgramClassFile)(ProGuard:69)
at proguard.classfile.ProgramClassFile.void accept(proguard.classfile.visitor.ClassFileVisitor)(ProGuard:356)
at proguard.classfile.ClassPool.void classFileAccept(proguard.classfile.visitor.ClassFileVisitor,java.lang.String)(ProGuard:149)
at proguard.classfile.visitor.NamedClassFileVisitor.void visitClassPool(proguard.classfile.ClassPool)(ProGuard:49)
at proguard.classfile.ClassPool.void accept(proguard.classfile.visitor.ClassPoolVisitor)(ProGuard:105)
at proguard.KeepCommand.void executeShrinkingPhase(proguard.classfile.ClassPool,proguard.classfile.ClassPool)(ProGuard:370)
at proguard.KeepCommand.void execute(int,proguard.classfile.ClassPool,proguard.classfile.ClassPool)(ProGuard:317)
at proguard.CompoundCommand.void execute(int,proguard.classfile.ClassPool,proguard.classfile.ClassPool)(ProGuard:55)
at proguard.ProGuard.void executeCommands(int)(ProGuard:363)
at proguard.ProGuard.void shrink()(ProGuard:187)
at proguard.ProGuard.void execute(java.lang.String[])(ProGuard:385)
at proguard.ProGuard.void main(java.lang.String[])(ProGuard:429)
</pre>
<h3><a name="without">Restoring a stack trace without line numbers</a></h3>
Assume for instance ProGuard itself has been obfuscated using the following
extra options, this time without preserving the line number tables:
<pre>
-printmapping proguard.map
</pre>
<p>
A stack trace <code>proguard.trace</code> will then lack line number
information:
<pre>
Exception in thread "main" java.lang.Error: Random exception
at pro.bY.a(Unknown Source)
at pro.bO.a(Unknown Source)
at pro.bj.a(Unknown Source)
at pro.bY.a(Unknown Source)
at pro.bj.a(Unknown Source)
at pro.bN.a(Unknown Source)
at pro.bY.a(Unknown Source)
at pro.bY.a(Unknown Source)
at pro.l.a(Unknown Source)
at pro.bo.b(Unknown Source)
at pro.ci.a(Unknown Source)
at pro.bo.a(Unknown Source)
at pro.be.a(Unknown Source)
at pro.bo.a(Unknown Source)
at pro.be.a(Unknown Source)
at pro.bg.a(Unknown Source)
at pro.bY.a(Unknown Source)
at pro.bh.a(Unknown Source)
at pro.bg.b(Unknown Source)
at pro.bY.a(Unknown Source)
at pro.bg.a(Unknown Source)
at pro.M.a(Unknown Source)
at pro.bY.a(Unknown Source)
at pro.M.a(Unknown Source)
at pro.bo.a(Unknown Source)
at pro.bY.a(Unknown Source)
at pro.bY.a(Unknown Source)
at pro.P.a(Unknown Source)
at pro.p.a(Unknown Source)
at pro.bU.a(Unknown Source)
at pro.bo.a(Unknown Source)
at pro.J.a(Unknown Source)
at pro.I.a(Unknown Source)
at pro.J.a(Unknown Source)
at pro.cf.c(Unknown Source)
at pro.cf.a(Unknown Source)
at pro.bc.a(Unknown Source)
at proguard.ProGuard.a(Unknown Source)
at proguard.ProGuard.c(Unknown Source)
at proguard.ProGuard.b(Unknown Source)
at proguard.ProGuard.main(Unknown Source)
</pre>
<p>
We can still use the same command to recover the stack trace:
<pre>
<b>java -jar retrace.jar proguard.map proguard.trace</b>
</pre>
<p>
The output will now give a list of alternative original method names for each
ambiguous obfuscated method name:
<pre>
Exception in thread "main" java.lang.Error: Random exception
at proguard.shrink.UsageMarker.visitProgramClassFile(Unknown Source)
visitLibraryClassFile
visitProgramFieldInfo
visitProgramMethodInfo
visitMemberInfo
visitLibraryFieldInfo
visitLibraryMethodInfo
visitIntegerCpInfo
visitLongCpInfo
visitFloatCpInfo
visitDoubleCpInfo
visitStringCpInfo
visitUtf8CpInfo
visitFieldrefCpInfo
visitInterfaceMethodrefCpInfo
visitMethodrefCpInfo
visitClassCpInfo
visitNameAndTypeCpInfo
visitUnknownAttrInfo
visitInnerClassesAttrInfo
visitConstantValueAttrInfo
visitExceptionsAttrInfo
visitCodeAttrInfo
visitLineNumberTableAttrInfo
visitLocalVariableTableAttrInfo
visitSourceFileAttrInfo
visitDeprecatedAttrInfo
visitSyntheticAttrInfo
visitInstruction
visitCpInstruction
visitExceptionInfo
visitInnerClassesInfo
visitLocalVariableInfo
markCpEntry
markAsUnused
isUsed
at proguard.classfile.instruction.GenericInstruction.create(Unknown Source)
isWide
getLength
accept
at proguard.classfile.CodeAttrInfo.getAttribute(Unknown Source)
getAttrInfoLength
readInfo
accept
instructionsAccept
exceptionsAccept
[...]
at proguard.KeepCommand.executeShrinkingPhase(Unknown Source)
access$100
at proguard.KeepCommand.keepField(Unknown Source)
ensureMultiClassFileVisitorForMembers
execute
executeObfuscationPhase
access$002
access$000
access$102
access$108
at proguard.CompoundCommand.addCommand(Unknown Source)
execute
at proguard.ProGuard.readCommands(Unknown Source)
obfuscate
executeCommands
at proguard.ProGuard.shrink(Unknown Source)
at proguard.ProGuard.check(Unknown Source)
execute
at proguard.ProGuard.main(Unknown Source)
</pre>
<hr />
<noscript><div><a target="_top" href="../../index.html" class="button">Show menu</a></div></noscript>
<address>
Copyright &copy; 2002-2011
<a target="other" href="http://www.lafortune.eu/">Eric Lafortune</a>.
</address>
</body>
</html>

View File

@@ -0,0 +1,37 @@
<!doctype html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//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>ReTrace Manual</title>
<script type="text/javascript" language="JavaScript">
<!--
if (window.self==window.top)
window.top.location.replace("../../index.html#"+window.location.pathname+window.location.hash);
else {
var hash="#"+window.location.pathname.replace(window.top.location.pathname.replace("index.html", ""), "");
if (window.top.location.hash!=hash)
window.top.location.hash=hash;
}
//-->
</script>
</head>
<body>
<h2>ReTrace</h2>
<ol>
<li><a href="introduction.html">Introduction</a></li>
<li><a href="usage.html">Usage</a></li>
<li><a href="examples.html">Examples</a></li>
</ol>
<hr />
<noscript><div><a target="_top" href="../../index.html" class="button">Show menu</a></div></noscript>
<address>
Copyright &copy; 2002-2011
<a target="other" href="http://www.lafortune.eu/">Eric Lafortune</a>.
</address>
</body>
</html>

View File

@@ -0,0 +1,79 @@
<!doctype html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//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>ReTrace Introduction</title>
<script type="text/javascript" language="JavaScript">
<!--
if (window.self==window.top)
window.top.location.replace("../../index.html#"+window.location.pathname+window.location.hash);
else {
var hash="#"+window.location.pathname.replace(window.top.location.pathname.replace("index.html", ""), "");
if (window.top.location.hash!=hash)
window.top.location.hash=hash;
}
//-->
</script>
</head>
<body>
<h2>Introduction</h2>
<b>ReTrace</b> is a companion tool for <b>ProGuard</b> that 'de-obfuscates'
stack traces.
<p>
When an obfuscated program throws an exception, the resulting stack trace
typically isn't very informative. Class names and method names have been
replaced by short meaningless strings. Source file names and line numbers are
missing altogether. While this may be intentional, it can also be inconvenient
when debugging problems.
<p>
<table class="diagram" align="center">
<tr>
<td rowspan="1" class="lightblock">Original code</td>
<td class="transparentblock">- <b>ProGuard</b> &rarr;</td>
<td rowspan="1" class="lightblock">Obfuscated code</td>
</tr>
<tr>
<td rowspan="3" class="transparentblock"></td>
<td class="transparentblock">&darr;</td>
<td class="transparentblock">&darr;</td>
</tr>
<tr>
<td class="whiteblock">Mapping file</td>
<td class="transparentblock">&darr;</td>
</tr>
<tr>
<td class="transparentblock">&darr;</td>
<td class="transparentblock">&darr;</td>
</tr>
<tr>
<td class="whiteblock">Readable stack trace</td>
<td class="transparentblock">&larr; <b>ReTrace</b> -</td>
<td class="whiteblock">Obfuscated stack trace</td>
</tr>
</table>
<p>
ReTrace can read an obfuscated stack trace and restore it to what it would
look like without obfuscation. The restoration is based on the mapping file
that ProGuard can write out during obfuscation. The mapping file links the
original class names and class member names to their obfuscated names.
<hr />
<noscript><div><a target="_top" href="../../index.html" class="button">Show menu</a></div></noscript>
<address>
Copyright &copy; 2002-2011
<a target="other" href="http://www.lafortune.eu/">Eric Lafortune</a>.
</address>
</body>
</html>

View File

@@ -0,0 +1,127 @@
<!doctype html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//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>ReTrace Usage</title>
<script type="text/javascript" language="JavaScript">
<!--
if (window.self==window.top)
window.top.location.replace("../../index.html#"+window.location.pathname+window.location.hash);
else {
var hash="#"+window.location.pathname.replace(window.top.location.pathname.replace("index.html", ""), "");
if (window.top.location.hash!=hash)
window.top.location.hash=hash;
}
//-->
</script>
</head>
<body>
<h2>Usage</h2>
You can find the ReTrace jar in the <code>lib</code> directory of the
ProGuard distribution. To run ReTrace, just type:
<p>
<p class="code">
<code><b>java -jar retrace.jar </b></code>[<i>options...</i>]
<i>mapping_file</i> [<i>stacktrace_file</i>]
</p>
These are the arguments:
<dl>
<dt><i>mapping_file</i></dt>
<dd>Specifies the name of the mapping file, produced by ProGuard with the
option
"<a href="../usage.html#printmapping"><code>-printmapping</code></a> <i>mapping_file</i>",
while obfuscating the application that produced the stack trace.</dd>
<dt><i>stacktrace_file</i></dt>
<dd>Optionally specifies the name of the file containing the stack trace. If
no file is specified, a stack trace is read from the standard input. Blank
lines and unrecognized lines are ignored, as far as possible.</dd>
</dl>
The following options are supported:
<dl>
<dt><code><b>-verbose</b></code></dt>
<dd>Specifies to print out more informative stack traces that include not only
method names, but also method return types and arguments.</dd>
<dt><code><b>-regex</b></code> <i>regular_expression</i></dt>
<dd>Specifies the regular expression that is used to parse the lines in the
stack trace. Specifying a different regular expression allows to
de-obfuscate more general types of input than just stack traces. The
default is suitable for stack traces produced by most JVMs:
<pre>
(?:\s*%c:.*)|(?:\s*at\s+%c.%m\s*\(.*?(?::%l)?\)\s*)
</pre>
The regular expression is a Java regular expression (cfr. the documentation
of <code>java.util.regex.Pattern</code>), with a few additional wildcards:
<table cellspacing="10">
<tr><td valign="top"><code><b>%c</b></code></td>
<td>matches a class name (e.g.
"<code>myapplication.MyClass</code>").</td></tr>
<tr><td valign="top"><code><b>%C</b></code></td>
<td>matches a class name with slashes (e.g.
"<code>myapplication/MyClass</code>").</td></tr>
<tr><td valign="top"><code><b>%t</b></code></td>
<td>matches a field type or method return type (e.g.
"<code>myapplication.MyClass[]</code>").</td></tr>
<tr><td valign="top"><code><b>%f</b></code></td>
<td>matches a field name (e.g.
"<code>myField</code>").</td></tr>
<tr><td valign="top"><code><b>%m</b></code></td>
<td>matches a method name (e.g.
"<code>myMethod</code>").</td></tr>
<tr><td valign="top"><code><b>%a</b></code></td>
<td>matches a list of method arguments (e.g.
"<code>boolean,int</code>").</td></tr>
<tr><td valign="top"><code><b>%l</b></code></td>
<td>matches a line number inside a method (e.g.
"<code>123</code>").</td></tr>
</table>
Elements that match these wildcards are de-obfuscated, when possible. Note
that regular expressions must not contain any capturing groups. Use
non-capturing groups instead: <code>(?:</code>...<code>)</code>
</dd>
</dl>
The restored stack trace is printed to the standard output. The completeness
of the restored stack trace depends on the presence of line number tables in
the obfuscated class files:
<ul>
<li>If all line numbers have been preserved while obfuscating the application,
ReTrace will be able to restore the stack trace completely.</li>
<li>If the line numbers have been removed, mapping obfuscated method names
back to their original names has become ambiguous. Retrace will list all
possible original method names for each line in the stack trace. The user
can then try to deduce the actual stack trace manually, based on the logic
of the program.</li>
</ul>
<p>
Preserving line number tables is explained in detail in this <a
href="../examples.html#stacktrace">example</a> in the ProGuard User Manual.
<p>
Unobfuscated elements and obfuscated elements for which no mapping is available
will be left unchanged.
<hr />
<noscript><div><a target="_top" href="../../index.html" class="button">Show menu</a></div></noscript>
<address>
Copyright &copy; 2002-2011
<a target="other" href="http://www.lafortune.eu/">Eric Lafortune</a>.
</address>
</body>
</html>

View File

@@ -0,0 +1,60 @@
<!doctype html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
<meta http-equiv="content-script-type" content="text/javascript">
<meta http-equiv="content-style-type" content="text/css">
<link rel="stylesheet" type="text/css" href="../style.css">
<title>Sections</title>
</head>
<body class="navigation">
<ul class="navigation">
<li><a href="../sections.html">&lt;&lt; Main menu</a></li>
<li class="title">ProGuard Manual</li>
<li><a target="main" href="introduction.html">Introduction</a></li>
<li><a target="main" href="usage.html">Usage</a></li>
<li><a target="main" href="limitations.html">Limitations</a></li>
<li><a target="main" href="examples.html">Examples</a></li>
<li><a target="main" href="troubleshooting.html">Troubleshooting</a></li>
<li><a target="main" href="refcard.html">Ref Card</a></li>
<li><a target="main" href="gui.html">GUI</a></li>
<li><a target="main" href="ant.html">Ant Task</a></li>
<li><a target="main" href="wtk.html">JME WTK</a></li>
<li class="title">ReTrace Manual</li>
<li><a target="main" href="retrace/introduction.html">Introduction</a></li>
<li><a target="main" href="retrace/usage.html">Usage</a></li>
<li><a target="main" href="retrace/examples.html">Examples</a></li>
</ul>
<p>
<center>
<small>With support of</small>
<p>
<a href="http://sourceforge.net/projects/proguard/" target="other">
<script type="text/javascript" language="JavaScript">
<!--
document.write("<img src=\"");
document.write(document.location.hostname == "proguard.sourceforge.net" ?
"http://sourceforge.net/sflogo.php?group_id=54750&amp;type=1" :
"../sflogo.png");
document.write("\" width=\"88\" height=\"31\" alt=\"SourceForge\" />");
//-->
</script>
<noscript>
<img src="../sflogo.png" width="88" height="31" alt="SourceForge" />
</noscript>
</a>
<p>
<a href="http://www.saikoa.com/" target="_top">
<img src="../saikoalogo.png" width="88" height="19" alt="Saikoa" /></a>
</center>
</body>
</html>

View File

@@ -0,0 +1,105 @@
@charset "iso-8859-1";
/* Global settings. */
body {
background: #FFFFFF;
}
h1 {
text-align: center;
}
h2 {
background: #EEEEFF;
padding: 10px;
}
dt {
padding: 6px;
}
dt div
{
color: grey;
float: right;
}
dd {
padding: 6px;
}
pre {
padding: 10px;
background: #E0E0E0;
}
ul.spacious li
{
padding: 8px;
}
a
{
text-decoration: none;
}
a.button {
color: #000000;
text-decoration: none;
background: #E0E0E0;
border: 1px outset #FFFFFF;
float: right;
}
/* Settings for variable width code. */
p.code {
padding: 10px;
background: #E0E0E0;
}
/* Settings for diagrams. */
table.diagram {
padding: 8px;
border: none;
border-spacing: 2px;
}
td.transparentblock {
text-align: center;
padding: 10px 0px;
}
td.whiteblock {
width: 100px;
text-align: center;
border: 1px solid #C0C0C0;
background: #E0E0E0;
padding: 10px 0px;
}
td.lightblock {
width: 100px;
text-align: center;
border: 1px solid #8888FF;
background: #BBBBFF;
padding: 20px 0px;
}
td.darkblock {
width: 100px;
text-align: center;
background: #8888FF;
padding: 20px 0px;
}
/* Settings for buttons. */
td.button {
background: #E0E0E0;
border: 1px outset #FFFFFF;
font-weight: bold;
}

View File

@@ -0,0 +1,729 @@
<!doctype html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//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 Troubleshooting</title>
<script type="text/javascript" language="JavaScript">
<!--
if (window.self==window.top)
window.top.location.replace("../index.html#"+window.location.pathname+window.location.hash);
else {
var hash="#"+window.location.pathname.replace(window.top.location.pathname.replace("index.html", ""), "");
if (window.top.location.hash!=hash)
window.top.location.hash=hash;
}
//-->
</script>
</head>
<body>
<h2>Troubleshooting</h2>
While preparing a configuration for processing your code, you may bump into a
few problems. The following sections discuss some common issues and solutions:
<h3><a href="#processing">Problems while processing</a></h3>
<ul>
<li><a href="#dynamicalclass">Note: can't find dynamically referenced class</a></li>
<li><a href="#dynamicalclasscast">Note: ... calls '(...)Class.forName(variable).newInstance()'</a></li>
<li><a href="#dynamicalclassmember">Note: ... accesses a field/method '...' dynamically</a></li>
<li><a href="#descriptorclass">Note: the configuration keeps the entry point '...', but not the descriptor class '...'</a></li>
<li><a href="#classmembers">Note: the configuration doesn't specify which class members to keep for class '...'</a></li>
<li><a href="#duplicateclass">Note: duplicate definition of program/library class</a></li>
<li><a href="#duplicatezipentry">Warning: can't write resource ... Duplicate zip entry</a></li>
<li><a href="#unresolvedclass">Warning: can't find superclass or interface</a></li>
<li><a href="#unresolvedclass">Warning: can't find referenced class</a></li>
<li><a href="#superclass">Error: Can't find any super classes of ... (not even immediate super class ...)</a></li>
<li><a href="#superclass">Error: Can't find common super class of ... and ...</a></li>
<li><a href="#unresolvedclassmember">Warning: can't find referenced field/method</a></li>
<li><a href="#unresolvedenclosingmethod">Warning: can't find enclosing class/method</a></li>
<li><a href="#dependency">Warning: library class ... depends on program class ...</a></li>
<li><a href="#unexpectedclass">Warning: class file ... unexpectedly contains class ...</a></li>
<li><a href="#mappingconflict1">Warning: ... is not being kept as ..., but remapped to ...</a></li>
<li><a href="#mappingconflict2">Warning: field/method ... can't be mapped to ...</a></li>
<li><a href="#unsupportedclassversion">Error: Unsupported class version number</a></li>
<li><a href="#keep">Error: You have to specify '-keep' options</a></li>
<li><a href="#filename">Error: Expecting class path separator ';' before 'Files\Java\...' (in Windows)</a></li>
<li><a href="#macosx">Error: Can't read [.../lib/rt.jar] (No such file or directory) (in MacOS X)</a></li>
<li><a href="#startinggui">Internal problem starting the ProGuard GUI (Cannot write XdndAware property) (in Linux)</a></li>
<li><a href="#outofmemoryerror">OutOfMemoryError</a></li>
<li><a href="#stackoverflowerror">StackOverflowError</a></li>
<li><a href="#unexpectederror">Unexpected error</a></li>
<li><a href="#otherwise">Otherwise...</a></li>
</ul>
<h3><a href="#afterprocessing">Unexpected observations after processing</a></h3>
<ul>
<li><a href="#disappearingclasses">Disappearing classes</a></li>
<li><a href="#notkept">Classes or class members not being kept</a></li>
<li><a href="#notobfuscated">Variable names not being obfuscated</a></li>
</ul>
<h3><a href="#dalvik">Problems while converting to Android Dalvik bytecode</a></h3>
<ul>
<li><a href="#simexception">SimException: local variable type mismatch</a></li>
<li><a href="#conversionerror">Conversion to Dalvik format failed with error 1</a></li>
</ul>
<h3><a href="#preverifying">Problems while preverifying for Java Micro Edition</a></h3>
<ul>
<li><a href="#invalidclassexception1">InvalidClassException, class loading error, or verification error</a></li>
</ul>
<h3><a href="#runtime">Problems at run-time</a></h3>
<ul>
<li><a href="#stacktraces">Stack traces without class names or line numbers</a></li>
<li><a href="#noclassdeffounderror">NoClassDefFoundError</a></li>
<li><a href="#classnotfoundexception">ClassNotFoundException</a></li>
<li><a href="#nosuchmethodexception">NoSuchMethodException</a></li>
<li><a href="#missingresourceexception">MissingResourceException or NullPointerException</a></li>
<li><a href="#disappearingannotations">Disappearing annotations</a></li>
<li><a href="#invalidjarfile">Invalid or corrupt jarfile</a></li>
<li><a href="#invalidjarindexexception">InvalidJarIndexException: Invalid index</a></li>
<li><a href="#invalidclassexception2">InvalidClassException, class loading error, or verification error (in Java Micro Edition)</a></li>
<li><a href="#nosuchfieldormethod">Error: No Such Field or Method, Error verifying method (in a Java Micro Edition emulator)</a></li>
<li><a href="#failingmidlets">Failing midlets (on a Java Micro Edition device)</a></li>
<li><a href="#disappearingloops">Disappearing loops</a></li>
<li><a href="#securityexception">SecurityException: SHA1 digest error</a></li>
<li><a href="#classcastexception">ClassCastException: class not an enum</a></li><li><a href="#classcastexception">IllegalArgumentException: class not an enum type</a></li>
<li><a href="#arraystoreexception">ArrayStoreException: sun.reflect.annotation.EnumConstantNotPresentExceptionProxy</a></li>
<li><a href="#compilererror">CompilerError: duplicate addition</a></li>
<li><a href="#classformaterror1">ClassFormatError: repetitive field name/signature</a></li>
<li><a href="#classformaterror2">ClassFormatError: Invalid index in LocalVariableTable in class file</a></li>
<li><a href="#nosuchmethoderror">NoSuchMethodError or AbstractMethodError</a></li>
<li><a href="#verifyerror">VerifyError</a></li>
</ul>
<h2><a name="processing">Problems while processing</a></h2>
ProGuard may print out some notes and non-fatal warnings:
<dl>
<dt><a name="dynamicalclass"><b>Note: can't find dynamically referenced class</b></a></dt>
<dd>ProGuard can't find a class or interface that your code is accessing by
means of introspection. You should check if you want to add the jar that
contains this class.</dd>
<dt><a name="dynamicalclasscast"><b>Note: ... calls '(...)Class.forName(variable).newInstance()'</b></a></dt>
<dd>ProGuard lists all class casts of dynamically created class instances,
like "<code>(MyClass)Class.forName(variable).newInstance()</code>".
Depending on your application, you may need to keep the mentioned classes
with an option like "<code>-keep class MyClass</code>", or their
implementations with an option like "<code>-keep class * implements
MyClass</code>". You can switch off these notes by specifying the
<a href="usage.html#dontnote"><code>-dontnote</code></a> option.</dd>
<dt><a name="dynamicalclassmember"><b>Note: ... accesses a field/method '...' dynamically</b></a></dt>
<dd>ProGuard lists a number of constructs like
"<code>.getField("myField")</code>". Depending on your application, you
may need to figure out where the mentioned class members are defined and
keep them with an option like "<code>-keep class MyClass { MyFieldType
myField; }</code>". Otherwise, ProGuard might remove or obfuscate the
class members, since it can't know which ones they are exactly. It does
list possible candidates, for your information. You can switch off these
notes by specifying the <a
href="usage.html#dontnote"><code>-dontnote</code></a> option.</dd>
<dt><a name="descriptorclass"><b>Note: the configuration keeps the entry point '...', but not the descriptor class '...'</b></a></dt>
<dd>Your configuration contains a <code>-keep</code> option to preserve the
given method (or field), but no <code>-keep</code> option for the given
class that is an argument type or return type in the method's descriptor.
You may then want to keep the class too. Otherwise, ProGuard will
obfuscate its name, thus changing the method's signature. The method might
then become unfindable as an entry point, e.g. if it is part of a public
API. You can switch off these notes by specifying the <a
href="usage.html#dontnote"><code>-dontnote</code></a> option.</dd>
<dt><a name="classmembers"><b>Note: the configuration doesn't specify which class members to keep for class '...'</b></a></dt>
<dd>Your configuration contains
a <code>-keepclassmembers/-keepclasseswithmembers</code> option to
preserve fields or methods in the given class, but it doesn't specify
which fields or methods. This way, the option simply won't have any
effect. You probably want to specify one or more fields or methods, as
usual between curly braces. You can specify all fields or methods with a
wildcard "<code>*;</code>". You can switch off these notes by specifying
the <a href="usage.html#dontnote"><code>-dontnote</code></a> option.</dd>
<dt><a name="duplicateclass"><b>Note: duplicate definition of program/library class</b></a></dt>
<dd>Your program jars or library jars contain multiple definitions of the
listed classes. ProGuard continues processing as usual, only considering
the first definitions. The warning may be an indication of some problem
though, so it's advisable to remove the duplicates. A convenient way to do
so is by specifying filters on the input jars or library jars. You can
switch off these notes by specifying the <a
href="usage.html#dontnote"><code>-dontnote</code></a> option.</dd>
<dt><a name="duplicatezipentry"><b>Warning: can't write resource ... Duplicate zip entry</b></a></dt>
<dd>Your input jars contain multiple resource files with the same name.
ProGuard continues copying the resource files as usual, skipping any files
with previously used names. Once more, the warning may be an indication of
some problem though, so it's advisable to remove the duplicates. A
convenient way to do so is by specifying filters on the input jars. There
is no option to switch off these warnings.</dd>
</dl>
<p>
ProGuard may terminate when it encounters parsing errors or I/O errors, or
some more serious warnings:
<dl>
<dt><a name="unresolvedclass"><b>Warning: can't find superclass or interface</b><br/><b>Warning: can't find referenced class</b></a></dt>
<dd>If there are unresolved references to classes or interfaces, you most
likely forgot to specify an essential library. For proper processing, all
libraries that are referenced by your code must be specified, including
the Java run-time library. For specifying libraries, use
the <a href="usage.html#libraryjars"><code>-libraryjars</code></a> option.
<p>
For example, if ProGuard complains that it can't find a
<code>javax.crypto</code> class, you probably still have to specify
<code>jce.jar</code>, next to the more common <code>rt.jar</code>.
<p>
If you're missing a library and you're absolutely sure it isn't used
anyway, you can try your luck with the <a
href="usage.html#ignorewarnings"><code>-ignorewarnings</code></a> option,
or even the <a href="usage.html#dontwarn"><code>-dontwarn</code></a>
option. Only use these options if you really know what you're doing
though.
<p>
For example, if you're developing for Android, and ProGuard complains that
it can't find a <code>java.awt</code> class, then some library that you
are using is referring to <code>java.awt</code>. This is a bit shady, since
Android doesn't have this package at all, but if your application works
anyway, you can let ProGuard accept it with "<code>-dontwarn
java.awt.**</code>".</dd>
<dt><a name="superclass"><b>Error: Can't find any super classes of ... (not even immediate super class ...)</b><br/><b>Error: Can't find common super class of ... and ...</b></a></dt>
<dd>It seems like you tried to avoid the warnings from the previous paragraph
by specifying
<a href="usage.html#ignorewarnings"><code>-ignorewarnings</code></a>
or <a href="usage.html#dontwarn"><code>-dontwarn</code></a>, but it didn't
work out. ProGuard's optimization step and preverification step really
need the missing classes to make sense of the code. Preferably, you would
solve the problem by adding the missing library, as discussed. If you're
sure the class that references the missing class isn't used either, you
could also try filtering it out from the input, by adding a filter to the
corresponding <a href="usage.html#injars"><code>-injars</code></a> option:
"<code>-injars
myapplication.jar(!somepackage/SomeUnusedClass.class)</code>". Hopefully,
you can access the configuration of your build process for such a
modification. As a final solution, you could switch off optimization
(<a href="usage.html#dontoptimize"><code>-dontoptimize</code></a>) and
preverification
(<a href="usage.html#dontpreverify"><code>-dontpreverify</code></a>).</dd>
<dt><a name="unresolvedclassmember"><b>Warning: can't find referenced field/method</b></a></dt>
<dd>If there are unresolved references to class members in input classes, your
class files are most likely inconsistent. Possibly, some class file didn't
get recompiled properly, or some class file was left behind after its
source file was removed. Try removing all class files, recompiling them,
zipping them up, and running ProGuard again.
<p>
If your program classes reside in the same packages as library classes,
and refer to their package visible class members, then you should also
specify the
<a href="usage.html#dontskipnonpubliclibraryclassmembers"><code>-dontskipnonpubliclibraryclassmembers</code></a>
option.</dd>
<dt><a name="unresolvedenclosingmethod"><b>Warning: can't find enclosing class/method</b></a></dt>
<dd>If there are unresolved references to classes that are defined inside
methods in your input, once more, your class files are most likely
inconsistent. Possibly, some class file didn't get recompiled properly, or
some class file was left behind after its source file was removed. Try
removing all class files, recompiling them, zipping them up, and running
ProGuard again.</dd>
<dt><a name="dependency"><b>Warning: library class ... depends on program class ...</b></a></dt>
<dd>If any of your library classes depend on your program classes, by
extending, implementing or just referencing them, your processed code will
generally be unusable. Program classes can depend on library classes, but
not the other way around. Program classes are processed, while library
classes always remain unchanged. It is therefore impossible to adapt
references from library classes to program classes, for instance if the
program classes are renamed. You should define a clean separation between
program code (specified with <a
href="usage.html#injars"><code>-injars</code></a>) and library code
(specified with <a
href="usage.html#libraryjars"><code>-libraryjars</code></a>), and try
again.</dd>
<dt><a name="unexpectedclass"><b>Warning: class file ... unexpectedly contains class ...</b></a></dt>
<dd>The given class file contains a definition for the given class, but the
directory name of the file doesn't correspond to the package name of the
class. ProGuard will accept the class definition, but the current
implementation will not write out the processed version. Please make sure
your input classes are packaged correctly. Notably, class files that are
in the <code>WEB-INF/classes</code> directory in a war should be packaged
in a jar and put in the <code>WEB-INF/lib</code> directory. If you don't
mind these classes not being written to the output, you can specify the <a
href="usage.html#ignorewarnings"><code>-ignorewarnings</code></a> option,
or even the <a href="usage.html#dontwarn"><code>-dontwarn</code></a>
option.</dd>
<dt><a name="mappingconflict1"><b>Warning: ... is not being kept as ..., but remapped to ...</b></a></dt>
<dd>There is a conflict between a <code>-keep</code> option in the
configuration, and the mapping file, in the obfuscation step. The given
class name or class member name can't be kept by its original name, as
specified in the configuration, but it has to be mapped to the other given
name, as specified in the mapping file. You should adapt your
configuration or your mapping file to remove the conflict. Alternatively,
if you're sure the renaming won't hurt, you can specify the <a
href="usage.html#ignorewarnings"><code>-ignorewarnings</code></a> option,
or even the <a href="usage.html#dontwarn"><code>-dontwarn</code></a>
option.</dd>
<dt><a name="mappingconflict2"><b>Warning: field/method ... can't be mapped to ...</b></a></dt>
<dd>There is a conflict between some new program code and the mapping file, in
the obfuscation step. The given class member can't be mapped to the given
name, because it would conflict with another class member that is already
being mapped to the same name. This can happen if you are performing
incremental obfuscation, applying an obfuscation mapping file from an
initial obfuscation step. For instance, some new class may have been added
that extends two existing classes, introducing a conflict in the name
space of its class members. If you're sure the class member receiving
another name than the one specified won't hurt, you can specify the <a
href="usage.html#ignorewarnings"><code>-ignorewarnings</code></a> option,
or even the <a href="usage.html#dontwarn"><code>-dontwarn</code></a>
option. Note that you should always use the <a
href="usage.html#useuniqueclassmembernames"><code>-useuniqueclassmembernames</code></a>
option in the initial obfuscation step, in order to reduce the risk of
conflicts.</dd>
<dt><a name="unsupportedclassversion"><b>Error: Unsupported class version number</b></a></dt>
<dd>You are trying to process class files compiled for a recent version of
Java that your copy of ProGuard doesn't support yet. You should check if
there is a more recent release
<a href="http://proguard.sourceforge.net/downloads.html">on-line</a>.</dd>
<dt><a name="keep"><b>Error: You have to specify '-keep' options</b></a></dt>
<dd>You either forgot to specify <a
href="usage.html#keep"><code>-keep</code></a> options, or you mistyped the
class names. ProGuard has to know exactly what you want to keep: an
application, an applet, a servlet, a midlet,..., or any combination of
these. Without the proper seed specifications, ProGuard would shrink,
optimize, or obfuscate all class files away.</dd>
<dt><a name="filename"><b>Error: Expecting class path separator ';' before 'Files\Java\</b>...<b>'</b> (in Windows)</a></dt>
<dd>If the path of your run-time jar contains spaces, like in "Program Files",
you have to enclose it with single or double quotes, as explained in the
section on <a href="usage.html#filename">file names</a>. This is actually
true for all file names containing special characters, on all
platforms.</dd>
<dt><a name="macosx"><b>Error: Can't read [</b>...<b>/lib/rt.jar] (No such file or directory)</b> (in MacOS X)</a></dt>
<dd>In MacOS X, the run-time classes may be in a different place than on most
other platforms. You'll then have to adapt your configuration, replacing
the path <code>&lt;java.home&gt;/lib/rt.jar</code> by
<code>&lt;java.home&gt;/../Classes/classes.jar</code>.</dd>
<dt><a name="startinggui"><b>Internal problem starting the ProGuard GUI (Cannot write XdndAware property)</b> (in Linux)</a></dt>
<dd>In Linux, at least with Java 6, the GUI may not start properly, due to
<a href="http://bugs.sun.com/view_bug.do?bug_id=7027598">Sun
Bug #7027598</a>. The work-around at this time is to specify the JVM
option <code>-DsuppressSwingDropSupport=true</code> when running the
GUI.</dd>
<dd>
</dl>
<p>
Should ProGuard crash while processing your application:
<dl>
<dt><a name="outofmemoryerror"><b>OutOfMemoryError</b></a></dt>
<dd>You can try increasing the heap size of the Java virtual machine (with the
usual <code>-Xms</code> and <code>-Xmx</code> options). You can also
reduce the amount of memory that ProGuard needs by removing unnecessary
library jars from your configuration, or by filtering out unused library
packages and classes. Remember that only classes or interfaces that are
extended or implemented by classes in your input jars are required.</dd>
<dt><a name="stackoverflowerror"><b>StackOverflowError</b></a></dt>
<dd>This error might occur when processing a large code base on Windows
(surprisingly, not so easily on Linux). In theory, increasing the stack
size of the Java virtual machine (with the usual <code>-Xss</code> option)
should help too. In practice however, the <code>-Xss</code> setting
doesn't have any effect on the main thread, due to <a
href="http://bugs.sun.com/view_bug.do?bug_id=4362291">Sun Bug
#4362291</a>. As a result, this solution will only work when running
ProGuard in a different thread, e.g. from its GUI.</dd>
<dt><a name="unexpectederror"><b>Unexpected error</b></a></dt>
<dd>ProGuard has encountered an unexpected condition, typically in the
optimization step. It may or may not recover. You should be able to avoid
it using the <a
href="usage.html#dontoptimize"><code>-dontoptimize</code></a> option. In
any case, please report the problem, preferably with the simplest example
that causes ProGuard to crash.</dd>
<dt><a name="otherwise"><b>Otherwise...</b></a></dt>
<dd>Maybe your class files are corrupt. See if recompiling them and trying
again helps. If not, please report the problem, preferably with the
simplest example that causes ProGuard to crash.</dd>
</dl>
<p>
<h2><a name="afterprocessing">Unexpected observations after processing</a></h2>
If ProGuard seems to run fine, but your processed code doesn't look right,
there might be a couple of reasons:
<dl>
<dt><a name="disappearingclasses"><b>Disappearing classes</b></a></dt>
<dd>If you are working on Windows and it looks like some classes have
disappeared from your output, you should make sure you're not writing your
output class files to a directory (or unpacking the output jar). On
platforms with case-insensitive file systems, such as Windows, unpacking
tools often let class files with similar lower-case and upper-case names
overwrite each other. If you really can't switch to a different operating
system, you could consider using ProGuard's <a
href="usage.html#dontusemixedcaseclassnames"><code>-dontusemixedcaseclassnames</code></a>
option.
<p>
Also, you should make sure your class files are in directories that
correspond to their package names. ProGuard will read misplaced class
files, but it will currently not write their processed versions. Notably,
class files that are in the <code>WEB-INF/classes</code> directory in a
war should be packaged in a jar and put in the <code>WEB-INF/lib</code>
directory.</dd>
<dt><a name="notkept"><b>Classes or class members not being kept</b></a></dt>
<dd>If ProGuard is not keeping the right classes or class members, make sure
you are using fully qualified class names. If the package name of some
class is missing, ProGuard won't match the elements that you might be
expecting. It may help to double-check for typos too. You can use the <a
href="usage.html#printseeds"><code>-printseeds</code></a> option to see
which elements are being kept exactly.
<p>
If you are using marker interfaces to keep other classes, the marker
interfaces themselves are probably being removed in the shrinking step.
You should therefore always explicitly keep any marker interfaces, with
an option like "<code>-keep interface MyMarkerInterface</code>".
<p>
Similarly, if you are keeping classes based on annotations, you may have to
avoid that the annotation classes themselves are removed in the shrinking
step. You can explicitly keep all annotation classes in your program code
with an option like "<code>-keep @interface *</code>".<dd>
<dt><a name="notobfuscated"><b>Variable names not being obfuscated</b></a></dt>
<dd>If the names of the local variables and parameters in your obfuscated code
don't look obfuscated, because they suspiciously resemble the names of
their types, it's probably because the decompiler that you are using is
coming up with those names. ProGuard's obfuscation step does remove the
original names entirely, unless you explicitly keep the
<code>LocalVariableTable</code> or <code>LocalVariableTypeTable</code>
attributes.</dd>
</dl>
<h2><a name="dalvik">Problems while converting to Android Dalvik bytecode</a></h2>
If ProGuard seems to run fine, but the dx tool in the Android SDK subsequently
fails with an error:
<dl>
<dt><a name="simexception"><b>SimException: local variable type mismatch</b></a></dt>
<dd>This error indicates that ProGuard's optimization step has not been able
to maintain the correct debug information about local variables. This can
happen if some code is optimized radically. Possible work-arounds: let the
java compiler not produce debug information (<code>-g:none</code>), or let
ProGuard's obfuscation step remove the debug information again
(by <i>not</i> keeping the attributes <code>LocalVariableTable</code>
and <code>LocalVariableTypeTable</code>
with <a href="usage.html#keepattributes"><code>-keepattributes</code></a>),
or otherwise just disable optimization
(<a href="usage.html#dontoptimize"><code>-dontoptimize</code></a>).</dd>
<dt><a name="conversionerror"><b>Conversion to Dalvik format failed with error 1</b></a></dt>
<dd>This error may have various causes, but if dx is tripping over some code
processed by ProGuard, you should make sure that you are using the latest
version of ProGuard. You can just copy the ProGuard jars
to <code>android-sdk/tools/proguard/lib</code>. If that doesn't help,
please report the problem, preferably with the simplest example that still
brings out the error.</dd>
</dl>
<h2><a name="preverifying">Problems while preverifying for Java Micro Edition</a></h2>
If ProGuard seems to run fine, but the external preverifier subsequently
produces errors, it's usually for a single reason:
<dl>
<dt><a name="invalidclassexception1"><b>InvalidClassException</b>, <b>class loading error</b>, or <b>verification error</b></a></dt>
<dd>If you get any such message from the preverifier, you are probably working
on a platform with a case-insensitive file system, such as Windows. The
<code>preverify</code> tool always unpacks the jars, so class files with
similar lower-case and upper-case names overwrite each other. You can use
ProGuard's <a
href="usage.html#dontusemixedcaseclassnames"><code>-dontusemixedcaseclassnames</code></a>
option to work around this problem.
<p>
If the above doesn't help, there is probably a bug in the optimization
step of ProGuard. Make sure you are using the latest version. You should
be able to work around the problem by using the <a
href="usage.html#dontoptimize"><code>-dontoptimize</code></a> option. You
can check the bug database to see if it is a known problem (often with a
fix). Otherwise, please report it, preferably with the simplest example on
which you can find ProGuard to fail.</dd>
</dl>
Note that it is no longer necessary to use an external preverifier. With the
<a href="usage.html#microedition"><code>-microedition</code></a> option,
ProGuard will preverify the class files for Java Micro Edition.
<p>
<h2><a name="runtime">Problems at run-time</a></h2>
If ProGuard runs fine, but your processed application doesn't work, there
might be several reasons:
<dl>
<dt><a name="stacktraces"><b>Stack traces without class names or line numbers</b></a></dt>
<dd>If your stack traces don't contain any class names or lines numbers,
even though you are keeping the proper attributes, make sure this debugging
information is present in your compiled code to start with. Notably the Ant
javac task has debugging information switched off by default.</dd>
<dt><a name="noclassdeffounderror"><b>NoClassDefFoundError</b></a></dt>
<dd>Your class path is probably incorrect. It should at least contain all
library jars and, of course, your processed program jar.</dd>
<dt><a name="classnotfoundexception"><b>ClassNotFoundException</b></a></dt>
<dd>Your code is probably calling <code>Class.forName</code>, trying to create
the missing class dynamically. ProGuard can only detect constant name
arguments, like <code>Class.forName("mypackage.MyClass")</code>. For
variable name arguments like <code>Class.forName(someClass)</code>, you
have to keep all possible classes using the appropriate <a
href="usage.html#keep"><code>-keep</code></a> option, e.g. "<code>-keep
class mypackage.MyClass</code>" or "<code>-keep class * implements
mypackage.MyInterface</code>".</dd>
<dt><a name="nosuchmethodexception"><b>NoSuchMethodException</b></a></dt>
<dd>Your code is probably calling something like
<code>myClass.getMethod</code>, trying to find some method dynamically.
Since ProGuard can't always detect this automatically, you have to keep
the missing method in using the appropriate <a
href="usage.html#keep"><code>-keep</code></a> option, e.g. "<code>-keep
class mypackage.MyClass { void myMethod(); }</code>".
<p>
More specifically, if the method reported as missing is
<code>values</code> or <code>valueOf</code>, you probably have to keep
some methods related to <a
href="examples.html#enumerations">enumerations</a>.</dd>
<dt><a name="missingresourceexception"><b>MissingResourceException</b> or <b>NullPointerException</b></a></dt>
<dd>Your processed code may be unable to find some resource files. ProGuard
simply copies resource files over from the input jars to the output jars.
Their names and contents remain unchanged, unless you specify the options
<a
href="usage.html#adaptresourcefilenames"><code>-adaptresourcefilenames</code></a>
and/or <a
href="usage.html#adaptresourcefilecontents"><code>-adaptresourcefilecontents</code></a>.
<p>
Furthermore, directory entries in jar files aren't copied, unless you
specify the option <a
href="usage.html#keepdirectories"><code>-keepdirectories</code></a>.
Note that Sun advises against calling <code>Class.getResource()</code> for
directories (<a href="http://bugs.sun.com/view_bug.do?bug_id=4761949">Sun
Bug #4761949</a>).</dd>
<dt><a name="disappearingannotations"><b>Disappearing annotations</b></a></dt>
<dd>By default, the obfuscation step removes all annotations. If your
application relies on annotations to function properly, you should
explicitly keep them with
<code><a href="usage.html#keepattributes">-keepattributes</a>
*Annotation*</code>.</dd>
<dt><a name="invalidjarfile"><b>Invalid or corrupt jarfile</b></a></dt>
<dd>You are probably starting your application with the java option
<code>-jar</code> instead of the option <code>-classpath</code>. The java
virtual machine returns with this error message if your jar doesn't
contain a manifest file (<code>META-INF/MANIFEST.MF</code>), if the
manifest file doesn't specify a main class (<code>Main-Class:</code> ...),
or if the jar doesn't contain this main class. You should then make sure
that the input jar contains a valid manifest file to start with, that this
manifest file is the one that is copied (the first manifest file that is
encountered), and that the main class is kept in your configuration,</dd>
<dt><a name="invalidjarindexexception"><b>InvalidJarIndexException: Invalid index</b></a></dt>
<dd>At least one of your processed jar files contains an index file
<code>META-INF/INDEX.LIST</code>, listing all class files in the jar.
ProGuard by default copies files like these unchanged. ProGuard may however
remove or rename classes, thus invalidating the file. You should filter the
index file out of the input
(<code>-injars in.jar(!META-INF/INDEX.LIST)</code>) or update the file
after having applied ProGuard (<code>jar -i out.jar</code>).
</dd>
<dt><a name="invalidclassexception2"><b>InvalidClassException</b>, <b>class loading error</b>, or <b>verification error</b> (in Java Micro Edition)</a></dt>
<dd>If you get such an error in Java Micro Edition, you may have forgotten to
specify the <a
href="usage.html#microedition"><code>-microedition</code></a> option, so
the processed class files are preverified properly.</dd>
<dt><a name="nosuchfieldormethod"><b>Error: No Such Field or Method</b>, <b>Error verifying method</b> (in a Java Micro Edition emulator)</a></dt>
<dd>If you get such a message in a Motorola or Sony Ericsson phone emulator,
it's because these emulators don't like packageless classes and/or
overloaded fields and methods. You can work around it by not using the
options <code><a href="usage.html#repackageclasses">-repackageclasses</a>
''</code> and <a
href="usage.html#overloadaggressively"><code>-overloadaggressively</code></a>.
If you're using the JME WTK plugin, you can adapt the configuration
<code>proguard/wtk/default.pro</code> that's inside the
<code>proguard.jar</code>.</dd>
<dt><a name="failingmidlets"><b>Failing midlets</b> (on a Java Micro Edition device)</a></dt>
<dd>If your midlet runs in an emulator and on some devices, but not on some
other devices, this is probably due to a bug in the latter devices. For
some older Motorola and Nokia phones, you might try specifying the <a
href="usage.html#useuniqueclassmembernames"><code>-useuniqueclassmembernames</code></a>
option. It avoids overloading class member names, which triggers a bug in
their java virtual machine.
<p>
You might also try using the <a
href="usage.html#dontusemixedcaseclassnames"><code>-dontusemixedcaseclassnames</code></a>
option. Even if the midlet has been properly processed and then
preverified on a case-sensitive file system, the device itself might not
like the mixed-case class names. Notably, the Nokia N-Gage emulator works
fine, but the actual device seems to exhibit this problem.</dd>
<dt><a name="disappearingloops"><b>Disappearing loops</b></a></dt>
<dd>If your code contains empty busy-waiting loops, ProGuard's optimization
step may remove them. More specifically, this happens if a loop
continuously checks the value of a non-volatile field that is changed in a
different thread. The specifications of the Java Virtual Machine require
that you always mark fields that are accessed across different threads
without further synchronization as <code>volatile</code>. If this is not
possible for some reason, you'll have to switch off optimization using the
<a href="usage.html#dontoptimize"><code>-dontoptimize</code></a>
option.</dd>
<dt><a name="securityexception"><b>SecurityException: SHA1 digest error</b></a></dt>
<dd>You may have forgotten to sign your program jar <i>after</i> having
processed it with ProGuard.</dd>
<dt><a name="classcastexception"><b>ClassCastException: class not an enum</b>, or <br /><b>IllegalArgumentException: class not an enum type</b></a></dt>
<dd>You should make sure you're preserving the special methods of enumeration
types, which the run-time environment calls by introspection. The required
options are shown in the <a
href="examples.html#enumerations">examples</a>.</dd>
<dt><a name="arraystoreexception"><b>ArrayStoreException: sun.reflect.annotation.EnumConstantNotPresentExceptionProxy</b></a></dt>
<dd>You are probably processing annotations involving enumerations. Again, you
should make sure you're preserving the special methods of the enumeration
type, as shown in the examples.</dd>
<dt><a name="compilererror"><b>CompilerError: duplicate addition</b></a></dt>
<dd>You are probably compiling or running some code that has been obfuscated
with the <a
href="usage.html#overloadaggressively"><code>-overloadaggressively</code></a>
option. This option triggers a bug in
<code>sun.tools.java.MethodSet.add</code> in Sun's JDK 1.2.2, which is
used for (dynamic) compilation. You should then avoid this option.</dd>
<dt><a name="classformaterror1"><b>ClassFormatError: repetitive field name/signature</b></a></dt>
<dd>You are probably processing some code that has been obfuscated before with
the <a
href="usage.html#overloadaggressively"><code>-overloadaggressively</code></a>
option. You should then use the same option again in the second processing
round.</dd>
<dt><a name="classformaterror2"><b>ClassFormatError: Invalid index in LocalVariableTable in class file</b></a></dt>
<dd>If you are keeping the <code>LocalVariableTable</code> or
<code>LocalVariableTypeTable</code> attributes, ProGuard's optimizing step
is sometimes unable to update them consistently. You should then let the
obfuscation step remove these attributes or disable the optimization
step.</dd>
<dt><a name="nosuchmethoderror"><b>NoSuchMethodError</b> or <b>AbstractMethodError</b></a></dt>
<dd>You should make sure you're not writing your output class files to a
directory on a platform with a case-insensitive file system, such as
Windows. Please refer to the section about <a
href="#disappearingclasses">disappearing classes</a> for details.
<p>
Furthermore, you should check whether you have specified your program jars
and library jars properly. Program classes can refer to library classes,
but not the other way around.
<p>
If all of this seems ok, perhaps there's a bug in ProGuard (gasp!). If so,
please report it, preferably with the simplest example on which you can
find ProGuard to fail.</dd>
<dt><a name="verifyerror"><b>VerifyError</b></a></dt>
<dd>Verification errors when executing a program are almost certainly the
result of a bug in the optimization step of ProGuard. Make sure you are
using the latest version. You should be able to work around the problem by
using the <a href="usage.html#dontoptimize"><code>-dontoptimize</code></a>
option. You can check the bug database to see if it is a known problem
(often with a fix). Otherwise, please report it, preferably with the
simplest example on which ProGuard fails.</dd>
</dl>
<hr />
<noscript><div><a target="_top" href="../index.html" class="button">Show menu</a></div></noscript>
<address>
Copyright &copy; 2002-2011
<a target="other" href="http://www.lafortune.eu/">Eric Lafortune</a>.
</address>
</body>
</html>

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,70 @@
<!doctype html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//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 JME Wireless Toolkit Integration</title>
<script type="text/javascript" language="JavaScript">
<!--
if (window.self==window.top)
window.top.location.replace("../index.html#"+window.location.pathname+window.location.hash);
else {
var hash="#"+window.location.pathname.replace(window.top.location.pathname.replace("index.html", ""), "");
if (window.top.location.hash!=hash)
window.top.location.hash=hash;
}
//-->
</script>
</head>
<body>
<h2>JME Wireless Toolkit Integration</h2>
<b>ProGuard</b> can be seamlessly integrated in Oracle's Wireless Toolkit (WTK)
for Java Micro Edition (JME).
<p>
The WTK already comes with a plug-in for ProGuard. Alternatively, ProGuard
offers its own plug-in. This latter implementation is recommended, as it more
up to date and it solves some problems. It is also somewhat more efficient,
invoking the ProGuard engine directly, instead of writing out a configuration
file and running ProGuard in a separate virtual machine.
<p>
In order to integrate this plug-in in the toolkit, you'll have to put the
following lines in the file
{j2mewtk.dir}<code>/wtklib/Linux/ktools.properties</code> or
{j2mewtk.dir}<code>\wtklib\Windows\ktools.properties</code> (whichever is
applicable).
<p>
<pre>
obfuscator.runner.class.name: proguard.wtk.ProGuardObfuscator
obfuscator.runner.classpath: /usr/local/java/proguard/lib/proguard.jar
</pre>
<p>
Please make sure the class path is set correctly for your system.
<p>
Once ProGuard has been set up, you can apply it to your projects as part of
the build process. The build process is started from the WTK menu bar:
<p>
<center><b>Project -> Package -> Create Obfuscated Package</b></center>
<p>
This option will compile, shrink, obfuscate, verify, and install your midlets
for testing.
<p>
Should you ever need to customize your ProGuard configuration for the JME WTK,
you can adapt the configuration file <code>proguard/wtk/default.pro</code>
that's inside the <code>proguard.jar</code>.
<hr />
<noscript><div><a target="_top" href="../index.html" class="button">Show menu</a></div></noscript>
<address>
Copyright &copy; 2002-2011
<a target="other" href="http://www.lafortune.eu/">Eric Lafortune</a>.
</address>
</body>
</html>