Zelix KlassMaster

Tools Unobfuscate

Overview
Basics
The Class Names options
The Field Names options
The Method Names options
The Miscellaneous options

Overview

If you have a class (bytecode) file that has been unobfuscated (and you have the legal right to decompile it) then Zelix KlassMaster can to some extent unobfuscate it.

Zelix KlassMaster

  • Changes your package, class, field and method names to names that are Java legal and readable
  • Eliminates ambiguity in names. For example it eliminates
    • artificial overloading of method names
    • hiding of field names
    • hiding of static method names
  • Detects and removes corrupt debugging information
However, it will not unencrypt string variables encrypted with Zelix KlassMaster.
 

Basics

You may unobfuscate your classes at any time by selecting the Tools Unobfuscate names menu. This brings up the "Name Unobfuscate Options" dialog.
Zelix KlassMaster - Selecting Tools Unobfuscate

Leads to...

The "Class names" Options

If all the loaded classes have obfuscated names then you should select "change all class names". Similarly, if public class names are not obfuscated then you should select "don't change public class names".

Change all class names

If you select "change all class names" then all public and package (default) class names will be changed. The only exception would be a class specified in the "don't change main class name" option.

Don't change public class names

If you select "don't change public class names" then all package (default) class names will be changed. The only exception would be a class specified in the "don't change main class name" option.
Zelix KlassMaster - Name Unobfuscate Options

Warning

If any loaded classes are extended by classes that haven't been loaded then unobfuscation of the extended class names will break the extending classes. Zelix KlassMaster does not check for this situation.

Change package names below

Zelix KlassMaster can unobfuscate package names if you select the "change package names below" option. If the field to the right of this option is left blank then all package names will be unobfuscated. If a package qualfier is entered then only package qualifiers below or independent of the specified qualifier will be unobfuscated.

For example, if there were three classes with the fully qualified names

  • package1.package2.class1
  • package1.package2.Z1.class1
  • Z2.class1
and you specified that package names below package1.package2 should be changed then the changed class names would be
  • package1.package2.class1
  • package1.package2.pack1.class1
  • pack2.class1
Note that you can only change package names if "change public class names" has been selected.

Don't change main class name

Applications are started by running a class that contains a "main" method. It is usually desirable that this class have a user friendly name. To ensure this, select the "don't change main class name" option and select your main class from the list box. All loaded classes that contain a "main" method will appear in the list.

Derive subclass names from the superclass name

By default, Zelix KlassMaster unobfuscates class names to Classn or Interfacen where n is some integer. If the "derive subclass names from the superclass name" is selected then the unobfuscated subclass names will reflect the name of their superclasses except where the superclass is java.lang.Object. For example, if there were two classes with
  • one class being a subclass of java.util.Observable and
  • the other being a subclass of the first
then the unobfuscated names would be
  • Observable_Sub1 and
  • Observable_Sub1_Sub1.
Selecting this option makes the unobfuscated class names more meaningful but it can also make then rather unwieldly when inheritance hierarchies are several levels deep.

The "Field names" Options

If all the field names of loaded classes are obfuscated you should select "change all field names". If all but public fields are obfuscated you should select "don't change public field names". If only package and private fields are obfuscated you should select "don't change public and protected field names".

Change all field names

If you select "change all field names" then all public, protected, package (default) and private field names will be changed.

Don't change public field names

If you select "don't change public field names" then all protected, package (default) and private field names will be changed.

Don't change public or protected field names

If you select "don't change public or protected field names" then only package (default) and private field names will be changed.

The "Method names" Options

If all the method names of loaded classes are obfuscated you should select "change all method names". If all but public methods are obfuscated you should select "don't change public method names". If only package and private methods are obfuscated you should select "don't change public and protected field methods".

Change all method names

If you select "change all method names" then all public, protected, package (default) and private method names will be changed. (See exceptions.)

Don't change public method names

If you select "don't change public method names" then all protected, package (default) and private method names will be changed. (See exceptions.)

Don't change public or protected method names

If you select "don't change public or protected method names" then only package (default) and private method names will be changed. (See exceptions.)

Exceptions

The name of the methods "main" and "<init>" (i.e. constructors) will never be changed.

A method name will not be changed if

  • the method overrides a method in a superclass that hasn't been loaded or
  • the method implements a method in an interface that hasn't been loaded.
Also, a protected or package method name will not be changed if
  • the method is overridden in some subclass by a public method and
  • public method names are not being changed.
Zelix KlassMaster uses the path defined in the classpath option when searching for unloaded classes.

Warning

If any methods in loaded classes are overridden by classes that haven't been loaded then unobfuscation of the overridden method names will break the extending classes. Zelix KlassMaster does not check for this situation.

The "Miscellaneous" Options

Produce a change log file

If you select "produce a change log file" Zelix KlassMaster will write the name change details to a change log file. The change log file will be given the name that you entered in the input field to the right of the option. Note that only the latest changes will appear in the file. If you unobfuscate twice with the same change log file name then only the second set of name changes will be retained.

Keep inner class information

The JDK 1.1 introduced inner classes. At the level of the bytecode, inner classes are distinguished by the structure of their names and by the presence of a few attributes. This inner class information is not critical to the running of your bytecode. It is provided for the use of debuggers and similar utilities.

If you select the "keep inner class information" option then Zelix KlassMaster will retain this inner class information. You can select this option if you are confident that the obfuscated classes contain valid inner classes information. If there is no inner class information then the options has no effect.


Documentation Table of Contents
Copyright © 1997 Zelix Pty Ltd (ACN 078 740 093)