Skip to content

Instantly share code, notes, and snippets.

@timrach
Created December 25, 2023 19:22
Show Gist options
  • Save timrach/256095c285baa7f322da0bfa4d19a27a to your computer and use it in GitHub Desktop.
Save timrach/256095c285baa7f322da0bfa4d19a27a to your computer and use it in GitHub Desktop.
Convert Android Backup file to tarball
import zlib
# Read the android backup file 'backup.ab' and
# convert it to a tar archive file 'backup.tar'
with open("backup.ab", "rb") as input:
_skip = input.read(24)
_bytes = input.read()
data = zlib.decompress(_bytes)
open("backup.tar", "wb").write(data)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment