The longEncryptionUnexclude Statement
The ZKM Script longEncryptionUnexclude statement acts only on the set of excluded fields and classes created by an longEncryptionExclude statement.
The statement removes specified fields. methods and classes from the set of excluded fields, methods and classes so that they become available once more for Long Encryption by the
ZKM Script obfuscate statement.
The longEncryptionUnexclude statement is intended to be used in conjunction with a longEncryptionExclude statement to specify
a final set of excluded fields, methods and classes that would have been difficult to achieve using a longEncryptionExclude statement alone.
Typically, in such cases, an initial longEncryptionExclude statement would set the broad exclusions and then the longEncryptionUnexclude
statement would specify the exceptions to those broad exclusions.
The remainder of this page is organized into the following sections.
The syntax of the longEncryptionUnexclude statement is the same as that of the longEncryptionExclude statement.
The longEncryptionUnexclude statement parameters may be loosely categorized into the following groups
Put informally (with mandatory components in bold), the syntax is:
<classAnnotations> <classModifiers> "<archiveQualifier>"!<packageQualifiers>.<className> <containingClause> <extendsClause> <implementsClause>;
For a class to match a longEncryptionUnexclude class unexclude parameter and therefore have all of its long constants of the class unexcluded,
all of the following must be true:
- Its annotations must match any specified annotations.
- The class's modifiers (e.g.
public final ) must match all parameter modifiers.
So if the parameters are public abstract !interface then the class must be
public , abstract and NOT an interface to be unexcluded.
- If the parameter has an archive qualifier then the class must be contained in an archive which matches that archive qualifier.
- The class's package qualifiers must match any specified package exclude parameter component. If there is no
package exclude parameter component then the class must be in the default package.
- The class's unqualified name must match the parameter's class name specifier.
- If the parameter has a containing clause then the class must contain members which match the specified class
- If the parameter has an extends clause then the class must be a subclass of the specified class
- If the parameter has an implements clause then the class must directly or indirectly implement all of the specified interfaces
longEncryptionUnexclude
pack2.Class1 and //unexclude all long constants in class pack2.Class1 from encryption
*.* and //unexclude all long constants in all classes from encryption
//unexclude all long constants in all classes contained in a JAR file with a name matching "MyJar*.jar"
"MyJar*.jar"!*.* and
//unexclude all long constants in all classes annotated which an annotation matching *.MyAnnotation0
@*.MyAnnotation0 *.*;
Put informally (with mandatory components in bold), the syntax is:
<classAnnotations> <classModifiers> "<archiveQualifier>"!<packageQualifiers>.<className> <extendsClause> <implementsClause>
<fieldAnnotations> <fieldModifiers> <fieldType> <fieldName>;
For a field to match a longEncryptionUnexclude field unexclude parameter and therefore have its intitialization long constant unexcluded,
all of the following must be true:
- The field's containing class must match any class unexclude parameter component (see Class exclude parameters).
- The field's annotations must match any specified field level annotations.
- The field's modifiers (e.g.
public volatile ) must match all parameter field modifiers.
So if the parameters are public static !transient then the field must be
public , static and NOT transient to be excluded.
- The field's type (e.g. int[] or java.lang.String) must match the parameter field type if it exists.
- The field's name must match the parameter field name specifier.
longEncryptionUnexclude
*.* public static * and //unexclude long constants that initialize
//public static fields in any class from encryption
pack2.Class1 * and //unexclude long constants that initialize any fields
//in pack2.Class1 from encryption
//unexclude long constants that initialize any fields annotated with a class matching *.MyAnnotation0.
*.* @*.MyAnnotation0 *;
Put informally (with mandatory components in bold), the syntax is:
<classAnnotations> <classModifiers> "<archiveQualifier>"!<packageQualifiers>.<className> <extendsClause> <implementsClause>
<methodAnnotations> <methodModifiers> <methodName> (<argumentTypes>) <throwsClause>;
For a long constant referenced in a method to be excluded, all of the following must be true:
- The method's containing class must match any class unexclude parameter component (see Class exclude parameters).
- The method's annotations must match any specified method level annotations.
- The method's modifiers (e.g.
public synchronized ) must match all parameter method modifiers.
So if the parameters are public static !synchronized then the method must be
public , static and NOT synchronized to be unexcluded.
- Its name must match the parameter method name specification.
The special name
<init> matches all constructors and the special name <clinit>
matches all static initializers.
- Its argument types (e.g.
int[], java.lang.String ) must match the parameter argument types if they exist.
(A single parameter argument type of "*" matches any method argument types including no arguments.)
If the parameter has no argument type then the method must take no arguments.
- Its throws clause must contain all the classes specified in the longEncryptionUnexclude parameter's throw clause.
So, if the longEncryptionUnexclude parameter's throws clause is
throws java.io.IOException then the method
must throw java.io.IOException or one of its subclasses to be unexcluded.
longEncryptionUnexclude
*.* public static *(*) and //Unexclude long constants referenced in any
//public static method in any class from encryption
pack2.Class1 *(*); //Unexclude long constants referenced in any method
//in pack2.Class1 from encryption
"longEncryptionUnexclude" unexcludeParameter ("and" unexcludeParameter)* ";"
annotationSpecifier ::= ("@" [packageUnexcludeParameter] nameSpecifier) | annotationSpecifierAndList
annotationSpecifierAndList ::= ["!"] "(" annotationSpecifierOrList ("&&" annotationSpecifierOrList)* ")"
annotationSpecifierOrList ::= annotationSpecifier ("||" annotationSpecifier)*
classUnexcludeParameter ::=
[annotationSpecifier] [["!"] "public" | "package"]
[["!"] "abstract"] [["!"] "final"] [["!"] "interface"] [["!"] "synthetic"] [["!"] "enum"] [["!"] "annotation"]
["\"" archiveQualifier "\"" "!"] [packageExcludeParameter ["."]] nameSpecifier [containingClause]
[extendsClause] [implementsClause]
containingClause ::= "containing" "{" "memberAndList" "}"
unexcludeParameter ::=
|
classUnexcludeParameter
|
|
|
|
fieldUnexcludeParameter
|
|
|
|
methodUnexcludeParameter
|
|
extendsClause ::= "extends" [annotationSpecifier] wildcardClassName
fieldUnexcludeParameter ::=
classUnexcludeParameter [annotationSpecifier] [["!"] "public" | "protected"| "package"| "private"]
[["!"] "static"] [["!"] "final"] [["!"] "transient"] [["!"] "volatile"] [["!"] "synthetic"] [["!"] "enum"]
[type] nameSpecifier
methodExcludeParameter ::=
classExcludeParameter [annotationSpecifier] [["!"] "public" | "protected"| "package"| "private"]
[["!"] "abstract"] [["!"] "static"] [["!"] "final"] [["!"] "native"] [["!"] "synchronized"] [["!"] "synthetic"] [["!"] "bridge"]
(nameSpecifier | "<init>" | "<clinit>") "(" [ "*" | (parameter ("," parameter)*)] ")"
["throws" wildcardClassName]
fullyQualifiedClassName ::= name ("." name)*
implementsClause ::= "implements" [annotationSpecifier] wildcardClassName ("," [annotationSpecifier] wildcardClassName)*
memberAndList ::= ["!"] "(" memberOrList ("&&" memberOrList)* ")"
memberOrList ::= memberSpecifier ("||" memberSpecifier)*
memberSpecifier ::= fieldExcludeParameter | methodExcludeParameter
nameAndList ::= ["!"] "(" nameOrList ("&&" nameOrList)* ")"
name ::= (["0"-"9","a"-"z","A"-"Z","$","_"])+
i.e. a Java identifer (e.g. a package, class, field or method name) with no wildcards allowed
nameAndList ::= ["!"] "(" nameOrList ("&&" nameOrList)* ")"
nameOrList ::= nameSpecifier ("||" nameSpecifier)*
nameSpecifier ::= wildcardName | nameAndList
packageUnexcludeParameter ::= packageName | packageNameAndList
packageName ::= wildcardName ("." wildcardName)* "."
NB: the final "." is part of the package name
packageNameAndList ::= ["!"] "(" packageNameOrList ("&&" packageNameOrList)* ")"
packageNameOrList ::= packageUnexcludeParameter ("||" packageUnexcludeParameter)*
parameter ::= [annotationSpecifier] ("*" | "?" | type)
type ::=
("byte" | "short" | "char" | "int" | "long" | "float" | "double"| "boolean" |
fullyQualifiedClassName) ("[]")*
wildcardClassName ::= wildcardName ("." wildcardName)*
wildcardName ::= (["*","0"-"9","a"-"z","A"-"Z","$","_"])+
i.e. a Java identifer (e.g. a package, class, field or method name) with the "*" wildcard allowed
|