How appshubcc/bettbox works
Bettbox is a cross-platform Mihomo client for proxy routing and DNS troubleshooting. Its intended user workflow is to configure or import a profile, start the core through the client, route traffic through a VPN/TUN or proxy, and inspect operational state. The supplied tree and excerpts show Android service integration, the Go core, and selected native plugins; the Flutter UI and profile-import implementation are not represented in the supplied source excerpts, so those links are limited to documented behavior or marked unverified.
Main entry points: main.go Core entry · VpnPlugin.kt Android VPN bridge · BettboxVpnService.kt Android VPN service · GlobalState.kt Android run state
Components 19
Client runtime
- Client UI
- Profiles and settings
core/Clash.Meta/component/profile/profile.go
Mihomo engine
- Core entry
core/Clash.Meta/main.go - Configuration loading
core/Clash.Meta/config/config.go - Inbound listeners
core/Clash.Meta/adapter/inbound/listen.go - Proxy routing
core/Clash.Meta/tunnel/statistic/manager.go - Outbound adapters
core/Clash.Meta/adapter/outbound/base.go - DNS services
core/Clash.Meta/dns/server.go - Control API
core/Clash.Meta/hub/route/server.go - TUN integration
core/tun/tun.go
Platform services
- Android VPN bridge
android/app/src/main/kotlin/com/appshub/bettbox/plugins/VpnPlugin.kt - Android VPN service
android/app/src/main/kotlin/com/appshub/bettbox/services/BettboxVpnService.kt - Android run state
android/app/src/main/kotlin/com/appshub/bettbox/GlobalState.kt - Foreground service
android/app/src/main/kotlin/com/appshub/bettbox/services/BettboxService.kt - Quick settings tile
android/app/src/main/kotlin/com/appshub/bettbox/services/BettboxTileService.kt
Client extensions
- Code editor
plugins/code_forge/rust/src/api/editor.rs - JS customization
plugins/flutter_qjs/cxx/ffi.cpp - Desktop tray
plugins/tray_manager/macos/Classes/TrayManagerPlugin.swift
Other components
- User
Connections 19
- User → Client UI: configures
README.md - Client UI → Profiles and settings: selects profile
README.md - Profiles and settings → Core entry: configures
README.md - Client UI → Android VPN bridge: starts VPN
README.md - Android VPN bridge → Android VPN service: starts service
android/app/src/main/kotlin/com/appshub/bettbox/plugins/VpnPlugin.kt - Android VPN bridge → Android run state: updates state
android/app/src/main/kotlin/com/appshub/bettbox/plugins/VpnPlugin.kt - Android VPN service → Android run state: reads state
android/app/src/main/kotlin/com/appshub/bettbox/services/BettboxVpnService.kt - Quick settings tile → Android run state: toggles run state
android/app/src/main/kotlin/com/appshub/bettbox/services/BettboxTileService.kt - Android VPN service → Foreground service: uses service interface
- Core entry → Configuration loading: loads config
- Core entry → Inbound listeners: starts listeners
- Inbound listeners → Proxy routing: dispatches traffic
- Proxy routing → Outbound adapters: selects proxy
- Core entry → DNS services: starts DNS
- Core entry → Control API: starts control API
- Android VPN bridge → TUN integration: provides VPN interface
- User → Code editor: edits configuration
README.md - User → JS customization: customizes UI
README.md - Client UI → Desktop tray: controls tray