Hardened System-Level Adult Content Filter, Local DNS Sinkhole & Anti-Bypass Accountability OS for Android
ZevBlock is a hardened, battery-efficient Android protection and accountability platform designed to eliminate pornography and adult material at the system and network level, enforce strict SafeSearch across search engines, scrape browser address bars, prevent Private DNS/VPN tampering, and lock out self-bypass via Device Owner and offline cryptographic two-person rules.
Pre-compiled APKs are built directly by automated GitHub CI:
- Navigate to GitHub Releases.
- Under the latest v2.0 release, download
ZevBlock-v2.0.apkorZevBlock-latest.apk. - Open the downloaded file on your Android device to install.
- Go to the Actions tab.
- Select the latest run of "Build & Release ZevBlock APK".
- Under the Artifacts section at the bottom, download
ZevBlock-v2.0-apk.zipcontaining the pre-compiled APK.
[ Network Layer ]
+--------------------------------------------------------------------------+
| Tier 1: SafeSearch VIP Interception |
| -> Google (216.239.38.120), YouTube (216.239.38.119), Bing, DDG, Yahoo |
| |
| Tier 2: In-Memory StevenBlack & Adult CDN Blocklist (150+ Top Seeds) |
| -> phncdn.com, ypncdn.com, xhcdn.com, pornhub, xvideos, cams, onlyfans |
| |
| Tier 3: Upstream Cloudflare Family (1.1.1.3) & CleanBrowsing Fallback |
| -> Unlisted/new adult domains automatically sinkholed by upstream DNS |
+--------------------------------------------------------------------------+
|
[ Screen Layer ]
+--------------------------------------------------------------------------+
| Accessibility URL & On-Screen Node Scraper |
| -> 30+ Browsers (Chrome, Firefox, Brave, Kiwi, Via, Aloha, Opera, etc.) |
| -> Universal On-Screen Inspector (blocks adult content across any app) |
| -> NSFW Regex Classifier (word boundary matching, leetspeak, TLDs) |
+--------------------------------------------------------------------------+
|
[ Device Layer ]
+--------------------------------------------------------------------------+
| DevicePolicyManager Anti-Bypass Lockdown |
| -> DISALLOW_CONFIG_PRIVATE_DNS (prevents DoT bypass) |
| -> DISALLOW_INSTALL_UNKNOWN_SOURCES (blocks sideloading adult apps) |
| -> Always-On VPN Lockdown (drops traffic if VPN stops) |
| -> DISALLOW_SAFE_BOOT & Anti-Uninstall Block |
+--------------------------------------------------------------------------+
-
Battery-Optimized Virtual Split Routing: Allocates virtual IP
10.254.1.1/32(and IPv6fd00::1/128) and routes only port 53 DNS queries through the TUN interface. Standard TCP/UDP data traffic (browsing, streaming, downloads, gaming) continues at full wire speed without VPN latency or thermal throttling. -
Adult Content Delivery Network (CDN) Sinks: Hierarchically blocks adult video CDNs (
phncdn.com,ypncdn.com,xhcdn.com,rncdn3.com,bcvcdn.com, etc.), which completely breaks streaming video playback on mobile devices even if embedded within third-party viewers or WebViews. -
Strict SafeSearch VIP Rewriting: Intercepts DNS queries targeting search engines and forces them to strict VIPs:
-
Google:
216.239.38.120(forcesafesearch.google.com) -
YouTube:
216.239.38.119(Strict Restricted Mode VIP) -
Bing:
204.79.197.220(strict.bing.com) -
DuckDuckGo:
safe.duckduckgo.com -
Yahoo:
safe.search.yahoo.com -
Brave Search:
safe.brave.com -
Qwant:
safe.qwant.com
-
Google:
-
In-Memory StevenBlack & Adult Database: 150+ top global adult tube sites, webcam networks, escort aggregators, hentai/anime portals, and fan leak platforms with
$O(\text{labels})$ hierarchical suffix matching. -
Adult-Filtering Upstream Resolvers: Forwards clean queries to Cloudflare Family (
1.1.1.3/1.0.0.3) and CleanBrowsing Adult Filter (185.228.168.10) via non-blocking asynchronous coroutines. Any unlisted adult domain is automatically sinkholed by upstream DNS. -
Automatic Boot Recovery: Automatically restarts the DNS sinkhole upon system boot via
BootCompletedReceiver.
- 30+ Supported Mobile Browsers: Extracts address bar URLs across Chrome, Firefox, Brave, Edge, Samsung Internet, Opera (GX, Touch, Mini), Kiwi, Via, Aloha, Vivaldi, Puffin, Tor Browser, Mint, Phoenix, UC Browser, and generic WebViews.
- Smart Messaging & Chat Safeguard (WhatsApp, Telegram, Signal, Messages, Discord, etc.):
- Monitors on-screen text in real time for vulgar or explicit keywords (
"xxx", adult terms, etc.). - Non-Intrusive Warning System: Displays an instant Toast reminder and heads-up system notification with a 4-second throttle windowโkeeping users accountable without interrupting typing or force-quitting their chat session.
- Monitors on-screen text in real time for vulgar or explicit keywords (
- Universal Screen Content Inspector: Monitors on-screen window hierarchies across any app (including social apps, Reddit, and unlisted WebViews) for explicit adult titles or keywords, executing
GLOBAL_ACTION_BACKand displaying a full-screen warning overlay. - Incognito & Private Window Blocker: Detects Incognito mode triggers and immediately closes the window.
- Intelligent NSFW Classifier (
NsfwContentDetector):- Multilingual explicit terms (English, Spanish, Portuguese, French, German).
- Explicit URL path segment triggers (
/porn/,/xxx/,/hentai/,/nsfw/,/adult/,/cams/,/webcam/). - Explicit TLD filters (
.xxx,.adult,.porn,.sex,.sexy,.cam,.tube). - Comprehensive query parameter extractor (
?q=,&search_query=,?search=,?keyword=,?term=,?p=,?w=). - Word-boundary regex matching (
(^|[^a-z0-9])keyword([^a-z0-9]|$)) on short terms to prevent false positives on harmless words ("essex", "sussex", "analysis", "canal", "documentary").
- Settings Anti-Tamper Guard (
SettingsTamperGuard): Inspectscom.android.settingsto prevent unauthorized navigation into:- App Info (blocks "Force stop", "Uninstall", "Clear data")
- Accessibility Service toggles (prevents turning off protection)
- Device Administrator settings (prevents deactivation)
- VPN and Private DNS configuration screens
- OS-Level Uninstall Block: Calls
DevicePolicyManager.setUninstallBlocked()to disable uninstallation at the operating system level. - Safe Mode Boot Prevention: Enforces
UserManager.DISALLOW_SAFE_BOOTso restrictions cannot be bypassed by booting into Android Safe Mode. - Private DNS Lock: Enforces
UserManager.DISALLOW_CONFIG_PRIVATE_DNSto prevent bypassing local DNS sinkholes via Android 9+ DNS-over-TLS (DoT). - Unknown Sources Sideload Block: Enforces
UserManager.DISALLOW_INSTALL_UNKNOWN_SOURCESto block sideloading unauthorized adult APKs or proxy browsers. - Always-On VPN Lockdown: Enforces
setAlwaysOnVpnPackage(adminComponent, packageName, lockdown = true)to drop all device network traffic if the VPN service is ever disconnected.
- Offline RFC 6238 TOTP Engine: Generates a 160-bit cryptographically secure Base32 secret and
otpauth://totp/...URI scannable by Google Authenticator, Aegis, Bitwarden, or 2FAS on an accountability partner's phone. - Hardware Monotonic Clock Timer: Employs
SystemClock.elapsedRealtime()(hardware clock running since device boot, including deep sleep). Changing device date/time, advancing the system clock, or shifting timezones cannot accelerate countdown delays. - HMAC-SHA256 Integrity Sealing: Cryptographically seals lock state with a 256-bit device key to detect and invalidate manual storage tampering.
- Dashboard Screen: Hero defense status card with dynamic pulsing animation, 7-Day Visual Protection Bar Chart, Clean Protection Streak counter, 2x2 module status grid, live query counters, and real-time security activity feed.
-
Custom Shield Rules (Zero-Bypass Dual-Protection):
- Additive Protection: Add custom domains for local DNS sinkholing and custom keywords for screen and chat monitoring.
- Zero-Bypass Guarantee: Built-in adult blocklists and keywords are permanently locked and cannot be disabled or whitelisted.
-
Dual-Protection Deletion: Removing a custom rule strictly requires Partner 6-digit TOTP verification or a 24-hour hardware cooldown delay (
SystemClock.elapsedRealtime()) to protect against impulsive relapse.
-
Tamper-Proof Protection Analytics (
ProtectionStatsManager): Aggregates daily intercepts (DNS sinkhole, on-screen blocks, incognito attempts, chat warnings, and settings tamper guards). Clearing statistics requires Partner TOTP verification. - Android 13+ "Restricted Settings" Bypass Visual Guide: Illustrated step-by-step walkthrough resolving Android 13/14/15 sideloaded accessibility restrictions with direct intent launchers.
-
Partner Setup Screen: Pure-Kotlin QR code view, copyable Base32 secret key, rolling 6-digit code verifier with
$\pm 30\text{s}$ drift tolerance, and temporary bypass authorization. - Interactive Tools & Simulators: Test DNS lookups against SafeSearch VIPs and adult blocklists, evaluate search query URLs, and preview the translucent warning overlay.
To unlock hardware-level anti-uninstall protection and Safe Mode blocking, provision ZevBlock as the Device Owner via ADB:
# 1. Enable USB Debugging in Developer Options
# 2. Connect phone via USB
adb devices
# 3. Provision ZevBlock as Device Owner
adb shell dpm set-device-owner com.zevbuild.zevblock/.receiver.ShieldDeviceAdminReceiverNote
Android requires that personal accounts (Google, etc.) are temporarily removed before provisioning Device Owner on an active device, or provisioned during initial device factory setup.
If your device is rooted or has Shizuku configured:
dpm set-device-owner com.zevbuild.zevblock/.receiver.ShieldDeviceAdminReceiverOn Android 13, 14, and 15, accessibility services on sideloaded APKs are restricted by default:
- Open Settings > Apps > See all apps > ZevBlock (or tap "1. Open App Info" in the ZevBlock setup tab).
- Tap the three vertical dots (โฎ) in the top right corner.
- Tap "Allow restricted settings" and authenticate with your device PIN or fingerprint.
- Return to ZevBlock and tap "2. Open Accessibility" to toggle on the service.
The repository contains an automated test suite verifying core protocols:
# Run all unit tests locally
./gradlew :app:testDebugUnitTest --stacktraceTested components in ZevBlockCoreTest.kt include:
- Adult search query parameter extraction across Google, YouTube, Bing, Yahoo, and DuckDuckGo
- Adult TLD (
.xxx,.adult) and explicit path segment detection (/porn/,/hentai/) - False-positive prevention for safe words ("essex", "sussex", "analysis", "canal", "documentary")
- Hierarchical subdomain blocking on adult CDNs (
video.edge.phncdn.com,m.xvideos.com) - SafeSearch VIP rewriting for Google, YouTube, Bing, and DuckDuckGo
- Raw RFC 1035 packet parsing, response synthesis, and IP/UDP checksum calculations
- Base32 encoding / decoding round-trip fidelity
zevblock/
โโโ app/src/
โ โโโ main/
โ โ โโโ AndroidManifest.xml # Service, receiver, and permission declarations
โ โ โโโ java/com/zevbuild/zevblock/
โ โ โ โโโ MainActivity.kt # Primary Material 3 App Shell & Navigation
โ โ โ โโโ core/
โ โ โ โ โโโ admin/
โ โ โ โ โ โโโ DeviceAdminManager.kt # DevicePolicyManager anti-bypass enforcer
โ โ โ โ โโโ dns/
โ โ โ โ โ โโโ DnsPacket.kt # Binary IP/UDP and DNS data models
โ โ โ โ โ โโโ DnsPacketParser.kt # Raw IPv4/IPv6 and RFC 1035 packet parser
โ โ โ โ โ โโโ DnsPacketBuilder.kt # Synthesizer for A/AAAA/CNAME records & checksums
โ โ โ โ โ โโโ SafeSearchManager.kt # Google / YouTube / Bing / DDG / Yahoo VIP rewriter
โ โ โ โ โ โโโ DomainBlocklistMatcher.kt # StevenBlack & Adult CDN in-memory matcher
โ โ โ โ โโโ accessibility/
โ โ โ โ โ โโโ BrowserUrlExtractor.kt # Address bar scraper (30+ browsers)
โ โ โ โ โ โโโ NsfwContentDetector.kt # Adult terms, leetspeak, TLDs & query detector
โ โ โ โ โ โโโ SettingsTamperGuard.kt # com.android.settings inspection & blocker
โ โ โ โ โโโ security/
โ โ โ โ โโโ TamperLockManager.kt # RFC 6238 TOTP engine & monotonic cooldown
โ โ โ โโโ receiver/
โ โ โ โ โโโ ShieldDeviceAdminReceiver.kt # Device Administrator lifecycle receiver
โ โ โ โ โโโ BootCompletedReceiver.kt # Boot completed auto-start receiver
โ โ โ โโโ vpn/
โ โ โ โ โโโ DnsBlockerVpnService.kt # Local TUN DNS sinkhole & Cloudflare Family
โ โ โ โ โโโ ShieldVpnService.kt # Service alias
โ โ โ โโโ accessibility/
โ โ โ โ โโโ ShieldAccessibilityService.kt # Universal screen & browser scraper service
โ โ โ โโโ ui/
โ โ โ โโโ overlay/
โ โ โ โ โโโ SecurityWarningOverlayActivity.kt # Translucent Compose warning overlay
โ โ โ โ โโโ OverlayManager.kt # Debounced overlay trigger
โ โ โ โโโ qr/
โ โ โ โ โโโ QrCodeGenerator.kt # Pure-Kotlin QR matrix generator & Canvas view
โ โ โ โโโ screens/
โ โ โ โ โโโ DashboardScreen.kt # Hero defense status & live telemetry
โ โ โ โ โโโ OnboardingScreen.kt # Restricted Settings bypass & permissions guide
โ โ โ โ โโโ PartnerSetupScreen.kt # Friend QR code pairing & cooldown timer
โ โ โ โโโ theme/
โ โ โ โโโ Color.kt # ZevBlock security palette
โ โ โ โโโ Theme.kt # Material Design 3 Dark Theme
โ โ โ โโโ Type.kt
โ โ โโโ res/
โ โ โโโ xml/
โ โ โ โโโ accessibility_service_config.xml # Accessibility window configuration
โ โ โ โโโ device_admin_rules.xml # Device administrator policy declarations
โ โ โโโ values/
โ โ โโโ strings.xml # Localized labels and string resources
โ โโโ test/java/com/zevbuild/zevblock/
โ โโโ ZevBlockCoreTest.kt # Core unit test suite
โโโ .github/workflows/
โ โโโ build.yml # Automated CI build & release workflow
โโโ build.gradle.kts # Root build script
โโโ settings.gradle.kts # Gradle settings
โโโ README.md # Documentation
- 100% On-Device Processing: All domain matching, SafeSearch rewriting, and URL keyword scraping occur entirely in local device memory (RAM).
- Zero Cloud Leakage: No browsing logs, visited domains, search queries, or analytics are ever transmitted to remote servers.
- Zero Invasive Permissions: ZevBlock does not request contacts, SMS, call logs, location, camera, or microphone permissions.
- Open-Source & Auditable: Transparent Kotlin codebase with zero proprietary binary blobs or tracking SDKs.
This project is open-source under the Apache 2.0 / MIT License.
