📚 Encyclopedia

Android · updated 2026-10-13

Android app signing keys and why losing one is permanent

androidsigningkeystoreapkreleasebackup

Android only installs an update over an existing app if the new APK is signed with the same certificate. There is no recovery: lose the key and every user must uninstall (losing app data) and install fresh. For sideloaded apps with in-app updaters this is the single most important file in the project.

Conventions used across Justin's apps

The debug-key trap

Several apps (Run, Spectre, Forge) shipped release APKs signed with the Android debug key (CN=Android Debug, ~/.android/debug.keystore). It works, but updates are now tied to that one file on one desktop. Deleting ~/.android/ makes the SDK silently generate a new key, and every installed copy is orphaned. If an app already shipped that way, back the debug keystore up and never rotate it; check a key with apksigner verify --print-certs or keytool -printcert -jarfile app.apk.

Debug vs release on the same phone

A debug build and a release build have different signatures. Going from one to the other requires uninstalling, which wipes everything stored only on the device (for an SMS app: stars, reactions, drafts, scheduled messages, block flags; messages re-sync from the system provider). It also drops the app's AndroidKeyStore keys, so any encrypted local database becomes unreadable.

flutter run makes this easy to trigger by accident: on INSTALL_FAILED_UPDATE_INCOMPATIBLE it offers to uninstall the old version and does so, wiping the release app's data. That is how TLDR lost a phone's only E2E message key in July 2026. Recovery path (Android Auto Backup) and rules in Debug installs wipe app data, and recovering it with Android Auto Backup.

Lessons from TLDR (Flutter)

Device-owner apps

An app set as device owner (dpm set-device-owner) cannot change its signing key later. Install the release-signed build on day one. See Locking down an Android phone with a device-owner app.

Other identity mistakes to avoid

See also

Linked from

Sources: tldr memory (MEMORY.md, release-v1.31.0-audit, feedback_never_debug_install_real_device), apps memory (infra-apps-catalog-fdroid), keyboard memory (history), message memory (project_deploy_workflow), phone memory (kid-phone-project)