aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2023-10-23 15:18:35 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2023-10-23 15:18:35 +0200
commit1a6e1f50c00b0bf07806f5a1bedfd689c35065cf (patch)
tree2e8d530ea659b271e32eaba6ec00af943e97d39a
parentMake it easier to add more packages (diff)
downloadwireguard-vnet-hdr-zygisk-1a6e1f50c00b0bf07806f5a1bedfd689c35065cf.tar.xz
wireguard-vnet-hdr-zygisk-1a6e1f50c00b0bf07806f5a1bedfd689c35065cf.zip
Add license and readme
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
-rw-r--r--Makefile4
-rw-r--r--README.md23
-rw-r--r--jni/tunflags.cpp3
3 files changed, 28 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index e308b72..8446957 100644
--- a/Makefile
+++ b/Makefile
@@ -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
diff --git a/README.md b/README.md
index af4a582..25e1144 100644
--- a/README.md
+++ b/README.md
@@ -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.
*/