blockads-android

pass-with-high-scoreGPL-3.0活跃维护

基于本地 VPN 的 DNS 过滤,在 Android 上全局拦截广告,无需 root、不收集数据,适合想彻底去广告又不想折腾的用户。

Block ads system-wide on Android using local VPN-based DNS filtering. No root needed. No data collection.

v7.1.1发布于 2026-11-05 06:39 UTC2,687star +28 / 7 天164fork同步于 2026-11-10 17:45 UTC

怎么上手

由 README 提炼,执行前请确认
git clone --filter=blob:limit=1m https://github.com/pass-with-high-score/blockads-android.git
cd blockads-android
./gradlew assembleDebug
硬件要求按 README 说明

README 未说明硬件要求;这是 Android 应用,需 Android 系统(min SDK 24),构建需 Android SDK 36 与 JDK 17+

下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

安卓免 root 全局去广告工具,用本地 VPN 做 DNS 过滤,拦截广告、追踪和恶意域名

基于本地 VPN 的 DNS 过滤,在 Android 上全局拦截广告,无需 root、不收集数据,适合想彻底去广告又不想折腾的用户。

核心能力

  • 通过本地 VpnService 做 DNS 过滤,无需 root
  • 可选 Root Proxy 模式,经 iptables 重定向
  • 内置 StevenBlack、AdGuard DNS、EasyList 等过滤列表
  • HTTPS 过滤用 gVisor netstack 按应用 UID 做 MITM
  • 284 域名直通名单保障银行、支付、政务应用

容易踩的坑

仓库历史提交含约 1.2GB 旧 Go 二进制,建议用 blobless clone 避免全量下载;默认从 GitHub Releases 拉取预编译 tunnel.aar,只有改 Go 代码才需 Go 1.23+ 与 gomobile;HTTPS 过滤需安装并验证 CA 证书,证书固定应用会绕过 MITM

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

5 个版本v7.1.1
  1. tunnel-2026.11.08.63123206Go tunnel 2026.11.08.63123206pre-release2026-11-08 · 2026-11-08 09:09 UTC
    查看更新说明

    Reproducible tunnel.aar built from tunnel/ at f582acaf82b38e84d8b44f6d6527fed31c8d127f.

    sha256: 312200933dffd36d84a1664fb13fbe4baa605b561f53a5b460c3597b160e59ab

    Consumed as app.pwhs:tunnel:2026.11.08.63123206; see docs/TUNNEL.md.

  2. v7.1.1最新正式版2026-11-05 · 2026-11-05 06:39 UTC

    • Android TV: Added root proxy and VPN proxy support • Fixed HTTPS filtering issues (white screen & WebSocket stability) • Fixed Domain Rules management and CA certificate wizard in light mode • Enhanced Go tunnel engine performance and connection stability • General bug fixes and stability improvements

  3. tunnel-2026.11.02.a661770fGo tunnel 2026.11.02.a661770fpre-release2026-11-02 · 2026-11-02 16:08 UTC
    查看更新说明

    Reproducible tunnel.aar built from tunnel/ at 4591cb7ef1c014ec68dc24a9329ae4163ce0c4bf.

    sha256: 1dc3993e83bf56c97aeb6dc03b77ade2b1cb8821f444d0d26a46f4a95bafc631

    Consumed as app.pwhs:tunnel:2026.11.02.a661770f; see docs/TUNNEL.md.

  4. v7.1.02026-11-01 · 2026-11-01 09:55 UTC
    查看更新说明

    • Unified Proxy & VPN mode: AmneziaWG, Shadowsocks 2022, VLESS, VMess, Trojan, Hysteria 2, TUIC & MASQUE with subscription links • DNS Stamps (sdns://), DoH3 (HTTP/3) & WebRTC leak protection • On-device filter compilation, multi-URL filter merging & custom tags • Upgraded HTTPS filtering pipeline with OTA modular rules • Android TV: custom DNS, per-app firewall, themes & compact D-pad UI • Reset Settings, Support & Bug Report sheet, and stability fixes

  5. tunnel-2026.10.27.2b2a570eGo tunnel 2026.10.27.2b2a570epre-release2026-10-27 · 2026-10-27 01:19 UTC
    查看更新说明

    Reproducible tunnel.aar built from tunnel/ at 200e6cbade83bd763c04b8ee2392d91e2b90e362.

    sha256: 43009b4ba4493200ecc48d13699f9b1e7528d99cf2a9324eea83e954eaebbee0

    Consumed as app.pwhs:tunnel:2026.10.27.2b2a570e; see docs/TUNNEL.md.

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    Screenshots


    Features

    • Dual Routing Modes: System-wide ad blocking via VPN (no root needed) OR Root Proxy Mode (via iptables)
    • Privacy-first Optional Crash Reporting & Manual Local Logs Export
    • Comprehensive Onboarding Flow (Permissions, Battery Optimization, Opt-in telemetry)
    • WireGuard Profile Import
    • HTTPS Filtering with userspace TCP/IP stack — per-app MITM, cosmetic CSS, JS scriptlets
    • CA cert install verification (auto-refresh after returning from Settings)
    • 284-domain curated passthrough list keeps banking, payments and gov apps working
    • Multiple built-in filter lists (StevenBlack, AdGuard DNS, EasyList, and more)
    • Region-aware defaults — auto-enables filters for your language
    • Real-time DNS query logs with search & filtering
    • Security protection — blocks phishing, malware, and malvertising domains
    • Dark / Light / System theme with Material 3 dynamic colors
    • 7 accent color options + Material You dynamic theming
    • Quick Settings tile & home screen widget
    • Custom block/allow rules and whitelisting
    • Per-app filtering (bypass VPN for selected apps)
    • DNS-over-HTTPS (DoH) support with multiple providers
    • Auto-update filter lists on schedule (6h / 12h / 24h / 48h)
    • Export / Import settings backup
    • Auto-reconnect on boot
    • Multi-language support (English, Vietnamese, Japanese, Korean, Chinese, Thai, Spanish)
    • 100% local — all data stays on your device

    Community

    Join our community:
    Reddit Telegram

    Sponsor

    If you enjoy BlockAds, consider supporting the project! Your sponsorship helps us maintain and improve the app.

    Sponsor

    Build Instructions

    Requirements

    • Android Studio Ladybug or newer
    • JDK 17 or higher
    • Android SDK 36 (min SDK 24)
    • (Optional - only needed if modifying Go tunnel) Go 1.23+ and gomobile

    Steps

    [!TIP] Historical versions of the Go binary (tunnel.aar) were committed in the past before being moved to GitHub Releases. To avoid downloading ~1.2GB of old binaries, use blobless clone (--filter=blob:limit=1m) to download only ~20MB.

    1. Clone the repository:

      git clone --filter=blob:limit=1m https://github.com/pass-with-high-score/blockads-android.git
      cd blockads-android
      

      (Or for a shallow clone: git clone --depth=1 https://github.com/pass-with-high-score/blockads-android.git)

    2. (Optional) Build the Go tunnel AAR/JAR from source (with Android 15 16KB page size support):

      ./scripts/build_tunnel.sh
      # Or
      ./gradlew -Ptunnel.source=local buildGoTunnel
      

      Note: This is completely optional. Gradle automatically resolves a prebuilt, checksum-pinned tunnel.aar from GitHub Releases by default. You do not need Go or NDK unless you are modifying Go code in tunnel/. See docs/TUNNEL.md.

    3. Open the project in Android Studio

    4. Sync Gradle and run the app on a device or emulator

    5. Build from command line:

      ./gradlew assembleDebug
      ./gradlew bundleRelease   # requires signing key
      

    How It Works

    BlockAds routes DNS queries locally either through a VpnService (Vpn Mode) or via iptables redirection (Root Proxy Mode). These queries are matched against loaded filter lists using a memory-efficient Trie data structure. Matching queries are blocked locally, while all other traffic passes through normally — no data leaves your device.

    When HTTPS Filtering is enabled, a userspace TCP/IP stack (gVisor netstack via tun2socks) terminates each TCP/UDP flow in Go, looks up the owning app UID via Android's ConnectivityManager.getConnectionOwnerUid(), and only MITMs flows from selected browsers. Cert-pinned apps and the 284-domain curated passthrough list bypass MITM cleanly. Cosmetic CSS rules and EasyList ##+js(…) / AdGuard #%#//scriptlet(…) scriptlets are injected into HTML responses via a tiny in-memory local asset host.


    License

    This project is licensed under the GNU General Public License v3.0.
    You are free to use, modify, and distribute it under the terms of the license.
    See the full LICENSE file for details.


    Credits


    Contributing

    Pull requests and issue reports are welcome.
    Help us improve BlockAds!

    Help us translate BlockAds

    Want to see BlockAds in your language?
    Open an issue or submit a PR with your translations.


    Star History

    Star History Chart