Skip to content

yufengzhou46/SwitchAccelerator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SwitchAccelerator

A high-performance network accelerator for Nintendo Switch, built from scratch in Kotlin. Intercepts game traffic at the IP layer, optimizes DNS resolution via multi-endpoint DoH, and routes through a fully custom SOCKS5 proxy with multi-protocol tunnel support.

Architecture

Switch (WiFi/Hotspot) → Android VPN Interface → Packet Parser
    ↓
DNS Interceptor (DoH → System → Cache) → Traffic Router
    ↓
SOCKS5 Proxy Server (custom, zero-dependency) → Tunnel → Game Server
    ↓                                      ↓
Upstream Chain (phone VPN detected)    Direct (failover)

Key Features

  • Custom SOCKS5 Proxy Server — Full RFC 1928 implementation with HTTP CONNECT fallback, upstream chaining, and 3-strike automatic failover to direct connection
  • Layer 3 VPN Service — Raw IPv4 TCP/UDP packet interception via Android VpnService, with per-connection routing decisions
  • Multi-Tunnel Plugin System — Interface-based architecture supporting SOCKS5, Shadowsocks, VMess, VLESS, Trojan, and WireGuard tunnels
  • DNS Optimization Pipeline — 4-tier resolution: local cache → DoH pre-warming → system DNS → DoH emergency fallback. Uses Alibaba/Google/Cloudflare DoH endpoints to bypass ISP DNS poisoning
  • Dual Connectivity Mode — Same-WiFi mode (Switch and phone on same network) and Hotspot mode (phone acts as AP), with auto-detection
  • Smart Upstream Detection — Automatically detects running VPN/proxy apps on the phone and chains through them, with graceful degradation on failure
  • Real-time Performance Dashboard — Live throughput (bytes/sec), per-game-server latency probing, connection counting, and session duration tracking
  • Jetpack Compose UI — Material 3 design with animated latency gauge, connection phase indicators, and game-specific profiles

Tech Stack

Layer Technology
Language Kotlin
UI Jetpack Compose + Material 3
Async Kotlin Coroutines + StateFlow
Networking Android VpnService, raw socket I/O, OkHttp DoH
Storage DataStore Preferences
Min SDK 26 (Android 8.0)
Target SDK 35

Project Structure

com.switchaccel
├── domain/          # Business logic: AcceleratorEngine, SpeedTester
├── service/         # Android services: VpnService, SOCKS5 proxy, DNS interceptor
├── tunnel/          # Tunnel abstraction + protocol implementations
├── data/model/      # Domain models: Game, ServerNode, AccelerationState
├── data/repository/ # Data access: GameRepository, SettingsRepository
├── ui/screens/      # Compose screens: Home, Games, Settings, Accelerate
├── ui/components/   # Reusable widgets: LatencyGauge, SpeedGraph, StatusCard
├── ui/theme/        # Material 3 theming
└── util/            # Utilities: DNS optimizer, VPN detector, network helpers

How It Works

  1. Start → App detects current network mode (WiFi or Hotspot) and any existing phone VPN
  2. Proxy → A custom SOCKS5 proxy starts on the phone, listening on all interfaces
  3. DNS Warm → Game domain names are pre-resolved via DNS-over-HTTPS, bypassing ISP-level DNS blocking/poisoning
  4. Connect → The Switch is configured to use the phone's IP + proxy port in its network settings
  5. Accelerate → Game traffic flows Switch → phone proxy → (optional upstream VPN) → optimized DNS → game server
  6. Monitor → Real-time latency, throughput, and connection state displayed on the phone

Building

# Requires Android Studio Hedgehog+ and JDK 17
./gradlew assembleDebug

License

MIT

About

High-performance Nintendo Switch network accelerator with custom SOCKS5 proxy, VPN packet interception, DoH DNS optimization, and multi-protocol tunnel support. Built in Kotlin with Jetpack Compose.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages