Skip to content

Instantly share code, notes, and snippets.

@pascalwhoop
Created August 3, 2017 21:31
Show Gist options
  • Save pascalwhoop/6af35fa165b40c83cdcdca6857317198 to your computer and use it in GitHub Desktop.
Save pascalwhoop/6af35fa165b40c83cdcdca6857317198 to your computer and use it in GitHub Desktop.
Extracting and repackaging an android backup file
adb backup --noapk <your_apk_package_name>
#extract it, skipping the first 24. we'll use them later though, so keep the files
dd if=backup.ab bs=24 skip=1 | /usr/local/ssl/bin/openssl zlib -d > backup.tar
# do some stuff with it ...
#then repackage everything
/usr/local/ssl/bin/openssl zlib -e < ./newbackup.tar | dd of=newbackup.ab bs=24 seek=1
#reapply the first 24 bit to the file
dd if=mybackup.ab bs=24 count=1 | dd of=backup.ab bs=24 conv=notrunc
adb restore newbackup.adb #and confirm on the device
@tmst
Copy link

tmst commented Jul 3, 2018

I might be able to use this if it accepted the desktop backup password set on the device.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment