# saddytech/openwrt-nx679j architecture

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

- Interactive diagram: https://gitdiagram.com/saddytech/openwrt-nx679j
- Repository: https://github.com/saddytech/openwrt-nx679j

## Overview

This repository documents and prototypes an OpenWrt router port for the NX679J phone. The principal workflow is to preserve the stock kernel, boot a reconstructed image into a ramdisk-based chroot on slot B, and use the X65 modem for network uplink; a native display UI provides local control. The tree also includes boot-chain and EDL/QDL research tools. The README supports the product-level links, while sampled source confirms the UI/font and QDL CLI/program-file relationships; many runtime subsystems were not sampled.

Main entry points: [`02-sorgenti/wifi-luci/nx679j-ui.c`](https://github.com/saddytech/openwrt-nx679j/blob/main/02-sorgenti/wifi-luci/nx679j-ui.c) (Native control UI), [`02-sorgenti/20260917-init-v9`](https://github.com/saddytech/openwrt-nx679j/tree/main/02-sorgenti/20260917-init-v9) (Boot image), [`04-persistenza`](https://github.com/saddytech/openwrt-nx679j/tree/main/04-persistenza) (OpenWrt chroot), [`02-sorgenti/20260917-init-v9/nx679j-init-v9.c`](https://github.com/saddytech/openwrt-nx679j/blob/main/02-sorgenti/20260917-init-v9/nx679j-init-v9.c) (Router init)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_boot["Boot and Recovery"]
  node_bootchain["Boot-chain analysis<br/>[parse-chain.py]"]
  node_qdl["QDL client<br/>[main.rs]"]
  node_programfile["Program files<br/>[programfile.rs]"]
  node_bootimage["Boot image"]
  node_stockkernel["Stock kernel"]
end

subgraph group_system["Router System"]
  node_init["Router init<br/>[nx679j-init-v9.c]"]
  node_openwrt["OpenWrt chroot"]
  node_persistence["Persisted config"]
end

subgraph group_connectivity["Modem Connectivity"]
  node_modem["X65 modem"]
  node_qmi["QMI and QRTR tools<br/>[rmnet-query.c]"]
end

subgraph group_interface["Native Interface"]
  node_ui["Native control UI<br/>[nx679j-ui.c]"]
  node_font["UI font<br/>[ui-font8x16.h]"]
end

node_owner(("Device owner"))
node_phone["NX679J device"]
node_display["Phone display"]

node_owner -->|"operates"| node_phone
node_bootchain -->|"informs reconstruction"| node_bootimage
node_qdl -->|"loads"| node_programfile
node_bootimage -->|"retains"| node_stockkernel
node_bootimage -->|"boots"| node_init
node_init -->|"starts chroot"| node_openwrt
node_openwrt -->|"uses"| node_persistence
node_openwrt -->|"controls modem"| node_qmi
node_qmi -->|"communicates"| node_modem
node_owner -->|"uses"| node_ui
node_ui -->|"draws on"| node_display
node_ui -->|"includes"| node_font
node_ui -->|"controls"| node_phone

click node_bootchain "https://github.com/saddytech/openwrt-nx679j/blob/main/02-sorgenti/20260917-boot-chain/parse-chain.py"
click node_qdl "https://github.com/saddytech/openwrt-nx679j/blob/main/05-bootchain-re/nx679j-openwrt-clean/research/cve-2026-25262-sm8450/tools/qdlrs/cli/src/main.rs"
click node_programfile "https://github.com/saddytech/openwrt-nx679j/blob/main/05-bootchain-re/nx679j-openwrt-clean/research/cve-2026-25262-sm8450/tools/qdlrs/cli/src/programfile.rs"
click node_bootimage "https://github.com/saddytech/openwrt-nx679j/tree/main/02-sorgenti/20260917-init-v9"
click node_stockkernel "https://github.com/saddytech/openwrt-nx679j/tree/main/02-sorgenti/20260917-init-v9"
click node_init "https://github.com/saddytech/openwrt-nx679j/blob/main/02-sorgenti/20260917-init-v9/nx679j-init-v9.c"
click node_openwrt "https://github.com/saddytech/openwrt-nx679j/tree/main/04-persistenza"
click node_persistence "https://github.com/saddytech/openwrt-nx679j/tree/main/04-persistenza"
click node_modem "https://github.com/saddytech/openwrt-nx679j/tree/main/09-albero-originale/experiments-extra"
click node_qmi "https://github.com/saddytech/openwrt-nx679j/blob/main/09-albero-originale/experiments-extra/qrtr/rmnet-query.c"
click node_ui "https://github.com/saddytech/openwrt-nx679j/blob/main/02-sorgenti/wifi-luci/nx679j-ui.c"
click node_font "https://github.com/saddytech/openwrt-nx679j/blob/main/02-sorgenti/wifi-luci/ui-font8x16.h"

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_bootchain,node_qdl,node_programfile,node_bootimage,node_stockkernel toneBlue
class node_init,node_openwrt,node_persistence toneAmber
class node_modem,node_qmi toneMint
class node_ui,node_font toneRose
class node_owner,node_phone,node_display toneIndigo
```

## Components

### Boot and Recovery

- [Boot-chain analysis](https://github.com/saddytech/openwrt-nx679j/blob/main/02-sorgenti/20260917-boot-chain/parse-chain.py): `02-sorgenti/20260917-boot-chain/parse-chain.py`
- [QDL client](https://github.com/saddytech/openwrt-nx679j/blob/main/05-bootchain-re/nx679j-openwrt-clean/research/cve-2026-25262-sm8450/tools/qdlrs/cli/src/main.rs): `05-bootchain-re/nx679j-openwrt-clean/research/cve-2026-25262-sm8450/tools/qdlrs/cli/src/main.rs`
- [Program files](https://github.com/saddytech/openwrt-nx679j/blob/main/05-bootchain-re/nx679j-openwrt-clean/research/cve-2026-25262-sm8450/tools/qdlrs/cli/src/programfile.rs): `05-bootchain-re/nx679j-openwrt-clean/research/cve-2026-25262-sm8450/tools/qdlrs/cli/src/programfile.rs`
- [Boot image](https://github.com/saddytech/openwrt-nx679j/tree/main/02-sorgenti/20260917-init-v9): `02-sorgenti/20260917-init-v9`
- [Stock kernel](https://github.com/saddytech/openwrt-nx679j/tree/main/02-sorgenti/20260917-init-v9): `02-sorgenti/20260917-init-v9`

### Router System

- [Router init](https://github.com/saddytech/openwrt-nx679j/blob/main/02-sorgenti/20260917-init-v9/nx679j-init-v9.c): `02-sorgenti/20260917-init-v9/nx679j-init-v9.c`
- [OpenWrt chroot](https://github.com/saddytech/openwrt-nx679j/tree/main/04-persistenza): `04-persistenza`
- [Persisted config](https://github.com/saddytech/openwrt-nx679j/tree/main/04-persistenza): `04-persistenza`

### Modem Connectivity

- [X65 modem](https://github.com/saddytech/openwrt-nx679j/tree/main/09-albero-originale/experiments-extra): `09-albero-originale/experiments-extra`
- [QMI and QRTR tools](https://github.com/saddytech/openwrt-nx679j/blob/main/09-albero-originale/experiments-extra/qrtr/rmnet-query.c): `09-albero-originale/experiments-extra/qrtr/rmnet-query.c`

### Native Interface

- [Native control UI](https://github.com/saddytech/openwrt-nx679j/blob/main/02-sorgenti/wifi-luci/nx679j-ui.c): `02-sorgenti/wifi-luci/nx679j-ui.c`
- [UI font](https://github.com/saddytech/openwrt-nx679j/blob/main/02-sorgenti/wifi-luci/ui-font8x16.h): `02-sorgenti/wifi-luci/ui-font8x16.h`

### Other components

- **Device owner**
- **NX679J device**
- **Phone display**

## Connections

- Device owner → NX679J device: operates (evidence: `README.md`)
- Boot-chain analysis → Boot image: informs reconstruction (evidence: `README.md`)
- QDL client → Program files: loads (evidence: `05-bootchain-re/nx679j-openwrt-clean/research/cve-2026-25262-sm8450/tools/qdlrs/cli/src/main.rs`)
- Boot image → Stock kernel: retains (evidence: `README.md`)
- Boot image → Router init: boots (evidence: `README.md`)
- Router init → OpenWrt chroot: starts chroot (evidence: `README.md`)
- OpenWrt chroot → Persisted config: uses (evidence: `README.md`)
- OpenWrt chroot → QMI and QRTR tools: controls modem (evidence: `README.md`)
- QMI and QRTR tools → X65 modem: communicates (evidence: `README.md`)
- Device owner → Native control UI: uses (evidence: `README.md`)
- Native control UI → Phone display: draws on (evidence: `README.md`)
- Native control UI → UI font: includes (evidence: `02-sorgenti/wifi-luci/nx679j-ui.c`)
- Native control UI → NX679J device: controls (evidence: `README.md`)
