The PreEmptive Protection™ DashO™ Project Wizard creates a project that protects Java web applications and services packaged as .war files. The wizard examines your .war file, detects its classes and dependencies, and generates an Ant script that extracts the file, obfuscates it, and reassembles it for you.
Create a Web Project with the Project Wizard
- Go to File > Project Wizard.
- Select the Web application type.
- Enter the location and name of your
.warfile. - Enter the location of the JDK that DashO uses to resolve Java runtime classes. DashO examines the .war file for classes and jars that are included. These items include the special locations in WEB-INF that are used by the web container as well as jars that may be referenced by JNLP files.
- Add any shared classes your web container provides to the list of support JARs, such as the log4j logging service.
- Add Java modules (
.jmod) to the list of support libraries. -
Select the Generate Entry Point rules based on Hibernate annotations option to set the following rules:
Applies To Rule Classes annotated with javax.persistence.EntityDashO doesn't rename or remove the class. Members of classes annotated with javax.persistence.Entityorjavax.persistence.EmbeddedDashO doesn't remove:
- Fields
- Getters (0-parameter methods with names that begin with
getoris) - Setters (1-parameter methods with names that begin with
set)
- Review the suggested annotation-based entry point rules. Enable a rule only if you're familiar with the annotation and want to preserve the code elements it decorates.
-
Choose the directory where you want to save the wizard's output. The wizard creates a project file,
obfuscate.xml, andobfuscate.properties.
Obfuscate Your WAR File
- (Optional) Edit
obfuscate.propertiesto change location defaults. -
Run obfuscate.xml with Ant.You can do this from the command line:
ant -f obfuscate.xml
Or call it from another Ant file:
<ant antfile="obfuscate.xml"/>
- Find your protected file in the output location. Its name matches your original
.warfile with_dashoedappended. - Deploy and test the protected
.warfile.
What the Ant Script Does
When you run obfuscate.xml, it performs the following tasks in order:
- Extracts the
.warfile into a directory. The default directory is.unwar. - Runs the wizard-generated project file against the contents of the
.unwardirectory, and stores the results temporarily in the.obfusdirectory. - Reassembles the
.warfile with the obfuscated code in a new file with_dashoedappended to the name.
Limitations and Troubleshooting
| Issue | Resolution |
| The Ant script fails to run. | Install DashO's Ant tasks. See DashO's Ant Task documentation. |
| Your application depends on classes the web container shares among web applications. | The wizard doesn't detect these automatically. Add them to the list of support JARs. |
| You replaced an existing project and need the previous settings. | DashO creates a backup of the old project when you replace it. |