PreEmptive Protection - DashO v8.2 User Guide

Using the Command Line Interface

This section describes using PreEmptive Protection - DashO as a command line program. The command line interface is designed to allow you to:

  • Integrate DashO into your build process if you can’t use the provided Ant and Gradle integrations.

  • Add a watermark to a jar.

PreEmptive Protection - DashO Command Line

Command line options must begin with the '-' character.

dashocmd [options] projectfile

The following is a summary of the command line options:

Options Description
projectfile DashO project file
-e, --printStackTraces Print stack traces for exceptions
-f, --force Force execution
--file-version Show project file version and exit
-h, --help Display command line help
-p, --properties <filename> Load system properties from a file
-q, --quiet Print minimal amount of messages
-v, --verbose Print verbose messages
--version Show version and exit

The projectfile is a configuration file that is required for every run of DashO. Notice you do not enter entry point methods on the command line. This information must be found in the configuration file.

The –e, --printStackTraces option will print stack traces for exceptions.

The –f, --force option forces execution even if DashO finds Class.forName() methods (discussed in detail in Advanced Topics). The use of the force global option is preferred over the command line use of this option.

The --file-version option shows the project file (.dox) version used by DashO and exits.

The –h, --help option displays command line help on demand.

The -p, --properties option tells DashO to load system properties from the provided file.

The –q, --quiet option tells DashO to run completely and print a minimal amount of messages. This is suitable for inclusion into application build sequences. This option overrides verbose mode.

The –v, --verbose option induces DashO to provide printed verbose messages about its progress during execution.

The –-version option shows the version and license information of DashO and exits.

Building Projects from the Command Line

DashO can execute a project file from the command line. To do this, use:

dashocmd [options] projectfile

The project file can be either an Advanced or Quick Jar project.

Multiple warnings may be emitted during the build, but the process will stop immediately with an exit code of 1 if an error is encountered.

Watermarking PreMark Tool

You can use the PreMark tool to add a watermark or to read the watermark. It is a command line tool to watermark a jar without needing to start DashO. Using this tool you can PreMark any jar file even if it has not been obfuscated by DashO.

To run the command line PreMark tool, use the following command:

premark [options] inputfile

The command line options must begin with the '-' character. The following is a summary of those options.

Options Description
-c, --charmap <charmap> Character map name (6bit-a, 6bit-b, 7bit-a, 4bit-a, utf8)
-e, --printStackTraces Print stack traces for exceptions
-h, --help Display command line help
-m, --mark <watermark> Add watermark
-o, --output <file> Output file
-p, --passphrase <passphrase> Passphrase to encrypt/decrypt watermark string
-q, --quiet Print minimal amount of messages
-r, --read Read watermark
-t, --truncate Truncate watermark if too big (default: fail)
-v, --verbose Print verbose messages
--version Show version and exit

The -c, --charmap <charmap> option tells the PreMark tool which character map encoding should be used to embed the watermark string in the given input jar.

The –e, --printStackTraces option will print stack traces for exceptions.

The –h, --help option displays command line help on demand.

The –m, --mark <watermark> option watermarks the given input jar with the specified watermark string.

The –o, --output <file> option allows you to specify the path to the watermarked output jar.

The –p, --passphrase <passphrase> option sets the passphrase. The PreMark tool uses this passphrase to encrypt or decrypt the watermark string.

The –q,--quiet option tells DashO to run completely and print a minimal amount of messages. This is suitable for inclusion into application build sequences. This option overrides verbose mode.

The –r, --read option reads the watermark string from the specified input file.

The –t, --truncate option truncates the watermark string if it is too long. If this option is not specified, the default is to halt without watermarking the file.

The –v, --verbose option induces DashO to provide printed verbose messages about its progress during execution.

The --version option causes the PreMark tool to provide the version of the application and then to exit that application.

Note:

The value of charmap can be 6bit-a, 6bit-b, 7bit-a, 4bit-a, or utf8.

Ant integration

DashO can integrate directly with the Ant build system via a custom Ant task.

Gradle Integration

DashO can integrate directly with the Gradle build system via a Gradle plugin.

PreEmptive Protection - DashO Version 8.2.0. Copyright © 2017 PreEmptive Solutions, LLC