diff options
-rw-r--r-- | Makefile | 4 | ||||
-rw-r--r-- | README.md | 23 | ||||
-rw-r--r-- | jni/tunflags.cpp | 3 |
3 files changed, 28 insertions, 2 deletions
@@ -1,3 +1,7 @@ +# SPDX-License-Identifier: GPL-2.0 +# +# Copyright (C) 2023 Jason A. Donenfeld <Jason@zx2c4.com>. All Rights Reserved. + wireguard-vnet-hdr.zip: $(wildcard magisk/* jni/*) $(firstword $(wildcard $(ANDROID_HOME)/ndk/*/ndk-build)) bsdtar -cavf $@ -s '#^magisk/\(.*\)#\1#p' -s '#libs/\([^/]\+\)/libtunflags.so#zygisk/\1.so#p' magisk/* libs/*/libtunflags.so @@ -1 +1,22 @@ -Work in progress trashbin. Nothing to see here. +## `IFF_VNET_HDR` for Android + +Android's VPN framework does not allow setting `IFF_VNET_HDR` on tun devices. +This is a simple Zygisk module that sets this flag on tun devices for a +whitelisted set of packages - `com.wireguard.android` and +`com.wireguard.android.debug`. + + +### Building + +You must have the `ANDROID_HOME` environment variable set and an NDK installed. Simply run: + +``` +$ make +``` + +Then install `wireguard-vnet-hdr.zip` in Magisk manager. + + +### License + +This is a GPLv2 project. diff --git a/jni/tunflags.cpp b/jni/tunflags.cpp index 428ca9b..31cc238 100644 --- a/jni/tunflags.cpp +++ b/jni/tunflags.cpp @@ -1,4 +1,5 @@ -/* +/* SPDX-License-Identifier: GPL-2.0 + * * Copyright (C) 2023 Jason A. Donenfeld <Jason@zx2c4.com>. All Rights Reserved. */ |