# krishnasen2401/jiostb architecture

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

- Interactive diagram: https://gitdiagram.com/krishnasen2401/jiostb
- Repository: https://github.com/krishnasen2401/jiostb

## Overview

Jio STB Master Toolkit helps owners unlock ADB, customize and debloat a set-top box, capture firmware-update traffic, and query Jio’s ACS. The main workflow is to connect the STB through Ethernet or a Wi-Fi hotspot, run a captive lab that responds to provisioning traffic, cold-reboot the box, then use ADB for customization. Separate tools monitor or query the real ACS, and the repository documents a firmware catalog and sharing workflow. Source excerpts show implementation details for the labs and setup tools; other links below reflect README descriptions, not inspection of unsampled code.

Main entry points: [`captive_lab.py`](https://github.com/krishnasen2401/jiostb/blob/main/captive_lab.py) (Ethernet Captive Lab), [`fota_monitor_acs.py`](https://github.com/krishnasen2401/jiostb/blob/main/fota_monitor_acs.py) (FOTA Monitor), [`captive_wifi_lab.py`](https://github.com/krishnasen2401/jiostb/blob/main/captive_wifi_lab.py) (Wi-Fi Captive Lab), [`fota_captive_lab.py`](https://github.com/krishnasen2401/jiostb/blob/main/fota_captive_lab.py) (Universal Captive Lab)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_unlock["ADB Unlock Labs"]
  node_ethernet_lab["Ethernet Captive Lab<br/>[captive_lab.py]"]
  node_wifi_lab["Wi-Fi Captive Lab"]
  node_universal_lab["Universal Captive Lab"]
  node_mock_acs["Universal Mock ACS<br/>[mock_acs.py]"]
  node_legacy_lab["Original Verified Lab<br/>[captive_lab.py]"]
  node_legacy_acs["Original Mock ACS<br/>[mock_acs.py]"]
end

subgraph group_custom["Device Customization"]
  node_post_setup["Post-ADB Setup<br/>[post_adb_setup.py]"]
  node_adblock["Ad &amp; DNS Setup"]
end

subgraph group_firmware["Firmware Research"]
  node_fota_monitor["FOTA Monitor"]
  node_firmware_catalog["Firmware Catalog"]
  node_firmware_sharing["Firmware Sharing<br/>[share_firmware.py]"]
end

subgraph group_acs["ACS Tools"]
  node_direct_query["Direct ACS Query"]
end

subgraph group_support["Network Utilities"]
end

node_owner(("STB Owner"))
node_stb["Jio Set-Top Box"]
node_adb["ADB Service"]
node_live_acs["Jio Live ACS"]

node_owner -->|"runs Ethernet"| node_ethernet_lab
node_owner -->|"runs Wi-Fi"| node_wifi_lab
node_owner -->|"runs lab"| node_universal_lab
node_stb -->|"provisions over"| node_ethernet_lab
node_stb -->|"provisions over"| node_wifi_lab
node_stb -->|"provisions over"| node_universal_lab
node_owner -->|"chooses fallback"| node_legacy_lab
node_legacy_lab -.->|"uses responder"| node_legacy_acs
node_owner -->|"runs after unlock"| node_post_setup
node_post_setup -->|"controls through"| node_adb
node_adb -->|"configures"| node_stb
node_owner -->|"runs setup"| node_adblock
node_adblock -->|"patches settings"| node_stb
node_owner -->|"runs monitor"| node_fota_monitor
node_fota_monitor -->|"forwards traffic"| node_live_acs
node_fota_monitor -->|"reports update URLs"| node_owner
node_owner -->|"queries directly"| node_direct_query
node_direct_query -->|"sends CWMP Inform"| node_live_acs
node_owner -->|"consults packages"| node_firmware_catalog
node_owner -.->|"shares firmware"| node_firmware_sharing
node_wifi_lab -->|"reuses code"| node_ethernet_lab
node_universal_lab -->|"reuses code"| node_ethernet_lab

click node_ethernet_lab "https://github.com/krishnasen2401/jiostb/blob/main/captive_lab.py"
click node_wifi_lab "https://github.com/krishnasen2401/jiostb/blob/main/captive_wifi_lab.py"
click node_universal_lab "https://github.com/krishnasen2401/jiostb/blob/main/fota_captive_lab.py"
click node_mock_acs "https://github.com/krishnasen2401/jiostb/blob/main/mock_acs.py"
click node_legacy_lab "https://github.com/krishnasen2401/jiostb/blob/main/original_repo/captive_lab.py"
click node_legacy_acs "https://github.com/krishnasen2401/jiostb/blob/main/original_repo/mock_acs.py"
click node_post_setup "https://github.com/krishnasen2401/jiostb/blob/main/post_adb_setup.py"
click node_adblock "https://github.com/krishnasen2401/jiostb/blob/main/experiments/dnshole/stb_adblock_setup.py"
click node_fota_monitor "https://github.com/krishnasen2401/jiostb/blob/main/fota_monitor_acs.py"
click node_firmware_catalog "https://github.com/krishnasen2401/jiostb/blob/main/FIRMWARE_CATALOG.md"
click node_firmware_sharing "https://github.com/krishnasen2401/jiostb/blob/main/share_firmware.py"
click node_direct_query "https://github.com/krishnasen2401/jiostb/blob/main/query_acs_direct.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_ethernet_lab,node_wifi_lab,node_universal_lab,node_mock_acs,node_legacy_lab,node_legacy_acs toneBlue
class node_post_setup,node_adblock toneAmber
class node_fota_monitor,node_firmware_catalog,node_firmware_sharing toneMint
class node_direct_query toneRose
class node_owner,node_stb,node_adb,node_live_acs toneIndigo
```

## Components

### ADB Unlock Labs

- [Ethernet Captive Lab](https://github.com/krishnasen2401/jiostb/blob/main/captive_lab.py): `captive_lab.py`
- [Wi-Fi Captive Lab](https://github.com/krishnasen2401/jiostb/blob/main/captive_wifi_lab.py): `captive_wifi_lab.py`
- [Universal Captive Lab](https://github.com/krishnasen2401/jiostb/blob/main/fota_captive_lab.py): `fota_captive_lab.py`
- [Universal Mock ACS](https://github.com/krishnasen2401/jiostb/blob/main/mock_acs.py): `mock_acs.py`
- [Original Verified Lab](https://github.com/krishnasen2401/jiostb/blob/main/original_repo/captive_lab.py): `original_repo/captive_lab.py`
- [Original Mock ACS](https://github.com/krishnasen2401/jiostb/blob/main/original_repo/mock_acs.py): `original_repo/mock_acs.py`

### Device Customization

- [Post-ADB Setup](https://github.com/krishnasen2401/jiostb/blob/main/post_adb_setup.py): `post_adb_setup.py`
- [Ad & DNS Setup](https://github.com/krishnasen2401/jiostb/blob/main/experiments/dnshole/stb_adblock_setup.py): `experiments/dnshole/stb_adblock_setup.py`

### Firmware Research

- [FOTA Monitor](https://github.com/krishnasen2401/jiostb/blob/main/fota_monitor_acs.py): `fota_monitor_acs.py`
- [Firmware Catalog](https://github.com/krishnasen2401/jiostb/blob/main/FIRMWARE_CATALOG.md): `FIRMWARE_CATALOG.md`
- [Firmware Sharing](https://github.com/krishnasen2401/jiostb/blob/main/share_firmware.py): `share_firmware.py`

### ACS Tools

- [Direct ACS Query](https://github.com/krishnasen2401/jiostb/blob/main/query_acs_direct.py): `query_acs_direct.py`

### Other components

- **STB Owner**
- **Jio Set-Top Box**
- **ADB Service**
- **Jio Live ACS**

## Connections

- STB Owner → Ethernet Captive Lab: runs Ethernet (evidence: `README.md`)
- STB Owner → Wi-Fi Captive Lab: runs Wi-Fi (evidence: `README.md`)
- STB Owner → Universal Captive Lab: runs lab (evidence: `README.md`)
- Jio Set-Top Box → Ethernet Captive Lab: provisions over (evidence: `README.md`)
- Jio Set-Top Box → Wi-Fi Captive Lab: provisions over (evidence: `README.md`)
- Jio Set-Top Box → Universal Captive Lab: provisions over (evidence: `fota_captive_lab.py`)
- STB Owner → Original Verified Lab: chooses fallback (evidence: `README.md`)
- Original Verified Lab → Original Mock ACS: uses responder (evidence: `README.md`)
- STB Owner → Post-ADB Setup: runs after unlock (evidence: `README.md`)
- Post-ADB Setup → ADB Service: controls through (evidence: `post_adb_setup.py`)
- ADB Service → Jio Set-Top Box: configures
- STB Owner → Ad & DNS Setup: runs setup (evidence: `experiments/dnshole/stb_adblock_setup.py`)
- Ad & DNS Setup → Jio Set-Top Box: patches settings (evidence: `experiments/dnshole/stb_adblock_setup.py`)
- STB Owner → FOTA Monitor: runs monitor (evidence: `README.md`)
- FOTA Monitor → Jio Live ACS: forwards traffic (evidence: `fota_monitor_acs.py`)
- FOTA Monitor → STB Owner: reports update URLs (evidence: `fota_monitor_acs.py`)
- STB Owner → Direct ACS Query: queries directly (evidence: `README.md`)
- Direct ACS Query → Jio Live ACS: sends CWMP Inform (evidence: `query_acs_direct.py`)
- STB Owner → Firmware Catalog: consults packages (evidence: `README.md`)
- STB Owner → Firmware Sharing: shares firmware
- Wi-Fi Captive Lab → Ethernet Captive Lab: reuses code (evidence: `captive_wifi_lab.py`)
- Universal Captive Lab → Ethernet Captive Lab: reuses code (evidence: `fota_captive_lab.py`)
