I need to locate the release signing key for an android app from 4+ years ago. I have the codebase, and the MBP it was last worked on, but the person who worked on it was very disorganized.
I have multiple directories called /proj, /proj2, /desktop_proj, /old/proj...each has 2-3 apks in it. Source control is a similar mess.
I don't know what IDE they used to work on this project. I have IntelliJ, Eclipse, and Android Studio on this old machine. I can search all of them but I don't know where to look.
I did a find and none of the keystores (.jks or .keystore) really match up.
Basically, I was thinking to go the other way -- get the current release apk from google play and check out the keystore on it.
keytool -list -printcert -jarfile super-old-app__release.apk
Then, I can ... do something ... to find the actual name of the key used to create the signing build. Though now that I think of it, I don't know the passwords.
Anyways, maybe I can find that, once I get the actual keys. Does anyone possibly have any suggestions?
If you know alias used in app, you can reverse search it for all files ( search for .JKS or .keystore or without extension ).
Write a batch program searching in complete disk with taking file name as input parameter running
keytool -list -keystore XXX.XXX -alias **YOURAPPAliasname**
Write output of above batch program to a file. All files except one should return you java.lang.Exception: Alias does not exist or incorrect format.
You can modify above batch program to additionally find signature of key to match with signed key. See solutions provided in this link - How do I find out which keystore was used to sign an app?
When i try to uploading new update of my app, gives me this error "The apk must be signed with the same certificates as the previous version".
Procedure:
I use export wizard from eclipse, than load old cert file from my folder, i enter password correctly (i test it to enter incorrect, and cant go further) so i know for shure that is correct, and for alias the correct pass to, and save the apk. When i try to upload gives me the error. The package is the same, and oll the stuff.
Can anyone tell me where is the problem ?
Most definitely your certificates are different, you may check using the following commands:
unzip -d tmp filename.apk META-INF/CERT.RSA
keytool -printcert -v -file tmp/META-INF/CERT.RSA
where filename.apk is you apk for current and/or previous version.
One of three things could cause this problem:
Using a different private key cert (sounds like you don't think this is your problem)
Not increasing the versionCode and versionName in android manifest
Using a different package name
Hopefully it's not that you lost the cert! Good luck! Someone mentioned that it is possible to sign an old version of your app with multiple certs, and then continue to use the one you still have like this
I'm developing an app that uses Google Maps. I got the debug keystore and got the API key to work while I am debugging my program in Eclipse, but I am thoroughly confused in how to change this so that it works on an Android device when I export the .apk. I have searched around Google, but am mainly finding things that use the debug.keystore and I don't think this is what I want to use when I deploy this on an Android device, because I sent my .apk to a friend and he said he is getting gray boxes on the Map View.
Can anyone fill me in, step-by-step, on how to correctly make a new keystore for my app and how to sign my app so that it will work outside of debugging on Eclipse? A video tutorial would be preferable, but if not, simple 1-2-3 step type instructions would work. Thanks!
Eclipse (through ADT) has a nice wizard that lets you create a real keystore and build a signed apk. Right click your project, then Android Tools -> Export signed Application package
For the google maps key just follow these instructions
head to the command prompt, (I use windows so I'm going to go that route but same general idea for the other OS's)
The keytool program you'll need is part of the JDK so you do have it if your able to compile the apps at all. but it may not be on the app path so you can't just type it into the command line to be used.
for me it was in:C:\Program Files\Java\jdk1.7.0_21\bin so to get it on the app path I typed this in set PATH=%PATH%;C:\Program Files\Java\jdk1.7.0_21\bin
next you need to change to the directory your keystore files are in for me that is: C:\android\keys so I used the command cd C:\android\keys to change to the proper directory
then you need to run the keytool with the proper settings so it knows your after the key and not trying to do something else. the command I used was: keytool -list -v -keystore Testkeys and Testkeys is the name of my keystore use the name of your keystore there instead.
Last by not least it will spit out a whole bunch of different information but the one your looking for will look something like this
SHA1: A1:DF:83:DD:04:B2:26:10:B2:EB:26:00:90:75:D0:10:66:5E:A9:8A
you want all the numbers and : that are after the "SHA1: " that is your app key for the published version of your app, the one you need to register with the google maps api service, and then they will give you a new map api key that you need to put in your project and then republish it, and then the maps will work.
Every time I try to use the keytool to get a key for my maps API, it
pops up saying "Keytool is not a valid Win32 application"
I am running it through command line and am using the same command
that is on the android tutorials
I came across this problem as well. I looked at the size of the keytool.exe file, and found it was 0kb. I ended up running the JDK install file again to fix the problem.
This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
Login failed invalid key error with Facebook SDK
I am using a sample app for here ibm.com/developerworks/library/x-androidfacebookapi/
to test facebook android SDK,
I have given my APP ID in this sample app.
I have done all setups and prerequisites.
I have signed app with my keystore and generated hash key
I submitted hash key to facebook app settings page,
I installed facebook app on my device.
But after all doing the app gives Facebook error invalid_key.
Pls help me in this regards,
Thank you.
Invalid Key could be for a number of reasons -
Make sure you have Keytool and OpenSSL installed.
Make sure you are giving the correct Keystore file in the command.
Make sure you are giving the correct Alias.
Make sure you copied the generated Hash Key correctly to the Facebook application correctly.
When I got Invalid Key initially, it was because I was giving the wrong Alias. The strange thing is, that Keytool and OpenSSl won't mention that the alias is wrong. If you give the command to generate the Hash Key, and it doen't ask you for your password, you're probably doing it wrong.
After a few days of struggling with the same issues, I wrote up a full explanation of the problem and the various fixes here:
http://sean.lyn.ch/2011/07/android-the-facebook-sdk-sso-and-you/
A few things I ran into before I got this working:
1) Generate your hash in linux. Windows (at least for me, 64-bit) didn't generate the correct hash. Download the Cygwin bash shell and do it from there.
2) In the filepath for the keystore, everything should be a forward slash. Even in front of C:. So, for example, C:/Users/YourName/.android/debug.keystore, NOT C:\Users/YourName/.android/debug.keystore.
3) The equals at the end of the hash should be included. Maybe this was obvious to some people, but nevertheless I thought I should mention it.
It SHOULD prompt you for a password. If it doesn't, you've done something incorrectly.
I also had this problem, didn't really find how to resolve it untill I found this
http://support.getsocialize.com/socialize/topics/facebook_auth_key_issue_adding_the_invalid_key_from_logcat_seems_to_fix_sso?from_gsfn=truethread.
Every help topic states that the key hash hasn't been filled in correctly. After checking multiple times and using the keytool multiple times I knew I filled it in correctly. The above link goes to a toppic on Get Satisfaction about this issue, and the sollution that is offered there worked for me. Just copy the key you see in the popup into the hash box on your facebook developer page. It can be added alongside the hash you get from keytool.
Some things I found out while resolving this problem.
- I always used the full path in the keytool command
- when entering the keytool command make sure it asks for a password
- to find out if you correctly typed your password in de keytool command first supply it with something, that you know is not, your password cause it will also generate a hash. If the password is incorrect it will always give the same hash. so to check if you typed in your password correct compare it to a hash of a wrong password.
- This error only occurs if the facebook app is also on the phone, which I believe means that the error is not in the authentication itself, this made me search for errors in my code for hours while there were none (at least not in the authentication part :p)
- I was fortunate enough to have multiple test devices, which showed me it was not an error in the code but an error in the sdk or in some other part in the authentication phase.
I hope this info will help someone that runs into this problem and save him some time in resolving it.
kind regards Tom
Been having problems with this all day, I used cmd prompt to generate the key and it worked after I defined the path of openssl and keytool in the windows system settings.
I set up the Facebook application in eclipse and it was working fine on the AVD, however the same program causes the Facebook error invalid key when installed on my nexus s.
I've come to the conclusion that the device has its own keys and cannot use those in the keystore.
It is not logical bu "The Same" keytool command gives different results in Windows and Linux. The hash key got from Linux works, from Windows fails. You can try that!
The openssl in Windows installed from here: http://code.google.com/p/openssl-for-windows/
I have had the same problem and finally I found the solution : Use Cygwin for Windows users.
The result from Windows is different from linux/iOS.
So install Cygwin, it's very easy and you will also need cygwin if you want to work with NDK.
Run the command listed above copy the output and it will work.
Actually this is the problem in facebook sdk if you uninstall the com.facebook.katana then your application will work perfectly fine. I don't have a permanent solution for this problem but temporarily it will work
Today, you can't get a correct key with Windows EVEN using Cygwin. You must do it under MacOS or Linux. This is an issue. Hope they get it fixed very soon.
I was having this same problem and I think many others are running into the same thing that I was. The key store on windows is under the user directory by default e.g. C:\Users\User Name.android\
It failed for me because I was entering the full path and it had a space (" ") in folder that is named after the user. If you put quotes around the path it will likely work, and you should be prompted for the keystore password.
e.g.
keytool -exportcert -alias androiddebugkey -keystore "C:\Users\User Name.android" | openssl sha1 -binary | openssl base64
I'm using windows 7 and fix problem using :
keytool -export -alias androiddebugkey -keystore "[PATH]\debug.keystore" -storepass android -keypass android | openssl sha1 -binary | openssl enc -a -e
You can download OpenSSL for Windows
i fix the bug with this:
if you add to authorize line this code
Facebook.FORCE_DIALOG_AUTH
mFacebook.authorize(MundialRugby2011Activity.this,
new String[] {"publish_stream", "read_stream",
"offline_access"},Facebook.FORCE_DIALOG_AUTH, new LoginDialogListener());