Signing APK for system app - Lineage OS 15.1

Post Reply
juanitomaille
Posts: 40
Joined: Thu Dec 21, 2017 12:25 am
languages_spoken: english, french
ODROIDs: XU4
Has thanked: 0
Been thanked: 0
Contact:

Signing APK for system app - Lineage OS 15.1

Post by juanitomaille »

Hi,

I'm trying to install an apk as a service app with USB access on my XU4 LIneage OS 15.1 - @Voodik version
I understood that I have to sign this apk with platform keys found Here :
https://github.com/LineageOS/android_bu ... t/security

I firstly tried to do this inside android Studio

Create keystore with this script : https://github.com/VelocityPulse/platfo ... t_keystore

add in build.gradle :

Code: Select all

    signingConfigs {
        release {
            keyAlias 'myAlias'
            keyPassword 'myPass'
            storeFile file('keystorePath/myKeystore.jks')
        }
    }
then in Android Studio

Menu > Build
Generate signed Bundles /APK
choose my new keystore with V1 AND V2 signature scheme

I have my signed app.

in terminal, i've done :

Code: Select all

zipalign -fv 4 myApplication-signed.apk myApplication-aligned.apk

but when I install my app via adb install, i have this error :

Code: Select all

adb: failed to install myApp.apk: Failure [INSTALL_PARSE_FAILED_CERTIFICATE_ENCODING: Failed to collect certificates from /data/app/vmdlxxx.tmp/base.apk: android.content.pm.PackageParser$PackageParserException: Package /data/app/vmdlxxx.tmp/base.apk has no certificates at entry AndroidManifest.xml: Package /data/app/vmdlxxx.tmp/base.apk has no certificates at entry AndroidManifest.xml]
I also tried with signapk commend line without success.

Thk for help.
I will continue to investigate.

voodik
Posts: 1839
Joined: Sat Dec 07, 2013 2:36 am
languages_spoken: armenian, english, russian
Location: Armenia
Has thanked: 35 times
Been thanked: 221 times
Contact:

Re: Signing APK for system app - Lineage OS 15.1

Post by voodik »

Apk signed with platfor key need to be copied to /system/app folder. You cannot install it.
Buy me a beer ;)
https://www.paypal.me/voodikjan
BTC: 377wXjEr3QsDDzRqfMco3a41wicrsv3Sfs
--------------------------------------------------------
dump logs
(dmesg; logcat -d; lsusb) | curl -F 'f:1=<-' ix.io
--------------------------------------------------------
ADB enhanced PuTTY :!:
https://github.com/voodik/puttyadb/releases

juanitomaille
Posts: 40
Joined: Thu Dec 21, 2017 12:25 am
languages_spoken: english, french
ODROIDs: XU4
Has thanked: 0
Been thanked: 0
Contact:

Re: Signing APK for system app - Lineage OS 15.1

Post by juanitomaille »

Thanks for your Reply Voodik !

You mean apk copied in /system/app ?

juanitomaille
Posts: 40
Joined: Thu Dec 21, 2017 12:25 am
languages_spoken: english, french
ODROIDs: XU4
Has thanked: 0
Been thanked: 0
Contact:

Re: Signing APK for system app - Lineage OS 15.1

Post by juanitomaille »

OK I tried to copy my apk directly to /system/app and also tried to /system/priv-app. No success ๐Ÿ˜ฅ

juanitomaille
Posts: 40
Joined: Thu Dec 21, 2017 12:25 am
languages_spoken: english, french
ODROIDs: XU4
Has thanked: 0
Been thanked: 0
Contact:

Re: Signing APK for system app - Lineage OS 15.1

Post by juanitomaille »

OK, Finally, I will reinstall Android studio, SDK, JRE on a fresh ubuntu install.
There are too many sources of bug.
After that, I will try again.

Post Reply

Return to โ€œAndroidโ€

Who is online

Users browsing this forum: No registered users and 2 guests