This checklist brings together everything to review before you release an app or library protected with PreEmptive Protection™ DashO™. A misconfigured build ships code that's easier to reverse-engineer, or protection that breaks your app in production. Follow this checklist to confirm that your build is clean, your protection works as expected, and your protected product passes testing.
Review this checklist periodically, and each time you update to a new version of DashO.
Prerequisites
- A DashO build license for the build server. Only DashO build licenses may be used when protecting software for general release.
The following development practices aren't required, but this checklist assumes you have them:
- A source control system
- A build artifact repository that stores both publishable and private build artifacts
- A continuous integration (CI) environment that's separate from developer and integrator systems
1. Manage Protection Files
Store each protection file according to its category:
| File | Mode | Treat as |
Project configuration file (some-project.dox) |
All | Source file |
| Files the DashO Project Wizard generates, such as .gitignore, gradle.properties, and Ant files for .war projects | All | Source file |
Renaming Map input file (some-project-input.map) and String Encryption Map input file (some-project-input-se.map). Only when you use Incremental Obfuscation. |
Standard | Source file |
Renaming Map file (some-project.map in Standard Mode, or build/.../mapping.txt from R8 in Android Mode) |
All | Private build artifact |
String Encryption map file (some-project-se.map) |
Standard | Private build artifact |
DashO console output log. Android Mode records it automatically under build/outputs/logs. |
All | Private build artifact |
DashO reports (some-project-report.txt and some-project-mapreport.txt) |
Standard | Private build artifact |
| Unprotected app or library binaries, if you keep them | All | Private build artifact |
| All files that make up the protected app or library | All | Publishable build artifact |
| DashO automatic input management cache files (.dasho/) | Android | Temporary; don't preserve |
DashO temporary and intermediate files, including build/tmp and build/intermediates in Gradle builds |
All | Temporary; don't preserve |
- Keep source files in your source control system, and update them as your software evolves.
- Store private build artifacts in your artifact repository. You can also gather them into one archive file and store that as a private build artifact. They give you a record of the protections you applied, for auditing and future reference.
- Restrict access to private build artifacts based on your project's sensitivity.
- Give each build a distinct version, so you always know which log file and Renaming Map file belong to which binary.
2. Integrate DashO into Your CI Build
Add DashO protection as a step in your CI build, then confirm the following:
- Start with a clean build. Remove existing binaries and intermediate files before the build, so it doesn't accidentally use results from prior builds.
-
Build in release mode.
- Standard Mode: Compile without the
-goption tojavac. DashO strips debugging information by default, but this keeps it out from the start. - Android Mode: Build the release build type. This ensures DashO protects the app that receives release signing.
- Standard Mode: Compile without the
- Install the latest DashO version on the build server and development machines, or the latest version your license entitles you to. PreEmptive is always improving DashO's protection.
- Use a build license on the build server. Review the command-line output to confirm it.
- Fail the build if DashO fails. DashO must run and complete without errors. Configure the build to fail if the DashO step ends with a non-zero exit code. Android Mode projects do this automatically.
- Preserve DashO's build output in your general build log or a separate log. Consider enabling verbose output.
-
Monitor builds for DashO warnings. Address them by adjusting your configuration or modifying your code. New warnings appear when:
- A new DashO version detects conditions that may indicate previously unknown problems in existing projects.
- Your software changes without matching updates to your DashO configuration.
- Confirm signing. DashO Tamper Checks work with app signing (Android Mode and Standard Mode APK builds) and JAR signing (other Standard Mode projects). The certificate in your DashO configuration must match the one that signs the binaries your end users receive. For Android projects, see Android Signing.
- Review the Customer Feedback Program setting. When DashO runs, it may send feature usage and summary project data to PreEmptive through the Customer Feedback Program. It's on by default, and PreEmptive uses the data to guide development of new and existing features. Leave it enabled if your company's policies allow it.
3. Configure Protection for Your Project
- Enable the protections for your project type:
| Project type | What to configure |
| Android | Complete everything in Enhance Protection for Android. |
| Non-Android |
Together, Checks and obfuscation protect your code. |
- If you use String Encryption, enable Removal too. See String Encryption.
- If your project is a library, confirm that DashO preserves your API:
- Mark public API classes and methods as Entry Points.
- Build a test app that exercises every feature of your library, including String constants.
- Confirm that the test app compiles and runs with your protected library.
4. Verify Protection
Confirm that each protection you deployed works as you expect.
Extract Your Class Files
| Project type | Files to examine | Tools |
| Android |
.apk or .aar
|
unzip, Apktool, and dex2jar. Apktool and dex2jar are in the DashO tools/ folder. |
| Non-Android |
.jar or .war
|
unzip or jar
|
For Android projects, extract class files as follows:
- Use
unzipor Apktool to get theclasses.dexfiles. - Use dex2jar to convert the
classes.dexfiles to.jarfiles. - Use
unziporjarto extract the converted.jarfiles.
Examine the class files with javap, strings, and your preferred decompiler.
Verify Each Protection
| Protection | How to verify |
| Renaming | Confirm that most classes, methods, and fields have new names. Check that methods with particularly sensitive names are renamed. The names should match your Renaming Map files, but examining the binary directly is the most reliable check. |
| Control Flow | Open the class files in a decompiler. BytecodeViewer runs several decompilers at once, such as FernFlower, Procyon, and CFR. If the decompilers crash with stack traces or produce uninterpretable code, Control Flow worked. |
| String Encryption | Open the class files with javap and confirm the strings are encrypted. For particularly sensitive strings, use a tool such as grep to confirm they don't appear in any class file. This matters because the Java compiler inlines static final String constants. Enabling Removal removes static final String fields. |
| Resource Encryption | Open the .apk file with unzip or your preferred archive tool. Protected files in formats such as JPEG and MPEG shouldn't open in their normal applications, and a text editor should show seemingly random bytes. To understand why DashO encrypts some files and not others, use Preview and Preview All in the user interface to see how your patterns, such as regular expressions, match file names. |
| Removal | Confirm that fewer classes and methods exist in the protected binary. Use the report to see what DashO removed, and confirm those classes, methods, and fields aren't in the protected binary. |
| Premark (Watermarking) | Confirm that the watermark is present with the PreMark™ tool. |
Verify Checks
Run the protected app under each condition and confirm the Check triggers:
| Check | Test condition |
| Tamper | Sign the protected binary with the wrong certificate. |
| Debugging | Run the protected app in a debugger. |
| Emulator | Run the protected app in an emulator. |
| Root | Run the protected app on a rooted device or in an emulator. |
| Hook | Run the protected app on a device with a hooking framework set up. |
| Shelf Life | Run the protected app after adjusting the system time. Depending on the device, you may also need to disconnect from the network. |
5. Test the Protected Product
-
Run functional tests on the protected app before every release, even if you also test the unprotected app.
- Run performance tests on the protected app periodically, to catch performance problems your app changes introduce after you first configured protection.
- Run performance tests whenever you make significant changes to your project's configuration.
- Review the testing considerations for each protection you use. Expand each section for details.
Renaming (Functional)
Renaming is the most common and a highly effective form of obfuscation. It breaks functionality if DashO renames a symbol but not a reference to it. DashO automatically finds and renames most name-based references, such as simple reflection and manifest files. It can't statically analyze more complex references, so those must not be renamed. DashO tries to identify them and exclude the right symbols automatically, but it can't catch every scenario.
- Plan time in your project schedule for functional testing after Renaming.
- Decide how aggressively to rename. DashO uses relatively safe settings by default.
- To strengthen Renaming, specify Entry Points first. Without them, DashO treats the project like a library and doesn't rename public methods.
- Change the alphabet and length of the new names.
- If your app uses reflection in a straightforward way, consider renaming reflected classes.
Control Flow (Performance)
Control Flow obfuscation is low-risk in most cases. DashO offers three types, all on by default: Block Jumbling, Try/Catch obfuscation, and Block Splitting.
- Control Flow can degrade performance in performance-sensitive code. Test performance, exclude those areas from Control Flow, or both.
- If your Android app runs on Dalvik devices (Android KitKat and earlier), consider enabling Dalvik compatibility. Some Control Flow obfuscation may not behave correctly on Dalvik.
String Encryption (Performance)
String Encryption is on by default with relatively safe settings. It changes how your app accesses strings, which affects performance, especially in tight loops.
- Test your app's performance to find changes String Encryption causes.
- Enable Removal of unused fields, because the Java compiler inlines string constants.
- For stronger protection at the cost of performance, raise the String Encryption level. The default,
2, balances protection and speed. - For particularly sensitive strings, use Custom String Encryption to provide your own JAR for encrypting and decrypting strings. DashO applies Custom String Encryption nowhere by default, and String Encryption everywhere by default. Include both the classes and methods that define the string constants and all the classes and methods that reference them.
Resource Encryption (Functional, Performance)
Resource Encryption encrypts Android assets and raw resources. It's off by default. The DashO Gradle Plugin for Android adds the encryption step to your Gradle build, so Resource Encryption isn't available for Standard Mode APK projects.
- Enable Resource Encryption and choose which assets and raw resources to encrypt.
- Run functional tests. DashO wraps resource-access calls with decryption code, and it supports common access methods but not all of them. Testing confirms DashO wrapped every call.
- Run performance tests, especially on supported devices with slower CPUs or fewer cores. Runtime decryption takes a non-negligible amount of processing power.
- If performance suffers, exclude less sensitive assets. The impact depends on the number and size of your resources.
Checks (Functional)
DashO runs each Check wherever you configure it to inject the Check. Inject Checks at or near app startup, and at other points in the app lifecycle, especially around sensitive code.
All Checks share a common set of behaviors you configure for when the Check triggers. Plan each one:
- Custom behavior: A Check calls methods or sets fields in your app to change its behavior or report to third-party analytics platforms. This requires developers to modify or add application code.
- Pre-defined actions: DashO injects code that performs an action automatically, such as exiting the app.
For any behavior, built-in or custom, make sure the response is appropriate.
Unused Code Removal (Functional)
Removal reduces binary size and your app's attack surface. It applies only to Standard Mode projects. In Android Mode, R8 handles removal.
Removal identifies your app's entry points and statically analyzes all reachable code. Static analysis can't always find all used code, for example with dynamic reflection, so Removal can break functionality.
- Plan time in your project schedule for functional testing after Removal.
- Specify entry points. Without them, DashO treats your project like a library and doesn't remove public code elements.
- Decide how aggressively to apply Removal. More aggressive settings increase the risk of functional issues. Confirm your settings are what you want.
Merge Inputs (Functional)
Merge Inputs combines multiple inputs into a single output. It simplifies deployment and makes your app's structure somewhat harder for attackers to understand. It's off by default, so enable it to use it.
Merge Inputs doesn't apply to Android Mode and Standard Mode APK projects, which always produce a single output.
Watermarking
Watermarking embeds a custom string in your app's structure where attackers can't easily spot it. Extract the watermark to identify a particular build. Watermarking isn't available for Android Mode or Standard Mode APK projects.
6. Prepare for Release
- Confirm you've completed every step in this checklist. For any step or feature that doesn't apply, record the reason.
- Confirm the protected build passed functional testing.
- Confirm you've preserved the protection-related source files and build artifacts.
When you complete these steps, you've verified that your app or library is protected as expected.