#payload #packer #partition #android #cli

app payload_packer

CLI Utility to pack android device partitions as payload.bin

1 unstable release

Uses new Rust 2024

new 0.1.0 May 17, 2025

#123 in Compression

Apache-2.0

39KB
840 lines

payload_packer

  • CLI utility to pack Android device partitions as payload.bin.

⚠️ This tool is experimental.

Usage

Usage: payload_packer [OPTIONS] [IMAGES_DIR]

Arguments:
  [IMAGES_DIR]
          Directory containing image files to pack

Options:
      --out <OUT>
          Path to the output payload.bin file (default: output/payload.bin)
      --images-path <IMAGES_PATH>
          Specific image paths (can be used instead of or together with images_dir)
      --images <IMAGES>
          Comma-separated list of partition names to include (default: all)
      --method <METHOD>
          Compression method to use (xz or zstd) [default: xz] [possible values: xz, zstd]
      --threads <THREADS>
          Number of threads to use for parallel processing
      --block-size <BLOCK_SIZE>
          Block size in bytes [default: 4096]
      --skip-prop
          Skip creation of payload_properties.txt file
  -h, --help
          Print help
  -V, --version
          Print version
  • ✅ Pack multiple partitions into a payload.bin

  • ✅ Supports XZ and Zstd

  • ✅ Multi-threaded compression

Feature XZ Zstandard (zstd)
Compression Ratio Higher Slightly lower
Speed Slower (high compression time) Much faster (both compress & decompress)

Note:

This tool does not verify whether input .img files are valid Android partition images.
It will pack any files with a .img extension.

Build

  • Install Cargo & Rust Compiler
cargo install payload_packer

Dependencies :

Dependencies

~11–21MB
~324K SLoC