1. Selective Dex encryption
Selective Dex encryption is a feature that encrypts and protects specific dex files built with Java/Kotlin code on Android apps to mitigate any degradation in performance on some apps when all dex files are encrypted.
After installing an app with Dex full encryption on the terminal, it may take longer to run the activity on the first execution. When the app is installed on the device, the dex file is optimized for the device by its system, but the system cannot optimize the dex file encrypted by applying app sealing. These not optimized dex files are decrypted at the first app execution, and the system recognizes them and starts optimization. This process cause delay at the first execution.
2. Apply Selective Dex encryption
1) Enable the Selective option before applying AppSealing
When applying AppSealing, Selective Dex encryption can be activated in the Dex encryption menu.
2) Request Sealing
If Selective Dex encryption is used for the first time, the following notification window will be displayed when sealing is requested. You can proceed to the next screen by selecting the ‘Confirm’ button.
A pop-up window is displayed for the app that attempted to upload as above. Press the ‘Confirm’ button to display a new window, which allows you to add classes or packages to be protected by the app.
3) Add class or packages to which Selective Dex encryption will be applied
If you add the class or package of the app to be uploaded as below in advance, close the pop-up window, and request sealing again, the Selective Dex encryption will be applied normally.
4) Re-request for sealing and check the results.
If you apply Selective Dex encryption and then request sealing, you can see that the changed sealing option in the sealing history panel is applied properly.
5) Manage Selective Dex encryption packages and class lists.
Pop-up windows that manage packages and classes for Dex partial encryption can be accessed by selecting the 'Manage Selection' button that each app has in the App List panel on the Android Security Service page.
3. Dex encryption vs Selective Dex encryption
You can check the performance according to the Dex encryption option by Android OS through the comparison table below.
Performance measurement criteria.
- Depending on the OS version, we measured the time it takes for Activity to run at the first run after installation on each device.
- AppSealing version 2.22.0.0 is used.
- It was measured using an app with a Dex file size of 22MB, and when applying the Selective Dex function, it was encrypted by selecting a package of 1~2MB.
- Depending on the dex size of the app and the structure of the app, actual performance may vary.
The time it takes to execute Activity for the first time after installation. |
||||
OS version |
Original app (sec) |
Dex encryption (sec) |
Selective Dex encryption (sec) |
Disabled Dex encryption (sec) |
5 |
1.99 |
9.42 |
5.64 |
3.51 |
6 |
1.79 |
8.64 |
5.29 |
3.84 |
7 |
0.79 |
5.11 |
4.31 |
3.49 |
8 |
0.84 |
6.23 |
3.62 |
4.14 |
9 |
1.80 |
8.40 |
4.52 |
3.28 |
10 |
1.22 |
5.09 |
2.76 |
2.06 |
11 |
0.43 |
2.91 |
1.80 |
1.50 |