# confeden/nova-android architecture

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

- Interactive diagram: https://gitdiagram.com/confeden/nova-android
- Repository: https://github.com/confeden/nova-android

## Overview

Nova is an Android VPN client designed to keep access working across DPI-blocked networks. Its main workflow selects built-in or user-imported configurations, establishes a tunnel through the selected transport, then checks that the tunnel carries useful traffic and can retry or move to another built-in route. The README documents additional capabilities whose Android implementation is not present in the supplied tree; those nodes use supported enclosing directories. The excerpts show the native proxy and separate Xray bridges, but not the Android UI or most orchestration, so those links rely on README documentation.

Main entry points: [`nova-core/mobile.go`](https://github.com/confeden/nova-android/blob/main/nova-core/mobile.go) (Configuration selection), [`nova-core/engine/register.go`](https://github.com/confeden/nova-android/blob/main/nova-core/engine/register.go) (Built-in failover), [`nova-core/engine/tunnel.go`](https://github.com/confeden/nova-android/blob/main/nova-core/engine/tunnel.go) (Tunnel lifecycle), [`nova-xray/main.go`](https://github.com/confeden/nova-android/blob/main/nova-xray/main.go) (Xray runtime API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Client workflow"]
  node_android["Android client<br/>[native-lib.cpp]"]
  node_config["Configuration selection<br/>[mobile.go]"]
  node_import["Profile import"]
  node_health["Live tunnel checks"]
  node_failover["Built-in failover<br/>[register.go]"]
end

subgraph group_tunnel["Tunnel transports"]
  node_tunnel["Tunnel lifecycle<br/>[tunnel.go]"]
  node_awg["WARP / AmneziaWG<br/>[awg_compat.go]"]
  node_masque["MASQUE / QUIC<br/>[masque.go]"]
  node_opera["Opera proxy<br/>[native-lib.cpp]"]
  node_proton["Proton WireGuard"]
end

subgraph group_network["Network services"]
  node_routing["Routing and DNS"]
  node_dns["DNS configuration<br/>[dns_doh.go]"]
  node_sharing["Device-sharing gateway"]
end

subgraph group_xray["VLESS engine"]
  node_xraybridge["Xray JNI bridge<br/>[novaxray_jni.c]"]
  node_xrayapi["Xray runtime API<br/>[main.go]"]
  node_xraycore["Xray core"]
end

node_user(("User"))
node_external(("Remote network"))

node_user -->|"uses"| node_android
node_android -.->|"selects"| node_config
node_user -->|"imports profiles"| node_import
node_config -->|"starts"| node_tunnel
node_tunnel -->|"checks traffic"| node_health
node_health -->|"triggers retry"| node_failover
node_failover -->|"tries first"| node_awg
node_failover -->|"tries next"| node_masque
node_failover -->|"tries last"| node_opera
node_config -->|"selects directly"| node_proton
node_config -->|"starts imported VLESS"| node_xrayapi
node_xraybridge -.->|"exposes JNI"| node_xrayapi
node_xrayapi -->|"starts core"| node_xraycore
node_xraycore -.->|"routes traffic"| node_routing
node_tunnel -->|"configures DNS"| node_dns
node_user -->|"enables gateway"| node_sharing
node_sharing -->|"proxies connections"| node_external
node_tunnel -->|"carries traffic"| node_external

click node_android "https://github.com/confeden/nova-android/blob/main/app/src/main/cpp/native-lib.cpp"
click node_config "https://github.com/confeden/nova-android/blob/main/nova-core/mobile.go"
click node_import "https://github.com/confeden/nova-android/tree/main/nova-core"
click node_health "https://github.com/confeden/nova-android/tree/main/nova-core/engine"
click node_failover "https://github.com/confeden/nova-android/blob/main/nova-core/engine/register.go"
click node_tunnel "https://github.com/confeden/nova-android/blob/main/nova-core/engine/tunnel.go"
click node_awg "https://github.com/confeden/nova-android/blob/main/nova-core/engine/awg_compat.go"
click node_masque "https://github.com/confeden/nova-android/blob/main/nova-core/engine/masque.go"
click node_opera "https://github.com/confeden/nova-android/blob/main/app/src/main/cpp/native-lib.cpp"
click node_proton "https://github.com/confeden/nova-android/tree/main/nova-core/engine"
click node_xraybridge "https://github.com/confeden/nova-android/blob/main/nova-xray/jni/novaxray_jni.c"
click node_xrayapi "https://github.com/confeden/nova-android/blob/main/nova-xray/main.go"
click node_xraycore "https://github.com/confeden/nova-android/tree/main/tools/xray-core/core"
click node_routing "https://github.com/confeden/nova-android/tree/main/tools/xray-core/app/router"
click node_dns "https://github.com/confeden/nova-android/blob/main/nova-core/engine/dns_doh.go"
click node_sharing "https://github.com/confeden/nova-android/tree/main/nova-core/engine"

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_android,node_config,node_import,node_health,node_failover,node_user toneBlue
class node_tunnel,node_awg,node_masque,node_opera,node_proton toneAmber
class node_routing,node_dns,node_sharing toneMint
class node_xraybridge,node_xrayapi,node_xraycore toneRose
class node_external toneIndigo
```

## Components

### Client workflow

- [Android client](https://github.com/confeden/nova-android/blob/main/app/src/main/cpp/native-lib.cpp): `app/src/main/cpp/native-lib.cpp`
- [Configuration selection](https://github.com/confeden/nova-android/blob/main/nova-core/mobile.go): `nova-core/mobile.go`
- [Profile import](https://github.com/confeden/nova-android/tree/main/nova-core): `nova-core`
- [Live tunnel checks](https://github.com/confeden/nova-android/tree/main/nova-core/engine): `nova-core/engine`
- [Built-in failover](https://github.com/confeden/nova-android/blob/main/nova-core/engine/register.go): `nova-core/engine/register.go`

### Tunnel transports

- [Tunnel lifecycle](https://github.com/confeden/nova-android/blob/main/nova-core/engine/tunnel.go): `nova-core/engine/tunnel.go`
- [WARP / AmneziaWG](https://github.com/confeden/nova-android/blob/main/nova-core/engine/awg_compat.go): `nova-core/engine/awg_compat.go`
- [MASQUE / QUIC](https://github.com/confeden/nova-android/blob/main/nova-core/engine/masque.go): `nova-core/engine/masque.go`
- [Opera proxy](https://github.com/confeden/nova-android/blob/main/app/src/main/cpp/native-lib.cpp): `app/src/main/cpp/native-lib.cpp`
- [Proton WireGuard](https://github.com/confeden/nova-android/tree/main/nova-core/engine): `nova-core/engine`

### Network services

- [Routing and DNS](https://github.com/confeden/nova-android/tree/main/tools/xray-core/app/router): `tools/xray-core/app/router`
- [DNS configuration](https://github.com/confeden/nova-android/blob/main/nova-core/engine/dns_doh.go): `nova-core/engine/dns_doh.go`
- [Device-sharing gateway](https://github.com/confeden/nova-android/tree/main/nova-core/engine): `nova-core/engine`

### VLESS engine

- [Xray JNI bridge](https://github.com/confeden/nova-android/blob/main/nova-xray/jni/novaxray_jni.c): `nova-xray/jni/novaxray_jni.c`
- [Xray runtime API](https://github.com/confeden/nova-android/blob/main/nova-xray/main.go): `nova-xray/main.go`
- [Xray core](https://github.com/confeden/nova-android/tree/main/tools/xray-core/core): `tools/xray-core/core`

### Other components

- **User**
- **Remote network**

## Connections

- User → Android client: uses (evidence: `README.md`)
- Android client → Configuration selection: selects
- User → Profile import: imports profiles (evidence: `README.md`)
- Configuration selection → Tunnel lifecycle: starts (evidence: `README.md`)
- Tunnel lifecycle → Live tunnel checks: checks traffic (evidence: `README.md`)
- Live tunnel checks → Built-in failover: triggers retry (evidence: `README.md`)
- Built-in failover → WARP / AmneziaWG: tries first (evidence: `README.md`)
- Built-in failover → MASQUE / QUIC: tries next (evidence: `README.md`)
- Built-in failover → Opera proxy: tries last (evidence: `README.md`)
- Configuration selection → Proton WireGuard: selects directly (evidence: `README.md`)
- Configuration selection → Xray runtime API: starts imported VLESS (evidence: `README.md`)
- Xray JNI bridge → Xray runtime API: exposes JNI
- Xray runtime API → Xray core: starts core (evidence: `nova-xray/main.go`)
- Xray core → Routing and DNS: routes traffic
- Tunnel lifecycle → DNS configuration: configures DNS (evidence: `README.md`)
- User → Device-sharing gateway: enables gateway (evidence: `README.md`)
- Device-sharing gateway → Remote network: proxies connections (evidence: `README.md`)
- Tunnel lifecycle → Remote network: carries traffic (evidence: `README.md`)
