Zelix KlassMaster - Documentation

The classInitializationOrder Statement

The ZKM Script classInitializationOrder statement allows you to specify pairs of classes where you guarantee that the first class in the pair will definitely always be initialized at runtime before the second class under all circumstances. This information may then be used by Zelix KlassMaster™ to improve its obfuscation. For example, under some circumstances, it may be used by Zelix KlassMaster™'s Method Parameter Changes functionality to make it less vulnerable to being reversed.

Note that the classInitializationOrder statement does not determine the runtime class initialization order. Rather it is a way for you to tell Zelix KlassMaster™ what you definitely know about the runtime class initialization order where that order could not otherwise be discerned.

The classInitializationOrder statement should be used very carefully. Runtime class initialization order is not always easy to discern. If you specify a class initialization order which is incorrect under certain runtime circumstances then your obfuscated application may fail when those circumstances occur.

Successive classInitializationOrder statements have a cumulative effect. Once a specification has been set its effect can be removed entirely by a following resetClassInitializationOrder statement.

The remainder of this page is organized into the following sections.

Examples and Explanation

You specify class pairs as fully qualified class names separated by the ">" character. The first class name in a pair indicates the class that will always be initialized first. Wildcards are not supported.
classInitializationOrder mypackage.Class0 > mypackage.Class1 and //You guarantee Class0 always initialized before Class1
                         mypackage.ClassA > mypackage.ClassB     //You guarantee ClassA always initialized before ClassB
                         ;

Syntax

"classInitializationOrder" classPair ("and" classPair)* ";"

classPair ::= fullyQualifiedClassName ">" fullyQualifiedClassName

fullyQualifiedClassName ::= name ("." name)*

name ::= (["0"-"9","a"-"z","A"-"Z","$","_"])+
   i.e. a Java identifer (e.g. a package qualifier or class name) with no wildcards allowed
 
ZKM Script resetGroupings statement The ZKM Script Language ZKM Script resetClassInitializationOrder statement
Zelix KlassMaster - Java Obfuscator