PreEmptive Protection™ DashO™ can watermark your software. A watermark is data embedded unobtrusively in your application without affecting its runtime behavior. Use it to mark your software with information such as a copyright, or to make each distributed copy traceable with a unique value, such as a serial number. Read watermarks later with the PreMark command line utility.
This article explains how watermarking works. To configure it in DashO, see Configuring PreMark.
Two Ways to Watermark
| DashO user interface (PreMark page) | PreMark command line utility | |
|---|---|---|
| When it applies the watermark | While DashO processes your classes | To existing JAR files, at any time |
| What it watermarks | Each JAR file DashO outputs, all with the same watermark. Not directories or APKs. | Any JAR file. It doesn't need to be protected with DashO. |
| Best for | The same information in every copy, such as a copyright | A different watermark for each copy, such as a serial number |
| Reads watermarks | No | Yes |
Watermarking Options
These options apply to both the DashO user interface and the PreMark command line utility.
Watermark
The watermark is the string of characters DashO embeds in the output JAR file. It can contain any characters in the selected character map.
Overflow Behavior
How many characters fit in a watermark depends on:
- The size and complexity of the JAR file.
- The size of the character map.
- Whether you encrypt the watermark with a passphrase.
DashO can't tell whether a watermark fits until it generates the output JAR file. If the watermark doesn't fit, DashO does one of the following, depending on your configuration:
| Overflow behavior | Result |
|---|---|
| Halt | DashO stops the build with an error message. |
| Truncate | DashO uses as many characters as fit, and issues a warning message. |
Character Map
DashO defines five character maps, each with a different set of characters. Larger character sets need more bits per character, so they fit fewer characters in a watermark than smaller ones.
| Description (used in GUI) | Name (Used in Project File/PreMark Command Line Utility) | Included Characters | Bits/Character |
|---|---|---|---|
| 6 bit Uppercase Alphanumeric and symbols |
6bit-a
|
ABCDEFGHIJKLMNOPQRSTUVWXYZ-0123456789!@#$%^&*(){}=+_,./<>?\"
|
6 |
| 6 bit Alphanumeric |
6bit-b
|
ABCDEFGHIJKLMNOPQRSTUVWXYZ-abcdefghijklmnopqrstuvwxyz0123456789
|
6 |
| 7 bit Alphanumeric and symbols |
7bit-a
|
ABCDEFGHIJKLMNOPQRSTUVWXYZ-abcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*(){}=+_,./<>?\"|
|
7 |
| 4 bit Hexadecimal |
4bit-a
|
0123456789ABCDEF
|
4 |
| UTF-8 |
utf8
|
Any Character | 8 |
Passphrase
A passphrase encrypts and decrypts the watermark. An encrypted watermark needs more space, so it may fit fewer characters in a given JAR file.
Examples and Use Cases
| Scenario | Approach |
|---|---|
| Mark every copy with your copyright. | Configure the watermark on the PreMark page in DashO. |
| Trace each distributed copy back to a customer. | Use the PreMark command line utility to apply a different serial number to each copy. |
| Fit the longest possible watermark. | Use the smallest character map that contains your characters, such as 4 bit Hexadecimal for a hexadecimal serial number. |
| Make sure a watermark is never cut short. | Set the overflow behavior to halt the build. |
Limitations and Troubleshooting
| Limitation or issue | Details |
|---|---|
| Watermarking isn't available. | Your project uses Android Mode, or outputs to a directory or an APK. DashO watermarks only JAR files. |
| The build fails because the watermark doesn't fit. | Shorten the watermark, use a smaller character map, remove the passphrase, or set the overflow behavior to truncate. |
| The watermark is truncated. | The JAR file can't hold the full watermark. For more information, see Overflow Behavior. |
| You need a different watermark for each copy. | The DashO user interface applies the same watermark to every JAR file. Use the PreMark command line utility. |