Android GUI for WireGuard
This is an Android GUI for WireGuard. It opportunistically uses the kernel implementation, and falls back to using the non-root userspace implementation.
- Java 17+
- Android SDK — AGP 9.1.0 编译需要
- NDK (侧载版本 28.x) — 用于编译原生 C/Go 库
- Go ≥ 1.23 — 用于编译
libwg-go.so(仅 Linux/macOS 需要;Windows 使用预编译库或系统 Go) - Gradle 9.6+ — 项目使用 Gradle Wrapper,自动下载对应版本
$ git clone --recurse-submodules https://git.zx2c4.com/wireguard-android
$ cd wireguard-android
$ ./gradlew assembleRelease
或 Windows cmd/PowerShell:
gradlew.bat assembleDebug
- 原生库
libwg-go.so在 MINGW 环境下使用系统 Go 编译,请确保 Go 已安装 - 如无法从
services.gradle.org下载 Gradle 发行版,可配置代理或手动下载到%GRADLE_USER_HOME%/wrapper/dists/ - macOS 用户可能需要 flock(1)
| 命令 | 说明 |
|---|---|
assembleDebug |
Debug 版 APK,可直接安装测试 |
assembleRelease |
Release 版 APK,需要签名配置 |
The tunnel library is on Maven Central, alongside extensive class library documentation.
implementation 'com.wireguard.android:tunnel:$wireguardTunnelVersion'
The library makes use of Java 17 features, so be sure to support those in your gradle configuration with desugaring:
compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
coreLibraryDesugaringEnabled = true
}
dependencies {
coreLibraryDesugaring "com.android.tools:desugar_jdk_libs:2.1.5"
}
Please help us translate the app into several languages on our translation platform.