To protect application code security and your core assets, HarmonyOS provides an end-to-end mechanism to protect the kernel-level application code throughout its lifecycle based on system security.

You can submit an application release request to AppGallery Connect (AGC) and choose to encrypt the uploaded application package.
Then the application code will be encrypted by AGC after the release request is approved. When the application is installed on a device, the installation file is still encrypted after being stored on the device, which effectively protects the application. When the application is started, it is decrypted as required.
The AES algorithm is used to encrypt application code. Once decrypted, the plaintext of the application file exists only in the system memory but not on the device. This end-to-end encryption effectively improves application security.
The system-level application encryption stands out with the following features:
The impact of encryption on application performance is correlated with the size of the encrypted code file. The larger the .abc file of the application, the longer the cold start delay of the application.
The application code files including .abc files are encrypted. Unencrypted code file can be decompiled. After encryption, the security of the code files is greatly enhanced, increasing the difficulty in reverse engineering.
The application package does not include the encryption key. Therefore, even if the application package is obtained, the attacker can only access the encrypted code.
The application encryption feature allows applications to be encrypted in the release process and decrypted on demand at runtime. It enhances application security while minimizing your adaptation work, ensuring a seamless and secure user experience.
The following outlines how the application encryption feature is utilized throughout the application lifecycle:
For details, see Selecting the Package to Be Released.
A1: The application encryption feature can effectively increase the difficulty in reverse engineering of application code. However, defending against reverse engineering is a continuous attack-defense confrontation process. Further security hardening measures, such as code obfuscation and third-party security hardening features, are still necessary for higher levels of code protection.
A2: You can use code obfuscation and third-party security hardening measures. For details, see Protecting Application Code.
A3: An encrypted application may slightly increase performance overheads during startup and runtime. Compared with an unencrypted application, an encrypted application is larger in size, and may slightly increase the download and installation time.