Skip to content

Instantly share code, notes, and snippets.

@ptkdev
Last active March 28, 2023 15:51
Show Gist options
  • Save ptkdev/55df4423c840058ff5380aa161f7dff1 to your computer and use it in GitHub Desktop.
Save ptkdev/55df4423c840058ff5380aa161f7dff1 to your computer and use it in GitHub Desktop.
Android: Recovery lost keystore jks file or keystore password

Sign android app with new keystore file if you missing password or lost jks file.

  1. Create new keystore.jks file with comand line (not android studio build menu)

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

    Windows: "C:\Program Files\Android\Android Studio\jre\bin\keytool.exe" -genkeypair -alias upload -keyalg RSA -keysize 2048 -validity 9125 -keystore "C:\keystore_new.jks"

  2. Generate a .pem file from new keystore

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

    Windows: "C:\Program Files\Android\Android Studio\jre\bin\keytool.exe" -export -rfc -alias upload -file "C:\upload_cert.pem" -keystore "C:\keystore_new.jks"

  3. Use this support form, set "keystore problem" and with attachment add .pem file: https://support.google.com/googleplay/android-developer/contact/otherbugs

  4. 12-48h you new keystore is enabled. Update your app on playstore with new apk signed with new keystore :D

@shide1989
Copy link

Important note : you can only ask for a keystore change once per Application otherwise you'll have to publish a new app....

@parassinghh
Copy link

Will it work? Are you sure? I am facing this issue. I am getting alias name with my store password but key password is wrong any way. Will google team help in this? I will try it.

yeah its work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment