Android
Implementations and Integrations
DexProtector Gradle Plugin
The DexProtector Gradle plugin is included in every distribution package, and can be used to protect APKs, AABs, and AARs.
The steps are straightforward for implementing DexProtector into your build:
Set the path to DexProtector in your buildscript.repositories
(main build.gradle
of your project), for example:
flatDir { dirs '/Users/developer/DexProtector' }
Add the following dependencies:
buildscript {
dependencies {
classpath ':dexprotector-gradle-plugin:'
classpath ':dexprotector:'
}
}
And apply the DexProtector Gradle plugin in your build.gradle file, as the line immediately after apply plugin: 'com.android.application'
or apply plugin: 'com.android.library'
:
apply plugin: 'dexprotector'
It is necessary to specify the relevant DexProtector configuration file within the buildType, as follows:
ext.set("dexprotector.configFile", "${projectDir}/dexprotector.xml")
To specify a configuration file for a particular product flavor, the same principle applies:
buildTypes {
release {
..
productFlavors.flavor1.ext.set(“dexprotector.configFile”, “${projectDir}/dexprotector-flavor1.xml”) }
You can therefore manage your DexProtector configuration files for respective build variants, using flavor dimensions, product flavors, and build types, for example as follows:
flavorDimensions "release", "debug"
productFlavors {
releaseA {
dimension "release"
applicationIdSuffix ".releaseA"
}
releaseB {
dimension "release"
applicationIdSuffix ".releaseB"
}
debugA {
dimension "debug"
applicationId "com.dexprotector.debugA"
}
debugB {
dimension "debug"
applicationId "com.dexprotector.debugB"
}
}
buildTypes {
release {
productFlavors.releaseA.ext.set("dexprotector.configFile", "${projectDir}/dexprotector-releaseA.xml")
productFlavors.releaseB.ext.set("dexprotector.configFile", "${projectDir}/dexprotector-releaseB.xml")
}
...
DexProtecting Hybrid and Cross-Platform Applications (React Native, Ionic, NativeScript, Cordova, Xamarin, Flutter)
JavaScript and HTML-based Hybrid and Cross-Platform Apps
It is straightforward to DexProtect a hybrid or cross-platform app developed using frameworks such as React Native, Ionic, NativeScript, and Cordova.
For code hardening purposes, it is enough to target the JS and HTML files through Resource Encryption. That means setting a filter such as the following:
' <resourceEncryption mode="all">
<assets mode="on">
<filters>
<filter>**.html</filter>
<filter>**.js</filter>
</filters>
</assets>
</resourceEncryption>
Xamarin
Every feature of DexProtector Enterprise is available for Xamarin-based Android apps, including:
- Code hardening and resource hardening through obfuscation and encryption of classes, methods, and strings, to prevent static analysis and reverse engineering
- Runtime Application Self-Protection (RASP), with constant checks on the operating environment and communications network, to prevent dynamic analysis and Man-in-the-Middle attacks
- Integrity checks, to prevent code and resource tampering and cloning
- DexProtector's dedicated CryptoModule, isolating cryptographic data and processing to prevent interception of cryptographic keys and calculations
Xamarin Android applications contain Dalvik bytecode, resources, and native libraries. Within the resources there are Mono Runtime native libraries and Xamarin Assemblies. Xamarin Assemblies consist of Xamarin Runtime and Xamarin Program Code.
DexProtector's fundamental defenses against static analysis work on Dalvik bytecode within Xamarin-developed Android apps, which may contain Android Wrapper Classes (Activity, ContentProvider, Receiver, Service), Xamarin/Mono support classes and third-party library classes. So all of the following apply just as they would for an app developed in Java or Kotlin:
- String Encryption
- Class Encryption
- Hide Access
- Native code obfuscation (excluding Mono Runtime)
- Native code encryption
- Native code anti-debugging
- Encryption of resource and asset files in assets/, res/ and root/
- Resource name obfuscation (resources.arsc)
- Obfuscation of AndroidManifest.xml: Applications/ActivityNames/ContentProviders/Receivers class names mangling
And DexProtector is also capable of interacting with Mono Runtime
, thereby allowing you to encrypt Xamarin assemblies. You can use the <xamarinAssemblies/>
element in the DexProtector configuration file to enable the encryption of assemblies. For example:
<xamarinAssemblies dir="custom assemblies location">
</xamarinAssemblies>
For all other protection mechanisms, including the Runtime Checks, no special configuration is needed; just follow the steps described elsewhere in the documentation.
Flutter
DexProtector supports apps developed with Flutter in just the same way as native apps; there is no difference in the configuration requirements.
-
1. What is DexProtector?
Introduction to DexProtector > 1. What is DexProtector? -
2. The DexProtector process
Introduction to DexProtector > 2. The DexProtector process -
3. DexProtector Studio
Introduction to DexProtector > 3. DexProtector Studio -
4. Alice - Licel’s Attack Telemetry and Threat Intelligence System
Introduction to DexProtector > 4. Alice - Licel’s Attack Telemetry and Threat Intelligence System -
Overview
DexProtector for Android > Overview -
1. Download
Getting started > 1. Download -
2. Activate
Getting started > 2. Activate -
Activate via CLI (online)
Getting started > Activate via CLI (online) -
Activate via CLI (offline)
Getting started > Activate via CLI (offline) -
Activate via DexProtector Studio (online)
Getting started > Activate via DexProtector Studio (online) -
Activate via DexProtector Studio (offline)
Getting started > Activate via DexProtector Studio (offline) -
3. After activation
Getting started > 3. After activation -
Introduction to configuring DexProtector
Configuring DexProtector > Introduction to configuring DexProtector -
Configuration file overview
Configuring DexProtector > Configuration file overview -
Filters: A guide to targeting code and resources
Configuring DexProtector > Filters: A guide to targeting code and resources -
Inclusion
Configuring DexProtector > Inclusion -
Protecting every class in a specified package
Configuring DexProtector > Protecting every class in a specified package -
Protecting a single class
Configuring DexProtector > Protecting a single class -
Exclusion
Configuring DexProtector > Exclusion -
Excluding every class in a specified package from protection
Configuring DexProtector > Excluding every class in a specified package from protection -
Excluding a single class from protection
Configuring DexProtector > Excluding a single class from protection -
Mixed filters: Combining inclusion and exclusion
Configuring DexProtector > Mixed filters: Combining inclusion and exclusion -
Detailed filter syntax information
Configuring DexProtector > Detailed filter syntax information -
Additional notes on filters: Resource Encryption and Annotation Encryption
Configuring DexProtector > Additional notes on filters: Resource Encryption and Annotation Encryption -
Configuring DexProtector for applications (APK & AAB)
Configuring DexProtector > Configuring DexProtector for applications (APK & AAB) -
Example configuration for applications (APK & AAB)
Configuring DexProtector > Example configuration for applications (APK & AAB) -
Configuring DexProtector for libraries and SDKs (AAR)
Configuring DexProtector > Configuring DexProtector for libraries and SDKs (AAR) -
Initialization
Configuring DexProtector > Initialization -
Kotlin
Configuring DexProtector > Kotlin -
Protection of Public APIs
Configuring DexProtector > Protection of Public APIs -
Example configuration for libraries & SDKs (AAR)
Configuring DexProtector > Example configuration for libraries & SDKs (AAR) -
App Signing
Configuring DexProtector > App Signing -
Cloud Signing (Google Play App Signing; Amazon Appstore)
Configuring DexProtector > Cloud Signing (Google Play App Signing; Amazon Appstore) -
Google Play App Signing
Configuring DexProtector > Google Play App Signing -
Amazon Appstore Signing
Configuring DexProtector > Amazon Appstore Signing -
Signing for System Apps and Pre-Installed Apps
Configuring DexProtector > Signing for System Apps and Pre-Installed Apps -
Local Signing for APKs
Configuring DexProtector > Local Signing for APKs -
DexProtector Gradle Plugin
Implementations and Integrations > DexProtector Gradle Plugin -
DexProtecting Hybrid and Cross-Platform Applications (React Native, Ionic, NativeScript, Cordova, Xamarin, Flutter)
Implementations and Integrations > DexProtecting Hybrid and Cross-Platform Applications (React Native, Ionic, NativeScript, Cordova, Xamarin, Flutter) -
JavaScript and HTML-based Hybrid and Cross-Platform Apps
Implementations and Integrations > JavaScript and HTML-based Hybrid and Cross-Platform Apps -
Xamarin
Implementations and Integrations > Xamarin -
Flutter
Implementations and Integrations > Flutter -
Overview
DexProtector Studio > Overview -
Using DexProtector Studio: DexProtector JAR and License File
DexProtector Studio > Using DexProtector Studio: DexProtector JAR and License File -
Managing DexProtector JAR and License File
DexProtector Studio > Managing DexProtector JAR and License File -
Activating your license via Studio (online)
DexProtector Studio > Activating your license via Studio (online) -
Activating your license via Studio (offline)
DexProtector Studio > Activating your license via Studio (offline) -
Protecting your APK, AAB, or AAR with DexProtector Studio
DexProtector Studio > Protecting your APK, AAB, or AAR with DexProtector Studio -
Protection Recommendations
DexProtector Studio > Protection Recommendations -
Load Package for Protection
DexProtector Studio > Load Package for Protection -
Manage Protection Settings
DexProtector Studio > Manage Protection Settings -
Run Protection and View Protection Results
DexProtector Studio > Run Protection and View Protection Results -
Final Checklist
Completing the DexProtector Process > Final Checklist -
Run DexProtector via the CLI
Completing the DexProtector Process > Run DexProtector via the CLI -
Run DexProtector via DexProtector Studio
Completing the DexProtector Process > Run DexProtector via DexProtector Studio -
Using Alice with DexProtector
Alice - Threat Reporting and Telemetry > Using Alice with DexProtector -
General FAQs - DexProtector for Android
FAQs > General FAQs - DexProtector for Android -
FAQs on Installation, Activation, Configuration, and Distribution
FAQs > FAQs on Installation, Activation, Configuration, and Distribution
Link copied!