How to get the jks for the lost keystore?

JassimRahmaJassimRahma USMember ✭✭✭✭

Hi,

I have a Xamarin Forms app and I lost my ketstore file

Now Google is asking me to follow below steps to recover the keystore

but the first command is asking for the jks file

Where can I get that for Xamarin Forms app?

Hi There,
Thanks for contacting Google Play Developer Support.

Now that we’ve verified your account, I’m happy to help you reset your upload key. The new upload key will be used to sign APKs that you upload to Play.

Here’s how to generate and register a new upload key:
Follow the instructions in the Android Studio Help Center to generate a new key. It must be different from any previous keys. Alternatively, you can use the following command line to generate a new key:
keytool -genkeypair -alias upload -keyalg RSA -keysize 2048 -validity 9125 -keystore keystore.jks
This key must be a 2048 bit RSA key and have 25-year validity.
Export the certificate for that key to PEM format:
keytool -export -rfc -alias upload -file upload_certificate.pem -keystore keystore.jks
Reply to this email and attach the upload_certificate.pem file.
I look forward to your response. Please let me know if you have any questions in the meantime.

Regards,
Jaden
Google Play Developer Support

Thanks,
Jassim

Best Answer

Answers

  • yelinzhyelinzh Member, Xamarin Team Xamurai
    edited June 26

    JKS is the type of keystore. You can get the type of you keystore by the command in terminal. The .keystore that you are using to sign your Xamarin.Android app is type of jsk by default.

    /usr/bin/keytool -list -rfc -keystore debug.keystore |grep "Keystore type"
    

    Refer to: https://stackoverflow.com/a/49925137/11083277

  • JassimRahmaJassimRahma USMember ✭✭✭✭

    How to get that in Microsoft Windows?

  • yelinzhyelinzh Member, Xamarin Team Xamurai
    edited June 26

    cd to the path 'bin\keytool' and execute the command: -list -rfc -keystore xx.keystore |grep "Keystore type"

  • JassimRahmaJassimRahma USMember ✭✭✭✭

    'grep' is not recognized as an internal or external command, operable program or batch file.

  • batmacibatmaci DEMember ✭✭✭✭✭
    Did you use google sign with upload key before? If you only used self signing for you apk there is no way to restore it. Google wont know but I assume that you used it if you received email from google. I went through same process just last week for one of my apps.
    Basically you should use vs 2019 command line and go to path where keytool.exe is. It is usually on the path where your archives are on windows. Use the command what google wrote not with grep.
  • JassimRahmaJassimRahma USMember ✭✭✭✭

    but it's asking for a keystore path which I don't have because I lost the keystore

    C:\Users\jrahm>C:\Progra~1\Java\jdk1.8.0_211\bin\keytool -list -rfc -keystore debug.keystore
    keytool error: java.lang.Exception: Keystore file does not exist: debug.keystore

  • batmacibatmaci DEMember ✭✭✭✭✭
    edited June 26
    Read the message from google again 😁 do you see any debug.keystore in the email 😉
  • JassimRahmaJassimRahma USMember ✭✭✭✭

    but that's my question..

    The message from google says keystore.jks which I don't have in Xamarin

  • JassimRahmaJassimRahma USMember ✭✭✭✭

    @batmaci your solution solved my problem.

    Thank you

Sign In or Register to comment.