# sinanalizz123-max/rea-termux architecture

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

- Interactive diagram: https://gitdiagram.com/sinanalizz123-max/rea-termux
- Repository: https://github.com/sinanalizz123-max/rea-termux

## Overview

rea-termux is a Termux-facing REA wrapper for Android APK analysis, with separate utilities for combining split APKs and replacing classes in DEX files. The main workflow routes a user’s command either to engine-free REA passthrough or to Termux-native inspection/decompilation tools; README also documents blocked upstream Android-engine commands and fallback guidance. The standalone merge utilities have their own input-to-output workflows. The wrapper script itself was not excerpted, so its internal routing and tool calls are represented only where the README documents them.

Main entry points: [`rea-termux`](https://github.com/sinanalizz123-max/rea-termux/blob/main/rea-termux) (Termux command), [`apk-merge.py`](https://github.com/sinanalizz123-max/rea-termux/blob/main/apk-merge.py) (Split APK merger), [`DexMerge.java`](https://github.com/sinanalizz123-max/rea-termux/blob/main/DexMerge.java) (DEX class merger)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_wrapper["REA Termux wrapper"]
  node_cli["Termux command"]
  node_passthrough["REA passthrough"]
  node_manifest["Manifest inspection"]
  node_package_info["Package summary"]
  node_decode["APK decode"]
  node_decompile["Java decompile"]
  node_native["Native decompile"]
  node_source_search["Source searches"]
  node_inventory["UUID and URL inventory"]
  node_blocked["Blocked engine commands"]
  node_rea["Upstream REA"]
  node_aapt2["aapt2"]
  node_apktool["apktool"]
  node_jadx["jadx"]
  node_rizin["rizin and rz-ghidra"]
end

subgraph group_apk["APK utilities"]
  node_split_apks["Base and split APKs"]
  node_apk_merge["Split APK merger<br/>[apk-merge.py]"]
  node_merged_apk["Merged APK"]
end

subgraph group_dex["DEX utility"]
  node_base_patch["Base and patch DEX"]
  node_dex_merge["DEX class merger<br/>[DexMerge.java]"]
  node_merged_dex["Merged DEX"]
end

node_user(("Engineer"))

node_user -->|"runs command"| node_cli
node_cli -->|"passes through"| node_passthrough
node_passthrough -->|"invokes REA"| node_rea
node_cli -->|"routes command"| node_manifest
node_cli -->|"routes command"| node_package_info
node_cli -->|"routes command"| node_decode
node_cli -->|"routes command"| node_decompile
node_cli -->|"routes command"| node_native
node_cli -->|"routes command"| node_source_search
node_cli -->|"routes command"| node_inventory
node_cli -->|"blocks command"| node_blocked
node_manifest -->|"uses for metadata"| node_aapt2
node_package_info -->|"uses for metadata"| node_aapt2
node_decode -->|"decodes with"| node_apktool
node_decompile -->|"decompiles with"| node_jadx
node_native -->|"uses Ghidra via"| node_rizin
node_user -->|"runs utility"| node_apk_merge
node_split_apks -->|"provides inputs"| node_apk_merge
node_apk_merge -->|"writes archive"| node_merged_apk
node_user -->|"runs utility"| node_dex_merge
node_base_patch -->|"provides inputs"| node_dex_merge
node_dex_merge -->|"writes DEX"| node_merged_dex

click node_cli "https://github.com/sinanalizz123-max/rea-termux/blob/main/rea-termux"
click node_passthrough "https://github.com/sinanalizz123-max/rea-termux/blob/main/rea-termux"
click node_manifest "https://github.com/sinanalizz123-max/rea-termux/blob/main/rea-termux"
click node_package_info "https://github.com/sinanalizz123-max/rea-termux/blob/main/rea-termux"
click node_decode "https://github.com/sinanalizz123-max/rea-termux/blob/main/rea-termux"
click node_decompile "https://github.com/sinanalizz123-max/rea-termux/blob/main/rea-termux"
click node_native "https://github.com/sinanalizz123-max/rea-termux/blob/main/rea-termux"
click node_source_search "https://github.com/sinanalizz123-max/rea-termux/blob/main/rea-termux"
click node_inventory "https://github.com/sinanalizz123-max/rea-termux/blob/main/rea-termux"
click node_blocked "https://github.com/sinanalizz123-max/rea-termux/blob/main/rea-termux"
click node_apk_merge "https://github.com/sinanalizz123-max/rea-termux/blob/main/apk-merge.py"
click node_dex_merge "https://github.com/sinanalizz123-max/rea-termux/blob/main/DexMerge.java"

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_cli,node_passthrough,node_manifest,node_package_info,node_decode,node_decompile,node_native,node_source_search,node_inventory,node_blocked,node_rea,node_aapt2,node_apktool,node_jadx,node_rizin toneBlue
class node_split_apks,node_apk_merge,node_merged_apk toneAmber
class node_base_patch,node_dex_merge,node_merged_dex toneMint
class node_user toneIndigo
```

## Components

### REA Termux wrapper

- [Termux command](https://github.com/sinanalizz123-max/rea-termux/blob/main/rea-termux): `rea-termux`
- [REA passthrough](https://github.com/sinanalizz123-max/rea-termux/blob/main/rea-termux): `rea-termux`
- [Manifest inspection](https://github.com/sinanalizz123-max/rea-termux/blob/main/rea-termux): `rea-termux`
- [Package summary](https://github.com/sinanalizz123-max/rea-termux/blob/main/rea-termux): `rea-termux`
- [APK decode](https://github.com/sinanalizz123-max/rea-termux/blob/main/rea-termux): `rea-termux`
- [Java decompile](https://github.com/sinanalizz123-max/rea-termux/blob/main/rea-termux): `rea-termux`
- [Native decompile](https://github.com/sinanalizz123-max/rea-termux/blob/main/rea-termux): `rea-termux`
- [Source searches](https://github.com/sinanalizz123-max/rea-termux/blob/main/rea-termux): `rea-termux`
- [UUID and URL inventory](https://github.com/sinanalizz123-max/rea-termux/blob/main/rea-termux): `rea-termux`
- [Blocked engine commands](https://github.com/sinanalizz123-max/rea-termux/blob/main/rea-termux): `rea-termux`
- **Upstream REA**
- **aapt2**
- **apktool**
- **jadx**
- **rizin and rz-ghidra**

### APK utilities

- **Base and split APKs**
- [Split APK merger](https://github.com/sinanalizz123-max/rea-termux/blob/main/apk-merge.py): `apk-merge.py`
- **Merged APK**

### DEX utility

- **Base and patch DEX**
- [DEX class merger](https://github.com/sinanalizz123-max/rea-termux/blob/main/DexMerge.java): `DexMerge.java`
- **Merged DEX**

### Other components

- **Engineer**

## Connections

- Engineer → Termux command: runs command (evidence: `README.md`)
- Termux command → REA passthrough: passes through (evidence: `README.md`)
- REA passthrough → Upstream REA: invokes REA (evidence: `README.md`)
- Termux command → Manifest inspection: routes command (evidence: `README.md`)
- Termux command → Package summary: routes command (evidence: `README.md`)
- Termux command → APK decode: routes command (evidence: `README.md`)
- Termux command → Java decompile: routes command (evidence: `README.md`)
- Termux command → Native decompile: routes command (evidence: `README.md`)
- Termux command → Source searches: routes command (evidence: `README.md`)
- Termux command → UUID and URL inventory: routes command (evidence: `README.md`)
- Termux command → Blocked engine commands: blocks command (evidence: `README.md`)
- Manifest inspection → aapt2: uses for metadata (evidence: `README.md`)
- Package summary → aapt2: uses for metadata (evidence: `README.md`)
- APK decode → apktool: decodes with (evidence: `README.md`)
- Java decompile → jadx: decompiles with (evidence: `README.md`)
- Native decompile → rizin and rz-ghidra: uses Ghidra via (evidence: `README.md`)
- Engineer → Split APK merger: runs utility (evidence: `apk-merge.py`)
- Base and split APKs → Split APK merger: provides inputs (evidence: `apk-merge.py`)
- Split APK merger → Merged APK: writes archive (evidence: `apk-merge.py`)
- Engineer → DEX class merger: runs utility (evidence: `DexMerge.java`)
- Base and patch DEX → DEX class merger: provides inputs (evidence: `DexMerge.java`)
- DEX class merger → Merged DEX: writes DEX (evidence: `DexMerge.java`)
