# hoangsvit/google-ai architecture

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

- Interactive diagram: https://gitdiagram.com/hoangsvit/google-ai
- Repository: https://github.com/hoangsvit/google-ai

## Overview

ePlus AI Toolkit is a cross-platform terminal application for inspecting Google AI Pro offers on Android and, with explicit user review, proceeding through Google Play checkout stages. The main workflow runs through the Textual dashboard or platform adapters: prepare and select an Android device, inspect offers, optionally scan explicit SKUs, then invoke the original Android/Frida workflow for staged checkout. The README documents Windows, macOS, and Linux support and warns that checkout can incur real charges. Some implementation links below are documented or indexed rather than visible in the excerpts; those evidence limits are reflected in the edges.

Main entry points: [`tui.py`](https://github.com/hoangsvit/google-ai/blob/main/tui.py) (Textual dashboard), [`ultra0.py`](https://github.com/hoangsvit/google-ai/blob/main/ultra0.py) (Android / Frida workflow), [`device_selector.py`](https://github.com/hoangsvit/google-ai/blob/main/device_selector.py) (Device selection), [`macos_runner.py`](https://github.com/hoangsvit/google-ai/blob/main/macos_runner.py) (macOS adapter)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Terminal interface"]
  node_tui["Textual dashboard<br/>[tui.py]"]
  node_tui_helpers["UI state helpers<br/>[tui_core.py]"]
  node_stage_history[("Stage history<br/>[stage_history.py]")]
end

subgraph group_device["Device and environment"]
  node_env_setup["Environment setup<br/>[setup_env.py]"]
  node_diagnostics["Device diagnostics"]
  node_selector["Device selection<br/>[device_selector.py]"]
  node_adb(("ADB / Android device"))
  node_macos_adapter["macOS adapter<br/>[macos_runner.py]"]
end

subgraph group_offers["Offer inspection"]
  node_offer_discovery["Offer discovery<br/>[offer_discovery.py]"]
  node_sku_runner["SKU scan runner"]
  node_sku_model["SKU result model<br/>[sku_check_core.py]"]
  node_sku_query["Explicit SKU query<br/>[query_sku.py]"]
end

subgraph group_checkout["Android checkout"]
  node_play(("Google Play"))
  node_android_flow["Android / Frida workflow<br/>[ultra0.py]"]
end

node_user(("Toolkit user"))

node_user -->|"starts workflow"| node_tui
node_user -->|"prepares environment"| node_env_setup
node_tui -->|"uses helpers"| node_tui_helpers
node_tui -->|"records stages"| node_stage_history
node_tui -->|"checks connection"| node_diagnostics
node_tui -->|"selects device"| node_selector
node_tui -->|"parses offers"| node_offer_discovery
node_tui -->|"renders scan results"| node_sku_model
node_env_setup -->|"selects device"| node_selector
node_env_setup -->|"locates or connects"| node_adb
node_diagnostics -->|"probes connection"| node_adb
node_selector -->|"queries transports"| node_adb
node_macos_adapter -->|"checks connection"| node_diagnostics
node_macos_adapter -->|"selects device"| node_selector
node_macos_adapter -->|"uses helpers"| node_tui_helpers
node_tui -->|"runs SKU scan"| node_sku_runner
node_sku_runner -->|"normalizes results"| node_sku_model
node_sku_query -->|"builds query script"| node_android_flow
node_tui -->|"invokes checkout stages"| node_android_flow
node_android_flow -.->|"operates Android"| node_adb
node_android_flow -.->|"launches billing flow"| node_play
node_play -.->|"returns offer metadata"| node_android_flow

click node_tui "https://github.com/hoangsvit/google-ai/blob/main/tui.py"
click node_tui_helpers "https://github.com/hoangsvit/google-ai/blob/main/tui_core.py"
click node_stage_history "https://github.com/hoangsvit/google-ai/blob/main/stage_history.py"
click node_env_setup "https://github.com/hoangsvit/google-ai/blob/main/setup_env.py"
click node_diagnostics "https://github.com/hoangsvit/google-ai/blob/main/device_diagnostics.py"
click node_selector "https://github.com/hoangsvit/google-ai/blob/main/device_selector.py"
click node_macos_adapter "https://github.com/hoangsvit/google-ai/blob/main/macos_runner.py"
click node_offer_discovery "https://github.com/hoangsvit/google-ai/blob/main/offer_discovery.py"
click node_sku_runner "https://github.com/hoangsvit/google-ai/blob/main/sku_check_runner.py"
click node_sku_model "https://github.com/hoangsvit/google-ai/blob/main/sku_check_core.py"
click node_sku_query "https://github.com/hoangsvit/google-ai/blob/main/query_sku.py"
click node_android_flow "https://github.com/hoangsvit/google-ai/blob/main/ultra0.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_tui,node_tui_helpers,node_stage_history,node_user toneBlue
class node_env_setup,node_diagnostics,node_selector,node_adb,node_macos_adapter toneAmber
class node_offer_discovery,node_sku_runner,node_sku_model,node_sku_query toneMint
class node_play,node_android_flow toneRose
```

## Components

### Terminal interface

- [Textual dashboard](https://github.com/hoangsvit/google-ai/blob/main/tui.py): `tui.py`
- [UI state helpers](https://github.com/hoangsvit/google-ai/blob/main/tui_core.py): `tui_core.py`
- [Stage history](https://github.com/hoangsvit/google-ai/blob/main/stage_history.py): `stage_history.py`

### Device and environment

- [Environment setup](https://github.com/hoangsvit/google-ai/blob/main/setup_env.py): `setup_env.py`
- [Device diagnostics](https://github.com/hoangsvit/google-ai/blob/main/device_diagnostics.py): `device_diagnostics.py`
- [Device selection](https://github.com/hoangsvit/google-ai/blob/main/device_selector.py): `device_selector.py`
- **ADB / Android device**
- [macOS adapter](https://github.com/hoangsvit/google-ai/blob/main/macos_runner.py): `macos_runner.py`

### Offer inspection

- [Offer discovery](https://github.com/hoangsvit/google-ai/blob/main/offer_discovery.py): `offer_discovery.py`
- [SKU scan runner](https://github.com/hoangsvit/google-ai/blob/main/sku_check_runner.py): `sku_check_runner.py`
- [SKU result model](https://github.com/hoangsvit/google-ai/blob/main/sku_check_core.py): `sku_check_core.py`
- [Explicit SKU query](https://github.com/hoangsvit/google-ai/blob/main/query_sku.py): `query_sku.py`

### Android checkout

- **Google Play**
- [Android / Frida workflow](https://github.com/hoangsvit/google-ai/blob/main/ultra0.py): `ultra0.py`

### Other components

- **Toolkit user**

## Connections

- Toolkit user → Textual dashboard: starts workflow (evidence: `README.md`)
- Toolkit user → Environment setup: prepares environment (evidence: `README.md`)
- Textual dashboard → UI state helpers: uses helpers (evidence: `tui.py`)
- Textual dashboard → Stage history: records stages (evidence: `tui.py`)
- Textual dashboard → Device diagnostics: checks connection (evidence: `tui.py`)
- Textual dashboard → Device selection: selects device (evidence: `tui.py`)
- Textual dashboard → Offer discovery: parses offers (evidence: `tui.py`)
- Textual dashboard → SKU result model: renders scan results (evidence: `tui.py`)
- Environment setup → Device selection: selects device (evidence: `setup_env.py`)
- Environment setup → ADB / Android device: locates or connects (evidence: `README.md`)
- Device diagnostics → ADB / Android device: probes connection (evidence: `device_diagnostics.py`)
- Device selection → ADB / Android device: queries transports (evidence: `device_selector.py`)
- macOS adapter → Device diagnostics: checks connection (evidence: `macos_runner.py`)
- macOS adapter → Device selection: selects device (evidence: `macos_runner.py`)
- macOS adapter → UI state helpers: uses helpers (evidence: `macos_runner.py`)
- Textual dashboard → SKU scan runner: runs SKU scan (evidence: `tui.py`)
- SKU scan runner → SKU result model: normalizes results (evidence: `sku_check_runner.py`)
- Explicit SKU query → Android / Frida workflow: builds query script (evidence: `query_sku.py`)
- Textual dashboard → Android / Frida workflow: invokes checkout stages (evidence: `tui.py`)
- Android / Frida workflow → ADB / Android device: operates Android (evidence: `README.md`)
- Android / Frida workflow → Google Play: launches billing flow (evidence: `README.md`)
- Google Play → Android / Frida workflow: returns offer metadata
