Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Alias Key with space like (my name) insted of (my_name) cause error while generating release key hash

Here my problem is: - Last week I had generated the signed apk and upload to playstore. - I had implemented firebase auth in that apk but using debug key(debug md5).

  • Now I want to generate released key hash(release md5) for this app, but due to my key alias name with space like(my name) instead of (my_name)cause a problem like [Illegal option: name ] and below.

  • And now I knew that if I make alias name without space like (my_name), the release md5 hash key will be generated easily.

     keytool -exportcert -list -v -alias my name -keystore /home/bpn/Music/keystore.jks
    

    Illegal option: name

keytool -list [OPTION]...

Lists entries in a keystore

Options:

-rfc output in RFC style

-alias alias name of the entry to process

-keystore keystore name

-storepass keystore password

-storetype keystore type

-providername provider name

-providerclass provider class name

-providerarg provider argument

-providerpath provider classpath

-v verbose output

-protected password through protected mechanism

Use "keytool -help" for all available commands

like image 612
jazzbpn Avatar asked Jun 29 '16 15:06

jazzbpn


2 Answers

Put the name of the key alias in quotes, like this:

keytool -exportcert -list -v -alias "my name" -keystore /Path/to/keystore.jks

I made the experience that a space in the alias causes more troubles than it's worth. You can use the following command to change the alias if you like to. After you change the alias it's still possible to update your app in the Google Play Store.

keytool -changealias -alias "ALIAS OLD" -destalias "ALIASNEW" -keypass PASSWORD -keystore /Path/to/keystore.jks -storepass PASSWORD

like image 146
Stefan Wanitzek Avatar answered Sep 30 '22 10:09

Stefan Wanitzek


Use double quotation for alias below is example.

jarsigner -verb ose -sigalg SHA1withRSA -digestalg SHA1 -keystore keystore.jks unsignedapp.apk "alias name"

like image 22
Dharmen Gunawat Avatar answered Sep 30 '22 10:09

Dharmen Gunawat