How to Reset Your Upload Key for Google Play Store When It’s Lost, Compromised, or Forgotten

Were Samson Bruno
3 min readFeb 17, 2025

--

Image generated from Gemini AI with prompt "Generate an image and make sure these words are visible: "how to restore a lost upload key 🗝️ for Google Play store" display a laptop with the article showing on the laptop screen and a well lit window in the background"

Losing your app’s upload key can feel like a major setback, but thankfully, Google Play provides a way to recover. This article guides you through the process of resetting your upload key, whether you use Android Studio or Visual Studio Code for development.

Understanding the Importance of Upload Keys

Before diving into the process, it’s crucial to understand the role of upload keys in the Google Play ecosystem. Your upload key is what you use to sign your app bundles (*.aab files) before uploading them to the Play Store.1 Google verifies this signature to ensure the app genuinely comes from you. Google then re-signs your app with their app signing key (which they manage) before distributing it to users.2 This two-step signing process enhances security.

Scenario: You’ve Lost/Compromised Your Upload Key

If you’ve lost your upload key (keystore file) or suspect it’s been compromised, you must generate a new one and request a key reset through the Google Play Console.3

Method 1: Using Android Studio (For Key Generation)

If you use Android Studio, you can generate a new upload key and keystore as follows:

  1. Open the “Generate Signed Bundle/APK” Dialog: In the menu bar, click Build > Generate Signed Bundle/APK.4
  2. Select “Android App Bundle” or “APK”: Choose the appropriate option and click Next.
  3. Create a New Keystore: Click Create new below the “Key store path” field.
  4. Fill in the Keystore Information:
  • Key store path: Choose a secure location and filename (e.g., my_new_upload_keystore.jks). Remember this path!
  • Password: Create a strong password for your keystore. Remember this password!
  1. Fill in the Key Information:
  • Alias: Enter a descriptive name for your key (e.g., upload_key). Remember this alias!
  • Password: Create a strong password for your key. It’s recommended to use the same password as your keystore password for simplicity, but it can be different. Remember this password!
  • Validity (years): Set this to at least 25 years.
  • Certificate: Provide the requested information. This is not displayed in your app.
  1. Click OK: This generates your new keystore and key. Back up this .jks file immediately!

Method 2: Using the Command Line (For Key Generation)

If you use Visual Studio Code or prefer the command line, you can generate the key using the keytool utility (included with the JDK):

  1. Open Your Terminal: Navigate to the directory where you want to store your keystore.
  2. Run the keytool Command:

Bash

keytool -genkey -v -keystore <your_keystore_name>.jks -alias <your_key_alias> -keyalg RSA -keysize 2048 -validity 9125
*   Replace `<your_keystore_name>.jks` with your desired filename (e.g., `my_new_upload_keystore.jks`). *Remember this path!*
* Replace `<your_key_alias>` with a descriptive alias (e.g., `upload_key`). *Remember this alias!*
  • Provide Information at the Prompts: You’ll be asked for keystore and key passwords (choose strong ones and remember them!) and certificate information.
  • Verify Keystore Creation: Run keytool -list -v -keystore <your_keystore_name>.jks -alias <your_key_alias> to verify.
  • Back Up Your Keystore: Immediately copy the .jks file to a secure location.

Exporting the Upload Certificate (Both Methods)

After generating the keystore, you need to export the certificate:

  • Command Line:

Bash

keytool -exportcert -keystore <your_keystore_name>.jks -alias <your_key_alias> -file upload_certificate.pem

This will create a `upload_certificate.pem` file.

  • Android Studio: You can export the certificate from the same “Generate Signed Bundle/APK” dialog by clicking on it.

Requesting a New Upload Key in Google Play Console

  • Go to App Integrity: In the Play Console, navigate to Release > Setup > App integrity.
  • Go to App signing tab: Click on the App signing tab.
  • Request Upload Key Reset: You’ll see an option to “Request upload key reset”. Click it.
  • Follow the Instructions: Google will guide you through the process, which involves verifying your identity and ownership of the app.
  • Upload the Certificate: Once approved, Google will prompt you to upload the upload_certificate.pem file you exported earlier.

Updating Your Flutter Project (If Applicable)

If you’re using Flutter, update your android/app/build.gradle file with the new keystore information:

Gradle

android {
signingConfigs {
release {
storeFile file "<path_to_your_new_keystore>/<your_new_keystore_name>.jks"
storePassword "<your_new_keystore_password>"
keyAlias "<your_new_key_alias>"
keyPassword "<your_new_key_password>"
}
}
buildTypes {
release {
signingConfig signingConfigs.release
}
}
}

Things to keep in mind.

  • Security First: Keep your keystore file and passwords extremely secure. Losing them can cause significant problems.
  • Backups are Crucial: Regularly back up your keystore file to a safe location.(your local desktop, a security key, a Version control system or any other place that’s easy for you to retrieve)

My hindsight is now your foresight..

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

Were Samson Bruno
Were Samson Bruno

Written by Were Samson Bruno

Software Engineer | Believer | Entrepreneur

No responses yet

Write a response