Can I merge multiple Android keystore files into one?
Asked Answered
D

3

3

I have got myself into a slightly annoying situation with Android keystore files. Currently I have a few different apps each signed with a different keystore file. Kinda like this:

  • AppName1.apk signed with AppName1.keystore
  • AppName2.apk signed with AppName2.keystore
  • AppName3.apk signed with AppName2.keystore

Each of the keystores contain different names and aliases for each app.

I'm now learning that doing it this way is a bit silly and it would be better to use a single keystore file for all my apps. I am about to publish a new app so I'm trying to get it right this time around.

My general question is, what can I do to make life easier in future?

I've read that I can rename one of they keystores and change the aliases so, in theory, I can sign my next app with one of the existing keystores? That will mean at least 2 of my apps are using the same keystore and it will have a sensible name.


EDIT: For reference, this is one of the tutorials I was reading today:

http://blog.blundell-apps.com/tut-change-alias-passwords-of-your-android-keystore/

and also this other stack overflow answer: Can I change the alias of my key?

It is my understanding from the tutorial that I can safely rename the keystore file, change the passwords and rename the alias without loosing the ability to update the existing app. Can anyone confirm if that's true, or if there is some way I can prove it?


Lastly, I have a 3rd keystore I would like to merge into the other one if that's possible? So ideally, I would like to end up with just one keystore for all 3 apps. I know that's probably pushing it but I'll ask anyway.

Obviously, I don't want to loose the ability to update existing apps.

Dab answered 18/2, 2014 at 7:39 Comment(3)
My understanding is that if you change/merge your keystores on an app, you will lose the ability to update your existing app (unless you're willing to give up on its existing user base/reviews/current ratings/etc). And by the way, it's not the name of an app, or its alias, that is important, it's the application package name that is important (along with the keystore you used initially).Druggist
@StephanBranczyk I believe you are correct that the same application package name AND the same keystore file must be used together for updates to work, but as far as I can tell it's okay to change the name and aliases in the keystore as long as the actual key stays the same. I've updated my question to hopefully confirm this.Dab
Yeah, changing the keystore alias would lose the ability to update an existing app. #5725131 (and even if you could change the keystore alias, which you clearly can't according to the documentation, I just wouldn't see any benefit to it since your keystores would still end up having to be different from each other, and changing their alias would just make it harder to tell them apart later on).Druggist
L
4

[EDIT]

Now it's possible. Use KeyStore Explorer

[Older Answer Follows]

No

AFAIK, No. A keystore is usually used to identify a developer(or an app publisher). If you have used multiple keystores, you have to keep them all very safe now in order to maintain those applications now.

For now onwards, choose a single keystore and maintain several alias inside it for different applications.

Reference: http://developer.android.com/tools/publishing/app-signing.html

Ladin answered 18/2, 2014 at 8:28 Comment(0)
V
6

Yes You can merge all the keys from different keystores into one. Than there is no need to manage different keystores, you can change the alias of the key also, passwords for the key also, even a new keystore for existing keys.

You need to export all the keys first and than import into the destination keystore.

Remember you can still have different passwords for each key. Keystore password is separate from the key passwords.

Use the KeyStore Explorer

Vesuvian answered 1/7, 2015 at 21:12 Comment(0)
L
4

[EDIT]

Now it's possible. Use KeyStore Explorer

[Older Answer Follows]

No

AFAIK, No. A keystore is usually used to identify a developer(or an app publisher). If you have used multiple keystores, you have to keep them all very safe now in order to maintain those applications now.

For now onwards, choose a single keystore and maintain several alias inside it for different applications.

Reference: http://developer.android.com/tools/publishing/app-signing.html

Ladin answered 18/2, 2014 at 8:28 Comment(0)
L
0

You can use keytool -export to export the keys from the old keystore into files an then keytool -import to import into another keystore, applying new aliases or the same than before. See keytool's man page for details of the command line.

I needed to download a fresh Java runtime to get a version of keytool that could open a recent keystore.

Lillia answered 18/1, 2019 at 16:34 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.