Scroll to navigation

UNPACK_BOOTIMG(1) User Commands UNPACK_BOOTIMG(1)

NAME

unpack_bootimg - Android boot.img manipulation tools

DESCRIPTION

usage: unpack_bootimg [-h] --boot_img BOOT_IMG [--out OUT]

[--format {info,mkbootimg}] [-0]

Unpacks boot, recovery or vendor_boot image.

options:

show this help message and exit
path to the boot, recovery or vendor_boot image
output directory of the unpacked images
text output format (default: info)
-0, --null
output null-terminated argument strings

Output format:

* info
Pretty-printed info-rich text format suitable for human inspection.
* mkbootimg
Output shell-escaped (quoted) argument strings that can be used to reconstruct the boot image. For example:
$ unpack_bootimg --boot_img vendor_boot.img --out out --format=mkbootimg |
tee mkbootimg_args
$ sh -c "mkbootimg $(cat mkbootimg_args) --vendor_boot repacked.img"
vendor_boot.img and repacked.img would be equivalent.
If the -0 option is specified, output unescaped null-terminated argument strings that are suitable to be parsed by a shell script (xargs -0 format):
$ unpack_bootimg --boot_img vendor_boot.img --out out --format=mkbootimg \

-0 | tee mkbootimg_args

$ declare -a MKBOOTIMG_ARGS=()
$ while IFS= read -r -d '' ARG; do
MKBOOTIMG_ARGS+=("${ARG}")
done <mkbootimg_args
$ mkbootimg "${MKBOOTIMG_ARGS[@]}" --vendor_boot repacked.img
September 2023 unpack_bootimg 34.0.4