Log File Contents - RetroGuard Documentation
A log file is written by RetroGuard during obfuscation. An explanation of the
various sections which can occur in this file is given below.
Header:
The log file header lists the current version of RetroGuard, the data and time
of obfuscation, and lists the names used for the input jar file, the output
jar file and the script file.
Pass one phase:
During the first pass over the Jar file to be obfuscated, each class is
analysed and any use of methods which reference identifiers by a 'String' is
identified. After this pass, a list of these 'identifier-as-String' method
calls (if any are found) is written to the log file. The problems that can be
associated with these methods, and the solution, are described in the
following section. The memory usage and current heap size are also written to
the log file at this stage.
Renaming phase:
All identifiers in the analyzed Java classes which are to be obfuscated are
then renamed. Some identifiers cannot be changed, for one of the following
reasons:
- The identifier is listed for preservation in the RetroGuard script file.
- Due to inheritance constraints, some identifiers cannot be modified. For
example, if a class implements the interface 'java.util.Enumeration', the
methods inherited from that interface ('hasMoreElements' and 'nextElement')
cannot be changed.
- Synthetic methods and fields, which are generated automatically by Java
compilers as a way of implementing the inner class features, are
not obfuscated. Since these names are already short, meaningless,
machine-generated strings this is no disadvantage.
After this renaming three tables are written to the log file:
- A summary of the use of remapped identifiers.
- A listing of identifiers which were explicitly preserved from obfuscation
by entries in the script file.
- A listing of obfuscated identifiers and identifiers which were left
unchanged due to inheritance constraints.
Pass two phase:
A second pass is made over the input Jar file, during which debugging
information is removed from each class and identifiers are replaced by their
obfuscated version. The output Jar file is generated to contain the obfuscated
classes, and a fresh manifest file is created for this Jar. Unless an error
occurs during this pass, no output is sent to the log file.
|