Skip to content

Focus Lock: An Android app that locks your screen for a set time, helping you stay focused on what matters most

License

Notifications You must be signed in to change notification settings

HumbleBee14/ZenLock

Repository files navigation

ZenLock Logo

ZenLock

License: MIT Android Min SDK Target SDK Google Play Downloads

ZenLock is a productivity Android application designed to help you maintain focus by blocking distracting applications during dedicated focus sessions. With an innovative SMS-based accountability system, ZenLock ensures you stay committed to your goals by requiring an accountability partner's verification for early session termination.

Status: Production Approved, Closed Alpha testing complete, Under final review for public release

Why ZenLock?

Most productivity apps on the market lock essential features behind premium paywalls, yet still lack the critical functionality users actually need. ZenLock was built to solve this problem by offering a comprehensive, completely free solution with all features available to everyone.

Unlike other apps that charge for basic features like app blocking or focus timers, ZenLock includes advanced capabilities such as:

  • SMS-based accountability system with OTP verification
  • Comprehensive usage analytics and focus tracking
  • Scheduled recurring focus sessions
  • Customizable app whitelisting, no more paying for whitelisting! :)

This project is open source to ensure transparency, encourage community contributions, and keep focus tools accessible to everyone who needs them.

Features

Core Functionality

  • Timed Focus Sessions: Set custom focus durations with hour and minute precision
  • App Blocking: Automatically blocks selected applications during focus sessions using Android Accessibility Service
  • Accountability System: SMS-based OTP verification system requiring an accountability partner to unlock early
  • App Whitelist Management: Configure which applications remain accessible during focus sessions
  • Scheduled Sessions: Create recurring focus schedules with customizable timing
  • Usage Statistics: Track your focus patterns and productivity metrics

Technical Highlights

  • Long-press activation (3-second hold) to prevent accidental session starts
  • Robust permission management system
  • Support for Android 9 (API 28) to latest Android 16 and above

Installation

Download

Get it on Google Play Get it on Google Play

UPDATE[2026-01-19]: App is now launched and available on Google Play! Please rate and review the app to help us improve and continue providing free, open-source productivity tools to the community.

Prerequisites

  • Android device running Android 9.0 (Pie) or higher
  • Java Development Kit (JDK) 17 or higher
  • Android Studio (latest stable version recommended)
  • Gradle 8.0+

Building from Source

  1. Clone the repository

    git clone https://github.com/HumbleBee14/ZenLock.git
    cd ZenLock
  2. Open in Android Studio

    • Launch Android Studio
    • Select "Open an Existing Project"
    • Navigate to the cloned repository directory
  3. Build the project

    # Debug build
    ./gradlew assembleDebug
    
    # Release build (requires signing configuration)
    ./gradlew assembleRelease
  4. Install on device

    # Via ADB
    adb install app/build/outputs/apk/debug/app-debug.apk

Usage

First Launch Setup

  1. Grant Required Permissions:

    • Accessibility Service (for app blocking)
    • SMS permissions (for accountability partner notifications)
    • Notification permissions
    • Usage statistics access
  2. Configure Accountability Partner:

    • Navigate to Partner Contact settings
    • Add your accountability partner's phone number
    • Verify SMS delivery
  3. Set Up App Whitelist:

    • Select apps that should remain accessible during focus sessions
    • Essential apps (Phone, Messages, Clock) are recommended

Starting a Focus Session

  1. Set your desired focus duration using the timer interface
  2. Long-press the "ENTER ZEN MODE" button for 3 seconds
  3. Selected apps will be blocked until the timer expires

Early Unlock Process

  1. Attempt to exit the session early
  2. Your accountability partner receives an SMS with a verification code
  3. Enter the received code to unlock the session
  4. Session statistics are saved

Project Structure

app/src/main/
├── java/com/grepguru/zenlock/
│   ├── MainActivity.java                    # Main entry point
│   ├── LockScreenActivity.java             # Lock screen overlay
│   ├── AppBlockerService.java              # Accessibility service
│   ├── PartnerContactActivity.java         # Partner management
│   ├── WhitelistActivity.java              # Whitelist configuration
│   ├── PermissionsOnboardingActivity.java  # Permission flow
│   ├── fragments/
│   │   ├── HomeFragment.java               # Timer setup UI
│   │   └── SettingsFragment.java           # App settings
│   └── utils/
│       ├── OTPManager.java                 # SMS/OTP handling
│       ├── ScheduleManager.java            # Session scheduling
│       ├── ScheduleActivator.java          # AlarmManager integration
│       └── EnhancedUnlockManager.java      # Unlock flow logic
└── res/                                     # Resources (layouts, drawables, etc.)

Contributing

We welcome contributions from the community! Please see our CONTRIBUTING.md file for detailed guidelines on:

  • Code style and conventions
  • Submitting pull requests
  • Reporting issues
  • Development workflow
  • Testing requirements

Quick Start for Contributors

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/your-feature-name
  3. Make your changes and commit: git commit -am 'Add new feature'
  4. Push to your fork: git push origin feature/your-feature-name
  5. Submit a pull request

Technology Stack

  • Language: Java
  • Minimum SDK: 28 (Android 9.0 Pie)
  • Target SDK: 35 (Android 15)
  • Build System: Gradle with Kotlin DSL
  • Key Libraries:
    • AndroidX AppCompat
    • Material Design Components
    • Navigation Component
    • MPAndroidChart (usage statistics)

Security

ZenLock implements several security measures:

  • ProGuard code obfuscation in release builds
  • Secure logging (no sensitive data in production logs/or anything sent remote, no telemetry either)
  • SMS verification system with OTP generation
  • Permission-based access control

For security concerns or vulnerability reports, please open a private security advisory or contact the maintainers directly.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Support


Built with focus and dedication. Lock your Zen, Lock your focus.

About

Focus Lock: An Android app that locks your screen for a set time, helping you stay focused on what matters most

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

Packages

No packages published

Languages