Signing my android application as system app

前端 未结 3 1295
傲寒
傲寒 2020-12-08 03:28

In my company, we would want total control for battery consumption in the field, using only 2g and gps could drain the battery awfully fast. What we decided is that we need

3条回答
  •  無奈伤痛
    2020-12-08 03:52

    For anyone coming to this question and even after reading the comments not being able to make it work, it might be because there're some things missing (specially if getting OPENSSL errors), here's everything you need.

    Sign APK with test keys from the AOSP

    1. git clone https://android.googlesource.com/platform/prebuilts/sdk.git - Careful it's ~6GB, or you can download what you need, the signapk.jar file and the libraries.
    2. download the platform.x509.pem and platform.pk8 from https://github.com/aosp-mirror/platform_build/tree/master/target/product/security
    3. With java installed, change the following command with the right paths for the files, the lib64 in the sdk you just cloned, the signapk.jar file, the platform key files and the apk to sign
    java -Xmx2048m -Djava.library.path="~/../sdk/tools/linux/lib64" \ # In the cloned sdk
        -jar ~/../sdk/tools/lib/signapk.jar \ # In the cloned sdk
        platform.x509.pem platform.pk8 \ # The keys for signing (from step 2)
        app-prod-release.apk release.apk # The app to sign and the signed app
    

提交回复
热议问题