Package Manager Android is a native Kotlin-based App Locker application built using the latest Android development best practices. It allows users to securely lock selected applications on their device using a custom PIN, enhancing privacy and control over app access.
- 🧭 New Onboarding Flow – step-by-step setup with a clickable progress bar UI
- Step 1: Allow Accessibility Service Permission
- Step 2: Allow “Draw over other apps” Permission
- Step 3: Set Up App PIN
- Step 4: Configure Preferences
- Step 5: Setup Completed Screen (navigates to app)
- 📱 Installed Apps Listing – lists user and system apps using Launcher Intent & PackageManager
- 🔒 Lock Any App with a custom PIN
- 🧩 Custom Lock Screen (Composable PIN UI) or Floating ScreenOverlay
- 🕒 Auto Re-lock After 5 Minutes of inactivity or screen off
- 🧠 Smart Runtime Caching for better performance & responsiveness
- 🛡️ Accessibility Service Monitoring for real-time app launch detection
- 🎛️ Settings Panel – Switch between LockScreen or Overlay Prompt, manage app unlock behavior
- 🗄️ Persistent Storage with Room database for locked apps
- 🔄 Lifecycle-aware Inactivity Timer using coroutines and flows
This project is built using modern Android Jetpack libraries and a scalable MVVM Clean Architecture.
- Language: Kotlin
- UI Framework: Jetpack Compose (Material 3)
- Architecture: MVVM + Clean Architecture Principles
- State Management: Compose States +
StateFlow,SharedFlow - Dependency Injection: Dagger Hilt
- Local Storage: Room Database
- App Monitoring: Accessibility Service
- Coroutines: Inactivity timeout, lifecycle-aware flows
- Theming: Dark/Light mode support with dynamic logo
| Feature | Description |
|---|---|
| 🚀 Onboarding Flow | Guides user through permission setup, PIN creation, and preference settings |
| 📊 Step Progress Bar | Visually tracks onboarding steps; each step is clickable and interactive |
| 🔍 App List Screen | Displays all installed apps using Launcher Intent, supports system apps too |
| 🔐 Lock Screen | Asks for PIN using a composable UI; fallback to Overlay Dialog supported |
| ⚙️ Settings Screen | Configure lock behavior (e.g., use overlay or activity, re-lock options) |
| 🕵️♂️ Background Service | Monitors foreground app launch using Accessibility Service |
AppListScreen / LockScreen
↓
ViewModel (State & UI Logic)
↓
Repository (Data Coordination)
↓
Room DB & DataStore + AppMonitorService
| 🛡️ Onboarding (Allow Permission) | ✅ Onboarding (Setup Complete) | 📱 App List Screen |
|---|---|---|
![]() |
![]() |
![]() |
| 🔒 Lock App | ⚙️ Settings Screen | 🔐 Lock Screen |
|---|---|---|
![]() |
![]() |
![]() |
- Composable lifecycle and recomposition-aware state handling
- Clean dependency separation with Hilt modules
- Navigation with proper back-stack and screen transition handling
- Performance optimization using runtime memory cache
- Secure lock screen behavior using Android best practices
- App starts with an interactive Onboarding Flow using a step progress UI.
- Steps include:
- Allow Accessibility Permission
- Allow “Draw over other apps” Permission
- Set custom App PIN
- Choose Preferences
- Final screen confirms setup is complete and navigates to main app
- User selects apps to lock from the App List screen.
- Accessibility Service continuously monitors foreground app launch.
- If a locked app is launched:
- User is prompted with LockScreen or a floating Overlay PIN dialog.
- If validated, the app is unlocked for 5 minutes or until screen off.
- A background inactivity timer ensures re-locking behavior.
├── ui/ → Compose screens (Onboarding, AppList, LockScreen, Settings)
├── viewmodel/ → ViewModels with StateFlows
├── data/ → Repositories and Room database
├── di/ → Hilt modules for dependency injection
├── service/ → AccessibilityService to monitor apps
├── utils/ → Timer, cache, helpers
- Clone the repo:
git clone https://github.com/your-username/package-manager-android.git
- Open in Android Studio (Hedgehog or newer)
- Run on an Android device (API 29+)
- Enable Accessibility Permission for the app
- Set your custom PIN and start locking apps!
- QUERY_ALL_PACKAGES (Android 11+) – To list system apps
- Accessibility Service – To monitor app launches
- Foreground Service – For tracking app usage in background (optional)
- Draw Over Other Apps – Required for displaying floating ScreenOverlay (PIN prompt)
- KILL_BACKGROUND_PROCESSES – Used to force-stop apps when needed after failed unlock attempt
Munib Hamza
📱 Mobile App Consultant | Android Specialist
LinkedIn | Upwork | GitHub
This project is open-source under the MIT License.






