How ahitagni07/escape-digital-detox works
Escape is an offline AI-powered digital-detox app: users configure protected social apps, the app monitors their use, and real-world missions earn them time back. The Flutter interface covers setup, dashboard, AI setup, and escape controls; Android code supplies native monitoring, locking, mission verification, and local AI support. The tree and README identify these capabilities, but the sampled source contains only build files, so runtime relationships below are dashed and unverified rather than asserted as inspected calls.
Main entry points: MonitorService.kt Usage monitor · MissionCoordinator.kt Mission coordinator · escape_native_bridge.dart Native bridge · setup_screen.dart Setup
Components 23
Flutter experience
- Setup
lib/features/setup/setup_screen.dart - Dashboard
lib/features/dashboard/dashboard_screen.dart - Escape controls
lib/features/escape/escape_controller.dart - Native bridge
lib/core/native/escape_native_bridge.dart - AI setup
lib/features/ai/ai_setup_screen.dart - AI status
lib/features/ai/ai_model_status.dart - Installed apps
lib/core/models/installed_app.dart
Android enforcement
- Usage monitor
android/app/src/main/kotlin/com/example/escape/MonitorService.kt - App detection
android/app/src/main/kotlin/com/example/escape/ForegroundAppDetector.kt - Lock overlay
android/app/src/main/kotlin/com/example/escape/LockOverlayController.kt - Detox settings
android/app/src/main/kotlin/com/example/escape/EscapePreferences.kt - Usage stats
android/app/src/main/kotlin/com/example/escape/StatsManager.kt
Missions and proof
- Mission coordinator
android/app/src/main/kotlin/com/example/escape/MissionCoordinator.kt - Mission pool
android/app/src/main/kotlin/com/example/escape/MissionPoolManager.kt - Mission generation
lib/features/ai/mission_generator.dart - Photo proof
android/app/src/main/kotlin/com/example/escape/PhotoProofVerifier.kt - Step tracking
android/app/src/main/kotlin/com/example/escape/StepTracker.kt - Recovery progress
android/app/src/main/kotlin/com/example/escape/RecoveryProgressTracker.kt
Offline AI
- Gemma engine
android/app/src/main/kotlin/com/example/escape/GemmaEngineManager.kt - Model management
android/app/src/main/kotlin/com/example/escape/GemmaModelManager.kt - Model download
android/app/src/main/kotlin/com/example/escape/GemmaAutoDownloader.kt
Other components
- User
- Protected apps
Connections 24
- User → Setup: configures
- User → Dashboard: views status
- User → Escape controls: requests escape
- Setup → Native bridge: sends settings
- Dashboard → Native bridge: requests status
- Escape controls → Native bridge: requests unlock
- AI setup → Native bridge: configures AI
- Native bridge → Usage monitor: controls monitoring
- Usage monitor → App detection: checks foreground
- App detection → Protected apps: detects use
- Usage monitor → Lock overlay: enforces lock
- Setup → Installed apps: selects apps
- Usage monitor → Detox settings: reads settings
- Usage monitor → Mission coordinator: requests mission
- Mission coordinator → Mission pool: selects mission
- Mission coordinator → Mission generation: requests generation
- Mission generation → Gemma engine: generates locally
- Gemma engine → Model management: uses model
- AI setup → Model download: sets up model
- Mission coordinator → Photo proof: checks photo proof
- Mission coordinator → Step tracking: checks steps
- Mission coordinator → Recovery progress: tracks recovery
- Usage monitor → Usage stats: records usage
- Dashboard → Usage stats: shows statistics