# vm03/payload_dumper architecture

> Architecture diagram of the GitHub repository vm03/payload_dumper, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-11). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/vm03/payload_dumper
- Repository: https://github.com/vm03/payload_dumper

## Overview

This is a command-line Android OTA payload dumper. The workflow accepts a local or remote payload (optionally inside a ZIP), parses its manifest, selects partitions, and writes partition images. Incremental updates use original images from the old-image directory; full and incremental extraction share the operation-application path. The sampled script supports remote filesystems, image selection, compressed replacements, and patch operations. The generated protobuf module is listed in the tree but was not sampled, so its internal behavior is not expanded here.

Main entry points: [`payload_dumper.py`](https://github.com/vm03/payload_dumper/blob/master/payload_dumper.py) (CLI and workflow), [`update_metadata_pb2.py`](https://github.com/vm03/payload_dumper/blob/master/update_metadata_pb2.py) (Manifest schema)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_input["Payload input"]
  node_entry["CLI and workflow<br/>[payload_dumper.py]"]
  node_opener["Payload opener<br/>[payload_dumper.py]"]
  node_manifest["Manifest parser<br/>[payload_dumper.py]"]
  node_metadata["Manifest schema"]
end

subgraph group_extract["Image extraction"]
  node_selector["Partition selection<br/>[payload_dumper.py]"]
  node_partition["Partition dumper<br/>[payload_dumper.py]"]
  node_operations["Operation applier<br/>[payload_dumper.py]"]
  node_patch["Patch and codecs<br/>[payload_dumper.py]"]
end

subgraph group_storage["Image storage"]
  node_oldimages[("Original images")]
  node_images[("Output images")]
end

node_user(("CLI user"))
node_payload["OTA payload"]
node_remote[("Remote storage")]

node_user -->|"runs"| node_entry
node_payload -->|"supplies"| node_opener
node_remote -->|"serves files"| node_opener
node_entry -->|"opens payload"| node_opener
node_entry -->|"parses manifest"| node_manifest
node_manifest -->|"uses schema"| node_metadata
node_entry -->|"selects partitions"| node_selector
node_entry -->|"dumps partitions"| node_partition
node_partition -->|"applies operations"| node_operations
node_operations -->|"decodes patches"| node_patch
node_partition -->|"reads originals"| node_oldimages
node_partition -->|"writes images"| node_images

click node_entry "https://github.com/vm03/payload_dumper/blob/master/payload_dumper.py"
click node_opener "https://github.com/vm03/payload_dumper/blob/master/payload_dumper.py"
click node_manifest "https://github.com/vm03/payload_dumper/blob/master/payload_dumper.py"
click node_metadata "https://github.com/vm03/payload_dumper/blob/master/update_metadata_pb2.py"
click node_selector "https://github.com/vm03/payload_dumper/blob/master/payload_dumper.py"
click node_partition "https://github.com/vm03/payload_dumper/blob/master/payload_dumper.py"
click node_operations "https://github.com/vm03/payload_dumper/blob/master/payload_dumper.py"
click node_patch "https://github.com/vm03/payload_dumper/blob/master/payload_dumper.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_entry,node_opener,node_manifest,node_metadata,node_user toneBlue
class node_selector,node_partition,node_operations,node_patch,node_remote toneAmber
class node_oldimages,node_images toneMint
class node_payload toneIndigo
```

## Components

### Payload input

- [CLI and workflow](https://github.com/vm03/payload_dumper/blob/master/payload_dumper.py): `payload_dumper.py`
- [Payload opener](https://github.com/vm03/payload_dumper/blob/master/payload_dumper.py): `payload_dumper.py`
- [Manifest parser](https://github.com/vm03/payload_dumper/blob/master/payload_dumper.py): `payload_dumper.py`
- [Manifest schema](https://github.com/vm03/payload_dumper/blob/master/update_metadata_pb2.py): `update_metadata_pb2.py`

### Image extraction

- [Partition selection](https://github.com/vm03/payload_dumper/blob/master/payload_dumper.py): `payload_dumper.py`
- [Partition dumper](https://github.com/vm03/payload_dumper/blob/master/payload_dumper.py): `payload_dumper.py`
- [Operation applier](https://github.com/vm03/payload_dumper/blob/master/payload_dumper.py): `payload_dumper.py`
- [Patch and codecs](https://github.com/vm03/payload_dumper/blob/master/payload_dumper.py): `payload_dumper.py`

### Image storage

- **Original images**
- **Output images**

### Other components

- **CLI user**
- **OTA payload**
- **Remote storage**

## Connections

- CLI user → CLI and workflow: runs (evidence: `README.md`)
- OTA payload → Payload opener: supplies (evidence: `payload_dumper.py`)
- Remote storage → Payload opener: serves files (evidence: `payload_dumper.py`)
- CLI and workflow → Payload opener: opens payload (evidence: `payload_dumper.py`)
- CLI and workflow → Manifest parser: parses manifest (evidence: `payload_dumper.py`)
- Manifest parser → Manifest schema: uses schema (evidence: `payload_dumper.py`)
- CLI and workflow → Partition selection: selects partitions (evidence: `payload_dumper.py`)
- CLI and workflow → Partition dumper: dumps partitions (evidence: `payload_dumper.py`)
- Partition dumper → Operation applier: applies operations (evidence: `payload_dumper.py`)
- Operation applier → Patch and codecs: decodes patches (evidence: `payload_dumper.py`)
- Partition dumper → Original images: reads originals (evidence: `payload_dumper.py`)
- Partition dumper → Output images: writes images (evidence: `payload_dumper.py`)
