# uaepro/philips-tv-saphi-os-jailbreak architecture

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

- Interactive diagram: https://gitdiagram.com/uaepro/philips-tv-saphi-os-jailbreak
- Repository: https://github.com/uaepro/philips-tv-saphi-os-jailbreak

## Overview

This repository provides a reversible custom Home dashboard for a compatible Philips SAPHI TV, plus LAN-based installation, recovery, and separate UPnP/DIAL controls. The main workflow is: an operator starts the helper, native TV playback bootstraps code into the dashboard, the installer saves a launcher hook and runtime, and the custom Home exposes native apps, inputs, settings, favourites, scenery, and optional prayer times. Recovery restores the saved stock menu. Some runtime details are documented but unsampled, so their links are limited to README-backed relationships.

Main entry points: [`native-home/session.js`](https://github.com/uaepro/philips-tv-saphi-os-jailbreak/blob/main/native-home/session.js) (Native Session), [`home-app/bridge.js`](https://github.com/uaepro/philips-tv-saphi-os-jailbreak/blob/main/home-app/bridge.js) (Native Feature Bridge), [`native_home.py`](https://github.com/uaepro/philips-tv-saphi-os-jailbreak/blob/main/native_home.py) (Dashboard Bootstrap), [`native-home/install.js`](https://github.com/uaepro/philips-tv-saphi-os-jailbreak/blob/main/native-home/install.js) (Install Hook)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_setup["LAN Setup"]
  node_helper["LAN Helper<br/>[native_home.py]"]
  node_upnp["UPnP Control<br/>[tv_control.py]"]
  node_bootstrap["Dashboard Bootstrap<br/>[native_home.py]"]
  node_eventservice["LAN Events and Commands<br/>[native_home.py]"]
end

subgraph group_persistence["Dashboard Persistence"]
  node_installer["Install Hook<br/>[install.js]"]
  node_launcher["Saved Launcher Hook<br/>[install.js]"]
  node_browserstore[("TV Browser Storage")]
  node_restore["Stock Recovery<br/>[restore.js]"]
end

subgraph group_home["Custom Home"]
  node_session["Native Session<br/>[session.js]"]
  node_homeui["Home Interface<br/>[index.html]"]
  node_appfeatures["Tiles and Favourites<br/>[app.js]"]
  node_atmosphere["Scenery and Prayer<br/>[app.js]"]
  node_config["Home Defaults<br/>[config.js]"]
  node_nativebridge["Native Feature Bridge<br/>[bridge.js]"]
  node_appregistry["Installed App Registry<br/>[bridge.js]"]
  node_inputs["Connected Inputs<br/>[bridge.js]"]
  node_promotion["Promotion Guard<br/>[session.js]"]
  node_remotehome["Home Key Handling<br/>[session.js]"]
end

subgraph group_controls["TV Controls"]
  node_dial["DIAL Apps<br/>[tv_control.py]"]
  node_volume["Volume and Status<br/>[tv_control.py]"]
end

node_operator(("Operator"))
node_tv["SAPHI TV"]

node_operator -->|"starts install"| node_helper
node_operator -->|"requests status"| node_upnp
node_helper -->|"serves bootstrap"| node_bootstrap
node_bootstrap -->|"opens dashboard"| node_tv
node_bootstrap -->|"loads installer"| node_installer
node_installer -->|"saves runtime and menu"| node_browserstore
node_installer -->|"patches menu entries"| node_launcher
node_launcher -->|"loads saved runtime"| node_session
node_session -->|"replaces dashboard"| node_homeui
node_homeui -->|"renders tiles"| node_appfeatures
node_homeui -->|"uses TV commands"| node_nativebridge
node_appfeatures -->|"requests app and source actions"| node_nativebridge
node_appfeatures -->|"renders scenery and prayer"| node_atmosphere
node_atmosphere -->|"reads defaults"| node_config
node_nativebridge -->|"reads installed apps"| node_appregistry
node_nativebridge -->|"detects and selects inputs"| node_inputs
node_session -->|"suppresses native promotion"| node_promotion
node_session -->|"captures Home key"| node_remotehome
node_session -->|"polls commands and reports"| node_eventservice
node_eventservice -->|"queues commands and events"| node_helper
node_operator -->|"requests recovery"| node_restore
node_restore -->|"restores stock menu"| node_browserstore
node_upnp -->|"queries and controls"| node_tv
node_operator -->|"launches or stops apps"| node_dial
node_operator -->|"checks or sets volume"| node_volume

click node_helper "https://github.com/uaepro/philips-tv-saphi-os-jailbreak/blob/main/native_home.py"
click node_upnp "https://github.com/uaepro/philips-tv-saphi-os-jailbreak/blob/main/tv_control.py"
click node_bootstrap "https://github.com/uaepro/philips-tv-saphi-os-jailbreak/blob/main/native_home.py"
click node_installer "https://github.com/uaepro/philips-tv-saphi-os-jailbreak/blob/main/native-home/install.js"
click node_launcher "https://github.com/uaepro/philips-tv-saphi-os-jailbreak/blob/main/native-home/install.js"
click node_restore "https://github.com/uaepro/philips-tv-saphi-os-jailbreak/blob/main/native-home/restore.js"
click node_session "https://github.com/uaepro/philips-tv-saphi-os-jailbreak/blob/main/native-home/session.js"
click node_homeui "https://github.com/uaepro/philips-tv-saphi-os-jailbreak/blob/main/home-app/index.html"
click node_appfeatures "https://github.com/uaepro/philips-tv-saphi-os-jailbreak/blob/main/home-app/app.js"
click node_atmosphere "https://github.com/uaepro/philips-tv-saphi-os-jailbreak/blob/main/home-app/app.js"
click node_config "https://github.com/uaepro/philips-tv-saphi-os-jailbreak/blob/main/home-app/config.js"
click node_nativebridge "https://github.com/uaepro/philips-tv-saphi-os-jailbreak/blob/main/home-app/bridge.js"
click node_appregistry "https://github.com/uaepro/philips-tv-saphi-os-jailbreak/blob/main/home-app/bridge.js"
click node_inputs "https://github.com/uaepro/philips-tv-saphi-os-jailbreak/blob/main/home-app/bridge.js"
click node_promotion "https://github.com/uaepro/philips-tv-saphi-os-jailbreak/blob/main/native-home/session.js"
click node_remotehome "https://github.com/uaepro/philips-tv-saphi-os-jailbreak/blob/main/native-home/session.js"
click node_eventservice "https://github.com/uaepro/philips-tv-saphi-os-jailbreak/blob/main/native_home.py"
click node_dial "https://github.com/uaepro/philips-tv-saphi-os-jailbreak/blob/main/tv_control.py"
click node_volume "https://github.com/uaepro/philips-tv-saphi-os-jailbreak/blob/main/tv_control.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_helper,node_upnp,node_bootstrap,node_eventservice toneBlue
class node_installer,node_launcher,node_browserstore,node_restore toneAmber
class node_session,node_homeui,node_appfeatures,node_atmosphere,node_config,node_nativebridge,node_appregistry,node_inputs,node_promotion,node_remotehome toneMint
class node_dial,node_volume toneRose
class node_operator,node_tv toneIndigo
```

## Components

### LAN Setup

- [LAN Helper](https://github.com/uaepro/philips-tv-saphi-os-jailbreak/blob/main/native_home.py): `native_home.py`
- [UPnP Control](https://github.com/uaepro/philips-tv-saphi-os-jailbreak/blob/main/tv_control.py): `tv_control.py`
- [Dashboard Bootstrap](https://github.com/uaepro/philips-tv-saphi-os-jailbreak/blob/main/native_home.py): `native_home.py`
- [LAN Events and Commands](https://github.com/uaepro/philips-tv-saphi-os-jailbreak/blob/main/native_home.py): `native_home.py`

### Dashboard Persistence

- [Install Hook](https://github.com/uaepro/philips-tv-saphi-os-jailbreak/blob/main/native-home/install.js): `native-home/install.js`
- [Saved Launcher Hook](https://github.com/uaepro/philips-tv-saphi-os-jailbreak/blob/main/native-home/install.js): `native-home/install.js`
- **TV Browser Storage**
- [Stock Recovery](https://github.com/uaepro/philips-tv-saphi-os-jailbreak/blob/main/native-home/restore.js): `native-home/restore.js`

### Custom Home

- [Native Session](https://github.com/uaepro/philips-tv-saphi-os-jailbreak/blob/main/native-home/session.js): `native-home/session.js`
- [Home Interface](https://github.com/uaepro/philips-tv-saphi-os-jailbreak/blob/main/home-app/index.html): `home-app/index.html`
- [Tiles and Favourites](https://github.com/uaepro/philips-tv-saphi-os-jailbreak/blob/main/home-app/app.js): `home-app/app.js`
- [Scenery and Prayer](https://github.com/uaepro/philips-tv-saphi-os-jailbreak/blob/main/home-app/app.js): `home-app/app.js`
- [Home Defaults](https://github.com/uaepro/philips-tv-saphi-os-jailbreak/blob/main/home-app/config.js): `home-app/config.js`
- [Native Feature Bridge](https://github.com/uaepro/philips-tv-saphi-os-jailbreak/blob/main/home-app/bridge.js): `home-app/bridge.js`
- [Installed App Registry](https://github.com/uaepro/philips-tv-saphi-os-jailbreak/blob/main/home-app/bridge.js): `home-app/bridge.js`
- [Connected Inputs](https://github.com/uaepro/philips-tv-saphi-os-jailbreak/blob/main/home-app/bridge.js): `home-app/bridge.js`
- [Promotion Guard](https://github.com/uaepro/philips-tv-saphi-os-jailbreak/blob/main/native-home/session.js): `native-home/session.js`
- [Home Key Handling](https://github.com/uaepro/philips-tv-saphi-os-jailbreak/blob/main/native-home/session.js): `native-home/session.js`

### TV Controls

- [DIAL Apps](https://github.com/uaepro/philips-tv-saphi-os-jailbreak/blob/main/tv_control.py): `tv_control.py`
- [Volume and Status](https://github.com/uaepro/philips-tv-saphi-os-jailbreak/blob/main/tv_control.py): `tv_control.py`

### Other components

- **Operator**
- **SAPHI TV**

## Connections

- Operator → LAN Helper: starts install (evidence: `README.md`)
- Operator → UPnP Control: requests status (evidence: `README.md`)
- LAN Helper → Dashboard Bootstrap: serves bootstrap (evidence: `native_home.py`)
- Dashboard Bootstrap → SAPHI TV: opens dashboard (evidence: `README.md`)
- Dashboard Bootstrap → Install Hook: loads installer (evidence: `native_home.py`)
- Install Hook → TV Browser Storage: saves runtime and menu (evidence: `native-home/install.js`)
- Install Hook → Saved Launcher Hook: patches menu entries (evidence: `native-home/install.js`)
- Saved Launcher Hook → Native Session: loads saved runtime (evidence: `README.md`)
- Native Session → Home Interface: replaces dashboard (evidence: `README.md`)
- Home Interface → Tiles and Favourites: renders tiles (evidence: `README.md`)
- Home Interface → Native Feature Bridge: uses TV commands (evidence: `README.md`)
- Tiles and Favourites → Native Feature Bridge: requests app and source actions (evidence: `home-app/app.js`)
- Tiles and Favourites → Scenery and Prayer: renders scenery and prayer (evidence: `README.md`)
- Scenery and Prayer → Home Defaults: reads defaults (evidence: `README.md`)
- Native Feature Bridge → Installed App Registry: reads installed apps (evidence: `home-app/bridge.js`)
- Native Feature Bridge → Connected Inputs: detects and selects inputs (evidence: `home-app/bridge.js`)
- Native Session → Promotion Guard: suppresses native promotion (evidence: `README.md`)
- Native Session → Home Key Handling: captures Home key (evidence: `native-home/session.js`)
- Native Session → LAN Events and Commands: polls commands and reports (evidence: `native-home/session.js`)
- LAN Events and Commands → LAN Helper: queues commands and events (evidence: `native_home.py`)
- Operator → Stock Recovery: requests recovery (evidence: `README.md`)
- Stock Recovery → TV Browser Storage: restores stock menu (evidence: `native-home/restore.js`)
- UPnP Control → SAPHI TV: queries and controls (evidence: `tv_control.py`)
- Operator → DIAL Apps: launches or stops apps (evidence: `tv_control.py`)
- Operator → Volume and Status: checks or sets volume (evidence: `tv_control.py`)
