"Obfuscate Name Exclusions" Window

Contents:

Overview

The Zelix KlassMasterTM "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 exclusions that, along with your "Application type", "Exclude package qualifiers" and "Don't change main class name" settings, are adequate for most purposes.

Default exclusion parameters

The default exclusions 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.

Package exclusion parameters

An exclusion parameter that excludes a package name prevents that package and its sub-packages from being renamed. However, in itself it will not prevent the class, field and the method names within that package from being renamed.

Class exclusion parameters

An exclusion parameter that excludes a class name prevents that class from being renamed. However, in itself it will not prevent the field and the method names of that class from being renamed.

Field exclusion parameters

An exclusion parameter that excludes a field name prevents that field from being renamed.

Method exclusion parameters

An exclusion parameter that excludes a method name prevents that method from being renamed.

Class suffix exclusion parameters

A class suffix exclusion parameter is a relatively complex and specialized exclusion parameter. It works in two stages. If a class matches a class suffix exclusion parameter then
  1. its specified suffix is excluded from being renamed
  2. if a class X can be found that has an unqualified name matching the non-suffix part of the matching class's name, then the non-suffix part of the matching class's name will be renamed to the new name of class X.
Its operation is best explained with an example. Consider a class suffix exclude parameter specifying the suffix "_Stub". A hypothetical class named "Class1_Stub" matches the parameter so the suffix part of the name will be retained. The non-suffix part of the matching class name "Class1_Stub" is "Class1". If there is a class in the same package named "Class1" and if, when obfuscating, "Class1" is renamed to "abc" then the class "Class1_Stub" will be renamed to "abc_Stub".

Exclusion parameter list

Shows the current exclusion parameters. Any default exclusion parameters will appear as disabled items. The form of the exclusion parameters is the ZKM Script syntax where the "*" character is a wildcard.

Add button

Click this button to add an exclusion parameter to the "Exclusion parameter" list.

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.

J2ME MIDlet This setting of the "Application type" list means that your classes are J2ME MIDlets. It adds exclusion parameters that prevent your MIDlets and their containing packages 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.


© 2019 Zelix Pty Ltd