Configure PreEmptive Protection™ DashO™ Resource Encryption from these pages in the DashO user interface: Resource Encryption - Options, Resource Encryption - Asset, and Resource Encryption - Raw, plus their include and exclude pages. Use them to turn Resource Encryption on and choose which assets and raw resources DashO encrypts.
To learn how Resource Encryption works, see Resource Encryption.
Prerequisites
- A DashO project in Android Mode. The Resource Encryption pages are only available in Android Mode.
- The Gradle integration with the DashO Gradle Plugin for Android.
How the Composite Resource View Works
When Android builds a project, it gathers resources from several locations derived from the variant name, based on Android directory priority. For example, for the menuPaidRelease variant, DashO aggregates the assets based on Android directory priority from:
src/menuPaidRelease/assetssrc/release/assetssrc/menuPaid/assetssrc/menu/assetssrc/paid/assetssrc/main/assets
The left pane of each Resource Encryption include and exclude page combines these locations into a single view for the current build variant.
This has two consequences for your rules:
- Rules use relative paths. All include and exclude rules and patterns are relative paths, because they can refer to files in different directory roots.
- Rules apply to all build variants, but previews don't. The left pane shows resources only for the current build variant, so Preview Rule and Preview All show the effects of your rules only on those resources.
Enable Resource Encryption
- Navigate to Resource Encryption.
- Check the Enable Resource Encryption option.
- Configure assets, raw resources, or both:
- Save your project and build it to apply the changes.
Encrypt Assets
- Go to Resource Encryption > Asset to open the Resource Encryption - Asset page.
- Check the Enable Asset Encryption option.
- Choose which assets to encrypt using the Resource Encryption - Asset - Include and Resource Encryption - Asset - Exclude pages. For more information, see Select Assets to Encrypt.
- Save your project and build it to apply the changes.
Select Assets to Encrypt
Use the Resource Encryption - Asset - Include and Resource Encryption - Asset - Exclude pages to select specific assets or entire directories. The left pane shows a directory tree of assets from all the directories that contribute to the current build variant.
- Go to Resource Encryption > Asset > Include or to Resource Encryption > Asset > Exclude to open the Resource Encryption - Asset - Include or Resource Encryption - Asset - Exclude page.
- Create rules for the assets or directories you want to include or exclude. Use relative paths. For more information, see Graphical Rules Editor.
- Exclude any asset your app accesses through code DashO can't wrap with decryption code. For more information, see Supported APIs and Behavior.
- (Optional) Preview your rules. The preview shows results for the current build variant only.
- Save your project and build it to apply the changes.
Encrypt Raw Resources
- Go to Resource Encryption > Raw to open the Resource Encryption - Raw page.
- Check the Enable Raw Resource Encryption option.
- Choose which raw resources to encrypt. For more information, see Select Raw Resources to Encrypt.
- Save your project and build it to apply the changes.
Select Raw Resources to Encrypt
Use the Resource Encryption - Raw - Include and Resource Encryption - Raw - Exclude pages to select specific raw resources. The left pane shows a list of raw resources from all the directories that contribute to the current build variant.
- Go to Resource Encryption > Raw > Include or Resource Encryption > Raw > Exclude to open the Resource Encryption - Raw - Include or Resource Encryption - Raw - Exclude page.
- Create rules for the raw resources you want to include or exclude. Use relative paths. For more information, see Graphical Rules Editor.
- Exclude any raw resource your app accesses through code DashO can't wrap with decryption code. For more information, see Supported APIs and Behavior.
- (Optional) Preview your rules. The preview shows results for the current build variant only.
- Save your project and build it to apply the changes.
Limitations and Troubleshooting
| Issue | Resolution |
| The Resource Encryption pages aren't visible. | They're only available in Android Mode. |
| A preview doesn't show resources from another build variant. | The preview only covers the current build variant. Change the current build variant to preview its resources. Your rules still apply to all variants. |
| A rule doesn't match the expected files. | Use relative paths. Rules can refer to files in different directory roots. |
| The app fails when reading an encrypted resource. | The call that reads it isn't wrapped. Exclude the resource. |