تطبيقات الموبايلالنشر على الـ Stores· 7 دقائق للقراءة
Upload Key vs App Signing Key: What Really Happens When You Sign an Android App
With Play App Signing, the key on your machine only proves to Google that the upload is yours. Phones verify a different key, and that changes what you can lose.
The laptop that held a Flutter team's release keystore dies, and there's no backup. Someone starts drafting a message asking users to install a "new" app under a new package name, because everyone knows an Android app can only be updated with the same key. Before it goes out, the lead opens the Play Console's app signing page and finds two certificates with different fingerprints, one of them held by Google. The message never ships. The same page also explains last month's mystery: Google Sign-In worked on every test phone and failed for users who installed from Play.
The common misconception
The belief: the keystore you sign your release with is your app's identity. Users' phones check that signature on every update, so losing the key means you can never update the app again, and its SHA-1 fingerprint is the one to give Google Sign-In, Maps or Facebook Login.
That used to be exactly how it worked, and it's still true for apps that manage their own signing key. Android's own docs explain that the system allows an update only "if the certificates match". Flutter's release guide walks you through creating a keystore and wiring it into Gradle, and many older tutorials stop there. The file is even named upload-keystore.jks, but few people stop to ask what "upload" means. The half-truth: phones do verify a signing certificate on every update, and losing that key is fatal. With Play App Signing, it just isn't the key on your machine.
What actually happens
Two keys with two jobs
Android's docs say Play App Signing "uses two keys: the app signing key and the upload key". You keep the and use it to sign the app bundle you upload. Google "uses the upload certificate to verify your identity, and signs your APK(s) with your for distribution". Flutter's docs put it in two sentences: developers upload a file "signed with an upload key", and "the end-users download the .apk file signed with an app signing key."
Google has to hold that second key because a bundle isn't what users install. Play builds optimized APKs from it, and someone has to sign them. For new apps this isn't a choice: the docs describe managing your own app signing key as an option "only for apps created before August 2021".
The phone only knows the app signing key
When Android installs an update, "it compares the certificate(s) in the new version with those in the existing version." The APK that reaches the phone was signed by Google with the app signing key, so that's the certificate that has to match. Your upload key's job ends when Play accepts the bundle.
The strict rule applies to the app signing key: the docs call it the key that "never changes during the lifetime of your app". Play does offer a key upgrade if it's compromised, but the docs explain that older Android versions don't enforce the new key, so it's a partial escape, not a clean swap.
Losing each key
Lose the upload key, or suspect it leaked, and Play's help is clear: "you are not locked out of your app." You create a new key, export its certificate and ask for a reset in the Play Console. The reset "will not affect the app signing key that Google Play uses to re-sign APKs before delivering to users", so updates keep flowing.
Bash · reset-upload-key.sh
# Lost upload key: create a new one...keytool -genkey -v -keystore ~/upload-keystore.jks -keyalg RSA \ -keysize 2048 -validity 10000 -alias upload# ...export its certificate, then in Play Console:# Upload key certificate > Request upload key resetkeytool -export -rfc -keystore ~/upload-keystore.jks -alias upload \ -file upload_certificate.pem
The app signing key is different. Google keeps it, and you can't download a copy. If you manage it yourself, the misconception is exactly right: "If you lose or misplace your key, you will not be able to publish updates to your existing app. You cannot regenerate a previously generated key."
Fingerprints: register the key users' phones see
Services like Google Maps, OAuth or Facebook Login recognize your app by a . Play's help states the trap directly: "Because Google signs the final APK, you must register the Google-held app signing key fingerprint with your API providers, not just your local upload key." A build you sign yourself carries your fingerprint; a build installed from Play carries Google's.
Finding the right fingerprint
Bash · fingerprint.sh
# This is the UPLOAD key. Its SHA-1 matches builds you sign# yourself, not the APKs Google Play delivers to users.keytool -list -v -keystore ~/upload-keystore.jks -alias upload
Bash · fingerprint.sh
# Copy the fingerprints from Play Console, or download the app# signing certificate there and read it (file name is yours):keytool -printcert -file app_signing_cert.der
Both commands print the same kind of output. On a throwaway keystore made with the Flutter docs' command, -list -v showed the alias, owner, validity dates and the SHA1 and SHA256 fingerprints; -printcert on the exported certificate printed identical fingerprints. The commands aren't the problem. The certificate you feed them is.
Upload key
App signing key
Who holds it
You (keystore, CI secret)
Google Play, unless you manage it yourself
What it signs
The bundle you upload
The APKs users install
Who checks it
Google Play, on upload
Android, on every install and update
If it's lost or leaked
Request an upload key reset
Held by Google: nothing to lose; self-managed: no updates
Fingerprint matters for
Builds you sign and install yourself
Every user who installs from Play
How to apply it in your project
Look at your app signing pageIn Play Console, open Protected with Play, then Play Store protection, then Manage Play app signing. Confirm that Google holds the app signing key and note both certificates.
Register the right fingerprintsCopy the app signing key's SHA-1 or SHA-256 into Firebase, Google Cloud, Facebook and any other provider. Add your debug fingerprint for development, and update assetlinks.json if you use App Links.
Protect and back up the upload keyKeep the keystore and its passwords in a password manager or CI secret store, never in Git. Use a different key from the app signing key, as both guides recommend.
Know the reset path before you need itWrite down the reset steps: new key, keytool -export -rfc, Request upload key reset. A lost laptop then becomes an inconvenience, not an incident.
Decide about self-managed keysIf an older app still signs with its own key, back it up in two safe places, or upgrade to Play App Signing from the same Play Console page.
Key takeaways
With Play App Signing, your keystore holds an upload key; Google signs what users install with the app signing key.
Android checks the app signing key on every update; the upload key only matters to Play.
A lost or leaked upload key can be reset; a lost self-managed app signing key ends updates.
Register the app signing key's fingerprints from Play Console with API providers, not your local SHA-1.
Keep keystores and passwords out of the repository, and know the reset steps in advance.
التعليقات (0)