Reclaim your attention. Block Instagram Reels, YouTube Shorts, TikTok, and Snapchat Spotlight โ entirely on your phone.
MindGuard is a privacy-first Android app that detects and blocks short-form video feeds before you get sucked in. No accounts. No tracking. No servers. Just you, your focus, and 500ms of protection.
You pick up your phone for one thing. Instagram for 5 minutes. YouTube to find a tutorial. TikTok just to check. Snapchat for your streak.
Three hours later, you're still scrolling. You lost the afternoon. Again.
MindGuard stops this. Instantly.
When you open Instagram and navigate to Reels, MindGuard detects the exact moment the short-video player loads and hits back before you can get hooked. Same with YouTube Shorts, TikTok, and Snapchat Spotlight.
All of this happens:
- On your phone โ no internet needed
- In 500ms โ faster than you can react
- With zero data collection โ your choices stay yours
See if blocking is active and track your progress in real-time.
- Active Shield โ blocks are running, Reels & Shorts can't get you
- Reels Blocked โ how many times the app saved you today
- Time Saved โ estimated hours you didn't lose
- Attempts โ how many times you wanted a short-form feed
- Deflected โ your success rate (blocks / attempts)
- Streak โ current clean days + your personal best
Decide which apps to block and when.
Per-App Toggles
- Instagram Reels
- YouTube Shorts
- TikTok
- Snapchat Spotlight
Focus Schedule
- Auto-block during work hours (or custom times)
- Pause manually anytime
- 30-second pause button in notification shade
Streak Tracking
- See your current streak and personal best
- Built-in motivation to keep the streak alive
- Allow Restricted Settings (one-time, Android 13+ only)
- Enable MindGuard Accessibility Service
That's it. Blocking starts immediately.
MindGuard uses Android's Accessibility API to read screen layout in real-time. It watches for specific resource IDs that indicate the short-video player is on screen, then instantly navigates away.
User opens Instagram Reels
โ
AccessibilityService detects 'reel_pager' resource ID
โ
RuleEngine evaluates: "Is this a Reels player?"
โ
Decision: YES โ Block
โ
BlockActionExecutor clicks Home tab (stay in Instagram)
โ
User sees Home feed instead of Reels
โ
MindGuard logs: +1 block, +1 attempt
MindGuard doesn't read text or analyze navigation buttons. It uses resource IDs only โ internal view IDs that identify the exact component.
This means:
- Opening Instagram doesn't trigger a block (just the app icon shows, no Reels player)
- Opening YouTube doesn't trigger a block (Shorts nav tab visible, but player not loaded)
- Only the confirmed player-specific layout triggers a block
Each app's short-form player has its own set of signature resource IDs:
| App | Blocked Player IDs |
|---|---|
clips_viewer_view_pager, reel_pager, reel_play_button, reels_viewer |
|
| YouTube | reel_watch_fragment_root, reel_progress_bar, shorts_container |
| TikTok | TikTok video-feed container IDs |
| Snapchat | spotlight_container |
Instagram's home feed, Explore, and Messaging are never blocked โ the service has an explicit guard that short-circuits detection for feed screens.
mindguard/
โโโ shared/ โ Pure Kotlin (no Android deps)
โ โโโ commonTest/
โ โโโ rules/ RuleEngine, InstagramReelRule, YouTubeShortsRule, ...
โ โโโ models/ ScreenSnapshot, DetectionResult, BlockAction
โ โโโ usecases/ FocusPauseLogic, BlockCooldown, DetectBlockedContentUseCase
โ
โโโ androidApp/ โ Android layer
โโโ accessibility/ MindGuardAccessibilityService, BlockActionExecutor
โโโ storage/ SettingsDataStore (DataStore Preferences)
โโโ ui/ Compose screens: Home, Settings, Stats, Onboarding
โโโ di/ Koin dependency injection
The shared module is 100% testable on the JVM โ zero Android dependencies. All detection logic, rules, and decision-making run as unit tests before any Android code touches them.
Download the APK from the latest release and install it.
git clone https://github.com/Ashish-CodeJourney/MindGuard.git
cd MindGuard
./gradlew :androidApp:assembleDebug
# APK at: androidApp/build/outputs/apk/debug/app-debug.apkAfter installing a sideloaded APK:
- Go to Settings โ Apps โ MindGuard
- Tap โฎ โ Allow restricted settings
- Go to Settings โ Accessibility โ MindGuard โ enable
Long-press your notification shade โ Edit tiles โ drag Focus Mode into active tiles. Now you can pause blocking with one tap.
- โ On-device only โ all detection runs locally
- โ No accounts โ nothing to sign up for
- โ No tracking โ no analytics, no user profiling
- โ No internet โ zero network requests
- โ Accessibility scope limited โ service can only read from 4 apps (Instagram, YouTube, TikTok, Snapchat)
- โ Explicit consent โ you enable it manually in system settings
Read the full accessibility declaration.
./gradlew :shared:testDebugUnitTestAll business logic is test-first (TDD). Tests live in shared/src/commonTest/ and run on the JVM.
- Language โ Kotlin Multiplatform (shared logic + Android UI)
- UI โ Jetpack Compose + Material 3
- Async โ Coroutines + Flow
- Storage โ DataStore Preferences
- DI โ Koin
- Testing โ Kotlin Test
- Create a new
BlockingRulein the shared module:
class BeRealRule : BlockingRule {
override fun evaluate(snapshot: ScreenSnapshot): DetectionResult {
if (snapshot.packageName != "com.bereal.app") return noBlock()
return if (snapshot.resourceIds.any { it.contains("camera_view") })
DetectionResult(shouldBlock = true, action = BlockAction.GO_BACK, reason = "BeReal camera detected")
else noBlock()
}
}- Register in
MindGuardAccessibilityService:
RuleEngine(listOf(
InstagramReelRule(), YouTubeShortsRule(), TikTokRule(),
SnapchatSpotlightRule(), BeRealRule() // add here
))- Add the package name to:
androidApp/src/main/res/xml/accessibility_config.xml(service scope)SettingsDataStore(user toggles)
- Android 7.0+ (API 24+)
- Accessibility Service permission (granted in system settings)
MIT โ see LICENSE
- ๐ฌ GitHub Discussions
- ๐ Found a bug? Issues
- ๐ค Want to contribute? PRs welcome!


