hBlock is a POSIX-compliant shell script that downloads multiple ad, tracking, and malware domain blocklists from curated sources, processes them into a unified hosts file (or alternative formats like dnsmasq, unbound, adblock, Windows PowerShell), and installs it to block those domains at the system level. The core architecture is a single self-contained script (hblock) with a custom option parser, robust error handling, and support for parallel downloads, allow/deny lists, template-based output formatting, and subdomain filtering. It is not a reusable library but a complete CLI tool; however, its companion scripts (resource/alt-formats/*.sh) demonstrate a clean plugin pattern for generating multiple output formats, and the stats script (resources/stats/stats.sh) provides a reusable utility for analyzing domain lists against the Public Suffix List. The project is well-maintained, tested across multiple shells and platforms, and follows strict POSIX shell practices.
AdAway is an open-source Android ad-blocking application that provides two methods for blocking ads: modifying the system hosts file (requires root) and a local VPN-based DNS filter. The app downloads and manages multiple hosts sources from URLs, parses them into a local Room database, and applies the blocklists either by writing to /etc/hosts or by intercepting DNS queries through a local VPN service. The VPN mode maps real DNS servers to fake addresses, forwards allowed queries, and returns blocked or redirected responses. The architecture follows MVVM with LiveData, ViewModel, and Room, and includes background workers for periodic updates. The app bundles a legacy native C library (tcpdump/libpcap) for packet capture, used for DNS logging. The codebase is actively maintained, with frequent commits and releases, but some native components are outdated and the VPN implementation may have compatibility issues on newer Android versions.
This repository is a comprehensive collection of ad-blocking filter lists, CSS styles, JavaScript scripts, and configuration files for proxy tools (Surge, QuantumultX, Shadowrocket, Clash) and browser extensions (uBlock Origin Lite, Tampermonkey). It targets both international and Chinese websites, with a strong focus on streaming, adult, and content farm sites. The core functionality is delivered through platform-specific rule lists (`.list`, `.conf`, `.sgmodule`, `.yaml`) and a set of userscripts that inject CSS/JS into web pages via MITM proxy or browser script managers. The repository also includes a large set of pre-compiled uBlock Origin Lite scriptlets that implement advanced ad-blocking techniques such as cookie removal, attribute removal, eval blocking, and timer manipulation. The project is community-driven, with issue templates for reporting new ad locations. While primarily a configuration/rule collection, it contains substantial JavaScript code that demonstrates client-side ad-blocking patterns.