summaryrefslogtreecommitdiffstats
path: root/docs/manual/introduction.html
diff options
context:
space:
mode:
authorYing Wang <wangying@google.com>2012-02-27 18:34:24 -0800
committerYing Wang <wangying@google.com>2012-02-27 18:34:24 -0800
commit9f606f95f03a75961498803e24bee6799a7c0885 (patch)
treea45f4d74feda9b76277a0c9ced55ad15d82248a1 /docs/manual/introduction.html
parentcfead78069f3dc32998dc118ee08cab3867acea2 (diff)
downloadexternal_proguard-9f606f95f03a75961498803e24bee6799a7c0885.tar.gz
external_proguard-9f606f95f03a75961498803e24bee6799a7c0885.tar.bz2
external_proguard-9f606f95f03a75961498803e24bee6799a7c0885.zip
This reverts commit cfead78069f3dc32998dc118ee08cab3867acea2. Bug: 6079915
Diffstat (limited to 'docs/manual/introduction.html')
-rw-r--r--docs/manual/introduction.html81
1 files changed, 32 insertions, 49 deletions
diff --git a/docs/manual/introduction.html b/docs/manual/introduction.html
index bc71f4a..cdab330 100644
--- a/docs/manual/introduction.html
+++ b/docs/manual/introduction.html
@@ -1,21 +1,10 @@
-<!doctype html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<!doctype html PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
<meta http-equiv="content-style-type" content="text/css">
<link rel="stylesheet" type="text/css" href="style.css">
<title>ProGuard 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>
@@ -87,9 +76,7 @@ libraries that you would need for compiling the code. ProGuard uses them to
reconstruct the class dependencies that are necessary for proper processing.
The library jars themselves always remain unchanged. You should still put them
in the class path of your final application.
-
-<h3>Entry points</h3>
-
+<p>
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,
@@ -97,59 +84,55 @@ midlets, etc.
<ul>
<li>In the <b>shrinking step</b>, ProGuard starts from these seeds and
recursively determines which classes and class members are used. All other
- classes and class members are discarded.</li>
+ classes and class members are discarded.
<li>In the <b>optimization step</b>, ProGuard further optimizes the code.
Among other optimizations, classes and methods that are not entry points
can be made private, static, or final, unused parameters can be removed,
- and some methods may be inlined.</li>
+ and some methods may be inlined.
<li>In the <b>obfuscation step</b>, ProGuard renames classes and class members
that are not entry points. In this entire process, keeping the entry
- points ensures that they can still be accessed by their original names.</li>
+ points ensures that they can still be accessed by their original names.
<li>The <b>preverification step</b> is the only step that doesn't have to know
- the entry points.</li>
+ the entry points.
</ul>
<p>
The <a href="usage.html">Usage section</a> of this manual describes the
necessary <a href="usage.html#keepoptions"><code>-keep</code> options</a> and
the <a href="examples.html">Examples section</a> provides plenty of examples.
-<h3>Reflection</h3>
-
-Reflection and introspection present particular problems for any automatic
-processing of code. In ProGuard, classes or class members in your code that
-are created or invoked dynamically (that is, by name) have to be specified as
-entry points too. For example, <code>Class.forName()</code> constructs may
-refer to any class at run-time. It is generally impossible to foresee which
-classes have to be preserved (with their original names), since the class
-names might be read from a configuration file, for instance. You therefore
-have to specify them in your ProGuard configuration, with the same
-simple <code>-keep</code> options.
+<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.
<p>
However, ProGuard will already detect and handle the following cases for you:
<ul>
-<li><code>Class.forName("SomeClass")</code></li>
-<li><code>SomeClass.class</code></li>
-<li><code>SomeClass.class.getField("someField")</code></li>
-<li><code>SomeClass.class.getDeclaredField("someField")</code></li>
-<li><code>SomeClass.class.getMethod("someMethod", new Class[] {})</code></li>
-<li><code>SomeClass.class.getMethod("someMethod", new Class[] { A.class })</code></li>
-<li><code>SomeClass.class.getMethod("someMethod", new Class[] { A.class, B.class })</code></li>
-<li><code>SomeClass.class.getDeclaredMethod("someMethod", new Class[] {})</code></li>
-<li><code>SomeClass.class.getDeclaredMethod("someMethod", new Class[] { A.class })</code></li>
-<li><code>SomeClass.class.getDeclaredMethod("someMethod", new Class[] { A.class, B.class })</code></li>
-<li><code>AtomicIntegerFieldUpdater.newUpdater(SomeClass.class, "someField")</code></li>
-<li><code>AtomicLongFieldUpdater.newUpdater(SomeClass.class, "someField")</code></li>
-<li><code>AtomicReferenceFieldUpdater.newUpdater(SomeClass.class, SomeType.class, "someField")</code></li>
+<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>
</ul>
The names of the classes and class members may of course be different, but the
constructs should be literally the same for ProGuard to recognize them. The
referenced classes and class members are preserved in the shrinking phase, and
-the string arguments are properly updated in the obfuscation phase.
+the string arguments are properly replaced 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
@@ -159,15 +142,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 reflection
+that you are processing. Obfuscating code that performs a lot of introspection
may require trial and error, especially without the necessary information
about the internals of the code.
+<p>
-<hr />
-<noscript><div><a target="_top" href="../index.html" class="button">Show menu</a></div></noscript>
+<hr>
<address>
-Copyright &copy; 2002-2011
-<a target="other" href="http://www.lafortune.eu/">Eric Lafortune</a>.
+Copyright &copy; 2002-2009
+<a href="http://www.graphics.cornell.edu/~eric/">Eric Lafortune</a>.
</address>
</body>
</html>