AegisNet is a high-performance, cross-platform system-wide DNS Privacy Guard & Ad-Blocking Mobile Application for Android (iOS in progress), built with Flutter and powered by a high-speed Rust Core Engine.
Official builds are listed at vannt-dev.github.io/official.html; anything else is not published by vannt-dev. The APK signing certificate fingerprints are listed there too.
How a DNS query is handled on Android; see Platform Status for iOS, desktop and web.
flowchart LR
lists["Blocklists<br/>Hosts, EasyList,<br/>AdGuard"]
yours["Your rules<br/>allow, block,<br/>custom hosts,<br/>quiet hours,<br/>SafeSearch"]
apps["Apps on<br/>the device"]
ui["Flutter app<br/>Dashboard, Rules,<br/>Logs, Analytics,<br/>Settings"]
vpn["Local VPN<br/>on Android<br/>DNS traffic only"]
upstream["Your DNS provider<br/>DoH, DoT or DoQ"]
core["Rust Core Engine<br/>aegis-core<br/>(private)"]
lists -->|"downloaded,<br/>kept in sync"| ui
yours --> ui
apps <-->|"DNS queries<br/>and answers"| vpn
ui -->|"rules,<br/>settings"| core
core -.->|"stats,<br/>query log"| ui
vpn <-->|"answered<br/>or blocked"| core
upstream <-->|"allowed<br/>queries"| core
- π Sub-Millisecond DNS Filtering: A Rust engine that reads Hosts files, EasyList DNS and AdGuard domain rules. A rule for a domain covers its subdomains too.
- β‘ DNS Cache: Answers already seen are served from memory until they expire, for low latency.
- πΊοΈ Local DNS Mapping & Custom Hosts: Define custom internal DNS host overrides (
domain->IP, e.g.myrouter.local->192.168.1.1) with real-time UI control. - β° Scheduled Quiet Hours (Parental Controls): Automatic category filter activation during configured quiet hours (e.g. 22:00 - 06:00).
- π Enforced SafeSearch: Exact-host SafeSearch rewriting for Google & DuckDuckGo (unrelated subdomains such as
mail.google.comare never touched). - π DNS-over-HTTPS, DNS-over-TLS & DNS-over-QUIC: Encrypted upstream over DoH (RFC 8484,
application/dns-message), DoT (RFC 7858, port 853) or DoQ (RFC 9250, UDP port 853). The built-in providers (Cloudflare, Google, AdGuard, Quad9) use DoH with IP-literal endpoints to avoid resolver bootstrap loops; a custom resolver can be anhttps://URL, atls://host[:port][#name]target or aquic://host[:port][#name]target, where#nameis the certificate name to verify when the host is an address. - π» Desktop (experimental): Windows, macOS and Linux builds include a local DNS resolver (
DesktopDnsProxy) to point the operating system at. It needs an engine library built by hand; see the platform table. - π Always-on VPN & Quick Settings tile (Android): Choose AegisNet as Android's Always-on VPN to protect from boot, or switch protection from the Quick Settings tile. A tunnel started this way, with the app closed, filters with your lists and settings.
- π App lock (PIN): An optional 4-6 digit PIN, asked when the app opens or comes back after 30 seconds away, and before anything that weakens protection: turning it off or pausing it, allowing a domain, switching off a filter, letting an app skip the VPN, or restoring a backup. Only a salted PBKDF2 hash of the PIN is stored, and wrong tries are slowed down. With the lock on, the Quick Settings tile opens the app instead of turning protection off. Android's own VPN settings can still disconnect any VPN.
- βΈοΈ Pause protection: Pause filtering for 5 minutes, 15 minutes or an hour. On Android it comes back on time even if the app has been closed, and the notification shows when. The notification also has a Pause 5 min button, counts down the time left and offers Resume.
- π Import a blocklist file (Android): Add a hosts file or a one-domain-per-line list from the phone's storage. Lines are checked and repeats dropped; the list blocks at once and is kept on the phone next to the downloaded ones.
- π§© Home-screen widget (Android): Shows whether protection is on, paused or off, and how much was blocked today; tap it to switch protection like the Quick Settings tile.
- β±οΈ DNS Latency Benchmark: Interactive built-in benchmark tool to test and automatically select the fastest upstream DNS provider.
- π± System-Wide Protection: Intercepts OS-level DNS traffic via local split-tunnel VPN (
VpnServiceon Android; the iOSNEPacketTunnelProvideris not finished) without routing web traffic to remote servers. - π Real-time Dashboard & Analytics: Interactive traffic graphs, query counters, ad-block stats, bandwidth savings, and detailed category analytics, plus a 30-day history of queries, blocks and the most-blocked domains that survives restarts (Android).
- π« Block an app (Android 10+): Refuse every DNS lookup a chosen app makes, from the Top apps list in Analytics. It stops name lookups, not connections to fixed IP addresses.
- π± Per-app statistics (Android 10+): See which apps make the most DNS queries and how many were blocked, and filter the live query log by app.
- π‘οΈ Bypass protection: DNS sent straight to public resolvers is filtered too, and their encrypted DNS is refused so apps fall back to the filter.
- πΆ Networks to protect (optional, Android): Filter only on Wi-Fi, only on mobile data, or on both, and leave chosen Wi-Fi networks out by name. Telling Wi-Fi from mobile data needs no permission; the Wi-Fi list asks for location access, which Android requires to read a Wi-Fi name. Off by default.
- π€ Look-alike domain protection (optional): Block every internationalized domain name (one with letters beyond plain a-z, accented ones included;
xn--in its technical form), which phishing sites use to imitate real addresses with look-alike letters. Off by default; domains on your allow list still work. - π Live Query Log & CSV Export: Real-time query monitoring with status filter chips (
ALL LOGS,BLOCKED,ALLOWED), instant domain search and CSV export. Tap an entry to see why it was blocked and to allow or block that domain on the spot, or to allow it for a while (15 min, 1 hour or 1 day): it is blocked again on time, even if the app is closed. Test a domain tells whether a domain would be blocked, and why, before anything asks for it. - β‘ Custom Whitelist & Blacklist: Flexible custom rule management with instant hot-reloading.
- π Background Auto-Sync: Automatic blocklist updates and background rule synchronization.
- π 4-Language i18n Support: Full internationalization for English (EN), Vietnamese (VI), Korean (KO), and Japanese (JA).
- π Dynamic Dark/Light Theme: Seamless theme switching with customizable app settings.
The app downloads these lists when it syncs. None of them is bundled with the app; each stays under its own licence and belongs to its maintainers. You can switch any of them off, or add your own list by URL, on the Rules screen.
| List | Filter | On by default |
|---|---|---|
| AdGuard DNS filter | Ads | Yes |
| StevenBlack Unified Hosts | Ads | Yes |
| Peter Lowe's Ad and Tracking Server List | Trackers | Yes |
| OISD Small | Ads | Yes |
| HaGeZi Multi NORMAL | Ads | No, adds about 6 MB of memory |
| URLhaus by abuse.ch, via malware-filter | Malware | Yes |
| StevenBlack Adult Hosts | Adult | No |
The HaGeZi lists are made by HaGeZi and licensed under GPL-3.0. The malware list is URLhaus data (CC0) as published by malware-filter (CC0 and MIT).
AegisNet blocks by domain name. It sees which host a device asks for and answers or refuses; it never looks inside the encrypted connection. That draws a hard line around what it can do.
Blocked effectively β ads and trackers served from their own domains: banners and interstitials in most free apps and games (AppLovin, Vungle, AdMob and similar networks), analytics and telemetry endpoints, and web ads while browsing.
Not blocked β ads served from the same domains as the content itself:
| App | Why |
|---|---|
| YouTube | Ads and video both come from googlevideo.com. Blocking it blocks the video too. The ad-only domains it also asks for (googleads.g.doubleclick.net and similar) are blocked, but they are not what plays the video ads. |
| Facebook / Instagram | In-feed ads arrive over the same hosts as the feed. |
| Spotify, TikTok | Same pattern: ad content shares the delivery infrastructure. |
This is a property of DNS filtering itself, not a gap in the rule list β no blocklist can fix it. Removing YouTube ads specifically requires a different approach: YouTube Premium (or Premium Lite), watching in a browser with a content blocker such as Firefox with uBlock Origin, or an alternative client such as NewPipe. Get any of these from their official site, F-Droid or GitHub only, and note that YouTube's terms forbid blocking its ads.
| Platform | Native DNS filtering | Notes |
|---|---|---|
| Android | β Working (verified on emulator) | TUN β Rust β device pipeline, DNS-only routing, DoH upstream. libaegis_core.so is built by a Gradle cargo-ndk task, or fetched already built when the engine's source is absent. |
| iOS | π§ App shell builds in CI; filtering not wired up | The Flutter shell compiles on a macOS runner when a PR changes the iOS project, the engine, the plugins or CI, and on every release PR into main. Extension provider, NETunnelProviderManager channel, entitlements, App Group state sharing and the Rust framework script are all in the repo, and the Rust core cross-compiles for iOS. Still missing: the PacketTunnel extension target is not checked into the Xcode project. ios/add_packet_tunnel_target.rb adds it on a Mac (and links the engine framework), but the extension has not yet been compiled in CI or run on a device. Final assembly needs macOS/Xcode + a paid Apple Developer account β see ios/IOS_SETUP.md. |
| Desktop | π§ Local DNS proxy; engine not bundled (Windows/macOS/Linux) | DesktopDnsProxy answers DNS on loopback (port 53, or 5300 without the rights for 53) through the engine, and the operating system has to be pointed at it by hand. The desktop builds do not build or bundle the engine library: put a hand-built aegis_core.dll / libaegis_core.so beside the app (on macOS, link it into the app). Without it the proxy cannot answer and the app runs the pure-Dart fallback. |
| Web | β Fallback Engine / WASM Ready | Runs the pure-Dart fallback engine (simulation) with WASM target scaffolding for browser testing. |
When the native engine is unavailable, the app gracefully falls back to a pure-Dart simulation engine instead of failing β useful for UI work without a native toolchain. See CHANGELOG.md for the full list of changes.
aegis-net/
βββ android/ # Native Android VpnService & MethodChannel
β βββ app/
β βββ build.gradle.kts # cargo-ndk preBuild task -> jniLibs
β βββ src/main/
β βββ jniLibs/ # libaegis_core.so per ABI (built, git-ignored)
β βββ kotlin/com/aegisnet/app/
β βββ AegisVpnService.kt
β βββ MainActivity.kt
βββ ios/ # Native iOS NEPacketTunnelProvider (WIP)
β βββ PacketTunnel/ # Extension sources β not built or run on a device yet
β β βββ PacketTunnelProvider.swift
β βββ add_packet_tunnel_target.rb # Adds the PacketTunnel target to the Xcode project
β βββ Runner/
β βββ AppDelegate.swift # registers the channel from didInitializeImplicitFlutterEngine
β βββ SceneDelegate.swift # UIScene lifecycle (Flutter 3.35+)
β βββ VpnManager.swift # com.aegisnet/vpn MethodChannel <-> NETunnelProviderManager
βββ rust/aegis_core/ # Rust engine β private submodule (vannt-dev/aegis-core)
βββ lib/ # Flutter Application (Dart)
β βββ main.dart
β βββ src/
β βββ bridge/ # Flutter-Rust FFI & Native VPN Channel
β βββ i18n/ # 4-language string localization (EN, VI, KO, JA)
β βββ providers/ # State management (VpnProvider, ThemeProvider)
β βββ screens/ # Dashboard, Analytics, Rules, Logs, Settings
β βββ services/ # DNS Benchmark & Rule Downloader Services
βββ .githooks/ # Pre-commit & Pre-push Git hooks
βββ .github/workflows/ # CI/CD workflows (Build & Test matrix)
βββ pubspec.yaml
βββ README.md
For detailed setup, building, testing, and deployment instructions, refer to the project documentation:
- π User Guide: USER_GUIDE.md | USER_GUIDE_EN.md
- π οΈ Build Guide: BUILD_GUIDE.md | BUILD_GUIDE_EN.md
- π Google Play Store Deployment: GOOGLE_PLAY_DEPLOYMENT_GUIDE.md
- π Apple App Store Deployment: APP_STORE_DEPLOYMENT_GUIDE.md
- πΊοΈ Product Roadmap: ROADMAP.md
- π Changelog: CHANGELOG.md
- π iOS Packet Tunnel Setup: ios/IOS_SETUP.md
- Flutter SDK (v3.0.0+ for Android/Web; iOS needs 3.35+ β the iOS shell
uses the UIScene lifecycle APIs
FlutterSceneDelegate/FlutterImplicitEngineDelegate, which older SDKs do not have. CI builds on the latest stable release; the version is not pinned.) - Rust Toolchain (
rustup,cargo) - Google Chrome / MS Edge (for Web local testing) or Android Studio / Visual Studio 2022 (for platform native builds)
flutter pub getNote: If the native engine is not compiled, AegisNet automatically falls back to its built-in Pure Dart Engine, allowing UI testing without native compilation.
The engine's source is not in this repository.
rust/aegis_coreis a git submodule of the private repositoryvannt-dev/aegis-core. With read access to it, fetch it withgit submodule update --init rust/aegis_core(or clone with--recurse-submodules). Without access the directory stays empty, and the build uses the engine already built: see Building without the engine's source below. You can then skip the rest of this step.
cd rust/aegis_core
cargo build --release # host build (desktop/tests)
cd ../..Android: the native library is built automatically. The Gradle preBuild
task runs cargo-ndk and drops libaegis_core.so into jniLibs for every ABI,
so a normal flutter build apk / flutter run produces a filtering-capable
build. It requires the Rust Android targets and cargo-ndk:
rustup target add aarch64-linux-android armv7-linux-androideabi x86_64-linux-android
cargo install cargo-ndkIf cargo-ndk is not on PATH, the task is skipped and the app runs in the
pure-Dart fallback (no crash).
π‘ Windows Troubleshooting (
os error 4551): If Windows Smart App Control blockscargo.exe, add an exclusion for~/.cargoand~/.rustupin Windows Security > App & browser control, or switch toolchain to GNU (rustup default stable-x86_64-pc-windows-gnu).
A clone of this repository alone builds a working app. Every release from 1.6.0
on carries the engine as binaries, and the build fetches them when
rust/aegis_core is empty. No Rust toolchain is needed.
- Android: nothing to do.
flutter build apk/flutter runfetchesaegis-engine-android.zip(the threelibaegis_core.soof that release's APK) intoandroid/app/src/main/jniLibsand checks it against the published SHA-256. The release of this checkout's version is tried first, then the latest one.-Paegis.prebuilt=falsebuilds without an engine instead;-Paegis.engineUrl=<url>takes the two files from another place. - iOS (on a Mac):
./ios/fetch_prebuilt_engine.shputsAegisCore.xcframeworkintoios/Frameworks, where./ios/build_rust_ios.shwould have written it. The app shell builds without it too; see the platform table above for what iOS does today. - Desktop and Web run the pure-Dart fallback engine, as they do with the source.
The binaries are the ones the release itself shipped, and they are what the build falls back to whenever the source is missing. Without a network the build still succeeds, in fallback mode: the app installs and runs but filters nothing, and the build log says so.
-
Run Web Debug Mode (Hot Reload):
flutter run -d chrome
(or
flutter run -d edge) -
Run Web Production Server:
flutter build web --release npx serve build/web -l 8080
Then open http://localhost:8080 in your browser.
-
Run on iOS (macOS + Xcode 15+ only):
flutter build ios --no-codesign # verify the shell compiles flutter run -d <simulator-id> # flutter devices to list them
There is no CocoaPods in this project β the only native plugin goes through Swift Package Manager, so
pod installis not a step and will fail with No Podfile found. If you open Xcode, openios/Runner.xcworkspace, notRunner.xcodeproj; opening the project directly leaves Xcode unable to resolve the generated package and it reports Missing package product 'FlutterGeneratedPluginSwiftPackage'.DNS filtering does not work on iOS yet β the
PacketTunneltarget has to be added withruby ios/add_packet_tunnel_target.rb, and the extension has not been built or run on a device yet. Seeios/IOS_SETUP.md.
- Flutter Unit Tests:
flutter test - Rust Core Tests:
cd rust/aegis_core cargo test
# Flutter Analysis & Format
flutter analyze
dart format --output=none --set-exit-if-changed .
# Rust Format & Lints
cd rust/aegis_core
cargo fmt --check
cargo clippy -- -D warningsAegisNet uses GitHub Actions for CI/CD with parallel job execution, Cargo & Gradle caching, and automated verification:
- Git Hooks: Pre-commit formatting & strict pre-push test gate (
.githooks/). - Build & Test (
build.yml): Rustcargo check/test, Flutter analyze/test/web build, and Android debug APK build. Runs on every push todevelop, every PR, and on a Monday/Thursday schedule that keeps the Gradle cache warm. A PR that only touches docs skips the jobs. - iOS Build Verification (
ios.yml): cross-compiles the Rust core for iOS targets and builds the Flutter iOS shell (flutter build ios --no-codesign) on a macOS runner. Both jobs gate β a broken iOS shell fails the run. It runs only whenbuild.ymlcalls it: when the iOS project, the engine, the plugins or CI change, and on every release PR intomain. - Release (
release.yml): builds, signs and publishes the Android release APK (GitHub Release + Firebase App Distribution). Only runs onmainβ a PR intomainbuilds a downloadable artifact without publishing, a push/merge tomainpublishes for real.
Distributed under the MIT License. See LICENSE for more information.