# impact-i/reflutter architecture

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

- Interactive diagram: https://gitdiagram.com/impact-i/reflutter
- Repository: https://github.com/impact-i/reflutter

## Overview

reFlutter reverse-engineers Flutter applications through engine replacement or runtime instrumentation. The main repack flow identifies an app’s snapshot hash, selects a matching engine, patches and repackages the app; parallel workflows provide Dart function dumps and Frida-based runtime SSL bypasses. The graph includes documented hash-index generation and dump-to-analysis capabilities. Some implementation details are unsampled, so uncertain links are omitted rather than inferred.

Main entry points: [`reflutter/__init__.py`](https://github.com/impact-i/reflutter/blob/main/reflutter/__init__.py) (Repack CLI), [`scripts/frida-dump.js`](https://github.com/impact-i/reflutter/blob/main/scripts/frida-dump.js) (Shorebird runtime dumper), [`frida-ssl.js`](https://github.com/impact-i/reflutter/blob/main/frida-ssl.js) (Runtime SSL bypass), [`frida.js`](https://github.com/impact-i/reflutter/blob/main/frida.js) (Function hook script)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_repack["Repack and patch"]
  node_reflutter["Repack CLI<br/>[__init__.py]"]
  node_utils["Engine utilities<br/>[utils.py]"]
  node_hash_index[("Snapshot indexes<br/>[enginehash.csv]")]
end

subgraph group_runtime["Runtime instrumentation"]
  node_ssl_runtime["Runtime SSL bypass<br/>[frida-ssl.js]"]
  node_function_hook["Function hook script<br/>[frida.js]"]
end

subgraph group_dump["Dart dump analysis"]
  node_shorebird_dump["Shorebird runtime dumper<br/>[frida-dump.js]"]
  node_dump_file["Function JSONL dump"]
  node_disasm["Disassembly scripts<br/>[dump2disasm.py]"]
end

subgraph group_engine["Engine hash support"]
  node_hash_generator["Hash index generator<br/>[gen_enginehash.py]"]
  node_snapshot_hash_tool["Snapshot hash tool"]
  node_engine_commit_tool["Engine commit lookup"]
end

node_user(("App analyst"))
node_target["Flutter app"]
node_repacked_app["Patched app"]
node_proxy["Intercepting proxy"]
node_frida["Frida runtime"]

node_user -->|"submits app"| node_reflutter
node_reflutter -->|"reads package"| node_target
node_reflutter -->|"uses utilities"| node_utils
node_reflutter -->|"matches hash"| node_hash_index
node_reflutter -->|"repackages"| node_repacked_app
node_repacked_app -->|"routes traffic"| node_proxy
node_user -->|"attaches script"| node_ssl_runtime
node_ssl_runtime -->|"patches verification"| node_target
node_user -->|"starts session"| node_frida
node_frida -->|"loads script"| node_function_hook
node_function_hook -->|"hooks offset"| node_target
node_frida -->|"loads script"| node_shorebird_dump
node_shorebird_dump -->|"reads runtime objects"| node_target
node_shorebird_dump -->|"writes JSONL"| node_dump_file
node_repacked_app -->|"emits dump"| node_dump_file
node_user -->|"converts dump"| node_disasm
node_dump_file -->|"provides input"| node_disasm
node_snapshot_hash_tool -->|"uses ELF parser"| node_utils
node_hash_generator -.-> node_hash_index

click node_reflutter "https://github.com/impact-i/reflutter/blob/main/reflutter/__init__.py"
click node_utils "https://github.com/impact-i/reflutter/blob/main/reflutter/utils.py"
click node_hash_index "https://github.com/impact-i/reflutter/blob/main/enginehash.csv"
click node_ssl_runtime "https://github.com/impact-i/reflutter/blob/main/frida-ssl.js"
click node_function_hook "https://github.com/impact-i/reflutter/blob/main/frida.js"
click node_shorebird_dump "https://github.com/impact-i/reflutter/blob/main/scripts/frida-dump.js"
click node_disasm "https://github.com/impact-i/reflutter/blob/main/scripts/dump2disasm.py"
click node_hash_generator "https://github.com/impact-i/reflutter/blob/main/scripts/gen_enginehash.py"
click node_snapshot_hash_tool "https://github.com/impact-i/reflutter/blob/main/scripts/get_snapshot_hash.py"
click node_engine_commit_tool "https://github.com/impact-i/reflutter/blob/main/scripts/get_flutter_engine.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_reflutter,node_utils,node_hash_index toneBlue
class node_ssl_runtime,node_function_hook toneAmber
class node_shorebird_dump,node_dump_file,node_disasm toneMint
class node_hash_generator,node_snapshot_hash_tool,node_engine_commit_tool toneRose
class node_user,node_target,node_repacked_app,node_proxy,node_frida toneIndigo
```

## Components

### Repack and patch

- [Repack CLI](https://github.com/impact-i/reflutter/blob/main/reflutter/__init__.py): `reflutter/__init__.py`
- [Engine utilities](https://github.com/impact-i/reflutter/blob/main/reflutter/utils.py): `reflutter/utils.py`
- [Snapshot indexes](https://github.com/impact-i/reflutter/blob/main/enginehash.csv): `enginehash.csv`

### Runtime instrumentation

- [Runtime SSL bypass](https://github.com/impact-i/reflutter/blob/main/frida-ssl.js): `frida-ssl.js`
- [Function hook script](https://github.com/impact-i/reflutter/blob/main/frida.js): `frida.js`

### Dart dump analysis

- [Shorebird runtime dumper](https://github.com/impact-i/reflutter/blob/main/scripts/frida-dump.js): `scripts/frida-dump.js`
- **Function JSONL dump**
- [Disassembly scripts](https://github.com/impact-i/reflutter/blob/main/scripts/dump2disasm.py): `scripts/dump2disasm.py`

### Engine hash support

- [Hash index generator](https://github.com/impact-i/reflutter/blob/main/scripts/gen_enginehash.py): `scripts/gen_enginehash.py`
- [Snapshot hash tool](https://github.com/impact-i/reflutter/blob/main/scripts/get_snapshot_hash.py): `scripts/get_snapshot_hash.py`
- [Engine commit lookup](https://github.com/impact-i/reflutter/blob/main/scripts/get_flutter_engine.py): `scripts/get_flutter_engine.py`

### Other components

- **App analyst**
- **Flutter app**
- **Patched app**
- **Intercepting proxy**
- **Frida runtime**

## Connections

- App analyst → Repack CLI: submits app (evidence: `README.md`)
- Repack CLI → Flutter app: reads package (evidence: `README.md`)
- Repack CLI → Engine utilities: uses utilities (evidence: `reflutter/__init__.py`)
- Repack CLI → Snapshot indexes: matches hash (evidence: `README.md`)
- Repack CLI → Patched app: repackages (evidence: `README.md`)
- Patched app → Intercepting proxy: routes traffic (evidence: `README.md`)
- App analyst → Runtime SSL bypass: attaches script (evidence: `README.md`)
- Runtime SSL bypass → Flutter app: patches verification (evidence: `frida-ssl.js`)
- App analyst → Frida runtime: starts session (evidence: `README.md`)
- Frida runtime → Function hook script: loads script (evidence: `README.md`)
- Function hook script → Flutter app: hooks offset (evidence: `frida.js`)
- Frida runtime → Shorebird runtime dumper: loads script (evidence: `README.md`)
- Shorebird runtime dumper → Flutter app: reads runtime objects (evidence: `scripts/frida-dump.js`)
- Shorebird runtime dumper → Function JSONL dump: writes JSONL (evidence: `scripts/frida-dump.js`)
- Patched app → Function JSONL dump: emits dump (evidence: `README.md`)
- App analyst → Disassembly scripts: converts dump (evidence: `README.md`)
- Function JSONL dump → Disassembly scripts: provides input (evidence: `README.md`)
- Snapshot hash tool → Engine utilities: uses ELF parser (evidence: `scripts/get_snapshot_hash.py`)
- Hash index generator → Snapshot indexes
