Securing Device Financing: How We Built Device Guardian
An in-depth look at the architecture of Device Guardian, a low-cost, high-reliability smartphone locking platform designed to defeat bypass attempts.

Smartphone financing is one of the fastest-growing sectors in emerging markets, enabling millions of consumers to purchase high-value devices via Equated Monthly Installments (EMIs). However, it faces a massive challenge: default rates often sit between 15% and 30%. Because lenders traditionally lose control of the device once it leaves the store, recoverability is slow, expensive, and frequently impossible.
To solve this, we engineered Device Guardian—a comprehensive device-financing protection system. If a customer misses their payment, the device automatically locks itself at the hardware level. Here is a deep dive into how we built it.
The Security Challenge: Defeating Bypass Tactics
Standard reminder and lock apps are easily bypassed by tech-savvy users. During discovery, we identified four common bypass techniques:
- ROM Flashing: Flashing a new ROM or factory-resetting the phone to wipe out custom user-space applications.
- SIM Swapping: Removing or swapping the SIM card to escape location and cell network tracking.
- Uninstallation: Users finding and force-stopping or uninstalling background management packages.
- Second-Hand Selling: Offloading unpaid devices to third parties who are unaware of the underlying debt.
To defeat these tactics, Device Guardian is installed at the point of sale as an Android Device Owner. This system-level administrative status prevents uninstallation, blocks factory resets, and monitors device state in real-time.
Architecture & Tech Stack
The system consists of three main components: Flutter clients, a Next.js web dashboard, and a central Laravel REST API backend.
- Customer App (Flutter): Operates as the Device Owner. It enforces the kiosk-mode lock screen, detects SIM swaps, and communicates with the backend via Firebase Cloud Messaging (FCM). It also supports offline unlock via secure, time-based codes.
- Retailer App (Flutter): Allows store owners to link devices via IMEI scanning, register customers, set up EMI schedules, and process payments.
- Admin Dashboard (Next.js): Provides full portfolio visibility, transaction logs, purchase approvals, and overdue statistics.
- Laravel Backend: An API engine handling IMEI validation, EMI schedules, activation-credit ledgers, and secure notification payloads.
How the EMI Enforcement Engine Works
When a retailer registers a device, the backend generates an EMI schedule. Every installment is given a due date and a lock date. Reminders are pushed to the device as the due date approaches.
If a payment is missed, the backend sends a Firebase push command. Within seconds, the customer's phone switches into a full-screen kiosk lock, restricting all functions except for emergency calls. Once the retailer marks the payment as received, the device unlocks instantly. After the final installment is paid, the restrictions are permanently removed, and the app cleanly uninstalls itself to ensure a positive user experience.
Real-Time Telemetry & Monitoring
To ensure the integrity of the system, the customer app reports periodic location telemetry (with user consent) and SIM card states. If a SIM swap is detected, the phone locks automatically and triggers an alert on the admin dashboard. This active approach allows finance partners to secure their portfolios and confidently scale their smartphone financing offerings.