Applications and Applets - RetroGuard Documentation
Applications
To preserve Java applications (the class name and the main method) from
obfuscation so that they can still be accessed and run after obfuscation,
add a script line:
.option Application
This is exactly equivalent to the script line:
.method **/main ([Ljava/lang/String;)V and_class
We can interprete this line as follows:
.method - preserve all methods that
**/main - are named 'main' in all classes in any package
('**' is the package-independent wildcard)
([Ljava/lang/String;)V - and that have the specified method
signature (in this case, 'takes an array of Strings and returns void')
and_class - and also preserve each such method's class name.
Applets
To preserve Java applets from obfuscation, add a script line:
.option Applet
This is exactly equivalent to the script line:
.class ** extends java/applet/Applet
This is interpreted as follows:
.class - preserve all class names that are
** - in any package
extends java/applet/Applet - if the class extends Applet.
The various methods that need to be called in your applet, such as 'init'
'start' and 'stop', are preserved automatically. These methods override
methods in the system class 'java.applet.Applet' and so cannot be obfuscated.
|