I have isolated this error to 2 source files. The
attached zip has the 2 source files and a build.xml to
recreate the error.
-Place proguard.jar into the prguard_bug directory.
-Run ant
-have ./output/obfuscated.jar to you classpath and
nothing else
-run javap ConvTable1025 and you get the following
error
java.io.UTFDataFormatException
at java.io.DataInputStream.readUTF
(DataInputStream.java:674)
at java.io.DataInputStream.readUTF
(DataInputStream.java:610)
at sun.tools.javap.ClassData.readCP
(ClassData.java:151)
at sun.tools.javap.ClassData.read
(ClassData.java:81)
at sun.tools.javap.ClassData.<init>
(ClassData.java:52)
at sun.tools.javap.JavapPrinter.<init>
(JavapPrinter.java:28)
at sun.tools.javap.Main.displayResults
(Main.java:204)
at sun.tools.javap.Main.perform(Main.java:61)
at sun.tools.javap.Main.entry(Main.java:49)
at sun.tools.javap.Main.main(Main.java:34)
ERROR:fatal exception
Compiled from null
Exception in thread "main" java.lang.NullPointerException
at sun.tools.javap.JavapPrinter.javaclassname
(JavapPrinter.java:788)
at sun.tools.javap.JavapPrinter.printclassHeader
(JavapPrinter.java:57)
at sun.tools.javap.JavapPrinter.print
(JavapPrinter.java:40)
at sun.tools.javap.Main.displayResults
(Main.java:205)
at sun.tools.javap.Main.perform(Main.java:61)
at sun.tools.javap.Main.entry(Main.java:49)
at sun.tools.javap.Main.main(Main.java:34)
I am using versoin 1.7 of proguard.
Ant version 1.5.4
Here is my jvm version (Windows XP)
java version "1.4.2"
Java(TM) 2 Runtime Environment, Standard Edition (build
1.4.2-b28)
Java HotSpot(TM) Client VM (build 1.4.2-b28, mixed
mode)
BTW besides I have converted from Retroguard to
ProGuard and besides this bug here it has been VERY
easy and because of ProGuard'a excellent generics our
software builds will be much more flexible (i.e. no
strange bugs because someone added an obfuscation
method and forgot to add it to retroguard) also support
for the .class constracts lets us use the standard log4j
coding pattern (rather than stirng with classnames that
don't refactor nicely).
Logged In: YES
user_id=749312
forgot to attach the file....
Could the error be the unicode strings? If there is support for
unicode needed I am willing to work on this if someone will
guide me in the right direction...
Logged In: YES
user_id=555208
This problem appears to be the result of the following bug
in all current JDKs:
http://developer.java.sun.com/developer/bugParade/bugs/4628881.html
A simple example of a string that doesn't get encoded
properly by String.getBytes("UTF-8") is "\uDBDC\uDEDF".
To complicate matters, there is some confusion about how
exactly to encode strings:
http://developer.java.sun.com/developer/bugParade/bugs/4614120.html
http://developer.java.sun.com/developer/bugParade/bugs/4787534.html
In order to work around this problem, String.getBytes has to
be replaced by proper UTF-8 encoding (in
proguard.classfile.Utf8CpInfo).
Logged In: YES
user_id=555208
I've re-implemented UTF-8 encoding to work around
the problems with the JRE implementation. The
new Utf8CpInfo class is attached below. It should
work for all foreign character sets. Please report
any problems. This patch will be included in the
upcoming version 2.0 of ProGuard.
proguard/classfile/Utf8CpInfo.java
Logged In: YES
user_id=749312
That fixed it. Thanks for the quick turn around. I was just
mangling our build script to work around the issue and the fix
came just in time :-)