Smokescreen Installation 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
Installation and use of Smokescreen requires that a Java Runtime Environment (including Swing Components) is already installed on the target computer. The following examples will assume that you have Sun's JRE, or Sun's Java SDK installed on a Microsoft Windows platform.
Installation

The program that performs the installation comes as a single executable Jar file. Assuming that the setup program is 'SmokescreenSetup36_Eval.jar', it may be started by double clicking on its icon, which is the preferred way to start the program. If you are using a console window then make sure that the setup program is in your current directory. The program may be started with the command
java -jar SmokescreenSetup36_Eval.jar
The program will begin by displaying the license agreement. After you have indicated that you accept the license agreement, it will bring up the main installation window. Here you would specify the directory for the installation. The last step in the installation process is to click on the 'Install' button which will install Smokescreen on your computer. The installation will create an executable Jar file called 'Smokescreen30_Eval.jar' in the directory which was specified during installation.

To uninstall Smokescreen simply delete the executable jar and its associated files.
Launching Smokescreen

This Jar file may be started by double clicking on its icon. If you are using the command line the program may be started with the command
java -jar Smokescreen30_Eval.jar
If the 'Use Class Loader' option of Smokescreen is to be used within the gui or through directives, then external classes that are referenced by the files to be obfuscated must be made accessible through the classpath option, as in the example command below
java -classpath mylibs.jar -jar Smokescreen30_Eval.jar
When external classes are involved the easiest way to launch Smokescreen is to make the classes accessible through the classpath. The 'Use Class Loader' check box in the 'Superclass path' menu option should then be checked if using the GUI, and the 'use_class_loader_for_superclasses' directive must be included if using a directives file.
Command line options

Valid command line options that may be specified when starting Smokescreen are:
-logifle filename This option specifies the filename to be used for the log file that is generated. It may be used with or without the GUI. If this option is not used then the default file name of 'Smokescreenlog.txt' is used.
-nogui This option specifies that the GUI should not be started. It must be specified if the directives option is used.
-directives filename or directives This option specifies the source for the directives that are to be used. There are two versions of this option. If a filename is given then it is taken to be the directives file containing the directives for the obfuscation. If individual directives are to be specified then each directive must start with a '-' character.
An example for starting Smokescreen while specifying a directives file is:
java -jar Smokescreen30_Eval.jar -nogui
-directives mydirectives.txt
Where mydirectives.txt is the name of the directives file.
If the 'use_class_loader_for_superclasses' directive is used then external classes that are referenced by the files to be obfuscated must be made accessible through the classpath option, as in the example command below
java -classpath mylibs.jar -jar Smokescreen30_Eval.jar -nogui
-directives mydirectives.txt
An example of starting Smokescreen with individual directives specified in the command line is
java -jar Smokescreen30_Eval.jar -nogui -directives 
-source_directory sourcedir -destination_directory destdir
-log_changes -use_class_loader_for_superclasses -overwrite_classfiles
-classes all_non-public, remove_unused, rename_packages
-methods all_methods, remove_unused  -fields all_fields, remove_unused
-bytecode shuffle_stack_operations, add_fake_exceptions,
change_switch_statements, encrypt_strings  
Launching Smokescreen from the classpath

To launch Smokescreen from the classpath, add the installed jar file 'Smokescreen36_Eval.jar' to the classpath. Now the application can be started with a command such as
java com.leesw.Smokescreen.Smokescreen
The 'nogui' and 'directives' options can also be specified, as shown below
java com.leesw.Smokescreen.Smokescreen -nogui
-directives mydirectives.txt
Again, any external classes must be made accessible through the classpath when the 'Use Class Loader' checkbox is checked, or when the 'use_class_loader_for_superclasses' directive is used in the directives file.
Launching Smokescreen through the api

To launch Smokescreen from the api , add the installed jar file 'Smokescreen36_Eval.jar' to the classpath. The methods in the 'com.leesw.Smokescreen.Smokescreen' class that can be used to launch Smokescreen are:
public static boolean obfuscate(String logfile,String[] directivesArray)
public static boolean obfuscate(String logfile,String directiveFile)
The 'logfile' specifies the filename for the log file which is generated. If it is null then the default 'Smokescreenlog.txt' is used. The 'directivesArray' is an array of directive strings. Each string represents a complete directive. The 'directiveFile' specifies the file name for the directives file that is to be used. The boolean return value indicates the success or failure of the method call. A 'false' value indicates that an error has occured.
Settings and log files

During the course of normal operation Smokescreen will create or overwrite two files in the user directory. The two files are 'SmokescreenLog.txt' which keeps a log of information for each Smokescreen session, and 'SmokescreenSettings' which maintains the current settings for the program.