Wednesday, January 18, 2012

sign your apk with platform key for using shared system id

you can find the key in your AOSP code.

normally you can find here AOSP_HOME/build/target/product/security

execute this command in that dir.

1.
$ openssl pkcs8 -inform DER -nocrypt -in platform.pk8 -out platform.pem
2.
$ openssl pkcs12 -export -in platform.x509.pem -inkey platform.pem -out platform.p12 -password pass:android -name androiddebugkey
3.
$ /usr/lib/jvm/java-6-sun/bin/keytool -importkeystore -deststorepass android -destkeystore platform.jks -srcstoretype PKCS12 -srcstorepass android -srckeystore platform.p12
then you can get platform.jks file can be used on eclipse.

copy platform.jks to your key dir.

and open eclipse -> window -> preferences -> Android -> build



then your application is signed with platform key and system user id application can be ran.

remember, your Androidmanifest.xml need "android:sharedUserId="android.uid.system"

4 comments:

  1. can you please give me this file platform.jks

    ReplyDelete
  2. Hi BG Park!! I tried to do follow your tip but my app can't sill run : Installation error: INSTALL_FAILED_SHARED_USER_INCOMPATIBLE.
    Can you help me! Thanks@

    ReplyDelete
  3. Thank you..It worked for me as well

    ReplyDelete