locked
How to get the jks for the lost keystore? RRS feed

  • Question

  • User31568 posted

    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 uploadcertificate.pem -keystore keystore.jks Reply to this email and attach the uploadcertificate.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

    Wednesday, June 26, 2019 10:18 AM

Answers

  • User176749 posted

    It will generate this for you. Just follow Google commands. This lines are very clear.

    , 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 uploadcertificate.pem -keystore keystore.jks Reply to this email and attach the uploadcertificate.pem file.

    • Marked as answer by Anonymous Thursday, June 3, 2021 12:00 AM
    Wednesday, June 26, 2019 3:15 PM

All replies

  • User382871 posted

    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

    Wednesday, June 26, 2019 11:56 AM
  • User31568 posted

    How to get that in Microsoft Windows?

    Wednesday, June 26, 2019 12:00 PM
  • User382871 posted

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

    Wednesday, June 26, 2019 12:41 PM
  • User31568 posted

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

    Wednesday, June 26, 2019 12:44 PM
  • User176749 posted

    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.

    Wednesday, June 26, 2019 1:05 PM
  • User31568 posted

    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

    Wednesday, June 26, 2019 2:48 PM
  • User176749 posted

    Read the message from google again ? do you see any debug.keystore in the email ?

    Wednesday, June 26, 2019 2:54 PM
  • User31568 posted

    but that's my question..

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

    Wednesday, June 26, 2019 3:03 PM
  • User176749 posted

    It will generate this for you. Just follow Google commands. This lines are very clear.

    , 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 uploadcertificate.pem -keystore keystore.jks Reply to this email and attach the uploadcertificate.pem file.

    • Marked as answer by Anonymous Thursday, June 3, 2021 12:00 AM
    Wednesday, June 26, 2019 3:15 PM
  • User31568 posted

    @batmaci your solution solved my problem.

    Thank you

    Wednesday, June 26, 2019 4:11 PM
  • User392244 posted

    If We lost keystore file and its credential then we can not upload new version on playstore In this case we have to follow following steps to create new one

    A) Create new keystore

    1) Right click on android project click on Archive, Archive process will start 2) Once Archive process complete choose Distribute => Ad Hoc => Click on plus sign to create new keystore 3) Once Keystore file create it will show in grid , Double click on that file Here we can find saved location of this file, Take those path and open folder explorer to get those files. 4) Copy those files in C:\Program Files (x86)\Java\jdk1.8.0_181\bin

    B) Create .pem file

    Open command prompt with administrator right and execute following command

    1) cd C:\Program Files (x86)\Java\jdk1.8.0_181\bin>

    2) C:\Program Files (x86)\Java\jdk1.8.0181\bin>keytool -export -rfc -keystore Techcheck.keystore -alias Techcheck -file uploadcertificate.pem Enter keystore password: ** Certificate stored in file

    Warning: The JKS keystore uses a proprietary format. It is recommended to migrate to PKCS12 which is an industry standard format using "keytool -importkeystore -srckeystore Techcheck-keystore.jks -destkeystore Techcheck-keystore.jks -deststoretype pkcs12".

    Once this process completed open C:\Program Files (x86)\Java\jdk1.8.0181\bin Here you will get uploadcertificate.pem , Techcheck.keystore , Techcheck.keyInfo

    Copy those file and place in secure place coz we want to use this Techcheck.keystore , Techcheck.keyInfo for next realese to playstore

    Send uploadcertificate.pem and describe them you have lost your keystore so please reset existing key Do not forgot to attach uploadcertificate.pem

    Wednesday, January 15, 2020 8:38 AM