All articles

Technical

Android Keystore and App Signing for PWA Developers

August 27, 2026 · 8 min read

Understanding Android Code Signing and Keystores

When deploying application updates to web servers, security is maintained through secure transport protocols and domain verification. In the Android ecosystem, security relies heavily on cryptographic code signing. Every application compiled for Android must be signed with a digital certificate before it can be installed on a device or uploaded to the Google Play Store.

For web developers converting a Progressive Web App into an Android application package, understanding this system is essential. An Android keystore is a secure binary file that contains one or more private keys. In the context of mobile development, it acts as a digital signature that verifies the identity of the developer. If you lose access to these keys or configure them incorrectly, you will lose the ability to update your application on Google Play, or your application will fail to verify its connection with your web domain.

This signature ensures that the application has not been altered or corrupted since it was signed. Android devices use this signature to verify that updates to an installed application come from the same developer. If the signature of a new update does not match the signature of the installed version, the Android operating system will reject the installation to protect the user from malicious overrides.

The Two-Key Architecture: Upload Key vs App Signing Key

Historically, developers managed a single keystore key that was used both to sign the application locally and to deliver it to end users. If that single key was lost, the developer could never update their application again. To mitigate this risk, Google introduced Play App Signing.

Under Play App Signing, the signing process is split into two distinct keys:

  • Upload Key: This is the key you generate locally on your machine. You use this key to sign your Android App Bundle before uploading it to the Google Play Console. Google uses this signature to verify your identity as the developer.
  • App Signing Key: This is the key that Google uses to sign the final APK files distributed to user devices. Google generates or receives this key when you set up your developer account, and it is stored securely on Google's infrastructure.

This separation offers a significant safety net. If you lose your local upload key, you can contact Google Play developer support to reset it. You generate a new upload key, associate it with your account, and continue updating your application. The actual app signing key remains safe on Google's servers, meaning your users will experience seamless updates despite your local key loss.

How App Signing Influences Digital Asset Links

For developers publishing a Progressive Web App using a Trusted Web Activity, this distinction between the upload key and the app signing key is highly critical. A Trusted Web Activity relies on Digital Asset Links to verify the relationship between your Android package and your web domain. This verification removes the browser address bar from the top of your mobile application.

To establish this verification, you must upload an assetlinks.json file to your web server. This file contains the package name of your application and the SHA-256 fingerprint of the signing certificate. A common point of failure occurs when developers use the SHA-256 fingerprint of their local upload key instead of the Google Play app signing key.

Key TypeWhere it is GeneratedPurpose in PWA Deployment
Upload KeyLocally by DeveloperSigns the AAB file for upload to the Google Play Console.
App Signing KeyGenerated/Stored by GoogleSigns the final APK downloaded by users. Must match the SHA-256 in assetlinks.json.

If you populate your assetlinks.json file with the fingerprint of your upload key, the verification will succeed during local development and testing (where you install the locally signed debug or release APK directly). However, once the application is published through the Play Store, Google signs it with the App Signing Key. Because the signature on the user's device does not match the upload key fingerprint on your server, the browser address bar will reappear in the production version of your application.

Locating Your SHA-256 Fingerprint in Play Console

To ensure your production PWA works flawlessly without the address bar, you must fetch the SHA-256 fingerprint directly from your Google Play Console after you have enabled Play App Signing. Navigate to your application dashboard, find the Release section, and select App Integrity. Under the App Signing tab, you will find the SHA-256 certificate fingerprint of your App Signing Key.

Copy this fingerprint and paste it into your assetlinks.json file. It should look like a long string of hexadecimal characters separated by colons. Once updated on your web server, Android devices will successfully verify the association, and your application will render in full-screen mode without the browser interface.

Generating a Local Keystore

To sign your Android App Bundle for submission, you must generate a private key using the keytool utility. This tool is included with the Java Development Kit (JDK). You can generate a keystore by executing a specific command in your command line interface.

Here is an example of the command used to generate a new keystore:

keytool -genkey -v -keystore my-upload-key.keystore -alias my-key-alias -keyalg RSA -keysize 2048 -validity 10000

When you execute this command, the system will prompt you to enter a password for the keystore and for the key itself. It will also ask for administrative details such as your name, organisation, and location. This metadata is embedded within the self-signed certificate.

Key Command Parameters Explained

  • -keystore: The name of the output file that will store your private key. Keep this file secure.
  • -alias: A unique name for your key. You will reference this alias when signing your application.
  • -keyalg: The cryptographic algorithm used to generate the key. RSA is the industry standard.
  • -keysize: The size of the key in bits. A size of 2048 is recommended for robust security.
  • -validity: The lifespan of the certificate in days. A value of 10000 ensures the key remains valid for over 27 years.

Ready to ship your Android app?

Paste your PWA URL, get a signed APK and a Google Play ready AAB in minutes.

Build my app