HabitLock is a next-generation Android application designed to eliminate digital distractions and enforce disciplined usage habits. Unlike traditional screen-time apps, HabitLock uses behavioral enforcement + real-world friction, ensuring users must earn access to distracting apps through meaningful effort.
You can download the latest version of HabitLock from the GitHub Releases page (~8MB).
To ensure HabitLock works correctly, follow these steps after installation:
- Open HabitLock on your Android device.
- Click the Setup button on the dashboard/home screen.
- IMPORTANT: Enable Accessibility Permission first. After clicking Setup, navigate to Installed Apps, then click on HabitLock and turn the switch ON. This is the core permission that allows HabitLock to monitor usage and block distracting apps.
- Follow the prompts to enable other required permissions:
- System Overlay: To show warning screens and blocking overlays.
- Usage Stats: To track time spent on different apps.
- Battery Optimization: (Recommended) Disable optimization for HabitLock to ensure it runs reliably in the background.
- 100% On-Device Processing: All monitoring and analysis happen locally.
- No Data Sharing: Your usage data never leaves your device.
- No Cloud Dependency: Works perfectly offline without tracking.
- Real-time app usage tracking: Stay informed about where your time goes.
- Scroll Analytics: Specifically tracks Instagram, TikTok, and YouTube Shorts.
- Reels Count Overlay: Displays a real-time counter of reels/shorts consumed while scrolling.
- Detailed Usage Stats: Track daily app usage with precision.
- Content Counters: Count exactly how many TikToks/Reels you've consumed.
- Pattern Identification: Identify addictive usage patterns.
- App Blocking: Hard system-level blocking using accessibility overlays.
- Focus Mode: Completely block selected apps during study or work sessions.
- Cheat Hours: Scheduled relaxation windows to prevent burnout.
- Explicit Content Filter: Keyword-based detection and URL pattern scanning.
- Keyword Blocking: Real-time custom keyword blocking across all apps.
- Smart Redirection: Redirects from distractions to productive articles or learning resources.
- Shorts/Reels Blocking: Detects and interrupts infinite scrolling feeds.
- Comment Blocking: Hides distracting comment sections.
- 🎨 Grayscale Mode: Anti-dopamine UI that turns selected apps black & white.
- ⏱️ Real-Time Usage Overlay: Displays time spent directly on the screen.
- 🛡️ Anti-Uninstall Protection: Prevents impulsive removal of the app.
⚠️ Custom Warning Screen: Fully customizable messages and motivation.- 🌍 Geo-Blocking: Location-based app restrictions (e.g., Library, Workplace).
To unlock blocked apps, users must prove their commitment by completing tasks:
- 🚶 Step Challenge: Sensor-verified walking.
- 🧮 Math Problems: Solve equations to engage your brain.
- 📖 Reading Task: Read articles before you consume.
- ⏳ Wait Timers: Practice patience.
- ✍️ Typing Challenge: Type complex sentences to overcome laziness.
- Home screen widgets: Quick access to your progress.
- Usage summaries: Clear visualization of your digital habits.
- Quick toggles: Easily enable/disable focus mode when needed.
HabitLock introduces the concept of "Productive Friction" — forcing real-world or cognitive effort before allowing digital consumption. This short-circuits the dopamine loop of impulsive app usage by introducing a deliberate pause that requires active participation.
- Language: Kotlin
- Platform: Android (Min SDK: 24 / Android 7.0)
- Core APIs:
AccessibilityService(for blocking and behavior detection)UsageStatsManager(for tracking)SensorManager(for task verification)Location Services(for Geo-blocking)System Alert Window(for overlays)
- Android 7.0 (Nougat) or above.
- Physical device recommended (for sensors and overlay stability).
- Accessibility and Overlay permissions enabled.
- Clone the repository:
git clone https://github.com/your-username/HabitLock.git
- Navigate to the project directory:
cd HabitLock - Build the project:
./gradlew build
- Install on device:
./gradlew installDebug
The HabitLock backend is managed using uv for fast and reliable dependency management.
- Ensure you have uv installed.
- Run the backend:
uv run main.py
- Monitor: The app monitors usage and behavior in real-time.
- Detect: It identifies triggers like infinite scrolling or blocked keywords.
- Trigger: A blocking overlay is immediately deployed.
- Enforce: Users are presented with a task (math, steps, etc.).
- Verify: Access is only restored once the task is successfully completed.
| Feature | Traditional Apps | HabitLock |
|---|---|---|
| Passive Tracking | ✅ | ✅ |
| Hard Blocking | ❌ | ✅ |
| Physical Task Unlock | ❌ | ✅ |
| Scroll Behavior Analysis | ❌ | ✅ |
| Keyword Redirection | ❌ | ✅ |
| Anti-Uninstall | ❌ | ✅ |
| Geo-Based Control | ❌ | ✅ |
- 🤖 AI-based addiction prediction
- 😊 Emotion-aware blocking
- ⌚ Smartwatch integration
- 🤝 Social accountability system
- 🎮 Gamification (XP, streaks, leaderboard)
- Prashant Dhuri
- Ritesh Gharat
- Prem Chaurasiya
- Sarthak Darge
If you find this project helpful, please give it a ⭐ on GitHub! It helps more people discover the tool.
Made with ❤️ for a better digital life






