For security purposes, mandatory code signature has been deployed on HarmonyOS NEXT. All applications to be released to AppGallery or debugged by developers must have their code files signed with valid certificates. A .so file directly pushed to the device will be intercepted by the system due to signature verification failures. Consequently, it fails to be loaded.
Be familiar with the following requirements regarding the deployment of .so files:
- In the release phase, all .so files of a third-party application must be packed in a HAP file and released with the application for forcible code signing. The .so files downloaded through hot updates will be intercepted by the system due to lack of valid signatures.
- In the debugging phase, a HAP file and its .so files must be signed using the developer certificate during development, and the bundle manager module enables code signing during its installation. DevEco Studio provides hot reload to quickly push code files (including .so files) to the device for installation and signature enabling. Specifically, DevEco Studio packs new or modified code files in the project directory into an HQF package. It uses the developer certificate to sign the package, push the package to the device through HDC, and trigger HQF installation and signature enabling through the bundle manager module. In this way, the code file is deployed on the device side.