DEVLOPN Audit

Uninstalling is not enough — Android Auto Backup silently restores your app data

From API 23 onward, Android backs up prefs, SQLite and cache to the user's Drive, then restores them on reinstall — before the app's very first launch.

This Android feature played a nasty trick on me. I uninstall the app, reinstall to start clean, relaunch. And there — surprise!

The first account's data was still there.

The culprit: Auto Backup.

Ghost data — when reinstallation doesn't start from scratch: uninstall, reinstall, Auto Backup, restored data

How it works

As soon as your app targets API 23 or higher, automatic backup to the user's Drive is active by default. Without a single line of code. Prefs, SQLite and cache included.

So on reinstall, you don't get a fresh app. The system restores the latest cloud snapshot right after install, before the very first launch.

What to do

You can keep the backup but exclude what has no business being there (cache, tokens) via:

  • dataExtractionRules (API 31+)
  • fullBackupContent before that

If you're still reading, I suspect you're about to go check your manifest. 😇