I've made a .bat file to get the SHA1 of my Android app so I don't need to type the command each time
keytool -list -v -keystore "Path/To/My/Key.jks"
When I run the bat file I get asked for the password. Is it possible to either put the password in the command e.g. something like --password MyPassword
, or in the .bat file wait for the Enter your password line, and then send the password? I don't have any experience really with .bat files so I don't know if that's possible to do or not.
I looked at the --help for keytool and the only password flags I could see were for changing the password, not specifying it.
From the logs: If you have your logs intact, then you can find the password in the Android Studio log files : Go to ~/Library/Logs -> AndroidStudio ->idea. log.
The default server password is changeit . The keytool application is included in the Java developer kit and is not part of IBM® UrbanCode Deploy.
As already answered by @Maas, keyPassword is required to access the key entry that is stored in the KeyStore. The way it happens is first KeyStore Password is used to access/unlock the KeyStore and then keyPassword is used to decrypt the key entry that is there inside that KeyStore.
The keytool
that ships with the Oracle JDK allows you to specify it on the command line with -storepass
, you were doing keytool -help
instead of keytool -list -help
. (I suppose the Android version is the same.)
C:\>keytool.exe -list -help keytool -list [OPTION]... Lists entries in a keystore Options: -rfc output in RFC style -alias <alias> alias name of the entry to process -keystore <keystore> keystore name -storepass <arg> keystore password -storetype <storetype> keystore type -providername <providername> provider name -providerclass <providerclass> provider class name -providerarg <arg> provider argument -providerpath <pathlist> provider classpath -v verbose output -protected password through protected mechanism Use "keytool -help" for all available commands
Specify the keystore password using the -storepass
option:
keytool <commands and options> -storepass changeit
changeit
being the default keystore password, but use whatever.
For example, to add a certificate using the default password:
keytool -importcert -trustcacerts -alias mycert -file mycert.cer -keystore .../lib/security/cacerts -storepass changeit
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With