An educational project and system security designed to demonstrate how a "lock-screen" ransomware mechanism operates within the Android operating system, built using Flutter and native Kotlin.
- About the Project
- Key Features
- Technologies Used
- Architecture
- Installation & Testing
- Security Analysis & Limitations
- Legal & Ethical Warning
This application was developed as a Proof of Concept (PoC) to explore security vulnerabilities and interface control mechanisms on Android devices. The project leverages an official Android operating system feature—Lock Task Mode (Screen Pinning)—combined with a background service (BroadcastReceiver) to simulate the behavior of ransomware, making it difficult for an average user to force-close the application.
-
Kiosk / Lock Task Mode: Completely locks the screen and disables physical or system navigation buttons (Home, Recent Apps, Back) via a Method Channel that communicates with native Android code.
-
Persistent Autostart (
BOOT_COMPLETED): Utilizes aBroadcastReceiverwritten in Kotlin to automatically relaunch the application and lock the screen immediately after the device reboots. -
Countdown Timer: A real-time simulation of a deadline for a ransom payment.
-
Virtual Keyboard Fix: Addresses Android’s Direct Boot limitations by implementing a structured
FocusNode, ensuring the virtual keyboard can be invoked to enter the decryption password. -
Anti-Bypass (
PopScope): Prevents navigation gestures or the "back" button from exiting the application before the correct password has been entered.
- Framework: Flutter (Dart)
- Native Bridge: Method Channel (
com.simulasi.lockscreen/lock) - Native Language: Kotlin (Android API Level 21+)
- Android Components:
Activity(SingleTop, LockTaskMode)BroadcastReceiver(Boot Persistence)SystemUiMode(Immersive Sticky)
lib/
└── main.dart # UI Interface (Flutter), Timer, & Focus Controller
android/app/src/main/
├── AndroidManifest.xml # System Permissions, Receiver, & Lock Task Mode Configuration
└── kotlin/com/example/ransim/
├── MainActivity.kt # Method Channel bridge for starting/stopping Lock Task
└── BootReceiver.kt # Captures device reboot completion signals
git clone https://github.com/pangeran-droid/android-ransomware-simulation.git
cd android-ransomware-simulationflutter pub getflutter build apk --release
# or run directly via USB Debugging
flutter run --releaseOpen the application manually at least once after installation (required by Android’s sandbox security policy to enable the Broadcast Receiver).
Go to Phone Settings -> Apps -> Manage Apps -> [Your App Name], then enable the "Autostart" (or "Background Running") permission to ensure the reboot simulation functions correctly.
Decryption Key Storage: In this simulation version, the decryption password (hacker123) is stored in plaintext within the local source code. In a real-world implementation, this is vulnerable to reverse engineering (decompilation using tools such as JADX).
Sandbox & Direct Boot: Following a reboot, the Android operating system keeps local storage encrypted until the user unlocks the device for the first time. A delay is incorporated into the application to allow essential system services and the Input Method Editor (keyboard) to become ready.
This project is created strictly for academic, educational, and security research purposes. It is strictly prohibited to use the code or concepts from this repository to distribute actual malware, engage in extortion, or compromise third-party devices without authorization. The developer assumes no responsibility for any misuse of this software.