JODE
Homepage

Jode

JODE is a java package containing a decompiler and an optimizer (aka obfuscator ;-) for java. This package was totally written in my spare time and is available for free (see license).

The decompiler takes class files as input and produces something similar to the original java file. Of course this can't be perfect: There is no way to produce the comments or the names of local variables (except when compiled with debuging) and there are often more ways to write the same thing. But JODE does its job quite well, so you should give it a try: start the applet.

The optimizer transforms class files in various ways with can be controlled by a script file. It supports the following operations:

  • Renaming class, method, field and local names to shorter or unique names or according to a given translation table
  • Removing debugging information
  • Removing dead code (classes, fields, methods) and constant fields
  • Optimizing local variable allocation

News

  • I can now decompile inner and anonymous classes.
  • The optimizer (aka obfuscator) can now be customized via a small config file
  • Jode is now autoconfigured.
  • I use the getopt package

Older News

  • There is a swing interface
  • Jode handles zip and jar archives as both input and output.

Known Bugs

If not all dependent classes can be found, the verifier (which is run before decompilation starts) may exit with a type error. You can decompile it with --verify=off, but take the warning serious, that the types may be incorrect. There's sometimes no way to guess the right type, if you don't have access the full class hierarchie.
But if you don't have the dependent classes, you can't compile the code again, anyway, so why do you want to decompile it?

There may be situations, where the code doesn't understand complex expressions. In this many ugly temporary variables are used, but the code should still be compileable. This does especially happen when you compile with `-O' flag and javac has inlined some methods.

Sometimes this program may exit with an Exception or produce incorrect code. Most time the code can't be compiled, so that it can be easily spotted. If you have one of these problems (except those that occur on some of the jode.test files, I would be very interested in a bug report (including the class file, if possible).

Sometimes JODE generates some GOTO expression and labels. This shouldn't happen any more with code produced by javac or jikes. But some flow obfuscator likes Zelix Klassmaster may provoke this. In that case you can run the Obfuscator first (to optimize away the flow obfuscation ;-).


http://www.informatik.uni-oldenburg.de/~delwi/jode/jode.html, last updated on 24-Okt-1999.