|
|
|
Revision 3.3 and later of Smokescreen will provide an exit code when the application terminates after being launched from the command line. This allows it to be integrated into a build process using a tool such as ANT. Revision 3.6 and later provide two api methods to start the obfuscation process.
|
|
|
|
Using Smokescreen with ANT
|
|
|
Smokescreen may be launched from ANT by using the 'java' task just as it would normally be used from a command line. Note that a directives file needs to be specified when launching from the command line. This file can either be present in the file system already, or it can be created on the fly just before the 'java' task is invoked. In the case of the latter, all the directives can be specified inside the build file.
|
|
|
Building with the directives file already available
The following sample build file shows an example of an obfuscation task where the directives file which is specified, is already available on the system. It is assumed that the 'basedir' attribute for the task points to the directory where the evaluation edition of Smokescreen rev 3.3 is installed. The directives file is assumed to be present in this same directory.
|
|
|
|
|
|
Building with the directives file created on the fly
The following sample build file shows an example of an obfuscation task where the directives file is created on the fly, and then used to launch Smokescreen. It is assumed that the 'basedir' attribute for the task points to the directory where the evaluation edition of Smokescreen rev 3.3 is installed. The directives file will be created in this same directory, and can be referred to if Smokescreen reports an error because of one of the directives.
|
|
|
|
|
|
|
|
Building with the api
|
|
|
For rev 3.6 and later there are two methods in the 'com.leesw.Smokescreen.Smokescreen' class named 'obfuscate' which may be called from a java application to start the obfuscation process. The first one is:
public static boolean obfuscate(String logfile,String directiveFile)
A code fragment to call this method is given below.
|
|
|
|
The second api method to perform an obfuscation is:
public static boolean obfuscate(String logfile,String[] directivesArray)
A code fragment to call this method is given below.
|
|
|
|
|
|
|
|
|
|
|
|