adb backup
and adb restore
are obscure (not mentioned in adb --help
) and depracated features of adb
but no root needed
adb backup
and adb restore
commands documented here
file generated by adb backup
is optionally compressed, optinally encrypted tar (pax (kinda) format (don't confuse with pax
command)) container
files and pax headers in tar archive need to be be in secific order and have specific names, so extracting and creating archive probably won't work (adb restore
silently fails)
you can u
pdate files in tar archive without extracting everything using 7zz
(7-Zip for Linux: console version) u
command
here is help for old version of 7z.exe
but most command line options are same as 7zz
abpy.py
depends on pycryptodome if using pbkdf2engine=pycryptodome
or aes256engine=pycryptodome
abpy.py
depends on pycryptodomex if using pbkdf2engine=pycryptodomex
or aes256engine=pycryptodomex
example: modify /data/data/com.gdpsedi.geometrydashsubzero/CCLocalLevels.dat
on android no root using linux computer
- backup
com.gdpsedi.geometrydashsubzero
's files intobackup.ab
:$ adb backup com.gdpsedi.geometrydashsubzero WARNING: adb backup is deprecated and may be removed in a future release
- convert
backup.ab
tobackup.tar
:$ python3 abpy.py ab2tar if=backup.ab of=backup.tar
- find
CCLocalLevels.dat
path inl
ist of files inbackup.tar
:$ 7zz l backup.tar | grep -F CCLocalLevels.dat 2023-04-13 11:11:51 ..... 733 1024 apps/com.gdpsedi.geometrydashsubzero/r/CCLocalLevels.dat
- e
x
tract with full pathapps/com.gdpsedi.geometrydashsubzero/r/CCLocalLevels.dat
frombackup.tar
:$ 7zz x backup.tar apps/com.gdpsedi.geometrydashsubzero/r/CCLocalLevels.dat 7-Zip (z) 22.01 (x64) : Copyright (c) 1999-2022 Igor Pavlov : 2022-07-15 64-bit locale=en_US.UTF-8 Threads:12, ASM Scanning the drive for archives: 1 file, 6880256 bytes (6719 KiB) Extracting archive: backup.tar -- Path = backup.tar Type = tar Physical Size = 6880256 Headers Size = 14336 Code Page = UTF-8 Characteristics = POSIX PREFIX PAX path ASCII Everything is Ok Size: 733 Compressed: 6880256
- edit
apps/com.gdpsedi.geometrydashsubzero/r/CCLocalLevels.dat
u
pdateapps/com.gdpsedi.geometrydashsubzero/r/CCLocalLevels.dat
tobackup.tar
:$ 7zz u backup.tar apps/com.gdpsedi.geometrydashsubzero/r/CCLocalLevels.dat 7-Zip (z) 22.01 (x64) : Copyright (c) 1999-2022 Igor Pavlov : 2022-07-15 64-bit locale=en_US.UTF-8 Threads:12, ASM Open archive: backup.tar -- Path = backup.tar Type = tar Physical Size = 6880256 Headers Size = 14336 Code Page = UTF-8 Characteristics = POSIX PREFIX PAX path ASCII Scanning the drive: 1 file, 824 bytes (1 KiB) Updating archive: backup.tar Keep old data in archive: 6 folders, 17 files, 6861172 bytes (6701 KiB) Add new data to archive: 1 file, 824 bytes (1 KiB) Files read from disk: 1 Archive size: 6880256 bytes (6719 KiB) Everything is Ok
- get info about
backup.ab
:$ python3 abpy.py abinfo if=backup.ab ver=5 compr
- convert
backup.tar
tobackup.ab
with that info:$ python3 abpy.py tar2ab if=backup.tar of=backup.ab compr ver=5
- restore the new
backup.ab
:$ adb restore backup.ab WARNING: adb restore is deprecated and may be removed in a future release Now unlock your device and confirm the restore operation.
- https://github.com/nelenkov/android-backup-extractor/
- https://nelenkov.blogspot.com/2012/06/unpacking-android-backups.html
- https://forum.xda-developers.com/t/guide-how-to-extract-create-or-edit-android-adb-backups.2011811/
- https://sourceforge.net/projects/android-backup-processor/files/