Files located in the tutorial/step05/files directory:
mousegestures-1.2.jar | Mouse Gestures library jar |
test.jar | Jar with Mouse Gestures demo frame |
config.xml | Allatori configuration file |
RunAllatori.bat | Runs Allatori |
ExtractWatermark.bat | Runs Allatori's watermark extracting class |
ExtractWatermark.xml | Configuration file for extracting a watermark |
Clean.bat | Deletes generated files |
<config> <input single-jar="single.jar"> <jar in="test.jar" out="obf-test.jar"/> <jar in="mousegestures-1.2.jar" out="obf-mousegestures-1.2.jar"/> </input> <keep-names> <class template="class *.TestFrame"/> </keep-names> <property name="log-file" value="log.xml"/> <watermark key="secure-key-to-extract-watermark" value="Customer: John Smith; Date: xx.yy.zzzz"/> </config>
We have added a watermark element with the following attributes:
key - the key that is used to embed a watermark into the application using steganography techniques;
value - any string that will be embedded into application jars.
It can be copyright, customer name, company name or any other information that uniquely identifies the build.
A watermark can be used to identify owners of the software or track the origin of a pirated copy.
To extract the watermark we need another configuration file:
<config> <input> <jar in="single.jar"/> </input> <watermark key="secure-key-to-extract-watermark"/> </config>
We specified jar file that contains the watermark and the key for the extraction.
The key should match the key used for embedding.
If you specify the wrong key, then watermark wouldn't be extracted.
Run ExtractWatermark.bat to see the extracted watermark.