Generating a Signed APK "Keystore was tampered with" - android

I am trying to push an update to my app, but when I am trying to build the APK, I get
Failed to read key from store: Keystore was tampered with, or password was incorrect
I am certain that the Key Alias and password are correct. Is there a way to fix this without having to generate a whole new keystore? From my understanding, if I generate a new keystore I can't push updates to the app that is already in the playstore

If this is an issue of forgetting the alias you used for your keystore, you can list the aliases for your keystore using the following command:
keytool -v -list -keystore .keystore

Related

I have two keystore files, but I forgot which one I used to sign the APK

I need to update my app on Play store, but I forgot that which Keystore I used to sign the APK. is there any way to identify this?
try to use one keystore and build apk and upload to playstore alpha/internal test if selected keystore is incorrect play store throw exception
To know the keystore you used for siging the APK, You need to identify SHA1 key of keystore. Unzip the APK and open "META-INF" folder in terminal. Run the following command: -
keytool -printcert -file CERT.RSA
This will print the SHA1 key. Just verify this key with your both keystores. To know the SHA1 of the keystore use following command in terminal: -
keytool -exportcert -alias aliname -keystore youkeystore.jks | openssl sha1 -binary | openssl base64
Just try with both one by one increasing version, Like first create sign APK with first one upload it on play store console if google throw exception then increase version code and try with second one and upload again on play store.
As if you are saying Keystore from you have then it will be match and your problem will be fixed.

Cannot see google maps on android when I upload it for release (works in debug), trying to get SHA1 from my created keystore

(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.

Android Studio change SHA1

I am using the last version of the Android Studio, but when I try to send the app for PlayStore I can't because the SHA1 is different.
This is SHA1 from the certificate:
but the app build has this SHA1:
I find a problem in Android Studio with my KeyStore.
The Key store has a SHA1 but the app with this keystore has another.
Just try this:
$ keytool -list -v -keystore mycert.keystore
will show:
SHA1: 67:F0:AE:82:85:7C:BD:C8:A0:CE:45:FA:6B:A5:92:E5:4A:34:40:AD
but when you build in Android Studio a app with this keyStore you will receive that:
$keytool -list -printcert -jarfile app-release.apk
will show:
SHA1: 15:C3:B6:FB:B0:9B:21:DC:85:D6:04:FA:62:44:EA:F7:3D:85:FD:F8
you need to provide a keystore having that sha1 key while signing the apk like this
Sometimes other apps change your keystore number - e.g. Unity does that.
Its not illegal, its just Unity thinks your keystore belongs to itself and writes over the SHA1 number.
Solution: store your keystore safely in an email or something.

Getting error even when Keystore password is true. How?

I had created my android game with libgdx in Elipse. I created the keystore and uploaded the file.
Now i have imported the project in Android Studio. And if i try to sign the apk with same alias and password it gives an error in Android Studio.
Error:Execution failed for task ':android:packageRelease'.
Failed to read key geekydhaval from store "C:\litikeystore": Cannot recover key
And i know that the keypass and alias password are right because whrn i run :
C:\Program Files (x86)\Java\jre7\bin>keytool -list -v -keystore c:\litikeystore -alias geekydhaval -storepass mykeystorepassword -keypass keypassword
it gives me all the details of the key. including SHA1 MD5.
U don't know what is happening here. PLEASE HELP.

Duplicating a private key with a new alias

http://developer.android.com/tools/publishing/app-signing.html
I have a keystore that I already have an alias and password for.
I have released applications using this keystore.
I have now given ownership of one of these applications to someone else, and so to update that application they need to use my keystore. However I don't want them to use my alias or password.
Is it possible to create a new alias and password for the same keystore
and just as importantly
will Google Play allow an APK signed with the new alias to be used as an update for that already published app?
If so what is the command, or a good help link please?
Your key store contains your key. Just put your key in a new keystore. And give them that one. Or.. I suppose just give them the key.
Ok I got it, thanks #Rossco for the initial boost.
First I copied my keystore to a new file
ctrl+c ctrl+v
Then I changed the password on the keystore:
keytool -storepasswd -keystore my.keystore
Then I changed the name of the alias in the keystore
keytool -changealias -keystore my.keystore -alias "old_alias" -destalias "new_alias"
Then I changed the password for the new alias:
keytool -keypasswd -keystore my.keystore -alias new_alias -keypass oldAliasPassword -new newAliasPassword
And yes I've just tested it and uploaded a new version of the app with the new keystore alias
Thanks!
References:
Keystore change passwords
Can I change the alias of my key?
http://docs.oracle.com/javase/1.4.2/docs/tooldocs/windows/keytool.html

Categories

Resources