Search code examples
androidgoogle-playapkcode-signing

How to update an android app If you lose keystore file?


I am new to the Android ecosystem. To give you a more context about my problem, here are some facts.

  • I've received access to a google developer team, who released time ago an application.
  • Now, I want to release a new version of that.
  • The new version is a completely new app. Have the same functionality, but is developed by somebody else.
  • All setup is made correctly, including the bundle id of the app.

Now, the problem is related to APK signing. From what I understand I should use something named Keystore file to sign the app in order to be able to update the current app.

The problem here, is that I can't obtain this file, because the previous developer doesn't have it anymore.

enter image description here

My question is, what can I do in this case. Releasing as a new app is not an option.

Verry important, the last developer doesn't have the option to let google to manage the signing keys.

Thank you for your help!


I founded a related question, but the answers are old, so maybe, since then google may come up with a backup plan to recover this.

android - how to recover Keystore file


Solution

  • Following are the steps to generate new keystores with the help of Google Play Console.

    Step 1. First of all Goto this Link [https://support.google.com/googleplay/android-developer/contact/otherbugs] in which they are asking about

    • First Name
    • Last Name
    • Email Address
    • Developer Name
    • Developer Account ID
    • Location
    • App Name
    • App Package name

    and select your issues in the context of mine i select(I have a key or keystore related issue-->I have an upload key-related issue-->I lost my upload key).

    After Submitting our request they Send us Email in which they are telling that we have to do two steps-

    In first step we open our command window in a specific folder and copy this below command and hit enter

    keytool -genkeypair -alias upload -keyalg RSA -keysize 2048 -validity 9125 -keystore keystore.jks
    

    after hitting enter we have to put key and password. it will generate .jks file

    In Second step copy second query and paste it into command window and hit enter now it will generate a .pem

    keytool -export -rfc -alias upload -file upload_certificate.pem -keystore keystore.jks
    

    Step 3.

    Now in the reply of email that Google Help Center send us attach .pem file

    Step 4.

    Now they register our new generated key but it will give some days to be valid.

    Step 5.

    Now Create signed apk with that key and upload to play store.