Class Open Warnings
Some classes cannot be automatically and reliably obfuscated or have any names changed.
Examples are classes that use the Java Reflection API by hardcoding package, class, field or method names in a string and then
Zelix KlassMaster can automatically handle many simple Reflection API calls. However, if Zelix KlassMaster opens a class that it might not be able to automatically process reliably then
it reports the fact using the "Class Open Warnings" screen.
- test a class, field or method's name against that string
- create Class, Field, Method or Constructor instances using that string
Note that the "Class Open Warnings" screen shows:
You may get the "Class Open Warnings" screen if an opened class contains a call
to one or more of the following methods:
- RMIClassLoader.loadClass(URL, String)
- LoaderHandler.loadClass(URL, String)
- EventSetDescriptor(Class, String, Class, String)
- EventSetDescriptor(Class, String, Class, String, String, String)
- EventSetDescriptor(Class, String, Class, String, String, String, String)
It does not show the name of the class, field or method that is being accessed by its name.
Zelix KlassMaster may still be able to automatically process classes that are listed in the Open Warnings.
For example, calls to Class.getName() are often made for debugging purposes and can be ignored. Also, in certain situations,
Zelix KlassMaster can change the contents of a string containing a class name to match the new class name.
Zelix KlassMaster can do this only if:
- the name of the class that contains the Java Reflection API method call and
- the signature of the method that contains the Reflection API method call and
- the signature of the Reflection API method call that was detected.
In any case, the user must look at the way the call is used to determine if the class can be reliably automatically processed. If necessary, you should explicity exclude the name of the
class, field or method, that is being accessed by its name, from being changed. You do this by using either the Obfuscation Name Exclusions dialog or
the ZKM Script exclude statement.
- the string is stored as an unencrypted string constant within an opened class file
(as opposed, for example, to being read from a file) and
- the fully qualified old class name:
- is at least three characters long
- contains at least one alpha character
- contains the package separator character "."