百科.dev
全部条目AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
P

payload-dumper-go

> 编程语言
开源

一个用 Go 编写的 Android OTA 有效载荷抽取器

3.4K stars0 点赞0 次浏览
访问官网GitHub

工具介绍

一个用 Go 编写的 Android OTA 有效载荷抽取器

payload-dumper-go

An android OTA payload dumper written in Go.

Features

See how fast payload-dumper-go is: https://imgur.com/a/X6HKJT4. (MacBook Pro 16-inch 2019 i9-9750H, 16G)

  • Incredibly fast decompression. All decompression progresses are executed in parallel.
  • Incremental OTA (delta) payload support. Applied on top of the base images (-old), bit-exact output.
  • Verifies everything: operation data, source images, and final images (sha256). Fails loudly with a non-zero exit code.
  • Support original zip package that contains payload.bin, read in place without a temp copy.
  • Usable as a Go library. (github.com/ssut/payload-dumper-go/payload)

Cautions

  • There's just one dependency you need to install on your system: xz. (The reason I didn't use the pure Go implementation is written in the Performance section below.)
  • Working on a SSD is highly recommended for performance reasons, a HDD could be a bottle-neck.

Limitations

  • PUFFDIFF, ZUCCHINI and LZ4DIFF_* delta operations are not supported yet. Affected partitions (usually only system/product/system_ext) fail with a clear error; extract the rest with -p.

Installation

Linux and macOS (From releases, recommended)

  1. Download the latest binary for your platform from here and extract the contents of the downloaded file to a directory on your system.
  2. Make sure the extracted binary file has executable permissions. You can use the following command to set the permissions if necessary:
chmod +x payload-dumper-go
  1. Run the following command to add the directory path to your system's PATH environment variable:
export PATH=$PATH:/path/to/payload-dumper-go

Note: This command sets the PATH environment variable only for the current terminal session. To make it permanent, you need to add the command to your system's profile file (e.g. .bashrc or .zshrc for Linux/Unix systems).

macOS (Homebrew)

Just simply run:

$ brew install payload-dumper-go

Windows

  1. Download the latest binary for your platform from here and extract the contents of the downloaded file to a directory on your system.
  2. Open the Start menu and search for "Environment Variables".
  3. Click on "Edit the system environment variables".
  4. Click on the "Environment Variables" button at the bottom right corner of the "System Properties" window.
  5. Under "System Variables", scroll down and click on the "Path" variable, then click on "Edit".
  6. Click "New" and add the path to the directory where the extracted binary is located.
  7. Click "OK" on all the windows to save the changes.

Usage

Run the following command in your terminal:

payload-dumper-go /path/to/payload.bin

The input can be a raw payload.bin or an OTA zip, detected by content.

Options:
  -c, -concurrency       Number of workers to extract concurrently (default: number of CPUs)
  -l, -list              Show list of partitions in payload.bin
  -o, -output            Set output directory
  -p, -partitions        Dump only selected partitions (comma-separated)
  -old                   Directory with base images, required for incremental OTA
  -q, -quiet             Quiet mode - suppress non-essential output
  -m, -machine-readable  Machine-readable output format
  -no-verify             Skip sha256 verification

Incremental (delta) OTA

Extract the base (previous) full OTA first, then pass it via -old:

payload-dumper-go -o base_images base_full_ota.zip
payload-dumper-go -old base_images -o new_images incremental_ota.zip

Library usage

import "github.com/ssut/payload-dumper-go/payload"

p, _ := payload.Open("ota.zip")
defer p.Close()

err := p.Extract(context.Background(), payload.ExtractOptions{
    OutputDir: "out",
    SourceDir: "base_images",
})

Performance

Machine: MacBook Pro 16-inch 2021 (Apple M1 Max, 64G), OS: macOS Sonoma 14.5, Go: 1.22.4.

Tested with a 2.31GB payload.bin file from https://developers.google.com/android/ota (akita).

…

Why not use the pure Go implementation for xz decompression?

The pure Go implementation of xz is very slow compared to the C implementation used with CGO. Here's the result with the same payload.bin file on the same conditions:

…

As you can see, the pure Go implementation is about 6~ times slower than the C implementation.

Sources

https://android.googlesource.com/platform/system/update_engine/+/master/update_metadata.proto

License

This source code is licensed under the Apache License 2.0 as described in the LICENSE file.

GitHub Issues· 2 开放

在 GitHub 查看全部
  • #69

    [Feature Request] Implement FEC

    更新于 2026年8月26日

> 标签

Goandroidgolang

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言