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.

1

1 Answer 1

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, ...)

1
  • 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
    Commented Nov 29, 2021 at 20:11

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .