System Documentation
The Focus Shield
The Focus Shield
Engine.
Official technical architecture and release notes for Unbreakfocus — built by a 15-year-old student, for students. The blocking engine now runs natively on Android, independent of the app itself.
v1.2.0 — Stable Release
What's New in v1.2.0
The biggest architectural update Unbreakfocus has ever shipped — the entire blocking engine has been rebuilt to run natively on Android, independent of the app itself. Your focus is no longer just enforced by the app in front of you; it's enforced by the system, in the background, at all times.
🛡️ The Focus Shield Engine
- True background blocking: Distracting apps are intercepted the instant Shield Mode is active, even if Unbreakfocus itself isn't open.
- Website-level blocking: The Shield now recognizes distracting domains inside Chrome, Firefox, Edge, Samsung Internet, Opera, DuckDuckGo, and Brave.
- YouTube Shorts lockdown: Shorts are detected and shut down both in the native app and on the web, with an automatic kick back to your home screen.
- Full-screen Shield overlay: Breaching the Shield surfaces a dedicated lockout screen with a personalized message and one of 27 rotating motivational quotes.
⏱️ Persistent Native Timer
- Survives app kills: Rebuilt as a true native foreground service, the countdown keeps running through Doze mode, background restrictions, and even a killed app process.
- Custom notification controls: Pause, resume, or stop your session from the collapsed or expanded notification without opening the app.
- Strict Mode lock: Stop/pause controls are hidden entirely from the notification when Strict Mode is engaged — no shortcuts out.
- Auto Do Not Disturb: DND engages automatically for the session, with calls and alarms still allowed through.
- Tripwire recovery: Swiping the notification away no longer kills your session — it instantly respawns to keep your Shield intact.
🧮 Smarter Progression System
- Exponential leveling: XP thresholds now double with every level, giving early progress a satisfying pace while keeping higher levels meaningful.
- Remote-configured streak goals: Daily streak targets for missions like Class 10th ICSE/CBSE are pulled from the cloud, so goals can be fine-tuned without an app update.
- Leaner cloud sync: Data synced to your account has been trimmed to essentials only, making sync faster and lighter on data.
💥 Reliability & Stability
- Crash reporting wired in: Both UI crashes and background/async errors are now automatically captured to help squash bugs faster.
- The Midnight Reaper: A silent background task evaluates your streak at 12:01 AM sharp, applying any penalties even if the app is completely closed.
- Dynamic timezone detection: Your device's timezone is detected automatically, with a fix for legacy timezone naming issues.
- Smoother transitions: Screen navigation now uses a soft fade instead of the default Android slide.
🎨 Visual Refresh
- New "Deep Focus" palette: A calmer sky-blue and indigo accent scheme replaces the previous look.
- Dual-font typography: Headers and body text now use a distinct sci-fi/utility font pairing for a sharper visual hierarchy.
- New Shield visuals: Fresh glow and ring graphics for the timer and Shield states.
🛡️ The Focus Shield Engine & App Blocker
- Native, Event-Driven Architecture: The blocking engine has moved out of Flutter into a dedicated native Android engine, giving it persistence and reach the old polling-based version couldn't match.
- Website & Domain-Level Blocking: Recognizes distracting domains inside Chrome, Firefox, Edge, Samsung Internet, Opera, DuckDuckGo, and Brave.
- Strict Mode: A high-stakes mode — once engaged, emergency abort costs 25% total XP and instantly resets your Streak to 0, with notification controls hidden entirely.
- Overtime Sequence: Keep the timer running past your daily goal to grind bonus XP at a 1.5× accelerated multiplier.
⏱️ Persistent Native Timer
- True Foreground Service: Decoupled from the Flutter engine's lifecycle, the countdown survives app kills, Doze mode, and background restrictions.
- Auto Do Not Disturb: DND engages automatically for the duration of a session, with calls and alarms still allowed through.
- Tripwire Recovery: Swiping the notification away instantly respawns the session instead of killing it.
- Live Native Chronometer: Ticking timer pinned accurately to your notification tray without flooding the system with updates.
🎮 Gamification & Progression Economy
- Exponential Leveling System: True RPG-style curve. Base XP starts at 50 and exponentially doubles every level.
- Dynamic XP Multipliers: Flow State sessions (1hr+, 2hr+) yield higher rates. Daily streaks grant up to +50% permanent bonus.
- Remote-Configured Streak Goals: Daily streak targets for missions like Class 10th ICSE/CBSE are pulled from the cloud, tunable without an app update.
- The Store & Vault: Purchase utilities like the Streak Freeze (1500 XP) to protect your daily streak. Real consequences, real rewards.
⚙️ Technical Architecture
- Real-Time Firebase Sync: Profiles, wallets, and inventory sync to the cloud in real-time, now trimmed to essentials only for a faster, leaner sync.
- Offline-First Architecture: Network down? App generates secure
_OFFLINE_tags that merge with the cloud once restored. - Instant Wake-Up Listeners: The background isolate communicates via dedicated streams, ensuring the UI updates the exact millisecond a state changes.
- Automated Crash Reporting: UI crashes and background/async errors are automatically captured to help squash bugs faster.
- The Midnight Reaper: A silent background task evaluates your streak at 12:01 AM sharp, applying penalties even if the app is fully closed, with automatic timezone detection.
- OLED-Optimized: Pure Black (#000000) background saves battery on AMOLED displays and prevents visual smearing.