Home | History | Annotate | Download | only in manual
      1 <!doctype html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
      2 <html>
      3 <head>
      4 <meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
      5 <meta http-equiv="content-style-type" content="text/css">
      6 <link rel="stylesheet" type="text/css" href="style.css">
      7 <title>ProGuard Limitations</title>
      8 <script type="text/javascript" language="JavaScript">
      9 <!--
     10 if (window.self==window.top)
     11   window.top.location.replace("../index.html#"+window.location.pathname+window.location.hash);
     12 else {
     13   var hash="#"+window.location.pathname.replace(window.top.location.pathname.replace("index.html", ""), "");
     14   if (window.top.location.hash!=hash)
     15     window.top.location.hash=hash;
     16 }
     17 //-->
     18 </script>
     19 </head>
     20 <body>
     21 
     22 <h2>Limitations</h2>
     23 
     24 When using ProGuard, you should be aware of a few technical issues, all of
     25 which are easily avoided or resolved:
     26 <p>
     27 <ul class="spacious">
     28 
     29 <li>For best results, ProGuard's optimization algorithms assume that the
     30     processed code never <b>intentionally throws NullPointerExceptions</b> or
     31     ArrayIndexOutOfBoundsExceptions, or even OutOfMemoryErrors or
     32     StackOverflowErrors, in order to achieve something useful. For instance,
     33     it may remove a method call <code>myObject.myMethod()</code> if that call
     34     wouldn't have any effect. It ignores the possibility that
     35     <code>myObject</code> might be null, causing a NullPointerException. In
     36     some way this is a good thing: optimized code may throw fewer exceptions.
     37     Should this entire assumption be false, you'll have to switch off
     38     optimization using the <code>-dontoptimize</code> option.</li>
     39 
     40 <li>ProGuard's optimization algorithms currently also assume that the
     41     processed code never creates <b>busy-waiting loops</b> without at least
     42     testing on a volatile field. Again, it may remove such loops. Should this
     43     assumption be false, you'll have to switch off optimization using
     44     the <code>-dontoptimize</code> option.</li>
     45 
     46 <li>If an input jar and a library jar contain classes in the <b>same
     47     package</b>, the obfuscated output jar may contain class names that
     48     overlap with class names in the library jar. This is most likely if the
     49     library jar has been obfuscated before, as it will then probably contain
     50     classes named 'a', 'b', etc. Packages should therefore never be split
     51     across input jars and library jars.</li>
     52 
     53 <li>When obfuscating, ProGuard writes out class files named
     54     "<code>a.class</code>", "<code>b.class</code>", etc. If a package contains
     55     a large number of classes, ProGuard may also write out
     56     <b>"<code>aux.class</code>"</b>. Inconveniently, Windows refuses to create
     57     files with this reserved name (among a few other names). It's generally
     58     better to write the output to a jar, in order to avoid such problems.</li>
     59 
     60 </ul>
     61 
     62 <hr />
     63 <noscript><div><a target="_top" href="../index.html" class="button">Show menu</a></div></noscript>
     64 <address>
     65 Copyright &copy; 2002-2013
     66 <a target="other" href="http://www.lafortune.eu/">Eric Lafortune</a>.
     67 </address>
     68 </body>
     69 </html>
     70