3

On my non-rooted phone first I did adb backup -all -apk -obb -f lenovo.ab and bit later adb restore lenovo.ab (both commands had no errors). Surprisingly I did not find quite a lot of apps after the restore. There are two options: these apps were not stored in the backup file in the first command or they were not restored in the second. To check the first option, I made a tar file from backup with dd if=lenovo.ab bs=24 skip=1 | openssl zlib -d > lenovo.tar (advice taken from Is there a way to look inside and modify an adb backup created file?) and did not find the missing apps there. So adb did not store them.

The question is why? Probably many of the missing apps (or even all of them) were not updated for a long time. Can this be the reason to discard the app from backup?

1 Answer 1

1
# adb shell bu -h
 backup [-f FILE] [-apk|-noapk] [-obb|-noobb] [-shared|-noshared] [-all]
        [-system|-nosystem] [-keyvalue|-nokeyvalue] [PACKAGE...]
     write an archive of the device's data to FILE [default=backup.adb]
     package list optional if -all/-shared are supplied
     -apk/-noapk: do/don't back up .apk files (default -noapk)
     -obb/-noobb: do/don't back up .obb files (default -noobb)
     -shared|-noshared: do/don't back up shared storage (default -noshared)
     -all: back up all installed applications
     -system|-nosystem: include system apps in -all (default -system)
     -keyvalue|-nokeyvalue: include apps that perform key/value backups.
         (default -nokeyvalue)
 restore FILE             restore device contents from FILE

There are two important things to consider when backing up apps through adb. First, all those apps whose developers do not want it to be backed up are never backed by adb. This is done by declaring a flag (allowbackup) in app's manifest. Second, even if a developer wants their app to be backed up, they can decide on either full backup (fullbackuponly) or only the key/value pairs backup. This is again done through app's manifest.

In your case, only the apps with allowbackup=true and fullbackuponly=true were backed up. Installation age or last revision's age of an app has no bearing on adb backup.

If you are curious to know which apps couldn't be backed up, I suggest you try an app from user Izzy's extensive app inspection list. As of now, I'm not aware of any app which can sort and show the apps based on those backup attributes.

3
  • The answer is really clear, thank you very much especially for the Izzy's list.
    – zeliboba
    Feb 7, 2019 at 16:24
  • Is there a way to bypass this flag and backup anyway without rooting?
    – Ben
    Oct 22, 2021 at 13:52
  • There is no way to do that because that would violate the trust model upon which an app developer chose to keep sensitive data away from backup mechanism. @Ben
    – Firelord
    Oct 22, 2021 at 14:40

You must log in to answer this question.

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