VaultGuard is a premium, offline-first application locking and privacy suite for Android. Built with a modern, modular Clean Architecture and Jetpack Compose UI, VaultGuard allows users to protect apps behind multiple auth methods, setup geofenced safe zones, vault private notifications, capture intruder selfies, and even break addictive habits with a built-in Doomscroll Guard.
- โก Blazingly Fast Interception: Foreground applications are intercepted and overlayed in under 150ms using a highly optimized background
AccessibilityService. - ๐ง In-Memory Caching: Implements a reactive, thread-safe memory cache of settings, configurations, and rules, reducing active should-lock evaluation times to under 1ms (pure in-memory logic).
- โฑ๏ธ Dynamic Time-Sync PINs: Hardens security against shoulder surfing and screen recording by syncing your master PIN to the current system clock (e.g.
14:35->1435).- Time + Offset: Shift the PIN minutes forward/backward (e.g. time + 10 mins).
- Time Reversed: Reverse clock digits for offset syncing (e.g.
14:35->5341). - Clock Formats: Choose 12-hour or 24-hour clock formats (e.g., noon formats to
1200or0100). Acceptance fallback evaluates both to prevent lockouts.
- ๐ฌ Master PIN Recovery Options: Securely regain access if you forget your master PIN.
- Recovery Key: Standard offline backup key generated during setup.
- Recovery Email: Enter a pre-configured recovery email in the tabbed Forgot PIN prompt to reset your master credentials instantly.
- ๐ Smart Lock (Secure Zones): Automatically bypasses lock overlay screens when connected to a trusted Wi-Fi network or inside defined GPS coordinates. Requests permissions dynamically in a modern two-step runtime flow (Foreground -> Background location).
- โฑ๏ธ Flexible Lock Timeouts: Configure session lock rules (Immediate, 15 seconds, 1 minute, etc.). Smart re-evaluation on screen off and screen on ensures apps are securely re-locked when the timeout expires.
- ๐ญ Multi-Profile & Decoy Mode: Setup up to 5 profiles. Supports a silent "Duress PIN" that switches the system to a pre-defined decoy profile to hide sensitive settings.
- โ Advanced Self-Protection: Prevents users from disabling admin rights or uninstalling/force-stopping the app without entering the correct master PIN.
- ๐ Offline & Private: 100% offline with zero network permissions requested.
- ๐ Doomscroll Guard: Breaks addictive scrolling habits. Configure screen time limits for individual locked apps (e.g., 10 minutes for Instagram). Once reached, the app is locked, forcing a focus-restoring exercise to unlock:
- ๐จ Breathing Exercise: Guided deep breathing cycle with animated circle scaling.
- โ๏ธ Focus Typing: Type mindful affirmations or sentences to regain access.
- ๐งฎ Math Puzzle: Solve rapid mental arithmetic to bypass the lock screen.
- ๐ธ Silent Intruder Selfie: Captures a snapshot of the person attempting access using the front camera after a pre-configured number of failed authentication attempts, saving it locally in a secure image vault.
- ๐จ Curated Lock Screen Themes: Move away from boring black lock overlays. Choose from four premium visual effects:
- Ambient Shader: The default ultra-smooth, color-shifting ambient shader background.
- Glassmorphism: Sleek frosted dark glass with animated, floating blue and pink canvas-drawn orbs.
- Neon Glow: High-contrast rotating gradient pink-purple-cyan-orange glow.
- Meme Mode: Display sarcastic, humorous warning card memes to deter snoopers.
VaultGuard is structured into highly cohesive, decoupled modules conforming to Clean Architecture principles:
app/ โ Jetpack Compose UI Screens, ViewModels, and App Entry Point
auth/ โ Hashing, Lockout State Manager, and Verification Use Cases
locker/ โ AccessibilityService, Window Overlay UI, and Timeout Evaluation engine
profiles/ โ Profile models and storage configuration
data/ โ Room Database implementation, DataStore repository bindings
domain/ โ Use Case interfaces, domain repositories, and core Models
common/ โ Thread-safe cryptography tools, security constants, and results wrappers
To prevent unauthorized uninstallation, data clearing, or deactivation of VaultGuard, the app utilizes a custom Multi-Layered Protection System designed to counter platform-level bypasses:
- Active Settings Ejection (Layer 1):
- Android OS enforces a platform security policy (
mForceHideNonSystemOverlayWindow=true) on the Settings app to prevent tapjacking. This makes standard alert windows invisible on Settings screens. - To counter this,
AppLockServiceactively detects when an unauthorized user attempts to open Settings -> App Info or Device Admin screens for VaultGuard. - It immediately sends a global
GLOBAL_ACTION_BACKto eject the user from the Settings app, waits for a300mstransition delay, and then launches ourMainActivityPIN verification screen to cover the screen.
- Android OS enforces a platform security policy (
- Deactivation Request Warning (Layer 2):
- If the deactivation intent is requested,
VaultGuardAdminReceiver.onDisableRequestedintercepts the removal attempt and returns a custom warning message to the OS prompt: "Deactivating VaultGuard administrator requires PIN verification. Please verify your PIN in the app first."
- If the deactivation intent is requested,
- Re-activation Recovery (Layer 3):
- In case of unauthorized deactivation (bypassing callbacks),
VaultGuardAdminReceiver.onDisableddetects the state and immediately launches the system-level Device Admin activation screen (ACTION_ADD_DEVICE_ADMIN) to force re-activation.
- In case of unauthorized deactivation (bypassing callbacks),
Authorized admins can easily configure settings or uninstall the app by entering their PIN in the app. This opens a secure 15-second grace window during which all Settings actions and deactivation attempts are permitted.
- PIN Storage: Credentials are never written in plaintext. PINs are salted with a cryptographically secure 16-byte salt (
SecureRandom) and hashed usingArgon2id(falling back to OWASP-compliantPBKDF2-HMAC-SHA256where unavailable). - Biometrics: Integrates with hardware-backed Android Keystore signatures (
BiometricPromptClass 3 validation). - Database Security: Local profiles, configuration, and audit logs are encrypted.
- Android Studio Koala / Ladybug or newer.
- Android SDK 26 (Android 8.0) minimum, targeting SDK 35 (Android 15 / API 35).
- Clone the repository and open in Android Studio.
- Build the project debug APK:
./gradlew assembleDebug
- Run unit and integration tests:
./gradlew test - Deploy the debug build directly to an emulator or physical device.
To function reliably, VaultGuard requires the following critical Android permissions:
- Accessibility Service: Allows foreground package detection and active ejection.
- Display Over Other Apps (
SYSTEM_ALERT_WINDOW): Required to render the lock overlay in a secure window. - Device Admin: Active permission to prevent unauthorized uninstallation of VaultGuard.
- Biometric Authentication (
USE_BIOMETRIC): Required to query and authenticate via hardware biometric sensors. - Location Access (
ACCESS_FINE_LOCATION,ACCESS_COARSE_LOCATION): Required to scan for trusted Wi-Fi SSIDs and verify GPS geofences for Smart Lock. - Background Location (
ACCESS_BACKGROUND_LOCATION): Required to check safe zones when the app monitors foreground app switches in the background. - Wi-Fi State (
ACCESS_WIFI_STATE,CHANGE_WIFI_STATE): Required to read the connected network SSID for Trusted Wi-Fi lock bypass. - Notification Access (
BIND_NOTIFICATION_LISTENER_SERVICE): Required to intercept and vault notifications for locked applications. - Camera (
android.permission.CAMERA): Required to capture front photos of intruders on failed authentication attempts.