I am a new to android application development. I want to release my app to market. Now I am working in Eclipse. I am stuck at the point of getting a keystore password. How to do this?
Here's an example of a Keytool command that generates a private key:
keytool \
-genkey -v -keystore my-release-key.keystore \
-alias alias_name -keyalg RSA -keysize 2048 -validity 10000
Running the example command above, Keytool prompts you to provide passwords for the keystore and key, and to provide the Distinguished Name fields for your key. It then generates the keystore as a file called my-release-key.keystore. The keystore and key are protected by the passwords you entered. The keystore contains a single key, valid for 10000 days. The alias is a name that you — will use later, to refer to this keystore when signing your application.
For more information about Keytool, see the documentation at this link.
To create keystore refer this link.
You need to sign your app in release mode for that refer this link.
You can see the step by step detailed instructions with screenshots here.
Jsut check the below url
publish app
Compiling and signing with Eclipse ADT When using Eclipse with ADT, you can use the Export Wizard to export a signed .apk (and even create a new keystore, if necessary). The Export Wizard performs all the interaction with the Keytool and Jarsigner for you, which allows you to perform signing via a graphical interface instead of the command-line. Because the Export Wizard uses both Keytool and Jarsigner, you should ensure that they are accessible on your computer, as described above in the Basic Setup for Signing.
To create a signed .apk, right-click the project in the Package Explorer and select Android Tools > Export Signed Application Package. (Alternatively, open your AndroidManifest.xml file in Eclipse, open the Overview tab, and click Use the Export Wizard.) The window that appears will display any errors found while attempting to export your application. If no errors are found, continue with the Export Wizard, which will guide you through the process of signing your application, including steps for selecting the private key with which to sign the .apk, or creating a new keystore and private key.
When you complete the Export Wizard, you'll have a signed .apk that's ready for distribution.
and check below link
Signing Your Applications
Key to Keystore Android from my Windows 10 pro:
Open your command prompt
Type: cd\
Type: cd\
Type:
cd Program Files\Java\jre7\bin>keytool -list -v -keystore "C:\Users\"your username_of_your_pc_login_without_quotes"\.android\debug.keystore" -alias androiddebugkey -storepass android -keypass android
Related
I'm trying to deploy my Flutter app to Android. According to the Flutter documentation we have to sign our apps. The first step is to create an upload keystore. There are apparently two ways to do this.
The first method uses Android Studio. The instructions say:
In the menu bar, click Build > Generate Signed Bundle/APK.
Here's a screenshot of Build in Bumblebee 2021.1.1:
Where is Generate Signed Bundle/APK?
I clicked Build > Flutter > Build App Bundle. This ran for awhile and finished without error messages.
The second method uses the CLI. You enter this (on a Mac or Linux):
keytool -genkey -v -keystore ~/upload-keystore.jks -keyalg RSA -keysize 2048 -validity 10000 -alias upload
That prompted me for a keystore password. What is that and where do I get one?
I'm supposed to see a upload-keystore.jks file in my home directory. Does this mean in my project's home directory or my user home directory? I don't see that file.
Next, I'm told to
Create a file named [project]/android/key.properties that contains a reference to your keystore:
storePassword=<password from previous step>
keyPassword=<password from previous step>
keyAlias=upload
storeFile=<location of the key store file, such as /Users/<user name>/upload-keystore.jks>
What password from what previous step? And where is the key store file located?
I apologize if this is all obvious to Android users. I've always used iPhones. I bought my first Android phone yesterday and this is completely baffling to me.
Thank you #ישו אוהב אותך. The mistake is that when you run
keytool -genkey -v -keystore ~/upload-keystore.jks -keyalg RSA -keysize 2048 -validity 10000 -alias upload
it prompts you: Enter keystore password: It should say Create new keystore password or Enter new keystore password.
I made up a unique new password swordfish and entered it. I was prompted for my name and address and then told:
Warning:
The JKS keystore uses a proprietary format. It is recommended to migrate to PKCS12 which is an industry standard format using "keytool -importkeystore -srckeystore /Users/TDK/upload-keystore.jks -destkeystore /Users/TDK/upload-keystore.jks -deststoretype pkcs12".
So apparently there's a second item that needs to be updated in the documentation.
I ran the new command and now I see a file upload-keystore.jks in my user home directory (not in my project home directory).
I'll post a ticket with Flutter the make these two updates.
(Mac)
I created a keystore with alias and password with the same name (projectOne) and when I try to get the SHA1 from that created keystore and put it on my created google console maps I have trouble getting the SHA1 out.
I type this in the terminal but it does not let me access the keystore.
keytool -list -v -keystore ~/.android/ projectOne.keystore -alias projectOne
It says this (roughly translated):
Invalid option/Unauthorized: projectOne.keystore
Now I use the SHA for debug:
keytool -list -v -keystore ~/.local/share/Xamarin/Mono\ for\ Android/debug.keystore -alias androiddebugkey -storepass android -keypass android
And this does not work when I try to "release" it. So I assume I have to get the SHA1 from my own created keystore but as I mentioned above. It says it is an invalid option/Unauthorized option.
Based from this documentation you need to first find the .keystore file that your .apk was signed with. The keystore used will depend on if your app's .apk package was created as a debug build, or if it was packaged with a different .keystore file.
For builds that you have signed with your projectOne.keystore file, you need to substitute your own values for the .keystore file, keystore password, and alias name from when you created the keystore file.
You can follow these tutorial and forum which suggested to verify that the alias or password you use is correct.
When you sign and distribute your Xamarin Android apps the wizard helps you create keystore for your app. However, wherever I looked on my mac I could not find the actual .keystore file anywhere. So how am I supposed to get the SHA-1 fingerprint for that keystore?
SHA1 fingerprints are stored within the same keystore files.
Visual studio has an unique feature to open such files.
Just double click the file after creating it inside Xamarin. It will give you the SHA1 Fingerprint.
For windows users,
Go to this path or where ever you have your keytool.exe file
C:\Program Files\Java\jre7\bin
Hold shift key and right click -> then select Open command window here
After commandline open paste this command
keytool.exe -list -v -keystore "%LocalAppData%\Xamarin\Mono for Android\debug.keystore" -alias androiddebugkey -storepass android -keypass android
Official document here - https://developer.xamarin.com/guides/android/deployment,_testing,_and_metrics/MD5_SHA1/
This questions a few months old, but in the event others were stymied by this and end up here - here's instructions for mac users:
When you use the Android Signing wizard it asks for an alias and password.
Generate the SHA1 by entering by opening a terminal window and entering:
keytool -list -v -keystore /Users/[USERNAME]/Library/Developer/Xamarin/Keystore/[ALIAS]/[ALIAS].keystore -alias [ALIAS]
It will then prompt you for the password and if happy with that, will return certificate info and fingerprints (including the SHA1).
Note two passwords aren't needed as mentioned in the Xamarin documentation here.
(And if like me you were searching in Finder for the keystore file you created with no luck, it's because the Library folder is hidden)
I'm trying to export a signed Android application in Eclipse.
I think I'm going in the right direction:
Right click on project > Android Tools > Export Signed Application Package
The Export Android Application wizard appears.
Select the project I want to export, click Next.
The Keystore Selection screen appears.
It looks like this (forgive my ascii, file uploader not working):
[ ] Use existing keystore
[o] Create new keystore
Location: __________ [Browse]
Password: __________
Confirm: __________
I don't have an existing keystore, so I click the "Create new keystore" radio button. The location field remains active, must be filled, and if I browse to some directory I'd like the keystore to go after it's created, the dialog complains that "Keystore path is a directory."
Is it actually possible to create a keystore with this dialog?
If not, how can I create one? My google-fu has provided only failed experiments for me so far. I'm using Eclipse on a PC.
The Compile and sign with Eclipse ADT section in the android developer page seems to think this will just work out, but I can't get past this part of the dialog. I can export unsigned .apk files just fine.
Thank you!
You should be able to create a keystore with the dialog, yes. After navigating to the folder you want to use, type a name in the 'File name:' field in the file browse window, e.g. sophie.keystore. Then you should be able to proceed.
Alternatively, you can create it on the command line as described in the docs.
The command looks like this:
keytool -genkey -v -keystore my-release-key.keystore -alias alias_name -keyalg RSA -keysize 2048 -validity 10000
for example:
keytool -genkey -v -keystore ~/dcaunt.keystore -alias dcaunt -keyalg RSA -keysize 2048 -validity 10000
If you have created an app right now with the sdk and adt plugin, like the hello world app, then you'll have to chose the debug.keystore file while exporting. The files is in c:/users/.../.android/debug.keystore, after that when asked for password.
Step 1 : How to generate keystore in eclipse
Step 2: Browse Directory and put filename.keystore and create password
[]
Step 3: Fill Expiry details and License detail
2[]3
You are done!
i am trying to sign an apk by following this guide.
I created a keytools folder in C:\Users\Family\workspace\ and a keys folder in the newly created keytools folder. So now i have C:\Users\Family\workspace\keytools and C:\Users\Family\workspace\keytools\keys folders.
I copied the debug.keystore into the keys folder and copied the keytool.exe and jli.dll into the keytools folder.
I ran cmd.exe and navigated to C:\Users\Family\workspace\keytools and ran keytool -genkey -alias anddev.keystore -keyalg RSA -validity 20000 -keystore keys/anddev.keystore
The anddev.keystore file is created in the keys folder.
I copied the apk to be signed into the keytools folder. I also copied jarsigner.exe into the keytools folder.
In cmd.exe I am at C:\Users\Family\workspace\keytools and trying to run: jarsigner -verbose -keystore C:\Users\Family\workspace\keytools\keys\anddev.keystore -signedjar sampleapp_signed.apk sampleapp.apk anddev.keystore. It gives me this error:
I also tried to run:
jarsigner -verbose -keystore C:\Users\Family\workspace\keytools\keys\anddev.keystore -signedjar sampleapp_signed.apk sampleapp.apk C:\Users\Family\workspace\keytools\keys\anddev.keystore
I have also tried to run:
jarsigner -verbose -keystore C:\Users\Family\workspace\keytools\keys\anddev.keystore -signedjar C:\Users\Family\workspace\keytools\sampleapp_signed.apk C:\Users\Family\workspace\keytools\sampleapp.apk C:\Users\Family\workspace\keytools\keys\anddev.keystore
When i navigate to c:\program files\java\jdk1.6.0_23\bin and run that code it asks for the keystore password and when I write the keystore pass (123456), it gives me an error:
jarsigner: Certificate chain not found for: c:\users\family\workspace\keytools\keys\anddev.keystore. c:\users\family\workspace\keytools\keys\anddev.keystore must reference a valid Keystore key entry containing a private key and corresponding key certificate chain.
When i write anddev.keystore pass (=asdfgh, the second pass that keytool asked for at the end of the process) i get this error:
jarsigner error: java.lang.RuntimeException: keystore load: Keystore was tampered with, or password was incorrect. (However, i am pretty sure this is rightful error, cause the pass is not this, but the 123456).
I am pretty sure i am getting closer and that certificate chain error is the problem. Right? Am i missing a step or what?
One another thing: in the command line when keytool asked for any password the cursor was not moving. I wrote the password but i didn't see any numbers or stars, or the cursor moving. It then asked for a reenter password, same happened. I guess this is ok, and a feature of the command line, i am just writing this to be sure.
Edit:
Based on the help of Hades and Saasha, it was extremely easy to sign the apk. For anyone interested here are my steps:
For this i created a MyKeys folder into C:\Users\Family\workspace. After the process the sample.keystore and the samplesigned.apk appeared in that folder.
Hallo
If you using Eclipse you can try:
Compile and sign with Eclipse ADT
If you are using Eclipse with the ADT plugin, you can use the Export Wizard to export a signed .apk (and even create a new keystore, if necessary). The Export Wizard performs all the interaction with the Keytool and Jarsigner for you, which allows you to sign the package using a GUI instead of performing the manual procedures to compile, sign, and align, as discussed above. Once the wizard has compiled and signed your package, it will also perfom package alignment with zipalign. Because the Export Wizard uses both Keytool and Jarsigner, you should ensure that they are accessible on your computer, as described above in the Basic Setup for Signing.
To create a signed and aligned .apk in Eclipse:
Select the project in the Package Explorer and select File > Export.
Open the Android folder, select Export Android Application, and click Next. The Export Android Application wizard now starts, which will guide you through the process of signing your application, including steps for selecting the private key with which to sign the .apk (or creating a new keystore and private key).
Complete the Export Wizard and your application will be compiled, signed, aligned, and ready for distribution.
Don't go through all that trouble.
Are you using eclipse? If you are refer this guide.
http://developer.android.com/guide/publishing/app-signing.html
Scroll down to this heading,
"Compile and sign with Eclipse ADT"
It has a wizard for a keystore too.