The security hardening process has the following requirements for your APK or AAB files. Please review these instructions before you begin.
Ensure that the onCreate method of a Provider can be executed multiple times. For example, if you initialize a singleton in the onCreate method, check whether the instance has already been initialized.
The x86 and MIPS architectures are not supported. If your application is configured for these architectures, remove them and then repackage your application for hardening.
minSdkVersion 24 and higher are not supported. You must set minSdkVersion to 23 or a lower value. When minSdkVersion is less than 23, security hardening compresses the native libraries in the APK by default. To set minSdkVersion to 23, choose one of the following methods:
Add
android:extractNativeLibs="true"to theapplicationnode property.Repackage the hardened APK or AAB, and configure compression based on your own rules.
ImportantTo harden the Assets files in your application, minSdkVersion must be 21 or higher (Android 5.0 or later).
If your project uses ARouter, use the Gradle plugin to automatically load the route table.
apply plugin: 'com.alibaba.arouter'// Configure this in the build.gradle file of your project's app module. buildscript { repositories { mavenCentral() } dependencies { classpath "com.alibaba:arouter-register:?" } }The registration plugin for ARouter automatically loads the route table by scanning DEX files. This feature is powered by AutoRegister. Automatic registration with the Gradle plugin shortens initialization time. It also prevents initialization failures that occur because security hardening blocks direct access to DEX files.
ImportantThis plugin requires API version 1.3.0 or later.
For more information, see the ARouter instructions.