How android sign your app


android APK employed the same signature method just as java jar package did.

there are two ways of sign your app.

1. Use tools in java package 


a. make your own keystore

keytool -genkey -v -keystore my-release-key.keystore -alias zpcat_key -keyalg RSA -keysize 2048 -validity 10000

b. sign your apk 

jarsigner -verbose -keystore my-release-key.keystore MainMenuView_unsign.apk zpcat_key

c. align your apk

zipalign -v 4 MainMenuView_unsign.apk MainMenuView.apk

2. Use android's private tools


a. make key/cert pair by android's private tools

development/tools/make_key: android tool to make key/cert pair

b. signing apk with key/cert pair:

java -jar SignApk.jar platform.x509.pem platform.pk8 Application.apk Application_signed.apk

3 compare the two methods -- the java keystore file .VS. key/cert pair of android (pk8 key file and x509.pem cert file)

they are the same stuff. you can import the key/cert pair into your java keystore file by:

keytool-importkeypair -k ~/.android/debug.keystore -p android -pk8 platform.pk8 -cert platform.x509.pem -alias platform

keytool-importkeypair is a opensource tools, which can get from https://github.com/getfatday/keytool-importkeypair



     

Comments

Popular posts from this blog

Bluedroid stack in android

How to setup a NAT server?

Network programming in elisp