1

I'm signing an APK using a keystore whose password includes spaces, using jarsigner. I'm specifying -storepass and then putting the password in quotes, e.g. -storepass "my password 123".

The sign always goes wrong though, because the key hash is not what I expect it to be. This is crucial for automating the build of my Android app without any user input.

basicallydan
  • 2,134
  • 3
  • 25
  • 40

1 Answers1

4

jarsigner seems to have an issue with passwords that contain spaces. When entering them after being prompted, it is fine, but using the parameter does not work. So, rather than generating a whole new keystore, change the password to something without spaces like so (taken from this answer)

For the store password:

keytool -storepasswd -keystore my.keystore

And you probably also want to change the key's password:

keytool -keypasswd  -alias <key_name> -keystore my.keystore
Community
  • 1
  • 1
basicallydan
  • 2,134
  • 3
  • 25
  • 40