Smokescreen User Guide

Smokescreen Home
Revision history
User Guide
Installation Guide
Obfuscation notes
Directives file
Incremental obfuscation
Build tool integration
License and Download
Purchase
Faqs/Known issues
Obfuscation may be carried out from a source directory to a destination directory, a source zip file to a destination zip file, or a source jar file to a destination jar file. All the Class files that require obfuscation are assumed to be in the source archive or directory. The obfuscated versions of these class files will be created in the destination archive or directory. The locations of all superclasses not already present in the source directory are assumed to be specified by the superclass path.
In order to obfuscate class files in packages, Smokescreen works with subdirectories as well so that all class files that are found in subdirectories of the main source directory will also be obfuscated. The directory structure of the source directory will be maintained in the destination directory. Subdirectories that are needed for saving the obfuscated class files will be created in the destination directory, if they don't already exist. The names of the subdirectories from the source directory and therefore the package names, will be preserved.
Smokescreen may be used with or without a GUI. The GUI features an easy to use interface which allows for the selection of various obfuscation options. When the program is started with a GUI it will present the user with a main window, that has a number of pull down menus, buttons and fields. The user can then select the obfuscation parameters, the source and destination directories and click on the Obfuscate button to start obfuscation. When run from the command line the obfuscation parameters are specified in a directives file. A description of the GUI interface is given below.
The menu bar

The menu bar consists of the following menus:

The 'File' menu
This menu is used for general program settings.



Log changes: When checked this will record all name changes in the log file.
Use Directives File: When checked, the obfuscation settings will be read in from the directives file rather than from the GUI.
Overwrite Class Files: When checked, allows the output class files created by Smokescreen in the destination directory to overwrite any existing files having the same name.
Superclass path: Brings up a panel where the user can specify the paths to superclass files not already included in the source directory.



All the paths may be entered on the same line, separated by semicolons, or each path may start a new line for better readability. Each path may specify a directory or a specific Jar file. When searching a directory for superclasses the obfuscator will check all the class files and Jar files contained in that directory, when searching a Jar file for superclasses all entries within the Jar file will be scanned for superclasses.
This panel also includes a 'Use Class Loader' checkbox to indicate that superclasses are to be found in the search path for loading classes. This means that the superclasses are already accessible through the classpath (which is the preferred method). If this checkbox is checked the path entries made in the panel will be ignored.
Quit: Allows the user to exit the program.

The 'Class obfuscation' menu
This menu is used to control class name obfuscation.



No Obfuscation: Turns off class name obfuscation.
All non-public: Allows class name obfuscation for non-public classes.
All classes: Allows class name obfuscation for all classes.
Remove unused: Allows unused classes to be considered for removal.
Rename packages: Allows renaming of packages.

The 'Method obfuscation' menu
This menu is used to control method name obfuscation, and method removal.



No obfuscation:Turns off method name obfuscation.
All private: Allows method name obfuscation for private methods.
All non-protected/non-private: Allows method name obfuscation for methods that are not protected and not public.
All non-public: Allows method name obfuscation for non-public methods.
All methods: Allows method name obfuscation for all methods.
Remove unused: Allows unused methods to be considered for removal.

The 'Field obfuscation' menu
This menu is used to control field name obfuscation, and field removal.



No obfuscation: Turns off field name obfuscation.
All private: Allows field name obfuscation for private fields.
All non-protected/non-private: Allows field name obfuscation for fields that are not protected and not public.
All non-public: Allows field name obfuscation for non-public fields.
All fields: Allows method name obfuscation for all fields.
Remove unused: Allows unused fields to be considered for removal.

The 'Bytecode' menu
This menu is used to control bytecode obfuscation.



Shuffle stack operations: Changes the order of some stack instructions.
Add fake exceptions: Introduces fake exception blocks that overlap with existing control blocks.
Change switch statements: Changes the control flow into switch statement blocks, bypassing the switch itself.
Encrypt strings: Changes string constants so that they are no longer present in their original form in the class file.
The fields and buttons

The Path fields
These fields, labelled 'Source' and 'Destination' and are used to specify the paths to the source and destination for obfuscation. The source and destination must be of the same type. They may be directories, Zip files (ending in ".zip") or Jar files (ending in ".jar"). The 'Directives File' field specifies the path to the directives file. The paths may be entered by typing text into the fields or by using the browse button beside each field.

The 'Obfuscate' and 'Cancel' buttons
These two buttons are used respectively to start the obfuscation process or cancel it while it is in progress.
The jar manifest

If the source is a Jar file that contains a manifest, then the manifest is expected to contain a manifest version attribute. The main class attribute in the manifest will be renamed so that an executable source Jar file can be obfuscated to an executable destination Jar file.
Return code

If Smokescreen was started from the command line, it will provide a return-code on exit to indicate if an error occured during obfuscation. This may be used when integrating Smokescreen into a larger build process.