A userspace TCP/UDP connection monitor, firewall, DNS resolver, and WireGuard client for Android.
Firestack is built specifically for Rethink DNS + Firewall. gVisor/netstack provides a SOCKS-like interface (similar to badvpn's tun2socks) for TCP and UDP connections over a tun-device.
Firestack is a hard-fork of Google's outline-go-tun2socks project.
Firestack is released as an Android Library (aar) and can be integrated into
your Android builds via jitpack.io (ref).
# add this to your project's build.gradle
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
# add the dep to your app's build.gradle
dependencies {
implementation 'com.github.celzero:firestack:Tag'
}The APIs aren't stable and hence left undocumented, but you can look at RethinkDNS (GoVpnAdapter, BraveVpnService) to see how to integrate with Firestack on Android.
- macOS host (iOS, macOS)
- make
- Go >= 1.18
- A C compiler (e.g.: clang, gcc)
Firestack APIs are available only on Android builds for now. iOS and Linux support will come by fall 2022.
- sdkmanager
- Download the command line tools from developer.android.com.
- Unzip the pacakge as
~/Android/Sdk/cmdline-tools/latest/. Make suresdkmanageris located at~/Android/Sdk/cmdline-tools/latest/bin/sdkmanager
- Android NDK 23+
- Install the NDK with
~/Android/Sdk/cmdline-tools/latest/bin/sdkmanager "platforms;android-30" "ndk;23.1.7779620"(platform from outline-client, exact NDK 23 version obtained fromsdkmanager --list) - Set up the environment variables:
export ANDROID_NDK_HOME=~/Android/Sdk/ndk/23.1.7779620 ANDROID_HOME=~/Android/Sdk
- Install the NDK with
- gomobile (installed as needed by
make)
- Xcode
- gomobile (installed as needed by
make)
We build binaries for Linux and Windows from source without any custom integrations.
xgo and Docker are required to support cross-compilation.
- Docker (for XGO)
- xgo (installed as needed by
make) - ghcr.io/crazy-max/xgo Docker image (~6.8GB pulled by
xgo).
# iOS and macOS: This will create build/apple/Tun2socks.xcframework
make clean && make apple
# Linux: This will create build/linux/tun2socks
make clean && make linux
# For Windows: This will create build/windows/tun2socks.exe
make clean && make windows
# For Android: This will create build/android/{tun2socks.aar,tun2socks-sources.jar}
make clean && make android
# For Intra: This will create build/intra/{tun2socks.aar,tun2socks-sources.jar}
make clean && make intra
If needed, you can extract the jni files into build/android/jni with:
unzip build/android/tun2socks.aar 'jni/*' -d build/android