I want to upload in the Playstore my app that will replace an older version that i have not loaded by myself in past. I have the following error when i try to upload my app:
You uploaded an APK that is signed with a certificate other than that
of your previous APK. You must use the same certificate.
The APK existing certificates are signed by these fingerprint:
[SHA1: .... ]
The certificates used to sign the APK that you have loaded these fingerprint:
[SHA1: .... ]
How can I get the keystore having the correct fingerprint?
How can I get the keystore having the correct fingerprint?
Google Play relies on key continuity to ensure the developer who published the app is the same developer who updates the app.
You should install the same public/private key on your machine, and then sign the APK with the private key. Finally, resubmit the APK to the play store.
How can I create a keystore starting from an existing fingerprint?
You can't. You need the original public/private key pair.
You can get the public key from the existing APK. Just look in the META-INF
directory. The certificate or public key is located in there.
But, you have to factor the RSA public key to recover the private key (or solve a related problem, like discrete roots in a finite field). Its non-trivial, and if you do it then you won't care about signing APKs :). See, for example, Calculating private keys in the RSA cryptosystem on the Crypto Stack Exchange.
Here's how to sign from the command line using jarsigner
and the debug key. The order of the arguments matters. You should use your real public/private key pair, and not the debug key.
jarsigner -verbose -keystore C:\Users\<user>\.android\debug.keystore \
-storepass android -keypass android -digestalg SHA1 \
-sigalg SHA1withRSA <package name>.apk androiddebugkey