Antarāl (derived from the original open-source app Reef) is an Android app designed for digital wellbeing, focusing entirely on mindful app consumption. The app employs accessibility services to intercept distracting apps and websites, prompting users with a "Mindful Launch" delay to rethink their immediate digital choices.
The app was recently heavily refined to remove redundant features (like Pomodoro timers and Focus Modes) and instead incorporates a lightweight overlay functionality (ported from UsagePeek) that displays real-time daily usage on selected apps.
- Language: Kotlin
- UI Toolkit: Jetpack Compose (Material 3/Material You design system)
- Architecture: MVVM (Model-View-ViewModel) + Single Activity Architecture (mostly)
- Build System: Gradle (Kotlin DSL -
build.gradle.kts) - Min SDK: 26 (Android 8.0)
- Target SDK: 37
- Key Libraries: Navigation Compose, WorkManager, Jetpack DataStore/SharedPreferences (with device-protected storage), Vico (for charts).
The repository is a multi-module Android project structured as follows:
:Antaraal(Main App Module) - Contains all core features, UI, services, and logic.:appintro- A smaller module handling the onboarding/intro flow.
.accessibility: Core background intersection logic (BlockerService,RoutinesService,UsageTracker)..data: Data models and repositories (Routine)..intro: Onboarding screens and logic..navigation: Type-safe navigation definitions (Screen.kt)..receivers: Broadcast receivers for Boot and Alarms (BootReceiver,RoutineAlarmReceiver,DailySummaryScheduler)..routine: Logic for managing scheduling and storing routines..screens: Jetpack Compose UI Screens (e.g.,MainScreen,SettingsScreen)..services: Supplementary services for app lifecycle..ui: Theming (Typography, Colors, Icons) defining the Antarāl Material-You aesthetic..util: Helpers for Permissions, Notifications, Usage Calculation, and Preferences.
- How it Works: When a user opens an app on their Blacklist,
BlockerServicedetects the window state change. - Overlay: A transparent, non-intrusive timer is overlaid on the screen showing exactly how much time the user has spent on that specific app today.
- Mindful Launch Entry: If Mindful Launch is globally toggled ON via the main screen, the user is redirected to
MindfulLaunchActivity.- Phase 1 (Countdown): A non-skippable countdown timer.
- Phase 2 (Duration Picker): The user selects how long they intend to use the app (e.g., 5, 10, 15 mins).
- Phase 3 (Unlock): The target package is temporarily unlocked for the selected duration.
- How it Works: Tracks daily usage via Android's
UsageStatsManager. - Enforcement:
BlockerServiceperiodically pollsUsageTracker. If the daily limit is breached, the user is blocked with a "Limit Reached" overlay.
- How it Works: Rather than using a VPN, the app uses Accessibility APIs to read the URL bar of supported browsers (Chrome, Brave, Firefox, Opera).
- Redirection: If a blacklisted domain (or limited domain with expired time) is detected in the
url_baroromnibox_suggestions_dropdownNode Info,BlockerServicephysically mimics clicks to redirect the browser toabout:blank.
- How it Works: Blocks specific apps/websites during specific times of the day (e.g., "Bedtime" from 10 PM to 7 AM).
- Triggering: Uses
AlarmManageralongsideRoutineAlarmReceiverto start/stop enforcement gracefully.
The app employs a simplified single-activity architecture nested under MainActivity's Compose NavHost. The bottom navigation bar has been removed to emphasize minimalism.
HomeContent(MainScreen.kt): The dashboard. Features a large, central tap-and-hold button to toggle the global Mindful Launch state. The top app bar houses two action buttons: Settings, and App Usage (which redirects to the phone's native Digital Wellbeing / Battery usage screen). The screen directly shows the list of Blacklisted/Whitelisted apps for mindful launch.SettingsContent(SettingsScreen.kt): Houses nested settings for Routines, Website Blocking, Mindful Launch configs, and About sections.RoutinesScreen&CreateRoutineScreen: Interfaces for building time-boxed restriction profiles (accessed via Settings).WhitelistScreen/BlacklistScreen: Allows selecting which apps are monitored for overlays and mindful launch intercepts.
MindfulLaunchActivity: Excluded from recents (excludeFromRecents="true"). An intercept screen ensuring the user pauses before engaging with a restricted app.PermissionsCheckActivity: Guided flow ensuring the app receivesPACKAGE_USAGE_STATS,SYSTEM_ALERT_WINDOW,POST_NOTIFICATIONS, andBIND_ACCESSIBILITY_SERVICE.DebugActivity: A crash-recovery screen spawned by a custom globalUncaughtExceptionHandlerinApp.kt.
This is the heartbeat of the application.
- Configuration: Bound via
<meta-data android:resource="@xml/blocker_configuration" />. - Event Handling: Listens to
TYPE_WINDOW_STATE_CHANGEDandTYPE_WINDOW_CONTENT_CHANGED. - Tasks: Injects the UsagePeek overlay onto tracked apps, intercepts app launches for Mindful Launch, polls routine evaluations, and reads URL bars for website blocking.
- WorkManager: Used lightly for
DailySummaryWorkerand a background safety net (AntaraalWorkerevery 15 minutes) to ensure the accessibility service is alive. - AlarmManager: Used for exact routine scheduling (
RoutineAlarmReceiver) since WorkManager is too inexact for to-the-minute blocking schedules.
- Device Protected Storage: Preferences are initialized using
createDeviceProtectedStorageContext()inApp.ktso the accessibility service can operate even before the device is unlocked after a reboot (Direct Boot Aware). - Datastore/Prefs: Heavily relies on SharedPreferences (
prefs.edit { ... }) for storing lists of tracked apps, limits, and configurations.
To function as an absolute blocking mechanism, Antarāl requests aggressive permissions:
- Usage Access (
PACKAGE_USAGE_STATS): To calculate screen time accurately. - Accessibility (
BIND_ACCESSIBILITY_SERVICE): For window injection, URL scraping, and applying the UsagePeek overlays. - Appear on Top (
SYSTEM_ALERT_WINDOW): Necessary to display the UsagePeek screen time overlays over other apps. - Foreground Service & Alarms:
FOREGROUND_SERVICE_SPECIAL_USEandUSE_EXACT_ALARM.
graph TD
subgraph UI_Layer["UI Layer (Jetpack Compose)"]
MainActivity["MainActivity (NavHost)"]
MainScreen["MainScreen (Home)"]
SettingsScreen["SettingsScreen"]
MindfulLaunchAct["MindfulLaunchActivity"]
Overlay["UsagePeek Overlay (System Alert)"]
end
subgraph Background_Layer["Background Services"]
BlockerService["BlockerService (Accessibility)"]
RoutineReceiver["RoutineAlarmReceiver"]
AntaraalWorker["AntaraalWorker (Safety Net)"]
end
subgraph Data_Layer["Data & OS Integration"]
SharedPrefs["Device Protected SharedPreferences"]
UsageStats["OS: UsageStatsManager"]
AlarmMgr["OS: AlarmManager"]
PackageManager["OS: PackageManager"]
end
%% UI Connections
MainActivity --> MainScreen
MainActivity --> SettingsScreen
MainScreen -- "Toggles State" --> SharedPrefs
SettingsScreen -- "Configures Routines" --> SharedPrefs
%% Background Logic
BlockerService -- "Reads Config" --> SharedPrefs
BlockerService -- "Checks Time Spent" --> UsageStats
BlockerService -- "Injects Overlay" --> Overlay
BlockerService -- "Intercepts App" --> MindfulLaunchAct
%% Routines
SettingsScreen -- "Schedules" --> AlarmMgr
AlarmMgr --> RoutineReceiver
RoutineReceiver -- "Enables/Disables Blocking" --> SharedPrefs
%% Safety
AntaraalWorker -. "Ensures Running" .-> BlockerService
| Feature / Aspect | Original State (Reef pre-refine) | Current State (Refined Antarāl) |
|---|---|---|
| Primary Goal | Comprehensive Digital Wellbeing suite (Timers, Limits, Routines). | Dedicated Mindful Launch & Live Screen-Time Overlay tool. |
| Focus Mode / Pomodoro | Supported Pomodoro, Count-up, and Strict Focus Modes. | Removed entirely. No Focus/Pomodoro logic exists. |
| App Usage Tracking UI | Dedicated in-app UsageScreen with charts & detailed stats. |
Removed. Now links directly to the OS's native Digital Wellbeing/Battery settings. |
| Navigation | 4-tab Bottom Navigation Bar (Home, Stats, Focus, Settings). | Removed. Clean single-page interface with Top Bar actions. |
| Main Screen Button | Triggered Focus Mode ("DIVE IN"). | Tap-and-hold toggles Global Mindful Launch state ON/OFF. |
| List Management | Separate Whitelist for bypassing Focus, and Blacklist for Limits. | Unified Blacklist for both Mindful Launch interception and UsagePeek overlays. |
| UsagePeek Integration | Not present. | Integrated. A non-intrusive live timer overlay appears over selected apps to show daily usage. |
| Foreground Services | FocusModeService ran constantly for timers. |
Removed. Relying solely on BlockerService (Accessibility) for interceptions and overlays. |
| Settings Placement | Accessible via bottom nav. Routines were partially on Home. | Settings accessed via Top Bar icon. Routines and Website Blocking moved fully inside Settings. |