$ keytool -genkey -v -keystore debug.keystore -storepass android -alias androiddebugkey -keypass android -keyalg RSA -keysize 2048 -validity 10000 -dname "C=US, O=Android, CN=Android Debug"
A debug keystore which is used to sign an Android app during development needs a specific alias and password combination as dictated by Google.
- Keystore name: "debug.keystore"
- Keystore password: "android"
- Key alias: "androiddebugkey"
- Key password: "android"
- CN: "CN=Android Debug,O=Android,C=US"
$ keytool -genkey -v -keystore release.keystore -alias alias_name -keyalg RSA -keysize 2048 -validity 10000
To get the keystore certificate fingerprints you can do:
keytool -list -v -keystore [keystore path] -alias [alias-name] -storepass [storepass] -keypass [keypass]
Ex.:
$ keytool -list -v -keystore debug.keystore -alias androiddebugkey -storepass android -keypass android
or
$ keytool -list -v -keystore debug.keystore
$ jarsigner -verify -verbose -certs my_application.apk
- Unzip apk
- Get MD5 and SHA1 of certificate of APK:
$ keytool -printcert -file ./META-INF/ANDROID_.RSA
- Get MD5 and SHA1 of keystore:
$ keytool -list -keystore signing-key.keystore
- Compare MD5/SHA1 and if they are the same, so the APK was signed with
signing-key.keystore
.
or
Using gradle:
$ ./gradlew signingReport