wollsmoth Java obfuscator

wollsmoth is a tiny post-compile Java obfuscator designed to produce hilarious and confusing source code if the obfuscated binaries decompiled. It doesn't do any optimizations, it only renames packages, classes, fields and methods to various unpleasantly pleasant names. Don't expect file size reduction. This obfuscator was only meant as a slightly functional joke. Not every Java feature is likely covered, and bugs are likely to be found.

Example

This unobfuscated snippet from com.jamieswhiteshirt.wollsmoth.PackageMapping:

public class PackageMapping { public String name ; public final HashMap < String , PackageMapping > children = new HashMap < String , PackageMapping >(); public PackageMapping ( String name ) { this . name = name ; } public PackageMapping getChild ( String name ) { PackageMapping p = children . get ( name ); if ( p == null ) { p = new PackageMapping ( name ); children . put ( name , p ); } return p ; } }

Becomes uh.uh.uh.Ooooooh, decompiled using JD-GUI:

public class Ooooooh { public String oh ; public final HashMap < String , Ooooooh > ooh = new HashMap (); public Ooooooh ( String mmh ) { mh . oh = mmh ; } public Ooooooh oh ( String mmh ) { Ooooooh mmmh = ( Ooooooh ) mh . ooh . get ( mmh ); if ( mmmh == null ) { mmmh = new Ooooooh ( mmh ); mh . ooh . put ( mmh , mmmh ); } return mmmh ; } }

Usage

Download either of the releases on the Downloads page and extract the contents wherever. Run the jar like this:

java -jar wollsmoth.jar "path_to_jar_to_obfuscate"

wollsmoth will sometimes need to preserve references to external libraries when obfuscating. You can optionally append the following parameters to link with either a single .jar or a folder containing jars:

-l "path_to_library_jar_or_folder"

These parameters can be repeated to add several libraries or folders to one obfuscation. The java standard library is always included.

Output

The obfuscated jar will be output with "-obfuscated" appended to the name in the location of the jar that was obfuscated.

ASM

wollsmoth is heavily based on ASM, a Java bytecode manipulation tool.

Licenses

ASM