summaryrefslogtreecommitdiff
path: root/docs/manual
diff options
context:
space:
mode:
Diffstat (limited to 'docs/manual')
-rw-r--r--docs/manual/android_small.pngbin0 -> 1106 bytes
-rw-r--r--docs/manual/ant.html110
-rw-r--r--docs/manual/examples.html667
-rw-r--r--docs/manual/gradle.html545
-rw-r--r--docs/manual/gui.html209
-rw-r--r--docs/manual/index.html45
-rw-r--r--docs/manual/introduction.html100
-rw-r--r--docs/manual/limitations.html57
-rw-r--r--docs/manual/optimizations.html50
-rw-r--r--docs/manual/refcard.html51
-rw-r--r--docs/manual/retrace/examples.html37
-rw-r--r--docs/manual/retrace/index.html26
-rw-r--r--docs/manual/retrace/introduction.html21
-rw-r--r--docs/manual/retrace/usage.html31
-rw-r--r--docs/manual/sections.html34
-rw-r--r--docs/manual/style.css69
-rw-r--r--docs/manual/troubleshooting.html417
-rw-r--r--docs/manual/usage.html379
-rw-r--r--docs/manual/wtk.html22
19 files changed, 2103 insertions, 767 deletions
diff --git a/docs/manual/android_small.png b/docs/manual/android_small.png
new file mode 100644
index 0000000..0313515
--- /dev/null
+++ b/docs/manual/android_small.png
Binary files differ
diff --git a/docs/manual/ant.html b/docs/manual/ant.html
index bc3a3b4..0837bbb 100644
--- a/docs/manual/ant.html
+++ b/docs/manual/ant.html
@@ -1,10 +1,21 @@
-<!doctype html PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
+<!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>
@@ -28,10 +39,14 @@ this new task. The easiest way is to add the following line to your
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.
+There are three ways to configure the ProGuard task:
+<ol>
+<li>using an external configuration file,</li>
+<li>using embedded ProGuard configuration options, or</li>
+<li>using the equivalent XML configuration tags.</li>
+</ol>
+These three ways can be combined, depending on practical circumstances and
+personal preference.
<p>
<h3>1. An external ProGuard configuration file</h3>
@@ -89,11 +104,11 @@ 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>.
+upset the structure of the XML build file. Environment variables can be
+specified with the usual Ant style <code>${...}</code>, instead of the ProGuard
+style <code>&lt;...&gt;</code>. Other occurrences of <code>&lt;</code> and
+<code>&gt;</code> have to be encoded as <code>&amp;lt;</code> and
+<code>&amp;gt;</code> respectively.
<p>
<h3>3. XML configuration tags</h3>
@@ -107,8 +122,7 @@ 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>
-<a name="proguard">&nbsp;</a>
-<h2>Task Attributes and Nested Elements</h2>
+<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
@@ -120,13 +134,14 @@ elements:
<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
+ file. Note: for reading multiple configuration files or XML-style
+ configurations, use the <a
href="#configuration_element"><code>configuration</code></a>
<i>element</i>.</dd>
-<dt><a href="usage.html#dontskipnonpubliclibraryclasses"><code><b>skipnonpubliclibraryclasses</b></code></a>
+<dt><a href="usage.html#skipnonpubliclibraryclasses"><code><b>skipnonpubliclibraryclasses</b></code></a>
= "<i>boolean</i>"
- (default = true)</dt>
+ (default = false)</dt>
<dd>Ignore non-public library classes.</dd>
<dt><a href="usage.html#dontskipnonpubliclibraryclassmembers"><code><b>skipnonpubliclibraryclassmembers</b></code></a>
@@ -242,6 +257,11 @@ elements:
<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>
@@ -257,7 +277,7 @@ elements:
<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>
+<dd>Target the processed class files at Java Micro Edition.</dd>
<dt><a href="usage.html#verbose"><code><b>verbose</b></code></a>
= "<i>boolean</i>"
@@ -305,7 +325,7 @@ elements:
<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
+<dd>Specifies the names of the output jars (or wars, ears, zips, or
directories).</dd>
<dt><a href="usage.html#libraryjars"><code><b>&lt;libraryjar</b></code></a>
@@ -436,23 +456,27 @@ elements:
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><br/>
+ <code><b>&lt;configuration file = </b></code>"<i>name</i>"
<code><b>/&gt;</b></code></dt>
-<dd>Includes the configuration specified in the
+<dd>The first form includes the XML-style configuration specified in a
<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>
+ <code>&lt;proguard&gt;</code> task) with attribute <code>id</code> =
+ "<i>ref_id</i>". Only the nested elements of this configuration are
+ considered, not the attributes.
+ <p>
+ The second form includes the ProGuard-style configuration from the specified
+ file. The element is actually a <code>fileset</code> element and supports
+ all of its attributes and nested elements, including multiple files.
+ </dd>
</dl>
-<a name="classpath">&nbsp;</a>
-<h2>Class Path Attributes and Nested Elements</h2>
+<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:
+The jar elements are <code>path</code> elements, so they can have any of the
+standard <code>path</code> attributes and nested elements. The most common
+attributes are:
<dl>
@@ -472,7 +496,7 @@ nested elements). The most common attributes are:
</dl>
-In addition, the jar tags can have ProGuard-style filter attributes:
+In addition, the jar elements can have ProGuard-style filter attributes:
<dl>
@@ -499,8 +523,7 @@ In addition, the jar tags can have ProGuard-style filter attributes:
</dl>
-<a name="keepmodifier">&nbsp;</a>
-<h2>Keep Modifier Attributes</h2>
+<h2><a name="keepmodifier">Keep Modifier Attributes</a></h2>
The keep tags can have the following <i>modifier</i> attributes:
@@ -526,8 +549,7 @@ The keep tags can have the following <i>modifier</i> attributes:
</dl>
-<a name="classspecification">&nbsp;</a>
-<h2>Class Specification Attributes and Nested Elements</h2>
+<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:
@@ -538,6 +560,10 @@ The keep tags can have the following <i>class_specification</i> attributes and
<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>
@@ -546,6 +572,10 @@ The keep tags can have the following <i>class_specification</i> attributes and
<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>
@@ -571,8 +601,7 @@ The keep tags can have the following <i>class_specification</i> attributes and
</dl>
-<a name="classmemberspecification">&nbsp;</a>
-<h2>Class Member Specification Attributes</h2>
+<h2><a name="classmemberspecification">Class Member Specification Attributes</a></h2>
The class member tags can have the following <i>class_member_specification</i>
attributes:
@@ -584,6 +613,10 @@ attributes:
"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
@@ -601,10 +634,11 @@ attributes:
</dl>
-<hr>
+<hr />
+<noscript><div><a target="_top" href="../index.html" class="button">Show menu</a></div></noscript>
<address>
-Copyright &copy; 2002-2009
-<a href="http://www.graphics.cornell.edu/~eric/">Eric Lafortune</a>.
+Copyright &copy; 2002-2013
+<a target="other" href="http://www.lafortune.eu/">Eric Lafortune</a>.
</address>
</body>
</html>
diff --git a/docs/manual/examples.html b/docs/manual/examples.html
index 3f47fca..804ae17 100644
--- a/docs/manual/examples.html
+++ b/docs/manual/examples.html
@@ -1,10 +1,21 @@
-<!doctype html PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
+<!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 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>
@@ -12,76 +23,84 @@
Some typical useful configurations:
<ol>
-<li><a href="#application">A typical application</a>
-<li><a href="#applet">A typical applet</a>
-<li><a href="#midlet">A typical midlet</a>
-<li><a href="#jcapplet">A typical Java Card applet</a>
-<li><a href="#xlet">A typical xlet</a>
-<li><a href="#androidapplication">A typical Android application</a>
-<li><a href="#library">A typical library</a>
-<li><a href="#applications">All possible applications in the input jars</a>
-<li><a href="#applets">All possible applets in the input jars</a>
-<li><a href="#midlets">All possible midlets in the input jars</a>
-<li><a href="#jcapplets">All possible Java Card applets in the input jars</a>
-<li><a href="#xlets">All possible xlets in the input jars</a>
-<li><a href="#androidapplications">All possible Android applications in the input jars</a>
-<li><a href="#servlets">All possible servlets in the input jars</a>
-<li><a href="#native">Processing native methods</a>
-<li><a href="#callback">Processing callback methods</a>
-<li><a href="#enumerations">Processing enumeration classes</a>
-<li><a href="#serializable">Processing serializable classes</a>
-<li><a href="#beans">Processing bean classes</a>
-<li><a href="#annotations">Processing annotations</a>
-<li><a href="#database">Processing database drivers</a>
-<li><a href="#componentui">Processing ComponentUI classes</a>
-<li><a href="#rmi">Processing RMI code</a>
-<li><a href="#resourcefiles">Processing resource files</a>
-<li><a href="#stacktrace">Producing useful obfuscated stack traces</a>
-<li><a href="#repackaging">Obfuscating package names</a>
-<li><a href="#restructuring">Restructuring the output archives</a>
-<li><a href="#filtering">Filtering the input and the output</a>
-<li><a href="#multiple">Processing multiple applications at once</a>
-<li><a href="#incremental">Incremental obfuscation</a>
-<li><a href="#microedition">Preverifying class files for Java Micro Edition</a>
-<li><a href="#upgrade">Upgrading class files to Java 6</a>
-<li><a href="#deadcode">Finding dead code</a>
-<li><a href="#structure">Printing out the internal structure of class files</a>
-<li><a href="#annotated">Using annotations to configure ProGuard</a>
+<li><a href="#application">A typical application</a></li>
+<li><a href="#applet">A typical applet</a></li>
+<li><a href="#midlet">A typical midlet</a></li>
+<li><a href="#jcapplet">A typical Java Card applet</a></li>
+<li><a href="#xlet">A typical xlet</a></li>
+<li><a href="#androidactivity">A simple Android activity</a></li>
+<li><a href="#androidapplication">A complete Android application</a></li>
+<li><a href="#library">A typical library</a></li>
+<li><a href="#applications">All possible applications in the input jars</a></li>
+<li><a href="#applets">All possible applets in the input jars</a></li>
+<li><a href="#midlets">All possible midlets in the input jars</a></li>
+<li><a href="#jcapplets">All possible Java Card applets in the input jars</a></li>
+<li><a href="#xlets">All possible xlets in the input jars</a></li>
+<li><a href="#servlets">All possible servlets in the input jars</a></li>
+<li><a href="#scala">Scala applications with the Scala runtime</a></li>
+<li><a href="#native">Processing native methods</a></li>
+<li><a href="#callback">Processing callback methods</a></li>
+<li><a href="#enumerations">Processing enumeration classes</a></li>
+<li><a href="#serializable">Processing serializable classes</a></li>
+<li><a href="#beans">Processing bean classes</a></li>
+<li><a href="#annotations">Processing annotations</a></li>
+<li><a href="#database">Processing database drivers</a></li>
+<li><a href="#componentui">Processing ComponentUI classes</a></li>
+<li><a href="#rmi">Processing RMI code</a></li>
+<li><a href="#injection">Processing resource injection</a></li>
+<li><a href="#resourcefiles">Processing resource files</a></li>
+<li><a href="#manifestfiles">Processing manifest files</a></li>
+<li><a href="#stacktrace">Producing useful obfuscated stack traces</a></li>
+<li><a href="#repackaging">Obfuscating package names</a></li>
+<li><a href="#logging">Removing logging code</a></li>
+<li><a href="#restructuring">Restructuring the output archives</a></li>
+<li><a href="#filtering">Filtering the input and the output</a></li>
+<li><a href="#multiple">Processing multiple applications at once</a></li>
+<li><a href="#incremental">Incremental obfuscation</a></li>
+<li><a href="#microedition">Preverifying class files for Java Micro Edition</a></li>
+<li><a href="#upgrade">Upgrading class files to Java 6</a></li>
+<li><a href="#deadcode">Finding dead code</a></li>
+<li><a href="#structure">Printing out the internal structure of class files</a></li>
+<li><a href="#annotated">Using annotations to configure ProGuard</a></li>
</ol>
You can find some sample configuration files in the <code>examples</code>
directory of the ProGuard distribution.
-<a name="application">&nbsp;</a>
-<h3>A typical application</h3>
-To shrink, optimize, and obfuscate the ProGuard application itself, one would
-typically create a configuration file <code>proguard.pro</code> and then type:
+<h3><a name="application">A typical application</a></h3>
+
+To shrink, optimize, and obfuscate a simple Java application, you typically
+create a configuration file like <code>myconfig.pro</code>, which can be used
+with
<pre>
-java -jar proguard.jar @proguard.pro
+bin/proguard @myconfig.pro
</pre>
<p>
-The configuration file would contain the following options:
+The configuration file specifies the input, the output, and the entry points
+of the application:
<pre>
--injars proguard.jar
--outjars proguard_out.jar
+-injars myapplication.jar
+-outjars myapplication_out.jar
-libraryjars &lt;java.home&gt;/lib/rt.jar
--printmapping proguard.map
+-printmapping myapplication.map
--keep public class proguard.ProGuard {
+-keep public class mypackage.MyMain {
public static void main(java.lang.String[]);
}
</pre>
<p>
-Note the use of the <code>&lt;java.home&gt;</code> system property; it is
-replaced automatically.
-<p>
-Also note that all type names are fully specified:
-<code>proguard.ProGuard</code> and <code>java.lang.String[]</code>.
+Note the use of the <code>&lt;java.home&gt;</code> system property. ProGuard
+automatically replaces it when parsing the file.
<p>
+The <a href="usage.html#keep"><code>-keep</code></a> option specifies the
+entry point of the application that has to be preserved.
The access modifiers <code>public</code> and <code>static</code> are not
really required in this case, since we know a priori that the specified class
and method have the proper access flags. It just looks more familiar this way.
<p>
+Note that all type names are fully specified:
+<code>mypackage.MyMain</code> and <code>java.lang.String[]</code>.
+<p>
We're writing out an obfuscation mapping file with <a
href="usage.html#printmapping"><code>-printmapping</code></a>, for
de-obfuscating any stack traces later on, or for incremental obfuscation of
@@ -103,11 +122,10 @@ href="#native">native methods</a>, <a href="#callback">callback methods</a>,
<a href="#enumerations">enumerations</a>, <a href="#serializable">serializable
classes</a>, <a href="#beans">bean classes</a>, <a
href="#annotations">annotations</a>, and <a href="#resourcefiles">resource
-files</a>. For processing 'simple' applications like ProGuard, that is not
-required.
+files</a>.
+
+<h3><a name="applet">A typical applet</a></h3>
-<a name="applet">&nbsp;</a>
-<h3>A typical applet</h3>
These options shrink, optimize, and obfuscate the applet
<code>mypackage.MyApplet</code>:
<pre>
@@ -129,15 +147,15 @@ classes</a>, <a href="#beans">bean classes</a>, <a
href="#annotations">annotations</a>, and <a href="#resourcefiles">resource
files</a>.
-<a name="midlet">&nbsp;</a>
-<h3>A typical midlet</h3>
+<h3><a name="midlet">A typical midlet</a></h3>
+
These options shrink, optimize, obfuscate, and preverify the midlet
<code>mypackage.MyMIDlet</code>:
<pre>
-injars in.jar
-outjars out.jar
--libraryjars /usr/local/java/wtk2.1/lib/midpapi20.jar
--libraryjars /usr/local/java/wtk2.1/lib/cldcapi11.jar
+-libraryjars /usr/local/java/wtk2.5.2/lib/midpapi20.jar
+-libraryjars /usr/local/java/wtk2.5.2/lib/cldcapi11.jar
-overloadaggressively
-repackageclasses ''
-allowaccessmodification
@@ -172,8 +190,8 @@ methods</a> and <a href="#resourcefiles">resource files</a>.
Note that you will still have to adapt the midlet jar size in the
corresponding jad file; ProGuard doesn't do that for you.
-<a name="jcapplet">&nbsp;</a>
-<h3>A typical Java Card applet</h3>
+<h3><a name="jcapplet">A typical Java Card applet</a></h3>
+
These options shrink, optimize, and obfuscate the Java Card applet
<code>mypackage.MyApplet</code>:
<pre>
@@ -192,8 +210,8 @@ The configuration is very similar to the configuration for midlets, except that
it now targets the Java Card run-time environment. This environment doesn't
have java.lang.Class, so we're telling ProGuard not to worry about it.
-<a name="xlet">&nbsp;</a>
-<h3>A typical xlet</h3>
+<h3><a name="xlet">A typical xlet</a></h3>
+
These options shrink, optimize, and obfuscate the xlet
<code>mypackage.MyXlet</code>:
<pre>
@@ -212,15 +230,16 @@ These options shrink, optimize, and obfuscate the xlet
The configuration is very similar to the configuration for midlets, except that
it now targets the CDC run-time environment with the Java TV API.
-<a name="androidapplication">&nbsp;</a>
-<h3>A typical Android application</h3>
-These options shrink, optimize, and obfuscate the simple Android application
-based on a single activity <code>mypackage.MyActivity</code>:
+<h3><a name="androidactivity">A simple Android activity</a></h3>
+
+These options shrink, optimize, and obfuscate the single Android
+activity <code>mypackage.MyActivity</code>:
<pre>
--injars in.jar
--outjars out.jar
--libraryjars /usr/local/java/android-1.5_r1/platforms/android-1.5/android.jar
--overloadaggressively
+-injars bin/classes
+-outjars bin/classes-processed.jar
+-libraryjars /usr/local/java/android-sdk/platforms/android-9/android.jar
+
+-dontpreverify
-repackageclasses ''
-allowaccessmodification
-optimizations !code/simplification/arithmetic
@@ -228,27 +247,180 @@ based on a single activity <code>mypackage.MyActivity</code>:
-keep public class mypackage.MyActivity
</pre>
<p>
-The configuration is very similar to the configuration for midlets, except that
-it now targets the Android run-time environment.
+We're targeting the Android run-time and keeping the activity as an entry
+point.
+<p>
+Preverification is irrelevant for the dex compiler and the Dalvik VM, so we
+can switch it off with the
+<a href="usage.html#dontpreverify"><code>-dontpreverify</code></a> option.
<p>
The <a href="usage.html#optimizations"><code>-optimizations</code></a> option
disables some arithmetic simplifications that Dalvik 1.0 and 1.5 can't handle.
+Note that the Dalvik VM also can't
+handle <a href="usage.html#overloadaggressively">aggressive overloading</a>
+(of static fields).
<p>
If applicable, you should add options for processing <a href="#native">native
-methods</a>, <a href="#callback">callback methods</a>, and <a
-href="#resourcefiles">resource files</a>.
+methods</a>, <a href="#callback">callback methods</a>,
+<a href="#enumerations">enumerations</a>,
+<a href="#annotations">annotations</a>, and
+<a href="#resourcefiles">resource files</a>.
+
+<h3><a name="androidapplication">A complete Android application</a></h3>
+
+<img class="float" src="attention.gif" width="64" height="64" alt="attention" />
+The Ant and Eclipse build processes of the Android SDK already integrate
+ProGuard by default, with all the proper settings. You only need to enable
+ProGuard (for release builds), by uncommenting the line
+"<code>proguard.config=.....</code>" in the file
+<code>project.properties</code> (created or updated by Android SDK revision 17
+or higher). Notes:
+<ul>
+<li>In case of problems, you may want to check if the configuration files that
+ are listed on this line (<code>proguard-project.txt</code>,...) contain
+ the necessary settings for your application.</li>
+<li>Android SDK revision 20 and higher have a different configuration file for
+ enabling optimization:
+ <code>${sdk.dir}/tools/proguard/proguard-android-optimize.txt</code>
+ instead of the default
+ <code>${sdk.dir}/tools/proguard/proguard-android.txt</code>.</li>
+<li>The build processes are already setting the necessary program jars,
+ library jars, and output jars for you &mdash; don't specify them again.</li>
+<li>If you get warnings about missing referenced classes: it's all too common
+ that libraries refer to missing classes.
+ See <a href="troubleshooting.html#unresolvedclass">"Warning: can't find
+ referenced class"</a> in the Troubleshooting section.</li>
+</ul>
+<p>
+For more information, you can consult the official <a target="other"
+href="http://developer.android.com/guide/developing/tools/proguard.html">Developer
+Guide</a> in the Android SDK.
+<p>
+If you're constructing a build process from scratch: these options shrink,
+optimize, and obfuscate all public activities, services, broadcast receivers,
+and content providers from the compiled classes and external libraries:
+<pre>
+-injars bin/classes
+-injars libs
+-outjars bin/classes-processed.jar
+-libraryjars /usr/local/java/android-sdk/platforms/android-9/android.jar
+
+-dontpreverify
+-repackageclasses ''
+-allowaccessmodification
+-optimizations !code/simplification/arithmetic
+-keepattributes *Annotation*
+
+-keep public class * extends android.app.Activity
+-keep public class * extends android.app.Application
+-keep public class * extends android.app.Service
+-keep public class * extends android.content.BroadcastReceiver
+-keep public class * extends android.content.ContentProvider
+
+-keep public class * extends android.view.View {
+ public &lt;init&gt;(android.content.Context);
+ public &lt;init&gt;(android.content.Context, android.util.AttributeSet);
+ public &lt;init&gt;(android.content.Context, android.util.AttributeSet, int);
+ public void set*(...);
+}
+
+-keepclasseswithmembers class * {
+ public &lt;init&gt;(android.content.Context, android.util.AttributeSet);
+}
+
+-keepclasseswithmembers class * {
+ public &lt;init&gt;(android.content.Context, android.util.AttributeSet, int);
+}
+
+-keepclassmembers class * extends android.content.Context {
+ public void *(android.view.View);
+ public void *(android.view.MenuItem);
+}
+
+-keepclassmembers class * implements android.os.Parcelable {
+ static android.os.Parcelable$Creator CREATOR;
+}
+
+-keepclassmembers class **.R$* {
+ public static &lt;fields&gt;;
+}
+
+-keepclassmembers class * {
+ @android.webkit.JavascriptInterface &lt;methods&gt;;
+}
+</pre>
+<p>
+Most importantly, we're keeping all fundamental classes that may be referenced
+by the <code>AndroidManifest.xml</code> file of the application. If your
+manifest file contains other classes and methods, you may have to specify
+those as well.
+<p>
+We're keeping annotations, since they might be used by custom
+<code>RemoteViews</code>.
+<p>
+We're keeping any custom <code>View</code> extensions and other classes with
+typical constructors, since they might be referenced from XML layout files.
+<p>
+We're also keeping possible <code>onClick</code> handlers in
+custom <code>Context</code> extensions, since they might be referenced from
+XML layout files.
+<p>
+We're also keeping the required static fields in <code>Parcelable</code>
+implementations, since they are accessed by introspection.
+<p>
+We're keeping the static fields of referenced inner classes of auto-generated
+ <code>R</code> classes, just in case your code is accessing those fields by
+introspection. Note that the compiler already inlines primitive fields, so
+ProGuard can generally remove all these classes entirely anyway (because the
+classes are not referenced and therefore not required).
+<p>
+Finally, we're keeping annotated Javascript interface methods, so they can be
+exported and accessed by their original names. Javascript interface methods
+that are not annotated (in code targeted at Android versions older than 4.2)
+still need to be preserved manually.
+<p>
+If you're using additional Google APIs, you'll have to specify
+those as well, for instance:
+<pre>
+-libraryjars /usr/local/android-sdk/add-ons/google_apis-7_r01/libs/maps.jar
+</pre>
+<p>
+If you're using Google's optional License Verification Library, you can
+obfuscate its code along with your own code. You do have to preserve
+its <code>ILicensingService</code> interface for the library to work:
+<pre>
+-keep public interface com.android.vending.licensing.ILicensingService
+</pre>
+<p>
+If you're using the Android Compatibility library, you should add the
+following line, to let ProGuard know it's ok that the library references some
+classes that are not available in all versions of the API:
+<pre>
+-dontwarn android.support.**
+</pre>
+<p>
+If applicable, you should add options for processing <a href="#native">native
+methods</a>, <a href="#callback">callback methods</a>,
+<a href="#enumerations">enumerations</a>,
+and <a href="#resourcefiles">resource files</a>. You may also want to add
+options for producing <a href="#stacktrace">useful stack traces</a> and
+to <a href="#logging">remove logging</a>. You can find a complete sample
+configuration in <code>examples/android.pro</code> in the ProGuard
+distribution.
+
+<h3><a name="library">A typical library</a></h3>
-<a name="library">&nbsp;</a>
-<h3>A typical library</h3>
These options shrink, optimize, and obfuscate an entire library, keeping all
public and protected classes and class members, native method names, and
-serialization code:
+serialization code. The processed version of the library can then still be
+used as such, for developing code based on its public API.
<pre>
-injars in.jar
-outjars out.jar
-libraryjars &lt;java.home&gt;/lib/rt.jar
-printmapping out.map
+-keepparameternames
-renamesourcefileattribute SourceFile
-keepattributes Exceptions,InnerClasses,Signature,Deprecated,
SourceFile,LineNumberTable,*Annotation*,EnclosingMethod
@@ -273,6 +445,7 @@ serialization code:
-keepclassmembers class * implements java.io.Serializable {
static final long serialVersionUID;
+ private static final java.io.ObjectStreamField[] serialPersistentFields;
private void writeObject(java.io.ObjectOutputStream);
private void readObject(java.io.ObjectInputStream);
java.lang.Object writeReplace();
@@ -289,12 +462,12 @@ The <a
href="usage.html#keepclassmembernames"><code>-keepclassmembernames</code></a>
option for the <code>class$</code> methods is not strictly necessary. These
methods are inserted by the <code>javac</code> compiler and the
-<code>jikes</code> compiler respectively, to implement the <code>.class</code>
-construct. ProGuard will automatically detect them and deal with them, even
-when their names have been obfuscated. However, older versions of ProGuard and
-other obfuscators may rely on the original method names. It may therefore be
-helpful to preserve them, in case these other obfuscators are ever used for
-further obfuscation of the library.
+<code>jikes</code> compiler respectively, in JDK 1.2 and older, to implement
+the <code>.class</code> construct. ProGuard will automatically detect them and
+deal with them, even when their names have been obfuscated. However, other
+obfuscators may rely on the original method names. It may therefore be helpful
+to preserve them, in case these other obfuscators are ever used for further
+obfuscation of the library.
<p>
The "Exceptions" attribute has to be preserved, so the compiler knows which
exceptions methods may throw.
@@ -307,6 +480,11 @@ classes otherwise.
The "Signature" attribute is required to be able to access generic types when
compiling in JDK 5.0 and higher.
<p>
+The <a href="usage.html#keepparameternames"><code>-keepparameternames</code></a>
+option keeps the parameter names in the "LocalVariableTable" and
+"LocalVariableTypeTable" attributes of public library methods. Some IDEs can
+present these names to the developers who use the library.
+<p>
Finally, we're keeping the "Deprecated" attribute and the attributes for
producing <a href="#stacktrace">useful stack traces</a>.
<p>
@@ -316,8 +494,8 @@ href="#serializable">serializable classes</a>, and <a
href="#annotations">annotations</a>, which are all discussed in their
respective examples.
-<a name="applications">&nbsp;</a>
-<h3>All possible applications in the input jars</h3>
+<h3><a name="applications">All possible applications in the input jars</a></h3>
+
These options shrink, optimize, and obfuscate all public applications in
<code>in.jar</code>:
<pre>
@@ -347,8 +525,8 @@ classes</a>, <a href="#beans">bean classes</a>, <a
href="#annotations">annotations</a>, and <a href="#resourcefiles">resource
files</a>.
-<a name="applets">&nbsp;</a>
-<h3>All possible applets in the input jars</h3>
+<h3><a name="applets">All possible applets in the input jars</a></h3>
+
These options shrink, optimize, and obfuscate all public applets in
<code>in.jar</code>:
<pre>
@@ -372,15 +550,15 @@ classes</a>, <a href="#beans">bean classes</a>, <a
href="#annotations">annotations</a>, and <a href="#resourcefiles">resource
files</a>.
-<a name="midlets">&nbsp;</a>
-<h3>All possible midlets in the input jars</h3>
+<h3><a name="midlets">All possible midlets in the input jars</a></h3>
+
These options shrink, optimize, obfuscate, and preverify all public midlets in
<code>in.jar</code>:
<pre>
-injars in.jar
-outjars out.jar
--libraryjars /usr/local/java/wtk2.1/lib/midpapi20.jar
--libraryjars /usr/local/java/wtk2.1/lib/cldcapi11.jar
+-libraryjars /usr/local/java/wtk2.5.2/lib/midpapi20.jar
+-libraryjars /usr/local/java/wtk2.5.2/lib/cldcapi11.jar
-overloadaggressively
-repackageclasses ''
-allowaccessmodification
@@ -412,8 +590,8 @@ methods</a> and <a href="#resourcefiles">resource files</a>.
Note that you will still have to adapt the midlet jar size in the
corresponding jad file; ProGuard doesn't do that for you.
-<a name="jcapplets">&nbsp;</a>
-<h3>All possible Java Card applets in the input jars</h3>
+<h3><a name="jcapplets">All possible Java Card applets in the input jars</a></h3>
+
These options shrink, optimize, and obfuscate all public Java Card applets in
<code>in.jar</code>:
<pre>
@@ -435,8 +613,8 @@ interface.
The <a href="usage.html#printseeds"><code>-printseeds</code></a> option prints
out which applets exactly will be preserved.
-<a name="xlets">&nbsp;</a>
-<h3>All possible xlets in the input jars</h3>
+<h3><a name="xlets">All possible xlets in the input jars</a></h3>
+
These options shrink, optimize, and obfuscate all public xlets in
<code>in.jar</code>:
<pre>
@@ -458,38 +636,8 @@ We're simply keeping all classes that implement the <code>Xlet</code> interface.
The <a href="usage.html#printseeds"><code>-printseeds</code></a> option prints
out which xlets exactly will be preserved.
-<a name="androidapplications">&nbsp;</a>
-<h3>All possible Android applications in the input jars</h3>
-These options shrink, optimize, and obfuscate all public activities, services,
-broadcast receivers, and content providers in <code>in.jar</code>:
-<pre>
--injars in.jar
--outjars out.jar
--libraryjars /usr/local/java/android-1.5_r1/platforms/android-1.5/android.jar
--overloadaggressively
--repackageclasses ''
--allowaccessmodification
--optimizations !code/simplification/arithmetic
--printseeds
-
--keep public class * extends android.app.Activity
--keep public class * extends android.app.Service
--keep public class * extends android.content.BroadcastReceiver
--keep public class * extends android.content.ContentProvider
-</pre>
-<p>
-We're keeping all classes that extend the base classes that may be referenced
-by the <code>AndroidManifest.xml</code> file of the application.
-<p>
-The <a href="usage.html#printseeds"><code>-printseeds</code></a> option prints
-out which implementations exactly will be preserved.
-<p>
-If applicable, you should add options for processing <a href="#native">native
-methods</a>, <a href="#callback">callback methods</a>, and <a
-href="#resourcefiles">resource files</a>.
+<h3><a name="servlets">All possible servlets in the input jars</a></h3>
-<a name="servlets">&nbsp;</a>
-<h3>All possible servlets in the input jars</h3>
These options shrink, optimize, and obfuscate all public servlets in
<code>in.jar</code>:
<pre>
@@ -521,8 +669,77 @@ classes</a>, <a href="#beans">bean classes</a>, <a
href="#annotations">annotations</a>, and <a href="#resourcefiles">resource
files</a>.
-<a name="native">&nbsp;</a>
-<h3>Processing native methods</h3>
+<h3><a name="scala">Scala applications with the Scala runtime</a></h3>
+
+These options shrink, optimize, and obfuscate all public Scala applications in
+<code>in.jar</code>:
+<pre>
+-injars in.jar
+-injars /usr/local/java/scala-2.9.1/lib/scala-library.jar
+-outjars out.jar
+-libraryjars &lt;java.home&gt;/lib/rt.jar
+
+-dontwarn scala.**
+
+-keepclasseswithmembers public class * {
+ public static void main(java.lang.String[]);
+}
+
+-keep class * implements org.xml.sax.EntityResolver
+
+-keepclassmembers class * {
+ ** MODULE$;
+}
+
+-keepclassmembernames class scala.concurrent.forkjoin.ForkJoinPool {
+ long eventCount;
+ int workerCounts;
+ int runControl;
+ scala.concurrent.forkjoin.ForkJoinPool$WaitQueueNode syncStack;
+ scala.concurrent.forkjoin.ForkJoinPool$WaitQueueNode spareStack;
+}
+
+-keepclassmembernames class scala.concurrent.forkjoin.ForkJoinWorkerThread {
+ int base;
+ int sp;
+ int runState;
+}
+
+-keepclassmembernames class scala.concurrent.forkjoin.ForkJoinTask {
+ int status;
+}
+
+-keepclassmembernames class scala.concurrent.forkjoin.LinkedTransferQueue {
+ scala.concurrent.forkjoin.LinkedTransferQueue$PaddedAtomicReference head;
+ scala.concurrent.forkjoin.LinkedTransferQueue$PaddedAtomicReference tail;
+ scala.concurrent.forkjoin.LinkedTransferQueue$PaddedAtomicReference cleanMe;
+}
+</pre>
+<p>
+The configuration is essentially the same as
+for <a href="#applications">processing applications</a>, because Scala is
+compiled to ordinary Java bytecode. However, the example processes the Scala
+runtime library as well. The processed jar can be an order of magnitude
+smaller and a few times faster than the original code (for the Scala code
+examples, for instance).
+<p>
+The <a href="usage.html#dontwarn"><code>-dontwarn</code></a> option tells
+ProGuard not to complain about some artefacts in the Scala runtime, the way it
+is compiled by the <code>scalac</code> compiler (at least in Scala 2.9.1 and
+older). Note that this option should always be used with care.
+<p>
+The additional <a href="usage.html#keepoverview"><code>-keep</code></a>
+options make sure that some classes and some fields that are accessed by means
+of introspection are not removed or renamed.
+<p>
+If applicable, you should add options for processing <a href="#native">native
+methods</a>, <a href="#callback">callback methods</a>, <a
+href="#enumerations">enumerations</a>, <a href="#serializable">serializable
+classes</a>, <a href="#beans">bean classes</a>, <a
+href="#annotations">annotations</a>, and <a href="#resourcefiles">resource
+files</a>.
+<h3><a name="native">Processing native methods</a></h3>
+
If your application, applet, servlet, library, etc., contains native methods,
you'll want to preserve their names and their classes' names, so they can
still be linked to the native library. The following additional option will
@@ -543,8 +760,8 @@ the classes or class members that are invoked by the native code. These are
entry points, which you'll have to specify explicitly. <a
href="callback">Callback methods</a> are discussed below as a typical example.
-<a name="callback">&nbsp;</a>
-<h3>Processing callback methods</h3>
+<h3><a name="callback">Processing callback methods</a></h3>
+
If your application, applet, servlet, library, etc., contains callback
methods, which are called from external code (native code, scripts,...),
you'll want to preserve them, and probably their classes too. They are just
@@ -559,8 +776,8 @@ the following option will keep the callback class and method:
<p>
This will preserve the given class and method from being removed or renamed.
-<a name="enumerations">&nbsp;</a>
-<h3>Processing enumeration classes</h3>
+<h3><a name="enumerations">Processing enumeration classes</a></h3>
+
If your application, applet, servlet, library, etc., contains enumeration
classes, you'll have to preserve some special methods. Enumerations were
introduced in Java 5. The java compiler translates enumerations into classes
@@ -576,8 +793,8 @@ removed or obfuscated:
}
</pre>
-<a name="serializable">&nbsp;</a>
-<h3>Processing serializable classes</h3>
+<h3><a name="serializable">Processing serializable classes</a></h3>
+
More complex applications, applets, servlets, libraries, etc., may contain
classes that are serialized. Depending on the way in which they are used, they
may require special attention:
@@ -589,6 +806,7 @@ may require special attention:
<pre>
-keepclassmembers class * implements java.io.Serializable {
+ private static final java.io.ObjectStreamField[] serialPersistentFields;
private void writeObject(java.io.ObjectOutputStream);
private void readObject(java.io.ObjectInputStream);
java.lang.Object writeReplace();
@@ -602,8 +820,7 @@ may require special attention:
option makes sure that any serialization methods are kept. By using this
option instead of the basic <code>-keep</code> option, we're not
forcing preservation of <i>all</i> serializable classes, just preservation
- of the listed members of classes that are actually used.
- <p>
+ of the listed members of classes that are actually used.</li>
<li>Sometimes, the serialized data are stored, and read back later into newer
versions of the serializable classes. One then has to take care the classes
@@ -617,7 +834,7 @@ may require special attention:
-keepclassmembers class * implements java.io.Serializable {
static final long serialVersionUID;
- static final java.io.ObjectStreamField[] serialPersistentFields;
+ private static final java.io.ObjectStreamField[] serialPersistentFields;
!static !transient &lt;fields&gt;;
private void writeObject(java.io.ObjectOutputStream);
private void readObject(java.io.ObjectInputStream);
@@ -632,7 +849,7 @@ may require special attention:
The <code>&lt;fields&gt;</code> line preserves all non-static,
non-transient fields, with their original names. The introspection of the
serialization process and the de-serialization process will then find
- consistent names.
+ consistent names.</li>
<li>Occasionally, the serialized data have to remain compatible, but the
classes involved lack <code>serialVersionUID</code> fields. I imagine the
@@ -651,7 +868,7 @@ may require special attention:
-keepclassmembers class * implements java.io.Serializable {
static final long serialVersionUID;
- static final java.io.ObjectStreamField[] serialPersistentFields;
+ private static final java.io.ObjectStreamField[] serialPersistentFields;
!static !transient &lt;fields&gt;;
!private &lt;fields&gt;;
!private &lt;methods&gt;;
@@ -668,7 +885,7 @@ may require special attention:
interfaces of the serializable classes (using something like "<code>-keep
interface MyInterface</code>"), since these names are also used when
computing the UID. A fast but sub-optimal alternative would be simply
- keeping all interfaces with "<code>-keep interface *</code>".
+ keeping all interfaces with "<code>-keep interface *</code>".</li>
</ul>
<p>
@@ -679,8 +896,8 @@ the <code>Serialization</code> interface, yet only a small number may actually
ever be serialized. Knowing your application and tuning the configuration
often produces more compact results.
-<a name="beans">&nbsp;</a>
-<h3>Processing bean classes</h3>
+<h3><a name="beans">Processing bean classes</a></h3>
+
If your application, applet, servlet, library, etc., makes extensive use of
introspection on bean classes to find bean editor classes, or getter and
setter methods, then configuration may become painful. There's not much else
@@ -696,8 +913,8 @@ names don't change. For instance:
</pre>
<p>
If there are too many elements to list explicitly, wildcards in class names
-and method signatures might be helpful. This example should encompasses all
-possible setters and getters in classes in the package <code>mybeans</code>:
+and method signatures might be helpful. This example preserves all possible
+setters and getters in classes in the package <code>mybeans</code>:
<pre>
-keep class mybeans.** {
void set*(***);
@@ -715,8 +932,8 @@ The '<code>***</code>' wildcard matches any type (primitive or non-primitive,
array or non-array). The methods with the '<code>int</code>' arguments matches
properties that are lists.
-<a name="annotations">&nbsp;</a>
-<h3>Processing annotations</h3>
+<h3><a name="annotations">Processing annotations</a></h3>
+
If your application, applet, servlet, library, etc., uses annotations, you may
want to preserve them in the processed output. Annotations are represented by
attributes that have no direct effect on the execution of the code. However,
@@ -744,8 +961,8 @@ has to be preserved as well:
-keepattributes EnclosingMethod
</pre>
-<a name="database">&nbsp;</a>
-<h3>Processing database drivers</h3>
+<h3><a name="database">Processing database drivers</a></h3>
+
Database drivers are implementations of the <code>Driver</code> interface.
Since they are often created dynamically, you may want to preserve any
implementations that you are processing as entry points:
@@ -758,8 +975,8 @@ This option also gets rid of the note that ProGuard prints out about
instantiating a driver in your code (without necessarily implementing any
drivers yourself).
-<a name="componentui">&nbsp;</a>
-<h3>Processing ComponentUI classes</h3>
+<h3><a name="componentui">Processing ComponentUI classes</a></h3>
+
Swing UI look and feels are implemented as extensions of the
<code>ComponentUI</code> class. For some reason, these have to contain a
static method <code>createUI</code>, which the Swing API invokes using
@@ -773,8 +990,8 @@ point, for instance like this:
<p>
This option also keeps the classes themselves.
-<a name="rmi">&nbsp;</a>
-<h3>Processing RMI code</h3>
+<h3><a name="rmi">Processing RMI code</a></h3>
+
Reportedly, the easiest way to handle RMI code is to process the code with
ProGuard first and then invoke the <code>rmic</code> tool. If that is not
possible, you may want to try something like this:
@@ -798,8 +1015,29 @@ The <code>Exceptions</code> attribute has to be kept too, because the RMI
handling code performs introspection to check whether the method signatures
are compatible.
-<a name="resourcefiles">&nbsp;</a>
-<h3>Processing resource files</h3>
+<h3><a name="injection">Processing resource injection</a></h3>
+
+If your application is using JEE-style resource injection, the application
+container will automatically assign instances of resource classes to fields and
+methods that are annotated with <code>@Resource</code>. The container applies
+introspection, even accessing private class members directly. It typically
+constructs a resource name based on the type name and the class member name.
+We then have to avoid that such class members are removed or renamed:
+<pre>
+-keepclassmembers class * {
+ @javax.annotation.Resource *;
+}
+</pre>
+<p>
+The Spring framework has another similar annotation <code>@Autowired</code>:
+<pre>
+-keepclassmembers class * {
+ @org.springframework.beans.factory.annotation.Autowired *;
+}
+</pre>
+
+<h3><a name="resourcefiles">Processing resource files</a></h3>
+
If your application, applet, servlet, library, etc., contains resource files,
it may be necessary to adapt their names and/or their contents when the
application is obfuscated. The following two options can achieve this
@@ -818,8 +1056,31 @@ option looks for class names in properties files and in the manifest file, and
replaces these names by the obfuscated names (if any). You'll probably want to
adapt the filters to suit your application.
-<a name="stacktrace">&nbsp;</a>
-<h3>Producing useful obfuscated stack traces</h3>
+<h3><a name="manifestfiles">Processing manifest files</a></h3>
+
+As illustrated in the previous section, manifest files can be treated like
+ordinary resource files. ProGuard can adapt obfuscated class names in the
+files, but it won't make any other changes. If you want anything else, you
+should apply an external tool. For instance, if a manifest file contains
+signing information, you should sign the jar again after it has been
+processed.
+<p>
+If you're merging several input jars into a single output jar, you'll have to
+pick one, typically by specifying <a href="usage.html#filters">filters</a>:
+<pre>
+-injars in1.jar
+-injars in2.jar(!META-INF/MANIFEST.MF)
+-injars in3.jar(!META-INF/MANIFEST.MF)
+-outjars out.jar
+</pre>
+<p>
+The filters will let ProGuard copy the manifest file from the first jar and
+ignore any manifest files in the second and third input jars. Note that
+ProGuard will leave the order of the files in the jars unchanged; manifest
+files are not necessarily put first.
+
+<h3><a name="stacktrace">Producing useful obfuscated stack traces</a></h3>
+
These options let obfuscated applications or libraries produce stack traces
that can still be deciphered later on:
<pre>
@@ -844,8 +1105,8 @@ their original names, so we're saving the mapping to a file
<code>out.map</code>. The information can then be used by the <a
href="retrace/index.html">ReTrace</a> tool to restore the original stack trace.
-<a name="repackaging">&nbsp;</a>
-<h3>Obfuscating package names</h3>
+<h3><a name="repackaging">Obfuscating package names</a></h3>
+
Package names can be obfuscated in various ways, with increasing levels of
obfuscation and compactness. For example, consider the following classes:
<pre>
@@ -951,8 +1212,37 @@ Note that not all levels of obfuscation of package names may be acceptable for
all code. Notably, you may have to take into account that your application may
contain <a href="#resourcefiles">resource files</a> that have to be adapted.
-<a name="restructuring">&nbsp;</a>
-<h3>Restructuring the output archives</h3>
+<h3><a name="logging">Removing logging code</a></h3>
+
+You can let ProGuard remove logging code. The trick is to specify that the
+logging methods don't have side-effects &mdash; even though they actually do,
+since they write to the console or to a log file. ProGuard will take your word
+for it and remove the invocations (in the optimization step) and if possible
+the logging classes and methods themselves (in the shrinking step).
+<p>
+For example, this configuration removes invocations of the Android logging
+methods:
+<pre>
+-assumenosideeffects class android.util.Log {
+ public static boolean isLoggable(java.lang.String, int);
+ public static int v(...);
+ public static int i(...);
+ public static int w(...);
+ public static int d(...);
+ public static int e(...);
+}
+</pre>
+<p>
+The wildcards are a shortcut to match all versions of the methods.
+<p>
+Note that you generally can't remove logging code that uses
+<code>System.out.println</code>, since you would be removing all invocations
+of <code>java.io.PrintStream#println</code>, which could break your
+application. You can work around it by creating your own logging methods and
+let ProGuard remove those.
+
+<h3><a name="restructuring">Restructuring the output archives</a></h3>
+
In simple applications, all output classes and resources files are merged into
a single jar. For example:
<pre>
@@ -1022,12 +1312,12 @@ This grouping, archiving, and flattening can be arbitrarily complex. ProGuard
always tries to package output archives in a sensible way, reconstructing the
input entries as much as required.
-<a name="filtering">&nbsp;</a>
-<h3>Filtering the input and the output</h3>
+<h3><a name="filtering">Filtering the input and the output</a></h3>
-If you want even greater control, you can add filters to the input and the
-output, filtering out zips, ears, wars, jars, and/or ordinary files. For
-example, if you want to disregard certain files from an input jar:
+If you want even greater control, you can add
+<a href="usage.html#filters">filters</a> to the input and the output,
+filtering out zips, ears, wars, jars, and/or ordinary files. For example, if
+you want to disregard certain files from an input jar:
<pre>
-injars in.jar(!images/**)
-outjars out.jar
@@ -1080,10 +1370,10 @@ files to <code>code_out.jar</code>, and all remaining files to
<code>resources_out.jar</code>.
<p>
Again, the filtering can be arbitrarily complex, especially when combined with
-the grouping of input and output.
+grouping input and output.
+
+<h3><a name="multiple">Processing multiple applications at once</a></h3>
-<a name="multiple">&nbsp;</a>
-<h3>Processing multiple applications at once</h3>
You can process several dependent or independent applications (or applets,
midlets,...) in one go, in order to save time and effort. ProGuard's input and
output handling offers various ways to keep the output nicely structured.
@@ -1100,10 +1390,10 @@ just the input and output options:
</pre>
<p>
After processing, the directory <code>processed_applications</code> will
-contain the processed application jars, with their original names.
+contain processed versions of application jars, with their original names.
+
+<h3><a name="incremental">Incremental obfuscation</a></h3>
-<a name="incremental">&nbsp;</a>
-<h3>Incremental obfuscation</h3>
After having <a href="#application">processed an application</a>, e.g.
ProGuard itself, you can still incrementally add other pieces of code that
depend on it, e.g. the ProGuard GUI:
@@ -1149,18 +1439,18 @@ jar as a library jar:
}
</pre>
-<a name="microedition">&nbsp;</a>
-<h3>Preverifying class files for Java Micro Edition</h3>
+<h3><a name="microedition">Preverifying class files for Java Micro Edition</a></h3>
+
Even if you're not interested in shrinking, optimizing, and obfuscating your
midlets, as shown in the <a href="#midlets">midlets example</a>, you can still
use ProGuard to preverify the class files for Java Micro Edition. ProGuard
-produces slightly more compact results compared to the traditional external
+produces slightly more compact results than the traditional external
preverifier.
<pre>
-injars in.jar
-outjars out.jar
--libraryjars /usr/local/java/wtk2.1/lib/midpapi20.jar
--libraryjars /usr/local/java/wtk2.1/lib/cldcapi11.jar
+-libraryjars /usr/local/java/wtk2.5.2/lib/midpapi20.jar
+-libraryjars /usr/local/java/wtk2.5.2/lib/cldcapi11.jar
-dontshrink
-dontoptimize
@@ -1175,8 +1465,8 @@ href="usage.html#microedition"><code>-microedition</code></a> option. Note
that we don't need any <code>-keep</code> options to specify entry points; all
class files are simply preverified.
-<a name="upgrade">&nbsp;</a>
-<h3>Upgrading class files to Java 6</h3>
+<h3><a name="upgrade">Upgrading class files to Java 6</a></h3>
+
The following options upgrade class files to Java 6, by updating their
internal version numbers and preverifying them. The class files can then be
loaded more efficiently by the Java 6 Virtual Machine.
@@ -1198,8 +1488,8 @@ automatically be preverified for Java 6 as a result. Note that we don't need
any <code>-keep</code> options to specify entry points; all class files are
simply updated and preverified.
-<a name="deadcode">&nbsp;</a>
-<h3>Finding dead code</h3>
+<h3><a name="deadcode">Finding dead code</a></h3>
+
These options list unused classes, fields, and methods in the application
<code>mypackage.MyApplication</code>:
<pre>
@@ -1232,8 +1522,8 @@ that keeps those fields a priori, in order to avoid having them listed:
}
</pre>
-<a name="structure">&nbsp;</a>
-<h3>Printing out the internal structure of class files</h3>
+<h3><a name="structure">Printing out the internal structure of class files</a></h3>
+
These options print out the internal structure of all class files in the input
jar:
<pre>
@@ -1250,8 +1540,7 @@ jar:
Note how we don't need to specify the Java run-time jar, because we're not
processing the input jar at all.
-<a name="annotated">&nbsp;</a>
-<h3>Using annotations to configure ProGuard</h3>
+<h3><a name="annotated">Using annotations to configure ProGuard</a></h3>
The traditional ProGuard configuration allows to keep a clean separation
between the code and the configuration for shrinking, optimization, and
@@ -1291,12 +1580,12 @@ href="#annotations">annotations</a>.
<p>
The directory <code>examples/annotations</code> contains more examples that
illustrate some of the possibilities.
-<p>
-<hr>
+<hr />
+<noscript><div><a target="_top" href="../index.html" class="button">Show menu</a></div></noscript>
<address>
-Copyright &copy; 2002-2009
-<a href="http://www.graphics.cornell.edu/~eric/">Eric Lafortune</a>.
+Copyright &copy; 2002-2013
+<a target="other" href="http://www.lafortune.eu/">Eric Lafortune</a>.
</address>
</body>
</html>
diff --git a/docs/manual/gradle.html b/docs/manual/gradle.html
new file mode 100644
index 0000000..3e0e500
--- /dev/null
+++ b/docs/manual/gradle.html
@@ -0,0 +1,545 @@
+<!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>Gradle Task</title>
+<script type="text/javascript" language="JavaScript">
+<!--
+if (window.self==window.top) {
+ history.go(-1);
+ 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>Gradle Task</h2>
+
+<b>ProGuard</b> can be run as a task in the Java-based build tool Gradle
+(version 1.3 or higher).
+<p>
+
+Before you can use the <code>proguard</code> task, you have to make sure
+Gradle can find it in its class path at build time. One way is to add the
+following line to your <code>build.gradle</code> file:
+<p>
+
+<pre>
+buildscript {
+ repositories {
+ flatDir dirs: '/usr/local/java/proguard/lib'
+ }
+ dependencies {
+ classpath ':proguard'
+ }
+}
+</pre>
+<p>
+
+Please make sure the class path is set correctly for your system.
+<p>
+
+You can then define a task:
+<p>
+<pre>
+task myProguardTask(type: proguard.gradle.ProGuardTask) {
+ .....
+}
+</pre>
+<p>
+
+The embedded configuration is much like a standard ProGuard configuration.
+Notable similarities and differences:
+<ul>
+<li>Like in ProGuard-style configurations, we're using all lower-case names
+ for the settings.</li>
+<li>The options don't have a dash as prefix.</li>
+<li>Arguments typically have quotes.</li>
+<li>Some settings are specified as named arguments.</li>
+</ul>
+<p>
+You can find some sample build files in the <code>examples/gradle</code>
+directory of the ProGuard distribution.
+<p>
+If you prefer a more verbose configuration derived from the Ant task, you can
+import the Ant task as a <a href="#anttask">Gradle task</a>.
+
+<h2><a name="proguard">Settings</a></h2>
+
+The ProGuard task supports the following settings in its closure:
+
+<dl>
+
+<dt><a name="configuration_attribute"><code><b>configuration</b></code></a>
+ <a href="#file"><i>files</i></a></dt>
+<dd>Read and merge options from the given ProGuard-style configuration
+ files. The files are resolved and parsed lazily, during the execution
+ phase.</dd>
+
+<dt><a href="usage.html#injars"><code><b>injars</b></code></a>
+ <a href="#classpath"><i>class_path</i></a></dt>
+<dd>Specifies the program jars (or wars, ears, zips, or directories). The files
+ are resolved and read lazily, during the execution phase.</dd>
+
+<dt><a href="usage.html#outjars"><code><b>outjars</b></code></a>
+ <a href="#classpath"><i>class_path</i></a></dt>
+<dd>Specifies the names of the output jars (or wars, ears, zips, or
+ directories). The files are resolved and written lazily, during the
+ execution phase.</dd>
+
+<dt><a href="usage.html#libraryjars"><code><b>libraryjars</b></code></a>
+ <a href="#classpath"><i>class_path</i></a></dt>
+<dd>Specifies the library jars (or wars, ears, zips, or directories). The files
+ are resolved and read lazily, during the execution phase.</dd>
+
+<dt><a href="usage.html#skipnonpubliclibraryclasses"><code><b>skipnonpubliclibraryclasses</b></code></a></dt>
+<dd>Ignore non-public library classes.</dd>
+
+<dt><a href="usage.html#dontskipnonpubliclibraryclassmembers"><code><b>dontskipnonpubliclibraryclassmembers</b></code></a></dt>
+<dd>Don't ignore package visible library class members.</dd>
+
+<dt><a href="usage.html#keepdirectories"><code><b>keepdirectories</b></code></a>
+ ['<a href="usage.html#filefilters"><i>directory_filter</i></a>']</dt>
+<dd>Keep the specified directories in the output jars (or wars, ears, zips,
+ or directories).</dd>
+
+<dt><a href="usage.html#target"><code><b>target</b></code></a>
+ '<i>version</i>'</dt>
+<dd>Set the given version number in the processed classes.</dd>
+
+<dt><a href="usage.html#forceprocessing"><code><b>forceprocessing</b></code></a></dt>
+<dd>Process the input, even if the output seems up to date.</dd>
+
+<dt><a href="usage.html#keep"><code><b>keep</b></code></a>
+ [<a href="#keepmodifier"><i>modifier</i>,...</a>]
+ <a href="#classspecification"><i>class_specification</i></a></dt>
+<dd>Preserve the specified classes <i>and</i> class members.</dd>
+
+<dt><a href="usage.html#keepclassmembers"><code><b>keepclassmembers</b></code></a>
+ [<a href="#keepmodifier"><i>modifier</i>,...</a>]
+ <a href="#classspecification"><i>class_specification</i></a></dt>
+<dd>Preserve the specified class members, if their classes are preserved as
+ well.</dd>
+
+<dt><a href="usage.html#keepclasseswithmembers"><code><b>keepclasseswithmembers</b></code></a>
+ [<a href="#keepmodifier"><i>modifier</i>,...</a>]
+ <a href="#classspecification"><i>class_specification</i></a></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>keepnames</b></code></a>
+ <a href="#classspecification"><i>class_specification</i></a></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>keepclassmembernames</b></code></a>
+ <a href="#classspecification"><i>class_specification</i></a></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>keepclasseswithmembernames</b></code></a>
+ <a href="#classspecification"><i>class_specification</i></a></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#printseeds"><code><b>printseeds</b></code></a>
+ [<a href="#file"><i>file</i></a>]</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>dontshrink</b></code></a></dt>
+<dd>Don't shrink the input class files.</dd>
+
+<dt><a href="usage.html#printusage"><code><b>printusage</b></code></a>
+ [<a href="#file"><i>file</i></a>]</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#whyareyoukeeping"><code><b>whyareyoukeeping</b></code></a>
+ <a href="#classspecification"><i>class_specification</i></a></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#dontoptimize"><code><b>dontoptimize</b></code></a></dt>
+<dd>Don't optimize the input class files.</dd>
+
+<dt><a href="usage.html#optimizations"><code><b>optimizations</b></code></a> '<a href="optimizations.html"><i>optimization_filter</i></a>'</dt>
+<dd>Perform only the specified optimizations.</dd>
+
+<dt><a href="usage.html#optimizationpasses"><code><b>optimizationpasses</b></code></a>
+ <i>n</i></dt>
+<dd>The number of optimization passes to be performed.</dd>
+
+<dt><a href="usage.html#assumenosideeffects"><code><b>assumenosideeffects</b></code></a>
+ <a href="#classspecification"><i>class_specification</i></a></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#allowaccessmodification"><code><b>allowaccessmodification</b></code></a></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></dt>
+<dd>Allow any interfaces to be merged, while optimizing.</dd>
+
+<dt><a href="usage.html#dontobfuscate"><code><b>dontobfuscate</b></code></a></dt>
+<dd>Don't obfuscate the input class files.</dd>
+
+<dt><a href="usage.html#printmapping"><code><b>printmapping</b></code></a>
+ [<a href="#file"><i>file</i></a>]</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>
+ <a href="#file"><i>file</i></a></dt>
+<dd>Reuse the given mapping, for incremental obfuscation.</dd>
+
+<dt><a href="usage.html#obfuscationdictionary"><code><b>obfuscationdictionary</b></code></a>
+ <a href="#file"><i>file</i></a></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>
+ <a href="#file"><i>file</i></a></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>
+ <a href="#file"><i>file</i></a></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></dt>
+<dd>Apply aggressive overloading while obfuscating.</dd>
+
+<dt><a href="usage.html#useuniqueclassmembernames"><code><b>useuniqueclassmembernames</b></code></a></dt>
+<dd>Ensure uniform obfuscated class member names for subsequent incremental
+ obfuscation.</dd>
+
+<dt><a href="usage.html#dontusemixedcaseclassnames"><code><b>dontusemixedcaseclassnames</b></code></a></dt>
+<dd>Don't generate mixed-case class names while obfuscating.</dd>
+
+<dt><a href="usage.html#keeppackagenames"><code><b>keeppackagenames</b></code></a> ['<a href="usage.html#filters"><i>package_filter</i></a>']</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#flattenpackagehierarchy"><code><b>flattenpackagehierarchy</b></code></a>
+ '<i>package_name</i>'</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>']</dt>
+<dd>Repackage all class files that are renamed into the single given
+ package.</dd>
+
+<dt><a href="usage.html#keepattributes"><code><b>keepattributes</b></code></a> ['<a href="usage.html#filters"><i>attribute_filter</i></a>']</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#keepparameternames"><code><b>keepparameternames</b></code></a></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>']</dt>
+<dd>Put the given constant string in the <code>SourceFile</code>
+ attributes.</dd>
+
+<dt><a href="usage.html#adaptclassstrings"><code><b>adaptclassstrings</b></code></a>
+ ['<a href="usage.html#filters"><i>class_filter</i></a>']</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>adaptresourcefilenames</b></code></a>
+ ['<a href="usage.html#filefilters"><i>file_filter</i></a>']</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>adaptresourcefilecontents</b></code></a>
+ ['<a href="usage.html#filefilters"><i>file_filter</i></a>']</dt>
+<dd>Update the contents of the specified resource files, based on the
+ obfuscated names of the processed classes.</dd>
+
+<dt><a href="usage.html#dontpreverify"><code><b>dontpreverify</b></code></a></dt>
+<dd>Don't 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></dt>
+<dd>Target the processed class files at Java Micro Edition.</dd>
+
+<dt><a href="usage.html#verbose"><code><b>verbose</b></code></a></dt>
+<dd>Write out some more information during processing.</dd>
+
+<dt><a href="usage.html#dontnote"><code><b>dontnote</b></code></a> '<a href="usage.html#filters"><i>class_filter</i></a>'</dt>
+<dd>Don't print notes about classes matching the specified class name
+ filter.</dd>
+
+<dt><a href="usage.html#dontwarn"><code><b>dontwarn</b></code></a> '<a href="usage.html#filters"><i>class_filter</i></a>'</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 href="usage.html#ignorewarnings"><code><b>ignorewarnings</b></code></a></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>
+ [<a href="#file"><i>file</i></a>]</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>
+ [<a href="#file"><i>file</i></a>]</dt>
+<dd>Write out the internal structure of the processed class files, to the
+ standard output or to the given file.</dd>
+
+</dl>
+
+<h2><a name="classpath">Class Paths</a></h2>
+
+Class paths are specified as Gradle file collections, which means they can be
+specified as simple strings, with <code>files(Object)</code>, etc.
+<p>
+In addition, they can have ProGuard-style filters, specified as
+comma-separated named arguments after the file:
+
+<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="file">Files</a></h2>
+
+Files are specified as Gradle files, which means they can be specified
+as simple strings, as File instances, with <code>file(Object)</code>, etc.
+<p>
+In Gradle, file names (any strings really) in double quotes can contain
+properties or code inside <code>${...}</code>. These are automatically
+expanded.
+<p>
+For example, <code>"${System.getProperty('java.home')}/lib/rt.jar"</code> is
+expanded to something like <code>'/usr/local/java/jdk/jre/lib/rt.jar'</code>.
+Similarly, <code>System.getProperty('user.home')</code> is expanded to the
+user's home directory, and <code>System.getProperty('user.dir')</code> is
+expanded to the current working directory.
+
+<h2><a name="keepmodifier">Keep Modifiers</a></h2>
+
+The keep settings can have the following named arguments that modify their
+behaviors:
+
+<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>
+
+Names arguments are comma-separated, as usual.
+
+<h2><a name="classspecification">Class Specifications</a></h2>
+
+A class specification is a template of classes and class members (fields and methods). There are two alternative ways to specify such a template:
+
+<ol>
+<li>As a string containing a ProGuard-style class specification. This is the
+ most compact and most readable way. The specification looks like a Java
+ declaration of a class with fields and methods. For example:
+<pre>
+keep 'public class mypackage.MyMainClass { \
+ public static void main(java.lang.String[]); \
+}'
+</pre></li>
+<li>As a Gradle-style setting: a method calls with named arguments and a
+ closure. This is more verbose, but it might be useful for programmatic
+ specifications. For example:
+<pre>
+keep access: 'public',
+ name: 'mypackage.MyMainClass', {
+ method access: 'public static',
+ type: 'void',
+ name: 'main',
+ parameters: 'java.lang.String[]'
+}
+</pre></li>
+</ol>
+<p>
+
+The <a href="usage.html#classspecification">ProGuard-style class
+specification</a> is described on the traditional Usage page.
+<p>
+A Gradle-style class specification can have the following named arguments:
+
+<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>
+
+</dl>
+
+The named arguments are optional. Without any arguments, there are no
+constraints, so the settings match all classes.
+<p>
+
+<h3><a name="cl">Gradle-style Class Member Specifications</h3>
+
+The closure of a Gradle-style class specification can specify class members
+with these settings:
+
+<dl>
+
+<dt><code><b>field</b></code> <i>field_constraints</i></dt>
+<dd>Specifies a field.</dd>
+
+<dt><code><b>method</b></code> <i>method_constraints</i></dt>
+<dd>Specifies a method.</dd>
+
+<dt><code><b>constructor</b></code> <i>constructor_constraints</i></dt>
+<dd>Specifies a constructor.</dd>
+
+</dl>
+
+A class member setting can have the following named arguments to express
+constraints:
+
+<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> argument 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> argument is
+ specified.</dd>
+
+</dl>
+
+The named arguments are optional. Without any arguments, there are no
+constraints, so the settings match all constructors, fields, or methods.
+<p>
+A class member setting doesn't have a closure.
+
+<h2><a name="anttask">Alternative: imported Ant task</a></h2>
+
+Instead of using the Gradle task, you could also integrate the Ant task in
+your Gradle build file:
+<p>
+<pre>
+ant.project.basedir = '../..'
+
+ant.taskdef(resource: 'proguard/ant/task.properties',
+ classpath: '/usr/local/java/proguard/lib/proguard.jar')
+</pre>
+<p>
+
+Gradle automatically converts the elements and attributes to Groovy methods,
+so converting the configuration is essentially mechanical. The one-on-one
+mapping can be useful, but the resulting configuration is more verbose. For
+instance:
+<pre>
+task proguard << {
+ ant.proguard(printmapping: 'proguard.map',
+ overloadaggressively: 'on',
+ repackageclasses: '',
+ renamesourcefileattribute: 'SourceFile') {
+
+ injar(file: 'application.jar')
+ injar(file: 'gui.jar', filter: '!META-INF/**')
+
+ .....
+ }
+}
+</pre>
+<p>
+
+<hr />
+<noscript><div><a target="_top" href="../index.html" class="button">Show menu</a></div></noscript>
+<address>
+Copyright &copy; 2002-2013
+<a target="other" href="http://www.lafortune.eu/">Eric Lafortune</a>.
+</address>
+</body>
+</html>
diff --git a/docs/manual/gui.html b/docs/manual/gui.html
index 37684a6..6677aaf 100644
--- a/docs/manual/gui.html
+++ b/docs/manual/gui.html
@@ -1,10 +1,21 @@
-<!doctype html PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
+<!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>
@@ -15,10 +26,12 @@ 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:
+Alternatively, the <code>bin</code> directory contains some short Linux and
+Windows scripts containing this command. 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">
@@ -57,8 +70,7 @@ process is assumed. Please refer to the <a
href="introduction.html">Introduction</a> of this manual.
<p>
-<a name="proguard">&nbsp;</a>
-<h2>The ProGuard Tab</h2>
+<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:
@@ -75,8 +87,7 @@ If you don't want to load an existing configuration, you can just continue
creating a new configuration from scratch.
<p>
-<a name="inputoutput">&nbsp;</a>
-<h2>The Input/Output Tab</h2>
+<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
@@ -88,12 +99,12 @@ wars, ears, zips, or directories).
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.
+ 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.
+ targeted Java runtime jar.</li>
</ul>
<p>
@@ -145,16 +156,15 @@ any duplicate entries gets precedence, just as in conventional class paths.
Corresponding configuration options:
<ul type="none">
-<li>-<a href="usage.html#injars">injars</a>
-<li>-<a href="usage.html#outjars">outjars</a>
-<li>-<a href="usage.html#libraryjars">libraryjars</a>
-<li><a href="usage.html#classpath"><i>class_path</i></a>
-<li><a href="usage.html#filters"><i>filters</i></a>
+<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>
-<a name="shrinking">&nbsp;</a>
-<h2>The Shrinking Tab</h2>
+<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
@@ -224,41 +234,41 @@ 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.
+ 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.
+ 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.
+ 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.
+ 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.
+ 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.
+ 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.
+ 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.
+ 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.
+ right-hand side.</li>
</ul>
<p>
@@ -270,18 +280,18 @@ advanced options.
<ul>
<li>The <b>Access</b> selections allows to specify constraints on the field or
- fields, based on their access modifiers.
+ 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.
+ 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.
+ 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.
+ name can contain wildcards.</li>
</ul>
<p>
@@ -293,36 +303,35 @@ 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.
+ 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.
+ 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>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.
+ 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.
+ wildcards.</li>
</ul>
<p>
Corresponding configuration options:
<ul type="none">
-<li>-<a href="usage.html#dontshrink">dontshrink</a>
-<li>-<a href="usage.html#printusage">printusage</a>
-<li>-<a href="usage.html#keep">keep</a>
-<li>-<a href="usage.html#keepclassmembers">keepclassmembers</a>
-<li>-<a href="usage.html#keepclasseswithmembers">keepclasseswithmembers</a>
+<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>
-<a name="obfuscation">&nbsp;</a>
-<h2>The Obfuscation Tab</h2>
+<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
@@ -336,32 +345,32 @@ href="#shrinking">Shrinking Tab</a>.
Corresponding configuration options:
<ul type="none">
-<li>-<a href="usage.html#dontobfuscate">dontobfuscate</a>
-<li>-<a href="usage.html#printmapping">printmapping</a>
-<li>-<a href="usage.html#applymapping">applymapping</a>
-<li>-<a href="usage.html#obfuscationdictionary">obfuscationdictionary</a>
-<li>-<a href="usage.html#classobfuscationdictionary">classobfuscationdictionary</a>
-<li>-<a href="usage.html#packageobfuscationdictionary">packageobfuscationdictionary</a>
-<li>-<a href="usage.html#overloadaggressively">overloadaggressively</a>
-<li>-<a href="usage.html#useuniqueclassmembernames">useuniqueclassmembernames</a>
-<li>-<a href="usage.html#dontusemixedcaseclassnames">dontusemixedcaseclassnames</a>
-<li>-<a href="usage.html#keeppackagenames">keeppackagenames</a>
-<li>-<a href="usage.html#flattenpackagehierarchy">flattenpackagehierarchy</a>
-<li>-<a href="usage.html#repackageclasses">repackageclasses</a>
-<li>-<a href="usage.html#keepattributes">keepattributes</a>
-<li>-<a href="usage.html#renamesourcefileattribute">renamesourcefileattribute</a>
-<li>-<a href="usage.html#adaptclassstrings">adaptclassstrings</a>
-<li>-<a href="usage.html#adaptresourcefilenames">adaptresourcefilenames</a>
-<li>-<a href="usage.html#adaptresourcefilecontents">adaptresourcefilecontents</a>
-<li>-<a href="usage.html#keepnames">keepnames</a>
-<li>-<a href="usage.html#keepclassmembernames">keepclassmembernames</a>
-<li>-<a href="usage.html#keepclasseswithmembernames">keepclasseswithmembernames</a>
-<li><a href="usage.html#classspecification"><i>class_specification</i></a>
+<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>
-<a name="optimization">&nbsp;</a>
-<h2>The Optimization Tab</h2>
+<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
@@ -375,18 +384,17 @@ href="#shrinking">Shrinking Tab</a>.
Corresponding configuration options:
<ul type="none">
-<li>-<a href="usage.html#dontoptimize">dontoptimize</a>
-<li>-<a href="usage.html#optimizations">optimizations</a>
-<li>-<a href="usage.html#optimizationpasses">optimizationpasses</a>
-<li>-<a href="usage.html#allowaccessmodification">allowaccessmodification</a>
-<li>-<a href="usage.html#mergeinterfacesaggressively">mergeinterfacesaggressively</a>
-<li>-<a href="usage.html#assumenosideeffects">assumenosideeffects</a>
-<li><a href="usage.html#classspecification"><i>class_specification</i></a>
+<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>
-<a name="information">&nbsp;</a>
-<h2>The Information Tab</h2>
+<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
@@ -396,26 +404,26 @@ classes and class members are being kept in the shrinking step.
Corresponding configuration options:
<ul type="none">
-<li>-<a href="usage.html#dontpreverify">dontpreverify</a>
-<li>-<a href="usage.html#microedition">microedition</a>
-<li>-<a href="usage.html#target">target</a>
-<li>-<a href="usage.html#verbose">verbose</a>
-<li>-<a href="usage.html#dontnote">dontnote</a>
-<li>-<a href="usage.html#dontwarn">dontwarn</a>
-<li>-<a href="usage.html#ignorewarnings">ignorewarnings</a>
-<li>-<a href="usage.html#dontskipnonpubliclibraryclasses">dontskipnonpubliclibraryclasses</a>
-<li>-<a href="usage.html#dontskipnonpubliclibraryclassmembers">dontskipnonpubliclibraryclassmembers</a>
-<li>-<a href="usage.html#keepdirectories">keepdirectories</a>
-<li>-<a href="usage.html#forceprocessing">forceprocessing</a>
-<li>-<a href="usage.html#printseeds">printseeds</a>
-<li>-<a href="usage.html#printconfiguration">printconfiguration</a>
-<li>-<a href="usage.html#dump">dump</a>
-<li>-<a href="usage.html#whyareyoukeeping">whyareyoukeeping</a>
+<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>
-<a name="process">&nbsp;</a>
-<h2>The Process Tab</h2>
+<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
@@ -433,8 +441,7 @@ bottom:
</table>
<p>
-<a name="retrace">&nbsp;</a>
-<h2>The ReTrace Tab</h2>
+<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
@@ -442,16 +449,16 @@ stack trace:
<ul>
<li>The <b>Verbose</b> check box in the settings panel allows to toggle between
- normal mode and verbose mode.
+ 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.
+ 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.
+ it can be loaded from a file by means of the load button below.</li>
</ul>
There are two buttons at the bottom:
@@ -463,12 +470,12 @@ There are two buttons at the bottom:
<tr><td class="button">ReTrace!</td>
<td>executes ReTrace with the current settings.</td></tr>
</table>
-<p>
-<hr>
+<hr />
+<noscript><div><a target="_top" href="../index.html" class="button">Show menu</a></div></noscript>
<address>
-Copyright &copy; 2002-2009
-<a href="http://www.graphics.cornell.edu/~eric/">Eric Lafortune</a>.
+Copyright &copy; 2002-2013
+<a target="other" href="http://www.lafortune.eu/">Eric Lafortune</a>.
</address>
</body>
</html>
diff --git a/docs/manual/index.html b/docs/manual/index.html
index 397b910..643a216 100644
--- a/docs/manual/index.html
+++ b/docs/manual/index.html
@@ -1,39 +1,52 @@
-<!doctype html PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
+<!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><a href="usage.html">Usage</a>
-<li><a href="limitations.html">Limitations</a>
-<li><a href="examples.html">Examples</a>
-<li><a href="troubleshooting.html">Troubleshooting</a>
-<li><a href="refcard.html">Reference Card</a>
-<li><a href="gui.html">Graphical User Interface</a>
-<li><a href="ant.html">Ant Task</a>
-<li><a href="wtk.html">JME Wireless Toolkit Integration</a>
+<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="gradle.html">Gradle 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><a href="retrace/usage.html">Usage</a>
-<li><a href="retrace/examples.html">Examples</a>
+<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>
+<hr />
+<noscript><div><a target="_top" href="../index.html" class="button">Show menu</a></div></noscript>
<address>
-Copyright &copy; 2002-2009
-<a href="http://www.graphics.cornell.edu/~eric/">Eric Lafortune</a>.
+Copyright &copy; 2002-2013
+<a target="other" href="http://www.lafortune.eu/">Eric Lafortune</a>.
</address>
</body>
</html>
diff --git a/docs/manual/introduction.html b/docs/manual/introduction.html
index cdab330..3f18114 100644
--- a/docs/manual/introduction.html
+++ b/docs/manual/introduction.html
@@ -1,10 +1,21 @@
-<!doctype html PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
+<!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>
@@ -17,8 +28,7 @@ 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.
+required for Java Micro Edition and for Java 6 and higher.
<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
@@ -62,13 +72,13 @@ efficient use in Java 6.
</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.
+ProGuard first reads the <b>input jars</b> (or wars, ears, zips, or
+directories). It then subsequently shrinks, optimizes, obfuscates, and
+preverifies them. You can optionally let ProGuard perform multiple
+optimization passes. 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
@@ -76,63 +86,69 @@ 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.
-<p>
+
+<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.
+midlets, activities, 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.
+ 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.
+ 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.
+ 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.
+ 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>Introspection</h3>
-
-Introspection presents 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.
+<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 compute 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><code>SomeClass.class</code>
-<li><code>SomeClass.class.getField("someField")</code>
-<li><code>SomeClass.class.getDeclaredField("someField")</code>
-<li><code>SomeClass.class.getMethod("someMethod", new Class[] {})</code>
-<li><code>SomeClass.class.getMethod("someMethod", new Class[] { A.class })</code>
-<li><code>SomeClass.class.getMethod("someMethod", new Class[] { A.class, B.class })</code>
-<li><code>SomeClass.class.getDeclaredMethod("someMethod", new Class[] {})</code>
-<li><code>SomeClass.class.getDeclaredMethod("someMethod", new Class[] { A.class })</code>
-<li><code>SomeClass.class.getDeclaredMethod("someMethod", new Class[] { A.class, B.class })</code>
+<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 replaced in the obfuscation phase.
+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
@@ -142,15 +158,15 @@ 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 introspection
+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.
-<p>
-<hr>
+<hr />
+<noscript><div><a target="_top" href="../index.html" class="button">Show menu</a></div></noscript>
<address>
-Copyright &copy; 2002-2009
-<a href="http://www.graphics.cornell.edu/~eric/">Eric Lafortune</a>.
+Copyright &copy; 2002-2013
+<a target="other" href="http://www.lafortune.eu/">Eric Lafortune</a>.
</address>
</body>
</html>
diff --git a/docs/manual/limitations.html b/docs/manual/limitations.html
index cfe0ff5..6b69410 100644
--- a/docs/manual/limitations.html
+++ b/docs/manual/limitations.html
@@ -1,10 +1,21 @@
-<!doctype html PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
+<!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>
@@ -13,16 +24,7 @@
When using ProGuard, you should be aware of a few technical issues, all of
which are easily avoided or resolved:
<p>
-<ul>
-
-<li>For efficiency, ProGuard always ignores any <b>private or package visible
- library classes</b> while reading library jars. If any of them are
- extended by public library classes, and then extended again by input
- classes, ProGuard will complain it can't find them. In that case, you'll
- have to use the <code>-dontskipnonpubliclibraryclasses</code> option, and
- maybe even the <code>-dontskipnonpubliclibraryclassmembers</code> option.
- The graphical user interface has checkboxes for these settings.
- <p>
+<ul class="spacious">
<li>For best results, ProGuard's optimization algorithms assume that the
processed code never <b>intentionally throws NullPointerExceptions</b> or
@@ -33,32 +35,35 @@ which are easily avoided or resolved:
<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.
- <p>
+ 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.
- <p>
+ across input jars and library jars.</li>
-<li>When obfuscating, ProGuard will write out class files named
- "<code>a.class</code>", "<code>b.class</code>", etc. If there is a large
- numbers of classes in the same package, it may also write out
- <b>"<code>aux.class</code>"</b>. Windows doesn't allow creating files with
- this reserved name (among a few other names), so it's generally better to
- write the output to a jar, in order to avoid such problems.
- <p>
+<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>
-<p>
-<hr>
+<hr />
+<noscript><div><a target="_top" href="../index.html" class="button">Show menu</a></div></noscript>
<address>
-Copyright &copy; 2002-2009
-<a href="http://www.graphics.cornell.edu/~eric/">Eric Lafortune</a>.
+Copyright &copy; 2002-2013
+<a target="other" href="http://www.lafortune.eu/">Eric Lafortune</a>.
</address>
</body>
</html>
diff --git a/docs/manual/optimizations.html b/docs/manual/optimizations.html
index 9c20571..e4c96b6 100644
--- a/docs/manual/optimizations.html
+++ b/docs/manual/optimizations.html
@@ -1,10 +1,21 @@
-<!doctype html PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
+<!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>
@@ -124,6 +135,9 @@ are added and reorganized.
<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
@@ -142,17 +156,43 @@ are added and reorganized.
<dd>Removes unused variables from the local variable frame.</dd>
<dt><code><b>code/removal/exception</b></code></dt>
-<dd>Removes exceptions with empty catch blocks.</dd>
+<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>
<p>
-<hr>
+ProGuard also provides some unofficial settings to control optimizations, that
+may disappear in future versions. These are Java system properties, which
+can be set as JVM arguments (with <code>-D.....)</code>:
+<dl>
+<dt><code><b>maximum.inlined.code.length</b></code> (default = 8 bytes)</dt>
+<dd>Specifies the maximum code length (expressed in bytes) of short methods
+ that are eligible to be inlined. Inlining methods that are too long may
+ unnecessarily inflate the code size.</dd>
+
+<dt><code><b>maximum.resulting.code.length</b></code> (default = 8000 bytes
+ for JSE, 2000 bytes for JME)</dt>
+<dd>Specifies the maximum resulting code length (expressed in bytes) allowed
+ when inlining methods. Many Java virtual machines do not apply just-in-time
+ compilation to methods that are too long, so it's important not to let them
+ grow too large.</dd>
+
+<dt><code><b>optimize.conservatively</b></code> (default = unset)</dt>
+<dd>Allows input code with ordinary instructions intentionally throwing
+ <code>NullPointerException</code>,
+ <code>ArrayIndexOutOfBoundsException</code>, or
+ <code>ClassCastException</code>, without any other useful purposes. By
+ default, ProGuard may just discard such seemingly useless instructions,
+ resulting in better optimization of most common code.</dd>
+</dl>
+
+<hr />
+<noscript><div><a target="_top" href="../index.html" class="button">Show menu</a></div></noscript>
<address>
-Copyright &copy; 2002-2009
-<a href="http://www.graphics.cornell.edu/~eric/">Eric Lafortune</a>.
+Copyright &copy; 2002-2013
+<a target="other" href="http://www.lafortune.eu/">Eric Lafortune</a>.
</address>
</body>
</html>
diff --git a/docs/manual/refcard.html b/docs/manual/refcard.html
index 236f049..d9301bd 100644
--- a/docs/manual/refcard.html
+++ b/docs/manual/refcard.html
@@ -1,10 +1,21 @@
-<!doctype html PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
+<!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>
@@ -52,7 +63,7 @@
<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
+<td>Specifies the names of the output jars (or wars, ears, zips, or
directories).</td>
</tr>
@@ -63,8 +74,13 @@
</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.</td>
+<td>Don't ignore non-public library classes (the default).</td>
</tr>
<tr>
@@ -281,6 +297,11 @@
</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>
@@ -345,14 +366,14 @@
<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
+<td>Write out the entire configuration in traditional ProGuard style, 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
+<td>Write out the internal structure of the processed class files, to the
standard output or to the given file.</td>
</tr>
@@ -362,11 +383,11 @@ Notes:
<ul>
<li><i>class_path</i> is a list of jars, wars, ears, zips, and directories,
- with optional filters, separated by path separators.
+ 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>'.
+ '<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.
+ should be quoted with single or double quotes.</li>
</ul>
<p>
@@ -443,23 +464,23 @@ Notes:
Notes:
<ul>
<li>Class names must always be fully qualified, i.e. including their package
- names.
+ 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..
+ '<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.
+ for any number of characters.</li>
</ul>
-<p>
-<hr>
+<hr />
+<noscript><div><a target="_top" href="../index.html" class="button">Show menu</a></div></noscript>
<address>
-Copyright &copy; 2002-2009
-<a href="http://www.graphics.cornell.edu/~eric/">Eric Lafortune</a>.
+Copyright &copy; 2002-2013
+<a target="other" href="http://www.lafortune.eu/">Eric Lafortune</a>.
</address>
</body>
</html>
diff --git a/docs/manual/retrace/examples.html b/docs/manual/retrace/examples.html
index 211017b..2137e3a 100644
--- a/docs/manual/retrace/examples.html
+++ b/docs/manual/retrace/examples.html
@@ -1,10 +1,21 @@
-<!doctype html PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
+<!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>
@@ -12,13 +23,13 @@
Some typical example uses:
<ol>
-<li><a href="#with">Restoring a stack trace with line numbers</a>
-<li><a href="#withverbose">Restoring a stack trace with line numbers (verbose)</a>
-<li><a href="#without">Restoring a stack trace without line numbers</a>
+<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>
-<a name="with">&nbsp;</a>
-<h3>Restoring a stack trace with line numbers</h3>
+<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:
@@ -133,8 +144,7 @@ Exception in thread "main" java.lang.Error: Random exception
at proguard.ProGuard.main(ProGuard:429)
</pre>
-<a name="withverbose">&nbsp;</a>
-<h3>Restoring a stack trace with line numbers (verbose)</h3>
+<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>
@@ -189,8 +199,7 @@ Exception in thread "main" java.lang.Error: Random exception
</pre>
-<a name="without">&nbsp;</a>
-<h3>Restoring a stack trace without line numbers</h3>
+<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:
@@ -324,12 +333,12 @@ Exception in thread "main" java.lang.Error: Random exception
execute
at proguard.ProGuard.main(Unknown Source)
</pre>
-<p>
-<hr>
+<hr />
+<noscript><div><a target="_top" href="../../index.html" class="button">Show menu</a></div></noscript>
<address>
-Copyright &copy; 2002-2009
-<a href="http://www.graphics.cornell.edu/~eric/">Eric Lafortune</a>.
+Copyright &copy; 2002-2013
+<a target="other" href="http://www.lafortune.eu/">Eric Lafortune</a>.
</address>
</body>
</html>
diff --git a/docs/manual/retrace/index.html b/docs/manual/retrace/index.html
index ebb23ac..47209df 100644
--- a/docs/manual/retrace/index.html
+++ b/docs/manual/retrace/index.html
@@ -1,25 +1,37 @@
-<!doctype html PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
+<!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><a href="usage.html">Usage</a>
-<li><a href="examples.html">Examples</a>
+<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>
+<hr />
+<noscript><div><a target="_top" href="../../index.html" class="button">Show menu</a></div></noscript>
<address>
-Copyright &copy; 2002-2009
-<a href="http://www.graphics.cornell.edu/~eric/">Eric Lafortune</a>.
+Copyright &copy; 2002-2013
+<a target="other" href="http://www.lafortune.eu/">Eric Lafortune</a>.
</address>
</body>
</html>
diff --git a/docs/manual/retrace/introduction.html b/docs/manual/retrace/introduction.html
index 19f9471..381ad1f 100644
--- a/docs/manual/retrace/introduction.html
+++ b/docs/manual/retrace/introduction.html
@@ -1,10 +1,21 @@
-<!doctype html PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
+<!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>
@@ -56,12 +67,12 @@ 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.
-<p>
-<hr>
+<hr />
+<noscript><div><a target="_top" href="../../index.html" class="button">Show menu</a></div></noscript>
<address>
-Copyright &copy; 2002-2009
-<a href="http://www.graphics.cornell.edu/~eric/">Eric Lafortune</a>.
+Copyright &copy; 2002-2013
+<a target="other" href="http://www.lafortune.eu/">Eric Lafortune</a>.
</address>
</body>
</html>
diff --git a/docs/manual/retrace/usage.html b/docs/manual/retrace/usage.html
index 88587ff..6e7f6a8 100644
--- a/docs/manual/retrace/usage.html
+++ b/docs/manual/retrace/usage.html
@@ -1,10 +1,21 @@
-<!doctype html PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
+<!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>
@@ -17,7 +28,8 @@ ProGuard distribution. To run ReTrace, just type:
<code><b>java -jar retrace.jar </b></code>[<i>options...</i>]
<i>mapping_file</i> [<i>stacktrace_file</i>]
</p>
-These are the arguments:
+Alternatively, the <code>bin</code> directory contains some short Linux and
+Windows scripts containing this command. These are the arguments:
<dl>
<dt><i>mapping_file</i></dt>
@@ -48,7 +60,7 @@ The following options are supported:
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*)
+ (?:.*?\bat\s+%c.%m\s*\(.*?(?::%l)?\)\s*)|(?:(?:.*?[:"]\s+)?%c(?::.*)?)
</pre>
The regular expression is a Java regular expression (cfr. the documentation
of <code>java.util.regex.Pattern</code>), with a few additional wildcards:
@@ -87,14 +99,13 @@ 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.
- <p>
+ 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.
+ of the program.</li>
</ul>
<p>
@@ -105,12 +116,12 @@ href="../examples.html#stacktrace">example</a> in the ProGuard User Manual.
Unobfuscated elements and obfuscated elements for which no mapping is available
will be left unchanged.
-<p>
-<hr>
+<hr />
+<noscript><div><a target="_top" href="../../index.html" class="button">Show menu</a></div></noscript>
<address>
-Copyright &copy; 2002-2009
-<a href="http://www.graphics.cornell.edu/~eric/">Eric Lafortune</a>.
+Copyright &copy; 2002-2013
+<a target="other" href="http://www.lafortune.eu/">Eric Lafortune</a>.
</address>
</body>
</html>
diff --git a/docs/manual/sections.html b/docs/manual/sections.html
index 62df9c3..1a6693d 100644
--- a/docs/manual/sections.html
+++ b/docs/manual/sections.html
@@ -1,4 +1,4 @@
-<!doctype html PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
+<!doctype html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
@@ -21,6 +21,7 @@
<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="gradle.html">Gradle Task</a></li>
<li><a target="main" href="wtk.html">JME WTK</a></li>
<li class="title">ReTrace Manual</li>
@@ -31,33 +32,22 @@
<p>
<center>
-<small>With support of</small>
+<small>More Android code protection:</small>
<p>
+<a href="http://www.saikoa.com/dexguard" target="_top">
+<img src="../dexguard.png" width="88" height="55" alt="DexGuard" /></a>
-<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>
+<p>
+<small>With support of</small>
+<p>
-</a>
+<a href="http://www.saikoa.com/" target="_top">
+<img src="../saikoalogo.png" width="88" height="19" alt="Saikoa" /></a>
<p>
-<a href="http://www.luciad.com/" target="other">
-<img src="../luciadlogo.png" width="88" height="24" alt="Luciad"></a>
+<a href="http://sourceforge.net/projects/proguard/" target="other">
+<img src="../sflogo.png" width="88" height="31" alt="SourceForge" /></a>
-<p>
-<a href="http://www.javadocking.com/" target="other">
-<img src="../sanawarelogo.png" width="88" height="24" alt="Luciad"></a>
</center>
</body>
diff --git a/docs/manual/style.css b/docs/manual/style.css
index 28fc112..8dae87d 100644
--- a/docs/manual/style.css
+++ b/docs/manual/style.css
@@ -2,20 +2,24 @@
/* Global settings. */
-body {
+body
+{
background: #FFFFFF;
}
-h1 {
+h1
+{
text-align: center;
}
-h2 {
+h2
+{
background: #EEEEFF;
padding: 10px;
}
-dt {
+dt
+{
padding: 6px;
}
@@ -25,23 +29,50 @@ dt div
float: right;
}
-dd {
+dd
+{
padding: 6px;
}
-pre {
+pre
+{
padding: 10px;
background: #E0E0E0;
}
+.spacious li
+{
+ padding: 8px;
+}
+
+.shifted li
+{
+ margin-left: 50px;
+}
+
+img.float
+{
+ float: left;
+}
+
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 {
+p.code
+{
padding: 10px;
background: #E0E0E0;
}
@@ -49,34 +80,39 @@ p.code {
/* Settings for diagrams. */
-table.diagram {
+table.diagram
+{
padding: 8px;
border: none;
border-spacing: 2px;
}
-td.transparentblock {
+td.transparentblock
+{
text-align: center;
padding: 10px 0px;
}
-td.whiteblock {
+td.whiteblock
+{
width: 100px;
text-align: center;
- border: solid #C0C0C0 1px;
+ border: 1px solid #C0C0C0;
background: #E0E0E0;
padding: 10px 0px;
}
-td.lightblock {
+td.lightblock
+{
width: 100px;
text-align: center;
- border: solid #8888FF 1px;
+ border: 1px solid #8888FF;
background: #BBBBFF;
padding: 20px 0px;
}
-td.darkblock {
+td.darkblock
+{
width: 100px;
text-align: center;
background: #8888FF;
@@ -85,8 +121,9 @@ td.darkblock {
/* Settings for buttons. */
-td.button {
+td.button
+{
background: #E0E0E0;
- border: outset #FFFFFF 1px;
+ border: 1px outset #FFFFFF;
font-weight: bold;
}
diff --git a/docs/manual/troubleshooting.html b/docs/manual/troubleshooting.html
index d3ed14e..964a25e 100644
--- a/docs/manual/troubleshooting.html
+++ b/docs/manual/troubleshooting.html
@@ -1,10 +1,21 @@
-<!doctype html PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
+<!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>
@@ -15,23 +26,32 @@ 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="#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="#unknownclass">Note: the configuration refers to the unknown class '...'</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="#unresolvedclassmember">Warning: can't find referenced field/method</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="#unresolvedprogramclassmember">Warning: can't find referenced field/method '...' in program class ...</a></li>
+<li><a href="#unresolvedlibraryclassmember">Warning: can't find referenced field/method '...' in library class ...</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="#cantread">Error: Can't read ...</a></li>
+<li><a href="#cantwrite">Error: Can't write ...</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>
@@ -45,6 +65,13 @@ few problems. The following sections discuss some common issues and solutions:
<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>
@@ -56,9 +83,12 @@ few problems. The following sections discuss some common issues and solutions:
<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="#nosuchfieldexception">NoSuchFieldException</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>
@@ -67,23 +97,23 @@ few problems. The following sections discuss some common issues and solutions:
<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="#classformaterror">ClassFormatError: repetitive field name/signature</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>
-<a name="processing">&nbsp;</a>
-<h2>Problems while processing</h2>
+<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>
+<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>
+ means of introspection. You should consider adding the jar that contains
+ this class.</dd>
<dt><a name="dynamicalclasscast"><b>Note: ... calls '(...)Class.forName(variable).newInstance()'</b></a></dt>
@@ -107,6 +137,13 @@ ProGuard may print out some notes and non-fatal warnings:
notes by specifying the <a
href="usage.html#dontnote"><code>-dontnote</code></a> option.</dd>
+<dt><a name="unknownclass"><b>Note: the configuration refers to the unknown class '...'</b></a></dt>
+
+<dd>Your configuration refers to the name of a class that is not present in
+ the program jars or library jars. You should check whether the name is
+ correct. Notably, you should make sure that you always specify
+ fully-qualified names, not forgetting the package names.</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
@@ -118,6 +155,21 @@ ProGuard may print out some notes and non-fatal warnings:
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 <a href="usage.html#keepclassmembers"><code>-keepclassmembers</code></a>/<a href="usage.html#keepclasseswithmembers">-keepclasseswithmembers</code></a>
+ 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 should also consider if you just need the
+ more common <a href="usage.html#keep"><code>-keep</code></a> option, which
+ preserves all specified classes <i>and</i> class members.
+ The <a href="usage.html#keepoverview">overview of all <code>keep</code>
+ options</a> can help. 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
@@ -126,7 +178,21 @@ ProGuard may print out some notes and non-fatal warnings:
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>
+ href="usage.html#dontnote"><code>-dontnote</code></a> option.
+ <p>
+ <img class="float" src="android_small.png" width="32" height="32"
+ alt="android" /> The standard Android build process automatically
+ specifies the input jars for you. There may not be an easy way to filter
+ them to remove these notes. You could remove the duplicate classes
+ manually from your libraries. You should never explicitly specify the
+ input jars yourself (with <code>-injars</code> or
+ <code>-libraryjars</code>), since you'll then get duplicate definitions.
+ You should also not add libraries to your application that are already
+ part of the Android run-time (notably <code>org.w3c.dom</code>,
+ <code>org.xml.sax</code>, <code>org.xmlpull.v1</code>,
+ <code>org.apache.commons.logging.Log</code>, <code>org.apache.http</code>,
+ and <code>org.json</code>). They are possibly inconsistent, and the
+ run-time libraries would get precedence anyway.</dd>
<dt><a name="duplicatezipentry"><b>Warning: can't write resource ... Duplicate zip entry</b></a></dt>
@@ -135,7 +201,13 @@ ProGuard may print out some notes and non-fatal warnings:
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>
+ is no option to switch off these warnings.
+ <p>
+ <img class="float" src="android_small.png" width="32" height="32"
+ alt="android" /> The standard Android build process automatically
+ specifies the input jars for you. There may not be an easy way to filter
+ them to remove these warnings. You could remove the duplicate resource files
+ manually from the input and the libraries.</dd>
</dl>
<p>
@@ -146,60 +218,133 @@ 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.
+<dd>A class in one of your program jars or library jars is referring to a
+ class or interface that is missing from the input. The warning lists both
+ the referencing class(es) and the missing referenced class(es). There can
+ be a few reasons, with their own solutions:
<p>
- If the class that is reported as missing is a non-public library class,
- you should specify the <a
- href="usage.html#dontskipnonpubliclibraryclasses"><code>-dontskipnonpubliclibraryclasses</code></a>
- option. Common examples are the classes
- <code>javax.swing.TransferHandler$HasGetTransferHandler</code> and
- <code>java.util.zip.ZipConstants</code>, which are used as interfaces in
- some public classes, even though they are only package visible. This
- option is not set by default for reasons of efficiency. Setting it increases
- the processing time a bit, but it won't hurt the output in any way.
+ <ol>
+ <li>If the missing class is referenced from your own code, you may have
+ forgotten to specify an essential library. Just like when compiling
+ all code from scratch, you must specify all libraries that the code is
+ referencing, directly or indirectly. If the library should be
+ processed and included in the output, you should specify it with
+ <a href="usage.html#injars"><code>-injars</code></a>, otherwise you
+ should specify it with
+ <a href="usage.html#libraryjars"><code>-libraryjars</code></a>.
+ <p>
+ For example, if ProGuard complains that it can't find a
+ <code>java.lang</code> class, you have to make sure that you are
+ specifying the run-time library of your platform. For JSE, these are
+ typically packaged in <code>lib/rt.jar</code> (<code>vm.jar</code> for
+ IBM's JVM, and <code>classes.jar</code> in MacOS X). Other platforms
+ like JME and Android have their own run-time libraries.
+ The <a href="examples.html">examples section</a> provides more details
+ for the various platforms.
+ <p>
+ If ProGuard still 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>.</li>
+ <li>If the missing class is referenced from a pre-compiled third-party
+ library, and your original code runs fine without it, then the missing
+ dependency doesn't seem to hurt. The cleanest solution is to
+ <a href="usage.html#filters">filter out</a> the <i>referencing</i>
+ class or classes from the input, with a filter like "<code>-libraryjars
+ mylibrary.jar(!somepackage/SomeUnusedReferencingClass.class)</code>".
+ ProGuard will then skip this class entirely in the input, and it will
+ not bump into the problem of its missing reference. However, you may
+ then have to filter out other classes that are in turn referencing the
+ removed class. In practice, this works best if you can filter out
+ entire unused packages at once, with a wildcard filter like
+ "<code>-libraryjars
+ mylibrary.jar(!someunusedpackage/**)</code>".<p></li>
+ <li>If you don't feel like filtering out the problematic classes, 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.</li>
+ </ol>
<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.</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.
+ <img class="float" src="android_small.png" width="32" height="32"
+ alt="android" /> The standard Android build process automatically
+ specifies the input jars for you. Unfortunately, many pre-compiled
+ third-party libraries refer to other libraries that are not actually used
+ and therefore not present. This works fine in debug builds, but in release
+ builds, ProGuard expects all libraries, so it can perform a proper static
+ analysis. For example, if 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>",
+ for instance.</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>". 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="unresolvedprogramclassmember"><b>Warning: can't find referenced field/method '...' in program class ...</b></a></dt>
+
+<dd>A program class is referring to a field or a method that is missing from
+ another program class. The warning lists both the referencing class and
+ the missing referenced class member. Your compiled 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 compiled class files and rebuilding your
+ project.</dd>
+
+<dt><a name="unresolvedlibraryclassmember"><b>Warning: can't find referenced field/method '...' in library class ...</b></a></dt>
+
+<dd>A program class is referring to a field or a method that is missing from a
+ library class. The warning lists both the referencing class and the
+ missing referenced class member. Your compiled class files are
+ inconsistent with the libraries. You may need to recompile the class
+ files, or otherwise upgrade the libraries to consistent versions.
<p>
- If the class member that is reported as missing is actually implemented in
- a non-public library class, you should specify the
- <a href="usage.html#dontskipnonpubliclibraryclasses"><code>-dontskipnonpubliclibraryclasses</code></a> option. A common example is
- the method <code>setLength(int)</code> in the public class
- <code>java.lang.StringBuilder</code>. This method is actually defined in
- the package visible superclass
- <code>java.lang.AbstractStringBuilder</code>, which ProGuard ignores by
- default.
+ <img class="float" src="android_small.png" width="32" height="32"
+ alt="android" /> If you're developing for Android and ProGuard complains
+ that it can't find a method that is only available in a recent version of
+ the Android run-time, you should change the build target in your
+ <code>project.properties</code> file or <code>build.gradle</code> file to
+ that recent version. You can still specify a different
+ <code>minSdkVersion</code> and a different <code>targetSdkVersion</code>
+ in your <code>AndroidManifest.xml</code> file.
<p>
- If your program classes reside in the same packages as library classes,
- and refer to their package visible class members, then you should specify
- the <a
- href="usage.html#dontskipnonpubliclibraryclassmembers"><code>-dontskipnonpubliclibraryclassmembers</code></a>
+ Alternatively, you may get away with ignoring the inconsistency with the
+ options
+ <a href="usage.html#ignorewarnings"><code>-ignorewarnings</code></a> or
+ even
+ <a href="usage.html#dontwarn"><code>-dontwarn</code></a>. For instance, you
+ can specify "<code>-dontwarn mypackage.MyInconsistentClass</code>".
+ <p>
+ Finally, should your program classes reside in the same packages as
+ library classes and should they 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
+ methods in your input, once more, your compiled 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>
+ removing all compiled class files and rebuilding your project.</dd>
<dt><a name="dependency"><b>Warning: library class ... depends on program class ...</b></a></dt>
@@ -210,7 +355,20 @@ some more serious warnings:
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 and library code, and try again.</dd>
+ 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.
+ <p>
+ <img class="float" src="android_small.png" width="32" height="32"
+ alt="android" /> In Android development, sloppy libraries may contain
+ duplicates of classes that are already present in the Android run-time
+ (notably <code>org.w3c.dom</code>, <code>org.xml.sax</code>,
+ <code>org.xmlpull.v1</code>, <code>org.apache.commons.logging.Log</code>,
+ <code>org.apache.http</code>, and <code>org.json</code>). You must remove
+ these classes from your libraries, since they are possibly inconsistent,
+ and the run-time libraries would get precedence anyway.</dd>
<dt><a name="unexpectedclass"><b>Warning: class file ... unexpectedly contains class ...</b></a></dt>
@@ -257,6 +415,13 @@ some more serious warnings:
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 <a href="http://proguard.sourceforge.net/downloads.html">check
+ on-line</a> if there is a more recent release.</dd>
+
<dt><a name="keep"><b>Error: You have to specify '-keep' options</b></a></dt>
<dd>You either forgot to specify <a
@@ -266,7 +431,6 @@ some more serious warnings:
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",
@@ -282,6 +446,30 @@ some more serious warnings:
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="cantread"><b>Error: Can't read ...</b></a></dt>
+
+<dd>ProGuard can't read the specified file or directory. Double-check that the
+ name is correct in your configuration, that the file is readable, and that
+ it is not corrupt. An additional message "Unexpected end of ZLIB input
+ stream" suggests that the file is truncated. You should then make sure
+ that the file is complete on disk when ProGuard starts (asynchronous
+ copying? unflushed buffer or cache?), and that it is not somehow
+ overwritten by ProGuard's own output.</dd>
+
+<dt><a name="cantwrite"><b>Error: Can't write ...</b></a></dt>
+
+<dd>ProGuard can't write the specified file or directory. Double-check that
+ the name is correct in your configuration and that the file is
+ writable.</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>
+
</dl>
<p>
@@ -304,7 +492,7 @@ Should ProGuard crash while processing your application:
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/bugdatabase/view_bug.do?bug_id=4362291">Sun Bug
+ 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>
@@ -326,8 +514,7 @@ Should ProGuard crash while processing your application:
</dl>
<p>
-<a name="afterprocessing">&nbsp;</a>
-<h2>Unexpected observations after processing</h2>
+<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:
@@ -363,7 +550,14 @@ there might be a couple of reasons:
<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.</dd>
+ 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 should package the annotation classes as a library, or
+ explicitly keep them 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>
@@ -377,8 +571,37 @@ there might be a couple of reasons:
</dl>
-<a name="preverifying">&nbsp;</a>
-<h2>Problems while preverifying for Java Micro Edition</h2>
+<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:
@@ -409,8 +632,7 @@ Note that it is no longer necessary to use an external preverifier. With the
ProGuard will preverify the class files for Java Micro Edition.
<p>
-<a name="runtime">&nbsp;</a>
-<h2>Problems at run-time</h2>
+<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:
@@ -439,14 +661,30 @@ might be several reasons:
class mypackage.MyClass</code>" or "<code>-keep class * implements
mypackage.MyInterface</code>".</dd>
+<dt><a name="nosuchfieldexception"><b>NoSuchFieldException</b></a></dt>
+
+<dd>Your code is probably calling something like
+ <code>myClass.getField</code>, trying to find some field dynamically.
+ Since ProGuard can't always detect this automatically, you have to keep
+ the missing field in using the
+ appropriate <a href="usage.html#keep"><code>-keep</code></a> option, e.g.
+ "<code>-keepclassmembers class mypackage.MyClass { int myField;
+ }</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 isn't detecting this (yet), 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>".</dd>
+ 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>-keepclassmembers 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>
@@ -460,7 +698,18 @@ might be several reasons:
<p>
Furthermore, directory entries in jar files aren't copied, unless you
specify the option <a
- href="usage.html#keepdirectories"><code>-keepdirectories</code></a>.</dd>
+ 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>
@@ -474,6 +723,17 @@ might be several reasons:
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
@@ -526,7 +786,7 @@ might be several reasons:
<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>
+<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
@@ -548,7 +808,7 @@ might be several reasons:
<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="classformaterror"><b>ClassFormatError: repetitive field name/signature</b></a></dt>
+<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
@@ -556,6 +816,14 @@ might be several reasons:
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
@@ -583,10 +851,11 @@ might be several reasons:
</dl>
-<hr>
+<hr />
+<noscript><div><a target="_top" href="../index.html" class="button">Show menu</a></div></noscript>
<address>
-Copyright &copy; 2002-2009
-<a href="http://www.graphics.cornell.edu/~eric/">Eric Lafortune</a>.
+Copyright &copy; 2002-2013
+<a target="other" href="http://www.lafortune.eu/">Eric Lafortune</a>.
</address>
</body>
</html>
diff --git a/docs/manual/usage.html b/docs/manual/usage.html
index 8be8d60..7d3a5bb 100644
--- a/docs/manual/usage.html
+++ b/docs/manual/usage.html
@@ -1,10 +1,21 @@
-<!doctype html PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
+<!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 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>
@@ -15,55 +26,53 @@ To run ProGuard, just type:
<code><b>java -jar proguard.jar </b></code><i>options</i> ...
</p>
You can find the ProGuard jar in the <code>lib</code> directory of the
-ProGuard distribution. Options can also be put in one or more configuration
-files. Typically, you'll put most options in a configuration file (say,
-<code>myconfig.pro</code>), and just call:
+ProGuard distribution. Alternatively, the <code>bin</code> directory contains
+some short Linux and Windows scripts containing this command. Typically, you'll
+put most options in a configuration file (say, <code>myconfig.pro</code>), and
+just call:
<p class="code">
<code><b>java -jar proguard.jar @myconfig.pro</b></code>
</p>
-You can combine command line options and options from configuration files, for
+You can combine command line options and options from configuration files. For
instance:
<p class="code">
<code><b>java -jar proguard.jar @myconfig.pro -verbose</b></code>
</p>
<p>
-In a configuration file, a <code><b>#</b></code> sign and all remaining
-characters on that line are ignored, allowing you to add comments.
+You can add comments in a configuration file, starting with a
+<code><b>#</b></code> character and continuing until the end of the line.
<p>
-Extra whitespace between words and delimiters is ignored. To specify file
-names with spaces or special characters, words can be quoted with single or
-double quotes. Note that the quotes may need to be escaped when used on the
-command line, to avoid them being gobbled by the shell.
+Extra whitespace between words and delimiters is ignored. File names with
+spaces or special characters should be quoted with single or double quotes.
<p>
Options can be grouped arbitrarily in arguments on the command line and in
-lines in configuration files. This means that you can quote any arbitrary
-section of command line options, to avoid shell expansion of special
-characters, for instance.
+lines in configuration files. This means that you can quote arbitrary sections
+of command line options, to avoid shell expansion of special characters, for
+instance.
<p>
-The order of the options is generally irrelevant. They can be abbreviated to
-their first unique characters.
+The order of the options is generally irrelevant. For quick experiments, you
+can abbreviate them to their first unique characters.
<p>
The sections below provide more details:
<ul>
-<li><a href="#iooptions">Input/Output Options</a>
-<li><a href="#keepoptions">Keep Options</a>
-<li><a href="#shrinkingoptions">Shrinking Options</a>
-<li><a href="#optimizationoptions">Optimization Options</a>
-<li><a href="#obfuscationoptions">Obfuscation Options</a>
-<li><a href="#preverificationoptions">Preverification Options</a>
-<li><a href="#generaloptions">General Options</a>
-<li><a href="#classpath">Class Paths</a>
-<li><a href="#filename">File Names</a>
-<li><a href="#filefilters">File Filters</a>
-<li><a href="#filters">Filters</a>
-<li><a href="#keepoverview">Overview of <code>Keep</code> Options</a>
-<li><a href="#keepoptionmodifiers">Keep Option Modifiers</a>
-<li><a href="#classspecification">Class Specifications</a>
+<li><a href="#iooptions">Input/Output Options</a></li>
+<li><a href="#keepoptions">Keep Options</a></li>
+<li><a href="#shrinkingoptions">Shrinking Options</a></li>
+<li><a href="#optimizationoptions">Optimization Options</a></li>
+<li><a href="#obfuscationoptions">Obfuscation Options</a></li>
+<li><a href="#preverificationoptions">Preverification Options</a></li>
+<li><a href="#generaloptions">General Options</a></li>
+<li><a href="#classpath">Class Paths</a></li>
+<li><a href="#filename">File Names</a></li>
+<li><a href="#filefilters">File Filters</a></li>
+<li><a href="#filters">Filters</a></li>
+<li><a href="#keepoverview">Overview of <code>Keep</code> Options</a></li>
+<li><a href="#keepoptionmodifiers">Keep Option Modifiers</a></li>
+<li><a href="#classspecification">Class Specifications</a></li>
</ul>
-<a name="iooptions">&nbsp;</a>
-<h2>Input/Output Options</h2>
+<h2><a name="iooptions">Input/Output Options</a></h2>
<dl>
<dt><a name="at"><code><b>@</b></code></a><a href="#filename"><i>filename</i></a></dt>
@@ -132,27 +141,32 @@ The sections below provide more details:
Although this may seem cumbersome, it allows you to process applications
targeted at different run-time environments. For example, you can process
<a href="examples.html#application">J2SE applications</a> as well as <a
- href="examples.html#midlet">JME midlets</a>, just by specifying the
- appropriate run-time jar.</dd>
+ href="examples.html#midlet">JME midlets</a> or <a
+ href="examples.html#androidapplication">Android apps</a>, just by
+ specifying the appropriate run-time jar.</dd>
+
+<dt><a name="skipnonpubliclibraryclasses"><code><b>-skipnonpubliclibraryclasses</b></code></a></dt>
+
+<dd>Specifies to skip non-public classes while reading library jars, to speed
+ up processing and reduce memory usage of ProGuard. By default, ProGuard
+ reads non-public and public library classes alike. However, non-public
+ classes are often not relevant, if they don't affect the actual program
+ code in the input jars. Ignoring them then speeds up ProGuard, without
+ affecting the output. Unfortunately, some libraries, including recent JSE
+ run-time libraries, contain non-public library classes that are extended
+ by public library classes. You then can't use this option. ProGuard will
+ print out warnings if it can't find classes due to this option being
+ set.</dd>
<dt><a name="dontskipnonpubliclibraryclasses"><code><b>-dontskipnonpubliclibraryclasses</b></code></a></dt>
-<dd>Specifies not to ignore non-public library classes. By default, non-public
- library classes are skipped while parsing library jars. The classes are
- typically not relevant during processing, since they don't affect the
- actual program code in the input jars. Ignoring them reduces memory usage
- and processing time. Occasionally, a badly designed library may contain a
- non-public library class that is extended/implemented by a public library
- class. If the latter library class in turn is extended/implemented by a
- program class, ProGuard will complain that it can't find the non-public
- library class, which it had ignored during parsing. This option will
- overcome that problem, at the cost of greater memory usage and longer
- processing time.</dd>
+<dd>Specifies not to ignore non-public library classes. As of version 4.5, this
+ is the default setting.</dd>
<dt><a name="dontskipnonpubliclibraryclassmembers"><code><b>-dontskipnonpubliclibraryclassmembers</b></code></a></dt>
<dd>Specifies not to ignore package visible library class members (fields and
- methods). By default, these class members are skipped while parsing
+ methods). By default, ProGuard skips these class members while parsing
library classes, as program classes will generally not refer to them.
Sometimes however, program classes reside in the same packages as library
classes, and they do refer to their package visible class members. In
@@ -162,23 +176,26 @@ The sections below provide more details:
<dt><a name="keepdirectories"><code><b>-keepdirectories</b></code></a>
[<i><a href="#filefilters">directory_filter</a></i>]</dt>
-<dd>Specifies the directories to be kept in the output jars (or wars, ears, or
- directories). By default, directory entries are removed. This reduces the
- jar size, but it may be undesirable if the program code tries to find them
- with constructs like "<code>MyClass.class.getResource("")</code>". If the
- option is specified without a filter, all directories are kept. With a
- filter, only matching directories are kept.</dd>
+<dd>Specifies the directories to be kept in the output jars (or wars, ears,
+ zips, or directories). By default, directory entries are removed. This
+ reduces the jar size, but it may break your program if the code tries to
+ find them with constructs like
+ "<code>mypackage.MyClass.class.getResource("")</code>". You'll then want to
+ keep the directory corresponding to the package, "<code>-keepdirectories
+ mypackage</code>". If the option is specified without a filter, all
+ directories are kept. With a filter, only matching directories are
+ kept.</dd>
<dt><a name="target"><code><b>-target</b></code></a> <i>version</i></dt>
<dd>Specifies the version number to be set in the processed class files. The
version number can be one of <code>1.0</code>, <code>1.1</code>,
<code>1.2</code>, <code>1.3</code>, <code>1.4</code>, <code>1.5</code> (or
- just <code>5</code>), or <code>1.6</code> (or just <code>6</code>). By
- default, the version numbers of the class files are left unchanged. For
- example, you may want to <a href="examples.html#upgrade">upgrade class
- files to Java 6</a>, by changing their version numbers and having them
- preverified.</dd>
+ just <code>5</code>), <code>1.6</code> (or just <code>6</code>), or
+ <code>1.7</code> (or just <code>7</code>). By default, the version numbers
+ of the class files are left unchanged. For example, you may want to
+ <a href="examples.html#upgrade">upgrade class files to Java 6</a>, by
+ changing their version numbers and having them preverified.</dd>
<dt><a name="forceprocessing"><code><b>-forceprocessing</b></code></a></dt>
@@ -189,8 +206,7 @@ The sections below provide more details:
</dl>
<p>
-<a name="keepoptions">&nbsp;</a>
-<h2>Keep Options</h2>
+<h2><a name="keepoptions">Keep Options</a></h2>
<dl>
<dt><a name="keep"><code><b>-keep</b></code></a>
@@ -245,11 +261,11 @@ The sections below provide more details:
<p>
Specifies class members whose names are to be preserved, if they aren't
removed in the shrinking phase. For example, you may want to preserve the
- name of the synthetic <code>class$</code> methods when <a
- href="examples.html#library">processing a library</a>, so obfuscators can
- detect it again when processing an application that uses the processed
- library (although ProGuard itself doesn't need this). Only applicable when
- obfuscating.</dd>
+ name of the synthetic <code>class$</code> methods
+ when <a href="examples.html#library">processing a library</a> compiled by
+ JDK 1.2 or older, so obfuscators can detect it again when processing an
+ application that uses the processed library (although ProGuard itself
+ doesn't need this). Only applicable when obfuscating.</dd>
<dt><a name="keepclasseswithmembernames"><code><b>-keepclasseswithmembernames</b></code></a>
<a href="#classspecification"><i>class_specification</i></a></dt>
@@ -280,8 +296,7 @@ The sections below provide more details:
</dl>
<p>
-<a name="shrinkingoptions">&nbsp;</a>
-<h2>Shrinking Options</h2>
+<h2><a name="shrinkingoptions">Shrinking Options</a></h2>
<dl>
<dt><a name="dontshrink"><code><b>-dontshrink</b></code></a></dt>
@@ -319,8 +334,7 @@ The sections below provide more details:
</dl>
<p>
-<a name="optimizationoptions">&nbsp;</a>
-<h2>Optimization Options</h2>
+<h2><a name="optimizationoptions">Optimization Options</a></h2>
<dl>
<dt><a name="dontoptimize"><code><b>-dontoptimize</b></code></a></dt>
@@ -348,14 +362,16 @@ The sections below provide more details:
<dd>Specifies methods that don't have any side effects (other than maybe
returning a value). In the optimization step, ProGuard will then remove
calls to such methods, if it can determine that the return values aren't
- used. Note that ProGuard will analyze your program code to find such
- methods automatically. It will not analyze library code, for which this
- option can thus be useful. For example, you could specify the method
+ used. ProGuard will analyze your program code to find such methods
+ automatically. It will not analyze library code, for which this option can
+ therefore be useful. For example, you could specify the method
<code>System.currentTimeMillis()</code>, so that any idle calls to it will
- be removed. Note that ProGuard applies the option to the entire hierarchy
- of the specified methods. Only applicable when optimizing. In general,
- making assumptions can be dangerous; you can easily break the processed
- code. <i>Only use this option if you know what you're doing!</i></dd>
+ be removed. With some care, you can also use the option to
+ <a href="examples.html#logging">remove logging code</a>. Note that
+ ProGuard applies the option to the entire hierarchy of the specified
+ methods. Only applicable when optimizing. In general, making assumptions
+ can be dangerous; you can easily break the processed code. <i>Only use
+ this option if you know what you're doing!</i></dd>
<dt><a name="allowaccessmodification"><code><b>-allowaccessmodification</b></code></a></dt>
@@ -401,14 +417,13 @@ The sections below provide more details:
<ul>
<li>Sun's JRE 1.3 may throw an <code>InternalError</code> when
encountering more than 256 <i>Miranda</i> methods (interface methods
- without implementations) in a class.
+ without implementations) in a class.</li>
</ul></dd>
</dl>
<p>
-<a name="obfuscationoptions">&nbsp;</a>
-<h2>Obfuscation Options</h2>
+<h2><a name="obfuscationoptions">Obfuscation Options</a></h2>
<dl>
<dt><a name="dontobfuscate"><code><b>-dontobfuscate</b></code></a></dt>
@@ -440,10 +455,12 @@ The sections below provide more details:
mapping may refer to input classes as well as library classes. This option
can be useful for <a href="examples.html#incremental">incremental
obfuscation</a>, i.e. processing add-ons or small patches to an existing
- piece of code. In such cases, you should consider whether you also need
- the option <a
- href="#useuniqueclassmembernames"><code>-useuniqueclassmembernames</code></a>.
- Only applicable when obfuscating.</dd>
+ piece of code. If the structure of the code changes fundamentally,
+ ProGuard may print out warnings that applying a mapping is causing
+ conflicts. You may be able to reduce this risk by specifying the option <a
+ href="#useuniqueclassmembernames"><code>-useuniqueclassmembernames</code></a>
+ in both obfuscation runs. Only a single mapping file is allowed. Only
+ applicable when obfuscating.</dd>
<dt><a name="obfuscationdictionary"><code><b>-obfuscationdictionary</b></code></a>
<a href="#filename"><i>filename</i></a></dt>
@@ -506,13 +523,13 @@ The sections below provide more details:
<ul>
<li>Sun's JDK 1.2.2 <code>javac</code> compiler produces an exception when
compiling with such a library (cfr. <a href=
- "http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4216736">Bug
- #4216736</a>). You probably shouldn't use this option for processing
- libraries.
+ "http://bugs.sun.com/view_bug.do?bug_id=4216736">Bug #4216736</a>).
+ You probably shouldn't use this option for processing libraries.</li>
<li>Sun's JRE 1.4 and later fail to serialize objects with overloaded
- primitive fields.
+ primitive fields.</li>
<li>Sun's JRE 1.5 <code>pack200</code> tool reportedly has problems with
- overloaded class members.
+ overloaded class members.</li>
+ <li>Google's Dalvik VM can't handle overloaded static fields.</li>
</ul></dd>
<dt><a name="useuniqueclassmembernames"><code><b>-useuniqueclassmembernames</b></code></a></dt>
@@ -548,16 +565,16 @@ The sections below provide more details:
filing system (say, Windows), the unpacking tool may let similarly named
class files overwrite each other. Code that self-destructs when it's
unpacked! Developers who really want to unpack their jars on Windows can
- use this option to switch off this behavior. Note that the obfuscated jars
- will become larger as a result. Only applicable when obfuscating.</dd>
+ use this option to switch off this behavior. Obfuscated jars will become
+ slightly larger as a result. Only applicable when obfuscating.</dd>
<dt><a name="keeppackagenames"><code><b>-keeppackagenames</b></code></a>
[<i><a href="#filters">package_filter</a></i>]</dt>
-<dd>Specifies not obfuscate the given package names. The optional filter is a
- comma-separated list of package names. Package names can contain <b>?</b>,
- <b>*</b>, and <b>**</b> wildcards, and they can be preceded by the
- <b>!</b> negator. Only applicable when obfuscating.</dd>
+<dd>Specifies not to obfuscate the given package names. The optional filter is
+ a comma-separated list of package names. Package names can contain
+ <b>?</b>, <b>*</b>, and <b>**</b> wildcards, and they can be preceded by
+ the <b>!</b> negator. Only applicable when obfuscating.</dd>
<dt><a name="flattenpackagehierarchy"><code><b>-flattenpackagehierarchy</b></code></a>
[<i>package_name</i>]</dt>
@@ -608,12 +625,24 @@ The sections below provide more details:
name can be specified as well, referring to the source name part of this
attribute. For example, you should at least keep the
<code>Exceptions</code>, <code>InnerClasses</code>, and
- <code>Signature</code> attributes when <a
- href="examples.html#library">processing a library</a>. As another example,
- you should keep the <code>SourceFile</code> and
- <code>LineNumberTable</code> attributes for <a
- href="examples.html#stacktrace">producing useful obfuscated stack
- traces</a>. Only applicable when obfuscating.</dd>
+ <code>Signature</code> attributes
+ when <a href="examples.html#library">processing a library</a>. You should
+ also keep the <code>SourceFile</code> and
+ <code>LineNumberTable</code> attributes
+ for <a href="examples.html#stacktrace">producing useful obfuscated stack
+ traces</a>. Finally, you may want
+ to <a href="examples.html#annotations">keep annotations</a> if your code
+ depends on them. Only applicable when obfuscating.</dd>
+
+<dt><a name="keepparameternames"><code><b>-keepparameternames</b></code></a></dt>
+
+<dd>Specifies to keep the parameter names and types of methods that are kept.
+ This option actually keeps trimmed versions of the debugging attributes
+ <code>LocalVariableTable</code> and
+ <code>LocalVariableTypeTable</code>. It can be useful when
+ <a href="examples.html#library">processing a library</a>. Some IDEs can
+ use the information to assist developers who use the library, for example
+ with tool tips or autocompletion. Only applicable when obfuscating.</dd>
<dt><a name="renamesourcefileattribute"><code><b>-renamesourcefileattribute</b></code></a>
[<i>string</i>]</dt>
@@ -665,8 +694,7 @@ The sections below provide more details:
</dl>
<p>
-<a name="preverificationoptions">&nbsp;</a>
-<h2>Preverification Options</h2>
+<h2><a name="preverificationoptions">Preverification Options</a></h2>
<dl>
<dt><a name="dontpreverify"><code><b>-dontpreverify</b></code></a></dt>
@@ -675,9 +703,10 @@ The sections below provide more details:
files are preverified if they are targeted at Java Micro Edition or at
Java 6 or higher. For Java Micro Edition, preverification is required, so
you will need to run an external preverifier on the processed code if you
- specify this option. For Java 6, preverification is not required (yet),
- but it improves the efficiency of the class loading in the Java Virtual
- Machine.</dd>
+ specify this option. For Java 6, preverification is optional, but as of
+ Java 7, it is required. Only when eventually targeting Android, it is not
+ necessary, so you can then switch it off to reduce the processing time a
+ bit.</dd>
<dt><a name="microedition"><code><b>-microedition</b></code></a></dt>
@@ -690,8 +719,7 @@ The sections below provide more details:
</dl>
<p>
-<a name="generaloptions">&nbsp;</a>
-<h2>General Options</h2>
+<h2><a name="generaloptions">General Options</a></h2>
<dl>
<dt><a name="verbose"><code><b>-verbose</b></code></a></dt>
@@ -749,8 +777,7 @@ The sections below provide more details:
</dl>
<p>
-<a name="classpath">&nbsp;</a>
-<h2>Class Paths</h2>
+<h2><a name="classpath">Class Paths</a></h2>
ProGuard accepts a generalization of class paths to specify input files and
output files. A class path consists of entries, separated by the traditional
@@ -759,12 +786,12 @@ The order of the entries determines their priorities, in case of duplicates.
<p>
Each input entry can be:
<ul>
-<li>A class file or resource file.
-<li>A jar file, containing any of the above,
-<li>A war file, containing any of the above,
-<li>An ear file, containing any of the above,
-<li>A zip file, containing any of the above,
-<li>A directory (structure), containing any of the above.
+<li>A class file or resource file,</li>
+<li>A jar file, containing any of the above,</li>
+<li>A war file, containing any of the above,</li>
+<li>An ear file, containing any of the above,</li>
+<li>A zip file, containing any of the above,</li>
+<li>A directory (structure), containing any of the above.</li>
</ul>
<p>
The paths of directly specified class files and resource files is ignored, so
@@ -776,11 +803,11 @@ any additional directory prefixes inside the archives or directories.
Each output entry can be:
<ul>
<li>A jar file, in which all processed class files and resource files will be
- collected.
-<li>A war file, in which any and all of the above will be collected,
-<li>An ear file, in which any and all of the above will be collected,
-<li>A zip file, in which any and all of the above will be collected,
-<li>A directory, in which any and all of the above will be collected.
+ collected.</li>
+<li>A war file, in which any and all of the above will be collected,</li>
+<li>An ear file, in which any and all of the above will be collected,</li>
+<li>A zip file, in which any and all of the above will be collected,</li>
+<li>A directory, in which any and all of the above will be collected.</li>
</ul>
<p>
When writing output entries, ProGuard will generally package the results in a
@@ -801,12 +828,12 @@ class path entry can be followed by up to 5 types of <a
href="#filefilters">file filters</a> between parentheses, separated by
semi-colons:
<ul>
-<li>A filter for all zip names that are encountered,
-<li>A filter for all ear names that are encountered,
-<li>A filter for all war names that are encountered,
-<li>A filter for all jar names that are encountered,
+<li>A filter for all zip names that are encountered,</li>
+<li>A filter for all ear names that are encountered,</li>
+<li>A filter for all war names that are encountered,</li>
+<li>A filter for all jar names that are encountered,</li>
<li>A filter for all class file names and resource file names that are
- encountered.
+ encountered.</li>
</ul>
<p>
If fewer than 5 filters are specified, they are assumed to be the latter
@@ -826,8 +853,8 @@ For example, "<code>input.jar(!**.gif,images/**)</code>" matches all files in
the <code>images</code> directory inside the <code>input</code> jar, except
gif files.
<p>
-Note that the different filters are applied to all corresponding file types,
-irrespective of their nesting levels in the input; they are orthogonal.
+The different filters are applied to all corresponding file types, irrespective
+of their nesting levels in the input; they are orthogonal.
<p>
For example,
"<code>input.war(lib/**.jar,support/**.jar;**.class,**.gif)</code>" only
@@ -840,40 +867,37 @@ possibilities. The Examples section provides a few more examples
for <a href="examples.html#filtering">filtering input and output</a>.
<p>
-<a name="filename">&nbsp;</a>
-<h2>File Names</h2>
+<h2><a name="filename">File Names</a></h2>
ProGuard accepts absolute paths and relative paths for the various file names
and directory names. A relative path is interpreted as follows:
<ul>
-<li>relative to the base directory, if set, or otherwise
+<li>relative to the base directory, if set, or otherwise</li>
<li>relative to the configuration file in which it is specified, if any, or
- otherwise
-<li>relative to the working directory.
+ otherwise</li>
+<li>relative to the working directory.</li>
</ul>
<p>
-The names can contain Java system properties delimited by '<b>&lt;</b>' and
-'<b>&gt;</b>'. The system properties
-are automatically replaced by their respective values.
+The names can contain Java system properties (or Ant properties, when using
+Ant), delimited by angular brackets, '<b>&lt;</b>' and '<b>&gt;</b>'. The
+properties are automatically replaced by their corresponding values.
<p>
-For example, <code>&lt;java.home&gt;/lib/rt.jar</code> will automatically be
+For example, <code>&lt;java.home&gt;/lib/rt.jar</code> is automatically
expanded to something like <code>/usr/local/java/jdk/jre/lib/rt.jar</code>.
-Similarly, <code>&lt;user.home&gt;</code> will be expanded to the user's home
-directory, and <code>&lt;user.dir&gt;</code> will be expanded to the current
+Similarly, <code>&lt;user.home&gt;</code> is expanded to the user's home
+directory, and <code>&lt;user.dir&gt;</code> is expanded to the current
working directory.
<p>
Names with special characters like spaces and parentheses must be quoted with
-single or double quotes. Note that each file name in a list of names has to be
-quoted individually. Also note that the quotes themselves may need to be
-escaped when used on the command line, to avoid them being gobbled by the
-shell.
+single or double quotes. Each file name in a list of names has to be quoted
+individually. Note that the quotes themselves may need to be escaped when used
+on the command line, to avoid them being gobbled by the shell.
<p>
For example, on the command line, you could use an option like <code>'-injars
"my program.jar":"/your directory/your program.jar"'</code>.
<p>
-<a name="filefilters">&nbsp;</a>
-<h2>File Filters</h2>
+<h2><a name="filefilters">File Filters</a></h2>
Like general <a href="#filters">filters</a>, a file filter is a
comma-separated list of file names that can contain wildcards. Only files with
@@ -905,8 +929,7 @@ For example, "<code>!**.gif,images/**</code>" matches all files in the
The Examples section provides a few more examples for <a
href="examples.html#filtering">filtering input and output</a>.
-<a name="filters">&nbsp;</a>
-<h2>Filters</h2>
+<h2><a name="filters">Filters</a></h2>
ProGuard offers options with filters for many different aspects of the
configuration: names of files, directories, classes, packages, attributes,
@@ -944,8 +967,7 @@ For example, "<code>!foobar,*bar</code>" matches all names ending with
<code>bar</code>, except <code>foobar</code>.
<p>
-<a name="keepoverview">&nbsp;</a>
-<h2>Overview of <code>Keep</code> Options</h2>
+<h2><a name="keepoverview">Overview of <code>Keep</code> Options</a></h2>
The various <code>-keep</code> options for shrinking and obfuscation may seem
a bit confusing at first, but there's actually a pattern behind them. The
@@ -989,24 +1011,17 @@ If you're not sure which option you need, you should probably simply use
<code>-keep</code>. It will make sure the specified classes and class members
are not removed in the shrinking step, and not renamed in the obfuscation step.
<p>
-<table>
-<tr><td valign="top">
-<img src="attention.gif" width="64" height="64"alt="attention">
-</td><td>
-Always remember:
-<ul>
-<li>Specifying a class without class members only preserves the class as an
- entry point &mdash; any class members may then still be removed, optimized,
- or obfuscated.</li>
-<li>Specifying a class member only preserves the class member as an entry
- point &mdash; any associated code may still be optimized and adapted.</li>
+<img class="float" src="attention.gif" width="64" height="64" alt="attention" />
+<ul class="shifted">
+<li>If you specify a class, without class members, ProGuard only preserves the
+ class and its parameterless constructor as entry points. It may
+ still remove, optimize, or obfuscate its other class members.</li>
+<li>If you specify a method, ProGuard only preserves the method as an entry
+ point. Its code may still be optimized and adapted.</li>
</ul>
-</td></tr>
-</table>
<p>
-<a name="keepoptionmodifiers">&nbsp;</a>
-<h2>Keep Option Modifiers</h2>
+<h2><a name="keepoptionmodifiers">Keep Option Modifiers</a></h2>
<dl>
<dt><a name="allowshrinking"><code><b>allowshrinking</b></code></a></dt>
@@ -1035,8 +1050,7 @@ Always remember:
</dl>
<p>
-<a name="classspecification">&nbsp;</a>
-<h2>Class Specifications</h2>
+<h2><a name="classspecification">Class Specifications</a></h2>
A class specification is a template of classes and class members (fields and
methods). It is used in the various <code>-keep</code> options and in the
@@ -1071,18 +1085,20 @@ of the specification that belong together. The indentation tries to clarify
the intended meaning, but white-space is irrelevant in actual configuration
files.
<p>
-<ul>
+<ul class="spacious">
<li>The <code><b>class</b></code> keyword refers to any interface or class.
The <code><b>interface</b></code> keyword restricts matches to interface
classes. The <code><b>enum</b></code> keyword restricts matches to
enumeration classes. Preceding the <code><b>interface</b></code> or
<code><b>enum</b></code> keywords by a <code><b>!</b></code> restricts
- matches to classes that are not interfaces or enumerations, respectively.
- <p>
+ matches to classes that are not interfaces or enumerations,
+ respectively.</li>
<li>Every <i>classname</i> must be fully qualified, e.g.
- <code>java.lang.String</code>. Class names may be specified as regular
+ <code>java.lang.String</code>. Inner classes are separated by a dollar sign
+ "<code>$</code>", e.g. <code>java.lang.Thread$State</code>. Class names
+ may be specified as regular
expressions containing the following wildcards:
<table cellspacing="10">
@@ -1120,22 +1136,19 @@ files.
should be used with moderation.
<p>
For convenience and for backward compatibility, the class name
- <code><b>*</b></code> refers to any class, irrespective of its package.
- <p>
+ <code><b>*</b></code> refers to any class, irrespective of its package.</li>
<li>The <code><b>extends</b></code> and <code><b>implements</b></code>
specifications are typically used to restrict classes with wildcards. They
are currently equivalent, specifying that only classes extending or
implementing the given class qualify. Note that the given class itself is
not included in this set. If required, it should be specified in a
- separate option.
- <p>
+ separate option.</li>
<li>The <code><b>@</b></code> specifications can be used to restrict classes
and class members to the ones that are annotated with the specified
annotation types. An <i>annotationtype</i> is specified just like a
- <i>classname</i>.
- <p>
+ <i>classname</i>.</li>
<li>Fields and methods are specified much like in Java, except that method
argument lists don't contain argument names (just like in other tools
@@ -1198,13 +1211,11 @@ files.
<code>***</code> wildcards will match array types of any dimension. For
example, "<code>** get*()</code>" matches "<code>java.lang.Object
getObject()</code>", but not "<code>float getFloat()</code>", nor
- "<code>java.lang.Object[] getObjects()</code>".
- <p>
+ "<code>java.lang.Object[] getObjects()</code>".</li>
<li>Constructors can also be specified using their short class names (without
package) or using their full class names. As in the Java language, the
- constructor specification has an argument list, but no return type.
- <p>
+ constructor specification has an argument list, but no return type.</li>
<li>The class access modifiers and class member access modifiers are typically
used to restrict wildcarded classes and class members. They specify that
@@ -1218,14 +1229,18 @@ files.
which case at least one of them has to be set (e.g. at least
<code>public</code>
<i>or</i> <code>protected</code>).
+ <p>
+ ProGuard supports the additional modifiers <code><b>synthetic</b></code>,
+ <code><b>bridge</b></code>, and <code><b>varargs</b></code>, which may be
+ set by compilers.</li>
</ul>
-<p>
-<hr>
+<hr />
+<noscript><div><a target="_top" href="../index.html" class="button">Show menu</a></div></noscript>
<address>
-Copyright &copy; 2002-2009
-<a href="http://www.graphics.cornell.edu/~eric/">Eric Lafortune</a>.
+Copyright &copy; 2002-2013
+<a target="other" href="http://www.lafortune.eu/">Eric Lafortune</a>.
</address>
</body>
</html>
diff --git a/docs/manual/wtk.html b/docs/manual/wtk.html
index b8c70b5..a7ea0b8 100644
--- a/docs/manual/wtk.html
+++ b/docs/manual/wtk.html
@@ -1,16 +1,27 @@
-<!doctype html PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
+<!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 Sun's Wireless Toolkit (WTK)
+<b>ProGuard</b> can be seamlessly integrated in Oracle's Wireless Toolkit (WTK)
for Java Micro Edition (JME).
<p>
@@ -49,10 +60,11 @@ 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>
+<hr />
+<noscript><div><a target="_top" href="../index.html" class="button">Show menu</a></div></noscript>
<address>
-Copyright &copy; 2002-2009
-<a href="http://www.graphics.cornell.edu/~eric/">Eric Lafortune</a>.
+Copyright &copy; 2002-2013
+<a target="other" href="http://www.lafortune.eu/">Eric Lafortune</a>.
</address>
</body>
</html>