wireguard-android
Mirror only. Official repository is at https://git.zx2c4.com/wireguard-android
Top Related Projects
The Mullvad VPN client app for desktop and mobile
Official ProtonVPN Android app
The easiest, most secure way to use WireGuard and 2FA.
Quick Overview
WireGuard/wireguard-android is an open-source project that provides a WireGuard VPN client for Android devices. It offers a secure, efficient, and user-friendly implementation of the WireGuard protocol, allowing Android users to establish encrypted VPN connections easily.
Pros
- Simple and intuitive user interface for managing VPN connections
- Efficient battery usage compared to other VPN protocols
- Regular updates and maintenance from the WireGuard team
- Integration with Android's VPN API for seamless system-wide VPN usage
Cons
- Limited advanced configuration options compared to desktop clients
- Requires root access for some features (e.g., kernel module usage)
- May have compatibility issues with older Android versions
- Lacks some features found in more established VPN clients (e.g., split tunneling)
Getting Started
To use WireGuard on your Android device:
- Install the WireGuard app from the Google Play Store or F-Droid.
- Open the app and tap the "+" button to add a new tunnel.
- Either scan a QR code containing the configuration or manually enter the details.
- Save the configuration and tap to activate the VPN connection.
For developers who want to contribute to the project:
- Clone the repository:
git clone https://github.com/WireGuard/wireguard-android.git
- Open the project in Android Studio.
- Build and run the app on an Android device or emulator.
Note: Detailed contribution guidelines and build instructions can be found in the project's README and CONTRIBUTING files on GitHub.
Competitor Comparisons
The Mullvad VPN client app for desktop and mobile
Pros of mullvadvpn-app
- Offers a full-featured VPN application with a user-friendly interface
- Includes additional privacy features like kill switch and split tunneling
- Supports multiple protocols beyond WireGuard, such as OpenVPN
Cons of mullvadvpn-app
- Larger codebase and more complex, potentially leading to more maintenance
- Specific to Mullvad VPN service, not as flexible for use with other providers
- May have a steeper learning curve for contributors due to its broader scope
Code Comparison
mullvadvpn-app (Kotlin):
private fun createTunnel() {
val tunnel = Tunnel(
name = generateName(),
config = TunnelConfig(
address = listOf(IpAddress("10.0.0.2/32")),
dnsServers = listOf(IpAddress("10.0.0.1"))
)
)
tunnelManager.add(tunnel)
}
wireguard-android (Java):
private void createTunnel() {
final String name = generateName();
final Config config = new Config.Builder()
.setInterface(new Interface.Builder()
.addAddress("10.0.0.2/32")
.addDnsServer("10.0.0.1")
.build())
.build();
tunnelManager.create(name, config);
}
Both examples demonstrate tunnel creation, but mullvadvpn-app uses Kotlin and a more concise syntax, while wireguard-android uses Java with a builder pattern.
Official ProtonVPN Android app
Pros of ProtonVPN android-app
- More comprehensive VPN solution with additional features like server selection and kill switch
- User-friendly interface designed for general consumers
- Regular updates and active development from a well-known VPN provider
Cons of ProtonVPN android-app
- Larger codebase and potentially more complex to maintain
- May have a higher resource footprint due to additional features
- Closed-source nature limits community contributions and auditing
Code Comparison
wireguard-android:
override fun onCreateTunnelConfig(tunnel: Tunnel): Config {
val config = Config.Builder().setInterface(
Interface.Builder()
.parsePrivateKey(tunnel.getConfigString("PrivateKey"))
.build()
)
return config.build()
}
ProtonVPN android-app:
override fun createVpnProfile(): VpnProfile {
return VpnProfile().apply {
name = "ProtonVPN"
type = VpnType.IKEV2
server = selectedServer.ip
username = vpnUser.name
password = vpnUser.password
}
}
The code snippets show different approaches to creating VPN configurations. wireguard-android focuses on WireGuard-specific setup, while ProtonVPN android-app creates a more generic VPN profile with additional user and server information.
The easiest, most secure way to use WireGuard and 2FA.
Pros of Tailscale
- Offers a more comprehensive networking solution, including automatic key management and NAT traversal
- Provides a user-friendly interface and easier setup process for non-technical users
- Supports multi-platform connectivity beyond just Android devices
Cons of Tailscale
- Closed-source core components, which may be a concern for privacy-focused users
- Requires a centralized coordination server, potentially introducing a single point of failure
- May have higher resource usage due to additional features and coordination overhead
Code Comparison
Tailscale (Go):
func (c *Conn) Close() error {
c.mu.Lock()
defer c.mu.Unlock()
if c.closed {
return nil
}
c.closed = true
return c.pconn.Close()
}
WireGuard-Android (Java):
@Override
public void onDestroy() {
super.onDestroy();
unregisterReceiver(mReceiver);
if (mService != null)
unbindService(mConnection);
}
The code snippets show different approaches to connection management, with Tailscale using Go for its implementation and WireGuard-Android using Java for the Android-specific codebase.
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual CopilotREADME
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.
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_17
targetCompatibility JavaVersion.VERSION_17
coreLibraryDesugaringEnabled = true
}
dependencies {
coreLibraryDesugaring "com.android.tools:desugar_jdk_libs:2.0.3"
}
Translating
Please help us translate the app into several languages on our translation platform.
Top Related Projects
The Mullvad VPN client app for desktop and mobile
Official ProtonVPN Android app
The easiest, most secure way to use WireGuard and 2FA.
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual Copilot