# zts678/html-to-apk architecture

> Architecture diagram of the GitHub repository zts678/html-to-apk, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/zts678/html-to-apk
- Repository: https://github.com/zts678/html-to-apk

## Overview

This repository packages a configured static site or online URL as an Android WebView APK. The main workflow is configure content and app settings, run the packaging entry point, install the APK, then launch the site in the app; optional online controls verify versions, enforce updates, and refresh the splash image. Runtime behavior is concentrated in MainActivity.java. The README documents build and runtime capabilities not visible in the partial source excerpt, so those links are cited to the README rather than treated as inspected implementation.

Main entry points: [`android/app/src/main/java/com/h5/webapp/MainActivity.java`](https://github.com/zts678/html-to-apk/blob/main/android/app/src/main/java/com/h5/webapp/MainActivity.java) (Installed app), [`android/app`](https://github.com/zts678/html-to-apk/tree/main/android/app) (WebView APK), [`build.ps1`](https://github.com/zts678/html-to-apk/blob/main/build.ps1) (Build script), [`android/app/build.gradle`](https://github.com/zts678/html-to-apk/blob/main/android/app/build.gradle) (Android app project)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_packaging["APK packaging"]
  node_build_bat["Build launcher<br/>[build.bat]"]
  node_build_ps1["Build script<br/>[build.ps1]"]
  node_android_project["Android app project<br/>[build.gradle]"]
  node_apk["WebView APK"]
end

subgraph group_runtime["Android runtime"]
  node_installed_app["Installed app<br/>[MainActivity.java]"]
  node_webview["WebView container<br/>[MainActivity.java]"]
  node_local_content["Packaged site"]
  node_splash["Splash display<br/>[MainActivity.java]"]
  node_proxy_check["Proxy and VPN check<br/>[MainActivity.java]"]
  node_session_state[("Web session storage<br/>[MainActivity.java]")]
  node_version_check["Version validation<br/>[MainActivity.java]"]
  node_update_download["APK update download<br/>[MainActivity.java]"]
  node_system_installer["System installer"]
end

subgraph group_online["Online services"]
  node_version_service["Version manifest<br/>[version.json]"]
  node_splash_service["Remote splash image"]
end

subgraph group_content["App configuration and content"]
  node_config["App settings<br/>[config.json]"]
  node_static_site["Static site<br/>[index.html]"]
end

node_user(("App maker"))

node_user -->|"configures"| node_config
node_user -->|"supplies site"| node_static_site
node_user -->|"runs"| node_build_bat
node_user -->|"runs"| node_build_ps1
node_build_bat -->|"launches"| node_build_ps1
node_build_ps1 -->|"builds"| node_android_project
node_config -->|"supplies settings"| node_android_project
node_static_site -->|"copied into"| node_apk
node_android_project -->|"produces"| node_apk
node_user -->|"installs"| node_apk
node_apk -->|"runs"| node_installed_app
node_installed_app -->|"shows"| node_splash
node_installed_app -->|"checks when enabled"| node_proxy_check
node_installed_app -->|"validates when enabled"| node_version_check
node_version_check -->|"fetches manifest"| node_version_service
node_version_check -->|"requests image"| node_splash_service
node_version_check -->|"dispatches update"| node_update_download
node_update_download -->|"opens installer"| node_system_installer
node_installed_app -->|"creates"| node_webview
node_webview -->|"loads in local mode"| node_local_content
node_webview -->|"persists"| node_session_state
node_webview -->|"displays site"| node_user

click node_config "https://github.com/zts678/html-to-apk/blob/main/config.json"
click node_static_site "https://github.com/zts678/html-to-apk/blob/main/static/index.html"
click node_build_bat "https://github.com/zts678/html-to-apk/blob/main/build.bat"
click node_build_ps1 "https://github.com/zts678/html-to-apk/blob/main/build.ps1"
click node_android_project "https://github.com/zts678/html-to-apk/blob/main/android/app/build.gradle"
click node_apk "https://github.com/zts678/html-to-apk/tree/main/android/app"
click node_installed_app "https://github.com/zts678/html-to-apk/blob/main/android/app/src/main/java/com/h5/webapp/MainActivity.java"
click node_webview "https://github.com/zts678/html-to-apk/blob/main/android/app/src/main/java/com/h5/webapp/MainActivity.java"
click node_splash "https://github.com/zts678/html-to-apk/blob/main/android/app/src/main/java/com/h5/webapp/MainActivity.java"
click node_proxy_check "https://github.com/zts678/html-to-apk/blob/main/android/app/src/main/java/com/h5/webapp/MainActivity.java"
click node_session_state "https://github.com/zts678/html-to-apk/blob/main/android/app/src/main/java/com/h5/webapp/MainActivity.java"
click node_version_service "https://github.com/zts678/html-to-apk/blob/main/service/version.json"
click node_version_check "https://github.com/zts678/html-to-apk/blob/main/android/app/src/main/java/com/h5/webapp/MainActivity.java"
click node_update_download "https://github.com/zts678/html-to-apk/blob/main/android/app/src/main/java/com/h5/webapp/MainActivity.java"
click node_splash_service "https://github.com/zts678/html-to-apk/tree/main/service"

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_build_bat,node_build_ps1,node_android_project,node_apk toneBlue
class node_installed_app,node_webview,node_local_content,node_splash,node_proxy_check,node_session_state,node_version_check,node_update_download,node_system_installer toneAmber
class node_version_service,node_splash_service toneMint
class node_config,node_static_site toneRose
class node_user toneIndigo
```

## Components

### APK packaging

- [Build launcher](https://github.com/zts678/html-to-apk/blob/main/build.bat): `build.bat`
- [Build script](https://github.com/zts678/html-to-apk/blob/main/build.ps1): `build.ps1`
- [Android app project](https://github.com/zts678/html-to-apk/blob/main/android/app/build.gradle): `android/app/build.gradle`
- [WebView APK](https://github.com/zts678/html-to-apk/tree/main/android/app): `android/app`

### Android runtime

- [Installed app](https://github.com/zts678/html-to-apk/blob/main/android/app/src/main/java/com/h5/webapp/MainActivity.java): `android/app/src/main/java/com/h5/webapp/MainActivity.java`
- [WebView container](https://github.com/zts678/html-to-apk/blob/main/android/app/src/main/java/com/h5/webapp/MainActivity.java): `android/app/src/main/java/com/h5/webapp/MainActivity.java`
- **Packaged site**
- [Splash display](https://github.com/zts678/html-to-apk/blob/main/android/app/src/main/java/com/h5/webapp/MainActivity.java): `android/app/src/main/java/com/h5/webapp/MainActivity.java`
- [Proxy and VPN check](https://github.com/zts678/html-to-apk/blob/main/android/app/src/main/java/com/h5/webapp/MainActivity.java): `android/app/src/main/java/com/h5/webapp/MainActivity.java`
- [Web session storage](https://github.com/zts678/html-to-apk/blob/main/android/app/src/main/java/com/h5/webapp/MainActivity.java): `android/app/src/main/java/com/h5/webapp/MainActivity.java`
- [Version validation](https://github.com/zts678/html-to-apk/blob/main/android/app/src/main/java/com/h5/webapp/MainActivity.java): `android/app/src/main/java/com/h5/webapp/MainActivity.java`
- [APK update download](https://github.com/zts678/html-to-apk/blob/main/android/app/src/main/java/com/h5/webapp/MainActivity.java): `android/app/src/main/java/com/h5/webapp/MainActivity.java`
- **System installer**

### Online services

- [Version manifest](https://github.com/zts678/html-to-apk/blob/main/service/version.json): `service/version.json`
- [Remote splash image](https://github.com/zts678/html-to-apk/tree/main/service): `service`

### App configuration and content

- [App settings](https://github.com/zts678/html-to-apk/blob/main/config.json): `config.json`
- [Static site](https://github.com/zts678/html-to-apk/blob/main/static/index.html): `static/index.html`

### Other components

- **App maker**

## Connections

- App maker → App settings: configures (evidence: `README.md`)
- App maker → Static site: supplies site (evidence: `README.md`)
- App maker → Build launcher: runs (evidence: `README.md`)
- App maker → Build script: runs (evidence: `README.md`)
- Build launcher → Build script: launches (evidence: `README.md`)
- Build script → Android app project: builds (evidence: `README.md`)
- App settings → Android app project: supplies settings (evidence: `android/app/build.gradle`)
- Static site → WebView APK: copied into (evidence: `README.md`)
- Android app project → WebView APK: produces (evidence: `README.md`)
- App maker → WebView APK: installs (evidence: `README.md`)
- WebView APK → Installed app: runs (evidence: `README.md`)
- Installed app → Splash display: shows (evidence: `README.md`)
- Installed app → Proxy and VPN check: checks when enabled (evidence: `README.md`)
- Installed app → Version validation: validates when enabled (evidence: `README.md`)
- Version validation → Version manifest: fetches manifest (evidence: `README.md`)
- Version validation → Remote splash image: requests image (evidence: `README.md`)
- Version validation → APK update download: dispatches update (evidence: `android/app/src/main/java/com/h5/webapp/MainActivity.java`)
- APK update download → System installer: opens installer (evidence: `android/app/src/main/java/com/h5/webapp/MainActivity.java`)
- Installed app → WebView container: creates (evidence: `android/app/src/main/java/com/h5/webapp/MainActivity.java`)
- WebView container → Packaged site: loads in local mode (evidence: `README.md`)
- WebView container → Web session storage: persists (evidence: `README.md`)
- WebView container → App maker: displays site (evidence: `README.md`)
