Prevention
A privacy-first, security-hardened Islamic mobile app for overcoming pornography addiction.
Our Role
Lead Mobile Developer, Security Architect, Full Stack Developer
Technologies & Frameworks
Project Overview
Prevention is a privacy-first, security-hardened Android application designed to help Muslims overcome pornography addiction. Unlike standard generic blocking or habit-tracking apps, Prevention builds a holistic recovery ecosystem. It blends technical safeguards (DNS-based VPN content blocking), behavioral accountability (daily check-ins and streak logs), spiritual motivation (Islamic teachings, Quran, Hadith, and supplications), and a reflective relapse flow. Built with security in mind, the platform uses enterprise-grade database rate limiting, device-fingerprinted offline sync validation, and tamper-resistant native features to ensure the user's path to sobriety remains secure, private, and consistent.
The Challenge & Problem
- Lack of Islamic Framework: Generic recovery apps lack a spiritual context, ignoring the deep conflict with Islamic teachings, modesty (taqwa), and spiritual guilt.
- Easy Circumvention: Basic web blockers are easily disabled, bypassable via third-party VPNs, or hacked on the client side.
- No Offline Integrity: Users can manipulate device clocks or logs offline to artificially protect or inflate their streaks.
- Shame-Inducing Relapse Cycle: Common solutions either ignore relapses or trigger feelings of despair, leading to binge cycles.
- No Emergency Intervention: Users have no immediate friction to break the impulse during moments of intense temptation.
The Engineering Solution
- Islamic-First Approach: Reframes recovery as a spiritual journey. Integrates curated Quranic verses, Hadith, and Duas to provide hope and internal spiritual grounding.
- Hardened VPN & Tampering Safeguards: Active split-tunneling DNS VPN (Cloudflare Family 1.1.1.3) with anti-tamper detection, emulator checks, and third-party VPN detection.
- Secure Offline Sync: Validates and queues offline check-ins with device fingerprint tracking and server-side verification to prevent time tampering.
- Compassionate & Reflective Relapse Flow: Enforces a structured 3-step relapse process (shame awareness, trigger categorization, and mandatory reflection) to turn failures into learning.
- Panic Mode Screen Pinning: Implements Android's native startLockTask() to lock the user into a 4-minute reflection screen, disrupting the impulse.
Key Architecture & Features
DNS-Based Content Blocking (Always-On VPN)
- Uses Android VpnService API to force system traffic through Cloudflare Family DNS (1.1.1.3 & 1.0.0.3)
- Split Tunneling selectively routes only web-browser apps, preventing general network breakage
- Foreground persistence to avoid OS kills via startForeground() and custom notifications
Tamper-Proof Streak Tracking
- Daily check-in captures mood and optional reflection notes
- Server-side verification using recursive SQL queries (log_daily_checkin RPC) to block client clock tampering
- Status locking prevents concurrent check-ins or contradictory relapse logging
Panic Mode Screen Pinning Lockdown
- Locks users into a reflection screen for 4 minutes with skip/exit buttons disabled
- Bridges to native Android startLockTask() to block Home, Recents, and Back button inputs
- Displays randomized Islamic Duas and spiritual grounding prompts
Islamic Motivation Content
- Curated libraries of Quranic verses, Hadiths, and supplications categorized specifically for recovery
- Randomized Carousel swipeable views with page indicators to encourage content interaction
Relapse Accountability Flow
- Shame Awareness warnings that deliver non-judgmental reminders of spiritual gravity
- Trigger analysis allowing users to categorize relapse sources (Stress, Boredom, Loneliness, Curiosity, Social Media, etc.)
- Enforces 50-character minimum text reflection before resetting the streak
Secured Offline Syncing
- Device fingerprinting links check-ins to unique device IDs to prevent multi-device spoofing
- Timestamp integrity validation to reject future-dated check-ins or excessive time drift