0

I try to sign Trebuchet launcher with platform certificate, but it fails to install after that:

    $ java -jar out/host/darwin-x86/framework/signapk.jar build/target/product/security/platform.x509.pem build/target/product/security/platform.pk8 out/target/product/crespo/system/app/Trebuchet.apk CapsuleLauncher.apk
    $ adb -e install -r CapsuleLauncher.apk
    1916 KB/s (7946887 bytes in 4.049s)
        pkg: /data/local/tmp/CapsuleLauncher.apk
    Failure [INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES]

If I do not sign it - it installs successfully. How to sign it?

HeatfanJohn
  • 7,143
  • 2
  • 35
  • 41
artem
  • 16,382
  • 34
  • 113
  • 189
  • INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES means that you use the wrong certificate. Signing with the platform cert only works if you build an app for your custom firmware rom where you know the certificate. It does not work if you use the standard firmware of a device. – zapl Aug 19 '12 at 16:16
  • @zapl, why didn't you add your comment as an answer? – HeatfanJohn Aug 19 '12 at 16:19
  • @HeatfanJohn bad habit, I tend to add a comment if it's just a sentence – zapl Aug 19 '12 at 16:22

1 Answers1

3

INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES means that you used the wrong certificate to sign your app.

Signing with the platform certificate only works if you build an app for your custom firmware rom where you know the certificate. It does not work if you use the standard firmware of a device since the manufacturers keep their certificates a secret.

If you don't sign it the app won't get any system priviledges but will still run.

zapl
  • 63,179
  • 10
  • 123
  • 154
  • The Trebuchet (and stock ICS) launcher works without signing, but the function to bind the Widgets doesn't work without system privileges. One of the XDA-dev users adviced me to sign it with platform cert, but as you see, it doesn't work. Are there any other methods to allow the launcher to use widgets? – artem Aug 19 '12 at 17:29
  • @RankoR sry, no idea. Do you use a CM rom? If you build a complete rom your modified launcher should be part of the system (in `system/app/Trebuchet.apk`) and it should be signed already. Maybe it just needs to be in `/system/app` instead of `/data/app` where it goes when you `adb install` it. And check that there is no old version of your app installed with a different certificate which would trigger that error too. – zapl Aug 19 '12 at 17:45
  • Yes, CM9. But I want to redistribute the app via the Play Store. If I copy app to the /system/app it works fine, but it's not a solution. – artem Aug 19 '12 at 18:25
  • You can probably distribute if via Play Store but if it requires system signing you are out of luck since every device-type / manufacturer has it's own certificate. It may work for CM9 devices since they will use the certificate you used to sign the app. – zapl Aug 19 '12 at 18:33