Go to file
Jason A. Donenfeld d6a8e9d4dc tunnel: avoid race between shutdown and stats
wgTurnOff can block for a while, in which case, calling getStatistics
will use a stale handle and stale tunnel. Not only that, but wgGetConfig
might return null, in which case string.split throws.

    java.lang.NullPointerException: Attempt to invoke virtual method
    'java.lang.String[] java.lang.String.split(java.lang.String)' on a null
    at com.wireguard.android.backend.GoBackend.getStatistics

Reported-by: tomt@adslweb.co.uk
Link: https://lists.zx2c4.com/pipermail/wireguard/2021-May/006709.html
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2021-05-06 10:50:20 +02:00
.idea project: use kotlin official code style 2021-05-05 13:19:04 +02:00
gradle/wrapper gradle: bump wrapper to v7.0 2021-04-11 22:03:25 +05:30
tunnel tunnel: avoid race between shutdown and stats 2021-05-06 10:50:20 +02:00
ui ui: replace deprecated string operations 2021-05-05 16:56:56 +05:30
.gitignore gitignore: add gradlew.bat 2020-06-25 01:36:31 +05:30
.gitmodules Migrate tunnel related classes to tunnel/ Gradle module 2020-03-09 19:24:26 +05:30
build.gradle build: update AGP, Kotlin and AndroidX Lifecycle 2021-05-05 12:29:23 +05:30
COPYING global: move to Apache 2.0 2018-07-06 16:28:46 +02:00
gradle.properties build: update AndroidX activity/fragments and resolve compile failure 2020-10-02 04:28:25 +05:30
gradlew build: uprev to Gradle 6.6 2020-08-12 13:28:00 +05:30
README.md README: move tunnel to maven central 2021-02-12 17:37:31 +01:00
settings.gradle gradle: include mavenCentral in plugin search repositories 2021-03-29 12:53:55 +05:30
sync-crowdin.sh build: add crowdin syncer script and use it 2020-10-14 17:16:36 +02:00
version.gradle version: bump 2021-05-05 13:30:28 +02:00

Android GUI for WireGuard

Download from the Play Store

This is an Android GUI for WireGuard. It opportunistically uses the kernel implementation, and falls back to using the non-root userspace implementation.

Building

$ git clone --recurse-submodules https://git.zx2c4.com/wireguard-android
$ cd wireguard-android
$ ./gradlew assembleRelease

macOS users may need flock(1).

Embedding

The tunnel library is on Maven Central, alongside extensive class library documentation.

implementation 'com.wireguard.android:tunnel:$wireguardTunnelVersion'

The library makes use of Java 8 features, so be sure to support those in your gradle configuration with desugaring:

compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_8
    targetCompatibility JavaVersion.VERSION_1_8
    coreLibraryDesugaringEnabled = true
}
dependencies {
    coreLibraryDesugaring "com.android.tools:desugar_jdk_libs:1.0.10"
}

Translating

Please help us translate the app into several languages on our translation platform.