← All articlesMobile applications

Android backups: what gets restored and how to check privacy

After moving to a new phone, users expect their familiar settings. Developers need to check more: did data that the app should have forgotten return, and does the restored sign-in state match the product policy? Finding allowBackup in the manifest is not enough. Start with a clear data inventory and test actual behavior.

Private storage and backups address different boundaries

Android internal storage is suitable for data that other apps should not access during normal use. A private file may still participate in backup. Protection from another app and rules for moving data to a new device are separate boundaries.

Auto Backup includes many application files, SharedPreferences and databases by default; cache, code-cache and no-backup directories are excluded. The value allowBackup=true does not by itself demonstrate a vulnerability. Establish what the app stores and which data the product intentionally transfers.

Separate cloud restoration from device-to-device transfer

Cloud backups and Android-to-Android device-to-device transfer, or D2D, have separate controls. Android documentation warns that, for apps targeting API 31 or higher, allowBackup=false may disable cloud backups without disabling D2D on devices from some manufacturers.

Record the exact scenario: restoring from the cloud to the same device, restoring to a new one, or transferring directly between devices. Any additional transfer modes your product supports need separate checks. One successful test does not cover every restoration method or manufacturer-specific behavior.

Check the rules for your OS and targetSdk

For an app targeting API 31 or higher on Android 12+, define backup rules through android:dataExtractionRules and the data-extraction-rules format. Configure cloud-backup and device-transfer separately. If the app supports Android 11 and earlier, retain the fullBackupContent configuration those devices need.

Inspect the release manifest and XML actually packaged in the build. Excluding a file from cloud backup does not exclude it from D2D. Do not treat a missing rules section as a transfer prohibition. getNoBackupFilesDir is excluded from Auto Backup; it does not promise protection from every copying method or a compromised device.

Set an expectation for each data class

Make a table covering language settings, local drafts, caches and sign-in data. For each class, record the storage location, permitted transfer method and expected state after restoration. This is a product policy: users should understand which data survives a device change.

For sessions, decide separately whether sign-in restoration is allowed and which supported mechanism provides it. A restored authorization flag in preferences does not replace a valid server session. The server must reject revoked access after a transfer as well. Do not turn an ordinary settings file into storage for live authentication tokens.

Use a fictional restoration scenario

An educational order approval app stores a Russian-language preference, a draft containing TEST-DRAFT and a local sign-in flag. Every order and account is fictional. The team expects the language to transfer and the draft to transfer only in an explicitly permitted scenario.

After restoration, the language is retained and the interface shows a signed-in user. That does not establish that the server accepted the session: test a permitted action on your own test object separately. If TEST-DRAFT appears in a scenario where transfer is prohibited, record the exact mode and active rules. This illustrates how to design a test; it is not a report of a discovered leak.

Establish that backup and restoration actually completed

Use a test build and accounts containing synthetic data. Follow the official guide to verify the selected transport and successful restoration of an allowed control value. Then look only for your own markers in data classes that should be excluded. Test cloud restoration and D2D separately.

Record the OS version, targetSdk, release build contents and actual outcome. If the transport failed or the control value did not return, a missing private draft does not establish correct rules. An emulator helps with repeatable scenarios, but it does not reproduce every manufacturer-specific behavior.

  • A control setting was restored, showing that the chosen scenario completed.
  • The educational marker is absent where policy prohibits its transfer.
  • Sign-in restoration follows the selected policy, and a revoked session receives no access.
  • Supported legacy and newer configurations have been checked separately.

Distinguish configuration from observed behavior

A flag or XML file describes configuration. A test with confirmed restoration demonstrates behavior for a particular build and environment. Include both in a fix ticket, along with the expected outcome. Address the transfer policy for sensitive data first, then repeat the control scenario.

New XML does not establish that earlier backups were deleted: previous releases and historical data need a separate decision. If your mobile product has a website or web component, you can request a free CheckMyApp audit of that part. Complement backup testing with a review of the server component that makes data access decisions.

Sources and documentation

  1. Android Developers: Auto Backup
  2. Android Developers: Android 12 backup and restore changes
  3. Android Developers: Data and file storage overview
  4. Android Developers: Test backup and restore
  5. OWASP MASVS-STORAGE-1: secure storage of sensitive data
  6. Android Developers: application manifest and allowBackup
CheckMyApp

Check your application’s security.

Enter your web application address and email. Get a free preliminary report and choose the depth of analysis.

Check for free