|
|
|
When Smokescreen performs an obfuscation it creates a record of the name transformations and removals in the 'Smokescreenlog.txt' file. This obfuscation log maps the old symbolic names to new ones. This log file can be used as an input change record file for future obfuscations, where it is necessary to perform renamings that are consistent with the previous obfuscation. This is useful if only some of the obfuscated classes are to be distributed as a patch (for previously released class files), in which case the renamings need to be consistent with the previously obfuscated classes. Only the mapping from the old to new names in the change record file is used by Smokescreen. All other obfuscation settings must be specified in the directives file. When using a change record file, all classes should be included for obfuscation as usual, even if only some of them are to be distributed.
Note that Smokescreen overwrites the log file each time it is launched. Therefore if a log file needs to be saved and used as a change record in future obfuscations then it should be renamed and saved separately.
|
|
|
|
Generating a valid Change Record file
|
|
|
In order for a log file to be used as a valid change record file, it should only contain one obfuscation log for an obfuscation that was completed successfully.
When using Smokescreen with the GUI, only one obfuscation should be done without errors before exiting the application. This is to ensure that there is only one obfuscation log in the log file that is created, since multiple obfuscations can be performed using the GUI (by clicking on the 'Obfuscate' button more than once) in one Smokescreen session.
If Smokescreen is being launched from the command line then it will only create a single obfuscation log in the log file for that session. However this log should be free of any errors.
Once a change record file has been renamed and saved, it should be tested for validity by using it to obfuscate the class files.
|
|
|
|
|
Using a Change Record file
|
|
|
If a Change Record file is to be used for obfuscation, it has to be specified in the directives file with the 'use_change_record' directive. This means that a directives file must be used when doing incremental obfuscation. The following example directive indicates that a change record file must be used and specifies its location:
* use_change_record c:\changelog.txt
|
|
|
When a change record file is used as an input for obfuscation, the renaming of classes, methods and fields will be done such that it is consistent with the change record. Priority will be given to the original-new name pairs found in the change record file. Any symbolic names that are not specified in the change record file will be renamed by Smokescreen as per usual. The new log file should be renamed and saved if any future obfuscations requiring the same name mapping are expected to be performed.
Since the renaming of most of the symbolic names is locked in when using a change record file, this can cause renaming conflicts when modified class files are obfuscated. Conflicts can arise due to the names used for new classes, methods or fields and due to changes made in the inheritance relationships of methods or fields. If Smokescreen reports a renaming conflict, then it may be necessary to change some of the new symbolic names that are being used, or to examine the inheritance relationships that have been modified due to changes in the code.
|
|
|
|
|
|
|