From Android 5.0 and later, all compiled system images (OEM’s, AOSP, LineageOS, etc) are not compressed anymore the way they used to be, because of their increasing size. The new systems are now packed within custom proprietary .DAT files. The question is: how to decompress them? These tools will help you get started!
For more information about the usage of these tools and tutorials, visit my XDA-Developers post.
This tool allows you to convert sparse Android data image (.dat) into filesystem ext4 image (.img). It requires Python 2.7 or newer installed on your system. It currently supports Windows, Linux, MacOS & ARM architectures.
Note: newer Google’s Brotli format (
system.new.dat.br) must be decompressed to a valid sparse data image before using
sdat2img.py <transfer_list> <system_new_file> [system_img]
<transfer_list>= input, system.transfer.list from rom zip
<system_new_file>= input, system.new.dat from rom zip
[system_img]= output ext4 raw image file (optional)
This tool allows you to convert back from filesystem ext4 image (.img) to Android sparse data image (.dat). It requires Python 2.7 or newer installed on your system. It currently supports Windows x86/x64, Linux x86/x64 & arm/arm64 architectures.
img2sdat.py <system_img> [-o outdir] [-v version] [-p prefix]
<system_img>= input system image
[-o outdir]= output directory (current directory by default)
[-v version]= transfer list version number (1 – 5.0, 2 – 5.1, 3 – 6.0, 4 – 7.0, will be asked by default, more info on xda thread)
[-p prefix]= name of image (prefix.new.dat)