A comprehensive Islamic mobile app for fighting pornography addiction through accountability, motivation, and DNS-based content blocking.
Current Version: 5.0 (February 9, 2026)
Prevention is a privacy-first, security-hardened Android application designed to help Muslims overcome pornography addiction through:
- DNS-based VPN blocking of explicit content
- Streak tracking with mandatory daily check-ins
- Islamic motivational content from Quran and Hadith
- Relapse accountability with trigger analysis and reflection
- Enterprise-grade security to prevent circumvention
- VPN-based DNS filtering using Cloudflare Family DNS (1.1.1.3)
- Always-on protection with automatic restart
- Bypass prevention with external VPN detection
- Tamper-resistant design
- Streak Tracking: Daily check-ins to maintain sobriety streak
- Server-side validation: All streak logic runs in Supabase (tamper-proof)
- Relapse Flow: Mandatory 3-step process (shame reminder, trigger selection, reflection)
- Historical logs: Complete audit trail of check-ins and relapses
- Curated Quranic verses about purity and taqwa
- Hadith collections on guarding chastity
- Daily reminders and duas
- Community stories of recovery
- Row Level Security (RLS) on all database tables
- Rate limiting (5 check-ins/hour, 3 syncs/30min)
- Anti-tampering: Emulator, root, and debug detection
- VPN enforcement: Blocks check-ins if external VPN active
- Offline integrity: Device fingerprinting + timestamp validation
- Audit logging: Immutable security events table
Frontend:
- Flutter 3.x - Cross-platform UI framework
- Riverpod - State management
- Go Router - Navigation
Backend:
- Supabase - PostgreSQL database + Auth + Real-time
- PostgreSQL Functions - Server-side business logic (streak calculation, validation)
Native Layer (Android):
- Kotlin - VPN service, tamper detection, network utilities
- VpnService API - DNS-based content filtering
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Flutter App β
β βββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β Dashboard β Islamic Corner β Relapse Flow β β
β βββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β β
β ββββββββββββββββββββββββΌβββββββββββββββββββββββββββ β
β β DashboardRepository (Dart) β β
β β β’ VPN Enforcement β β
β β β’ Security Logging β β
β ββββββββββββββββββββββββ¬βββββββββββββββββββββββββββ β
βββββββββββββββββββββββββββΌβββββββββββββββββββββββββββββββ
β
ββββββββββββββββββΌβββββββββββββββββ
βΌ βΌ βΌ
ββββββββββββββββββ ββββββββββββββββ βββββββββββββββββββ
β Native (VPN) β β Supabase β β Native β
β β’ BlockerVPN β β β’ RLS β β β’ TamperCheck β
β β’ NetworkUtil β β β’ RPCs β β β’ Root Detect β
ββββββββββββββββββ β β’ Rate Limitβ βββββββββββββββββββ
ββββββββββββββββ
- Flutter SDK 3.x
- Android Studio / VS Code
- Android device (API 21+)
- Supabase account
- Clone repository:
git clone https://github.com/yourusername/prevention.git
cd prevention- Install dependencies:
flutter pub get-
Configure Supabase:
- Create project at supabase.com
- Apply SQL migrations (in order):
1. complete_security_migration.sql 2. security_logging.sql 3. rate_limiting.sql 4. input_validation.sql - Update
lib/core/config.dartwith your Supabase URL and anon key
-
Run app:
flutter run# Clean build
flutter clean
flutter pub get
# Release APK
flutter build apk --release
# Output: build/app/outputs/flutter-apk/app-release.apk- Google Play Internal Testing (Recommended)
- Firebase App Distribution
- Direct APK sharing
See deployment_guide.md for detailed instructions.
| Feature | Status | Description |
|---|---|---|
| RLS Policies | β | All tables secured with auth.uid() scoping |
| VPN Enforcement | β | Blocks external VPNs during check-ins |
| Rate Limiting | β | 5 check-ins/hour, 3 syncs/30min |
| Input Validation | β | Mood enums, length checks, field validation |
| Offline Integrity | β | Device fingerprinting + timestamp validation |
| Anti-Tampering | β | Emulator, root, debug detection |
| Security Logging | β | Immutable audit trail in security_events |
| Server-side Logic | β | All streak calculations in PostgreSQL |
Prevents:
- β Client-side streak manipulation
- β Offline data tampering
- β VPN bypassing of blocker
- β Rate limit abuse
- β Emulator/rooted device usage
- β Future-dated check-ins
prevention/
βββ android/
β βββ app/src/main/kotlin/
β βββ com/prevention/prevention/
β βββ BlockerVpnService.kt # VPN implementation
β βββ TamperDetector.kt # Security checks
β βββ NetworkUtils.kt # VPN detection
β βββ MainActivity.kt # Platform channels
βββ lib/
β βββ core/ # Config, themes, utils
β βββ features/
β β βββ auth/ # Login, signup
β β βββ dashboard/ # Main screen, check-ins
β β βββ blocking/ # VPN control
β β βββ islamic_corner/ # Motivational content
β βββ main.dart
βββ supabase/migrations/ # SQL files
# Run unit tests
flutter test
# Run on device
flutter runSee testing_instructions.md for 1-week testing protocol.
- Deployment Guide - Production deployment steps
- Testing Instructions - Beta testing protocol
- Session Security - Supabase auth configuration
- Conflict Resolution - Offline sync policy
- Security Walkthrough - Complete security implementation
Contributions welcome! Please:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit changes (
git commit -m 'Add amazing feature') - Push to branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Follow Flutter style guide
- Add tests for new features
- Update documentation
- Ensure security best practices
This project is licensed under the MIT License - see LICENSE file.
- Cloudflare Family DNS for content filtering
- Supabase for backend infrastructure
- Flutter community for amazing packages
- Issues: GitHub Issues
- Email: support@prevention.app
- Discord: Community Server
Built with β€οΈ to help the Muslim community stay pure in the digital age