Zelix KlassMaster - Documentation
 

Obfuscate Name Exclusions

Overview

The Zelix KlassMaster™ "Obfuscate" tool renames packages, classes, fields and methods. Name exclusions specify the package, class, field and method names that should not be renamed by the "Obfuscate" tool. Zelix KlassMaster™ has inbuilt default (name) exclusion parameters that, along with your "Application type", "Exclude package qualifiers" and "Don't change main class name" settings, are adequate for most purposes.

However, the "Obfuscate Name Exclusions" window also allows you to interactively construct precise custom exclusion specifications. Exclude parameters may be added, modified and deleted from the list. If an exclusion parameter is selected in the list, an explanation of its exclusion effect appears in the lower pane.

Just before this dialog is displayed, all the classes specified by the earlier "Open Classes" dialog are partially opened so that the "don't change main class name" list can be populated and so that any package names you enter in the "exclude package qualifiers" field can be validated. So, if you wish to make use of these options, your class files must already exist in the specified directories and/or archive files.
 
Zelix KlassMaster - Obfuscate Name Exclusions

Exclusion parameter list

Shows the current exclusion parameters. Any default exclusion parameters will appear as disabled items. Although the form of the exclusion parameters is the ZKM Script syntax (where "*" is a wildcard), you do not need to know this syntax.

Add button

Click this button to add an exclusion parameter to the "Exclusion parameter" list. It will open the "Exclusion Parameter Type" dialog.

Modify button

Click this button to modify the selected exclusion parameter in the "Exclusion parameter" list.

Delete button

Click this button to delete the selected exclusion parameter in the "Exclusion parameter" list.

Explanation area

Displays a plain language explanation of the effect of the selected exclusion parameter in the "Exclusion parameter" list.

Application type list

This list adds standard exclusion parameters to the "Exclusion parameter" list based upon the application type. The added exclusion parameters are based on the access modifiers of your classes, fields and methods.

List item Explanation
Non-extensible library Your application is a "non-extensible library" if it does not form a complete application in its own right but rather is intended to be used by other developers as part of their application without them having to extend any of your classes. An example is a 3rd party statistics library.

This setting of the "Application type" list means that your public classes, fields and methods need to be accessible to other classes but your classes will not be extended or implemented by other classes. It adds exclusion parameters that prevent your public classes, fields and methods from being renamed.
Extensible framework Your application is an "extensible framework" if it does not form a complete application in its own right but rather is intended to be extended by other developers to become part of their application. The key difference between an "extensible framework" and a "non-extensible library" is that an "extensible framework" has classes that are abstract which need to be extended before they can do real work.

This setting of the "Application type" list means that your public classes, fields and methods and protected fields and methods need to be accessible to other classes because your classes will be extended or implemented by other classes. It adds exclusion parameters that prevent your public classes, fields and methods and protected fields and methods from being renamed.
Java 2ME MIDlet This setting of the "Application type" list adds exclusion parameters that will prevent your classes that extend javax.microedition.midlet.MIDlet from being renamed.
Self contained application or applet This setting of the "Application type" list means that your classes are self contained. It does not add any exclusion parameters to the "Exclusion parameter" list. Instead, you need to select the application entry point or Applet class in the Don't change main class name list.

Exclude package qualifiers list

This list contains the package names of all the classes that have been opened in Zelix KlassMaster. If you select a package name, then an exclusion parameter will be added to the "Exclusion parameter" list that will exclude that package from being renamed. Alternatively, if you select the special <All> item then an exclusion parameter will be added that will exclude all package names from being renamed.

For example, if your classes are within the package "com.mycompany" then typically you will want to exclude that package from being renamed. This would eliminate the risk of class name clashes when your classes appear in the same classpath as classes produced and obfuscated by other companies.

Don't change main class name list

This list adds an exclusion parameter that excludes the selected "entry point" class from being renamed. The contents of the list consist of all the opened classes that contain the public static main(java.lang.String[]) method or that extend java.applet.Applet. If your application contains more than one entry point then you will need to exclude these additional entry points by adding custom exclude parameters using the Add button.

Default exclusion parameters

Zelix KlassMaster™ has some default exclusions that are applied everytime you obfuscate. However, you may override these defaults with your own. Zelix KlassMaster looks for a file in the current user directory named "defaultExclude.txt". If it finds the file then it will use its contents as the default exclusions.

If the defaultExclude.txt file doesn't exist then Zelix KlassMaster™ applies its predefined internal default exclusions. If the defaultExclude.txt file exists but is is empty then there are no default exclusions.

The default exclusion parameters appear as disabled list entries in the "Exclusion parameter list". They can only be altered by editing the "defaultExclude.txt" file. They cannot be altered by using this dialog.
 
Tools | Obfuscate