JDK5 Features - RetroGuard Documentation
Annotations (JDK5/1.5 Metadata)Java now supports class, method, and field metadata; this is described in the Annotations guide at Sun, and in JSR 175 at the Java Community Process. At the classfile level, these annotations are encoded as attributes named
To preserve only the run-time accessible annotations, add a script line:
.option RuntimeAnnotations
This is exactly equivalent to the script lines:
.attribute RuntimeVisibleAnnotations
To preserve all annotations, add a script line:
.option Annotations
This is exactly equivalent to the script lines:
.attribute RuntimeInvisibleAnnotations
Enumerations (JDK5/1.5 'enum')Java now supports typesafe enums; this is described in the Enums guide at Sun, and as part of JSR 201 at the Java Community Process. Enumerations will work normally after obfuscation with no special effort. However, if you intend to access the enumerations later from outside the obfuscated jar, use the script line:
.option Enumeration
This is exactly equivalent to the script line:
.class ** public extends java/lang/Enum
To preserve a particular enum, use the script line:
.class com/widgetco/MyEnum public extends java/lang/Enum
RetroGuard
always preserves the auto-generated static methods Generics (JDK5/1.5)Java now supports parametric polymorphism, or generic types; this is described in the Generics guide at Sun, in JSR 14 at the Java Community Process, and in the article Using and Programming Generics. Generics will work normally after obfuscation with no special effort.
However, if you intend to compile other classes against your obfuscated code
or use reflection to determine generic types, the attribute
The classfile attribute
.attribute Signature
[RetroGuard-v2.2.x only]
or the equivalent option:
.option Generic
When debugging information has been generated for a class using the
.attribute LocalVariableTypeTable
The type signatures within the EnclosingMethod (JDK5/1.5)To provide additional information about inner classes, the attribute
.attribute EnclosingMethod
|
|