PhoneDetox
Open-source, offline-first digital wellbeing and app-blocking Android app
Context & Problem
Most mobile app blockers undermine their own promise in one of two ways: they either monetize attention with ads, subscriptions, and telemetry, or they are trivial to dismiss with a single tap the moment boredom hits.
PhoneDetox was built to be an open-source, ad-free alternative where privacy is architectural rather than a policy promise: the app declares no android.permission.INTERNET in its manifest, guaranteeing that focus schedules and app usage preferences never leave the device.
Architecture & Core Mechanics
1. Strict Overlay with Non-Negotiable Safety
When a focus session is active, a Foreground Service paired with an AccessibilityService draws a minimalist full-screen launcher overlay that blocks access to non-allowlisted apps. At the same time, safety is hard-coded into the allowlist layer: incoming phone calls, the system dialer, and emergency services are always reachable and can never be locked out.
2. Immutable Active Profiles & Merged Schedules
Users can organize allowlists into distinct profiles (such as Work, Sleep, or Deep Detox). Once a profile is active, its allowlist cannot be edited mid-session to sneak distracting apps in.
Scheduling supports both one-time future blocks and repeating weekly windows—including overnight schedules that cross midnight—with automatic interval merging via AlarmManager and local state persisted in Room (SQLite).
3. High-Friction Emergency Exit
Instead of an impulsive “unlock anyway” button, breaking a block early requires typing an explicit commitment statement verbatim with live typo detection, followed by a mandatory 5-minute cooldown before the overlay lifts. That deliberate friction turns mindless habit loops into a conscious pause.
4. OEM Hardware Compatibility Layer
Android background execution and overlay permissions behave inconsistently across vendors. PhoneDetox isolates device-specific permission guidance and background resilience behind modular adapters targeting Samsung One UI, Motorola, Xiaomi, and generic Android builds.
Trade-offs & Lessons Learned
- Zero network permission constrains convenience—by design: Excluding
INTERNETprevents cloud backup or remote sync, which makes the privacy guarantee verifiable directly from the APK manifest. - Testing system services on real vendor ROMs: Working around aggressive OEM battery killers reinforced the need for clean adapter boundaries instead of scattering manufacturer checks across UI screens.