7

I noticed that for some system apps (for example Chrome, which is preinstalled by default on my device), I can't do adb backup. Doing so results in the 47 bytes dummy .ab file. I checked in the manifest and they have allowBackup="true".

E.g. for Chrome, the content of the manifest is

allowBackup="true"
backupAgent="org.chromium.chrome.browser.ChromeBackupAgent"
extractNativeLibs="false"
fullBackupOnly="false"

Why is this happening? How can I backup such apps' data without root?

P.S. Helium backup doesn't show system apps.

Andrew T.
  • 15,988
  • 10
  • 74
  • 123
ratcher86
  • 73
  • 4

1 Answers1

4

I found the reason in logcat while performing a backup:

BackupManagerService: Package com.android.chrome is key-value.

By default, for abd backup, key-value backups are disabled:

"/system/bin/bu" (the command that is called on-device by adb backup) help text:

-keyvalue|-nokeyvalue: include apps that perform key/value backups. (default -nokeyvalue)

Therefore, you need to include the -keyvalue option to create a Chrome backup:

adb backup -keyvalue -f chrome.ab com.android.chrome

This creates a backup file that contains only the Chrome settings (no cache files, cookies, local data, ...)

Andrew T.
  • 15,988
  • 10
  • 74
  • 123
Robert
  • 20,025
  • 6
  • 47
  • 66
  • 1
    Any way to find out before the backup failed that this parameter is needed? Or is it safe to always provide it just-in-case, and "normal" apps will still be backed up as without? – Izzy Nov 29 '21 at 20:11