Utility to extract and repack Android backups created with adb backup
(ICS+).
Largely based on BackupManagerService.java
from AOSP.
Requires Java 11. Handling encrypted backups requires the JCE unlimited strength jurisdiction policy (not needed if using current Java 9 release).
http://www.oracle.com/technetwork/java/javase/downloads/jce-7-download-432124.html
Use one of the tools listed below to build or see Releases for pre-built binaries (runnable jar files).
Download the latest version of Bouncy Castle Provider jar
(bcprov-jdk15on-*.jar
) from here:
Drop the latest Bouncy Castle jar in lib/
, import in Eclipse and adjust
build path if necessary. Use the abe
script to start the utility.
To create a self-executable all-in-one jar:
mvn clean package
and then:
java -jar target/abe.jar pack|unpack|pack-kk ...
Use the bundled Ant script to create an all-in-one jar and run with:
(you still need to put the Bouncy Castle jar in lib/; modify the
bcprov.jar
property accordingly)
java -jar abe.jar pack|unpack|pack-kk ...
(Thanks to Jan Peter Stotz for contributing the build.xml file)
Use gradle to create an all-in-one jar:
./gradlew
and then:
java -jar build/libs/abe-all.jar pack|unpack|pack-kk ...
abe unpack <backup.ab> <backup.tar> [password]
abe pack <backup.tar> <backup.ab> [password]
abe pack-kk <backup.tar> <backup.ab> [password]
If the filename is -
, then data is read from standard input or written to
standard output.
If the password is not given on the command line, then the environment variable
ABE_PASSWD
is tried. If you don't specify a password the backup archive won't
be encrypted but only compressed.
allowBackup
flag set to false
are not backed up nor restored.
adb push
and adb shell
)BackupManagerService
.The safest way to pack a tar archive is to get the list of files from the original backup.tar file:
tar tf backup.tar | grep -F "com.package.name" > package.list
And then use that list to build the tar file. In the extracted backup directory:
tar cf restore.tar -T package.list
You can now pack restore.tar
and try adb restore restore.ab
Releases are built with Travis CI from the master branch and include a runnable fat jar.
Use the binaries at your own risk. No warranty or support provided.
Please report only bugs in backup extractor itself, I can't answer questions regrading unpacking/repacking backups or tar files. (See Usage for a mini usage guide.)
More details about the backup format and the tool implementation in the associated blog post.