Cubic-AdBlock icon

Cubic-AdBlock

v3.21guide

AdBlock Based in /etc/hosts

★80 stars
•Networking & Proxies•by Vaz15k•MIT•Updated Oct 5, 2026
Platforms:
✓ Magisk

Overview

While VPN-based ad blockers (such as AdGuard or local DNS filters) offer flexible filtering, they require an active Android VpnService session. This prevents users from running actual VPN connections, triggers persistent notification icons, and increases battery discharge through continuous packet inspection.

Developed by Vaz15k, Cubic AdBlock provides lightweight, transparent ad blocking using Android’s native domain resolution tables. By mounting a curated, optimized hosts file systemlessly over /system/etc/hosts, domain lookups for ad exchanges, user telemetry collectors, and malicious domains are immediately redirected to loopback (0.0.0.0) with zero memory footprint.

Curated Whitelisting Philosophy

A common problem with aggressive community hosts files is that they frequently break essential login frameworks, push notification gateways, and cloud sync services. Cubic AdBlock specifically curates its blocklist to ensure:

  • Single Sign-On (SSO): Preserves authentication pipelines for Google Identity, Facebook Login, and Microsoft Live services.
  • OEM Cloud Ecosystems: Keeps essential cloud sync and device finders intact across Samsung, Xiaomi, and Google Pixel handsets.
  • App Functionality: Blocks advertising assets without triggering “Connection Failed” locks inside sensitive shopping and banking utilities.

How It Works

  1. During system startup, Magisk or KernelSU bind-mounts the module’s curated hosts table over /system/etc/hosts.
  2. Whenever an application makes an HTTP/HTTPS connection, the Android Bionic C library resolver inspects /etc/hosts before querying network DNS servers.
  3. If the destination domain matches an advertising network, resolution returns 0.0.0.0 immediately.
  4. The ad request fails locally in microseconds, speeding up page load times and saving cellular data.

Installation & Setup

  1. If using Magisk, open Magisk Settings and ensure Systemless hosts is enabled.
  2. Download the latest Cubic-AdBlock .zip from the GitHub repository.
  3. Flash the package via Magisk, KernelSU, or APatch.
  4. Reboot your device to apply the updated hosts table.

Verification

To verify that the systemless hosts file is active:

su -c ping -c 1 pagead2.googlesyndication.com

The command should return an immediate response from 0.0.0.0 or report failure to resolve, confirming that tracking and ad networks are blocked at the OS layer.