Threat model
QuitLock is a commitment tool. This document says who it defends against, what it protects, how each way around it is handled, and what it does not try to stop. The rules it is built on are the invariants. The platform facts it relies on, and how each was checked, are in Platform facts.
Who it defends against
The user, during an urge. They hold the phone and the computer, know every PIN and password they set, have the key file and its passphrase, and have read this document and the source. They are not a skilled attacker with time to spare; they want a quick way out now, and will take one if it is quick.
So the goal is not that QuitLock cannot be removed. It is that every way out is slow, visible and deliberate: slow enough for the urge to pass, visible to the user and to a partner if there is one, and needing a decision rather than a reflex. The user can always get out (invariant 2). It takes hours, and it shows.
Also considered, more briefly:
- A partner, who can approve loosening changes but must never be able to trap the user. They cannot block an exit forever: re-pairing (with its 72-hour wait in partner mode) and a new key’s signed exit always remain.
- Someone else holding the phone (a thief, a curious friend). QuitLock is not anti-theft. It does not lock the phone, and Android’s own screen lock is what protects it. What matters here is that such a person cannot approve changes in the user’s name. That needs a key file and its passphrase, or a phone PIN typed on QuitLock’s own screen.
- Software on the phone or computer: keyboard apps, accessibility services, other apps, malware on the computer. See “Secrets” below.
Out of scope: a state-level attacker, physical attacks on the phone’s hardware, flashing the phone’s firmware, and compromise of Android itself or of the DNS provider.
What it protects
- The filter: Private DNS set to a filtering resolver and locked; Chrome’s managed settings (no incognito, SafeSearch, Chrome’s own DNS-over-HTTPS off, site lists); app rules that suspend new browsers and apps from untrusted sources.
- The locks that keep the filter in place: the user restrictions applied at arming (VPN, Private DNS, debugging, safe mode, factory reset from Settings, network reset, new users and profiles, date and time), the uninstall block on QuitLock, and device owner status itself.
- The delay: any loosening change, an app update, an exit, a shorter delay or a key change waits out the delay tier on the phone, measured so that changing the clock or rebooting earns nothing.
- The record: a hash-chained event log on the phone of every change to QuitLock, every debugging window and everything that ended one early.
QuitLock never records browsing or app use (invariant 4). There is nothing of that kind to protect or leak.
Ways out, and how each is handled
| Way out | How it is handled | What is left |
|---|---|---|
| Uninstall, disable, force-stop, clear data | Blocked by Android for a device owner with the uninstall block (platform facts, item 16) | None found on the emulators |
| Remove device owner over adb | Refused for a release build: “Attempt to remove non-test admin” (platform facts, item 16, release build on API 36) | None |
| Change Private DNS, add a VPN | Locked by user restrictions; checked by every self-check | — |
| Another browser | New browsers are suspended unless allowlisted; Chrome is configured | Browsers installed before arming are left alone (known limits) |
| An app that shows web pages without claiming to be a browser | Not detected | Known limit |
| An app from outside the Play Store or F-Droid | Suspended under the default install policy | Up to about 15 minutes before suspension if QuitLock’s process is not running (platform facts, item 3) |
| Safe mode, a new user, a work profile, Private Space | Blocked by user restrictions | — |
| Factory reset from Settings | Blocked | — |
| Factory reset from recovery mode | Not preventable. It wipes the phone, which makes it slow and costly | Stated in Known limits and Leaving |
| Change the clock to end a countdown | Within a boot only the monotonic clock counts; across a reboot the wall-clock difference, never less than zero; date and time settings are locked and automatic time forced on (Delays) | — |
| Shorten the delay first | Shortening is itself loosening and waits out the old delay (invariant 7) | — |
| Send a crafted or replayed bundle | Ed25519 over the exact bytes received; device binding, sequence number and expiry (invariants 8 and 9); shared test vectors | — |
| Install a modified QuitLock | An update must be signed with the installed app’s certificate, is a loosening change, and waits out the delay (invariant 10) | — |
| Lose or “lose” the key | Re-pairing replaces keys but cannot loosen anything; loosening still waits | — |
| Use a computer the phone is plugged into | Over the USB accessory, the computer gets only the connection protocol, and only while the phone is unlocked. With USB debugging, see the next section | With USB debugging, a window of at most 5 minutes |
| Kill QuitLock’s process | A foreground service keeps it alive while it serves a computer or a debugging window is open; jobs, the boot receiver and app open run the self-check otherwise | — |
| Doze, or restricting QuitLock’s battery use | QuitLock asks to be left out of battery optimization before arming. Settings cannot restrict a device owner; only adb can, and that is tampering (platform facts, item 16) | If the user declines the exemption, the self-check says so on every check |
| Another network that blocks DNS over TLS | Fails closed: no name resolution on that network | No internet there (known limits) |
| Another device | Not covered | Known limit |
Sessions: the deliberate window
An armed phone is reached over the USB accessory (Connecting). The computer then reaches only QuitLock’s connection protocol: read-only requests and bundles, judged exactly as an imported file. It gets no shell, and adb stays off. Whatever USB host the unlocked phone is plugged into can read status, config and the event log; that is no more than the phone’s own screen shows. A locked phone refuses.
Allow USB debugging gives the computer an adb shell for at most five minutes. It exists for computers that cannot use the accessory (Windows, for now). It is the main window an urge could use, and one tap away, so it is limited by:
- Who opens it. Only a tap on the phone opens one, never the computer. While armed, adb is off at every other time (invariant 13), and the event log records every window.
- What the shell can do. Android refuses most of what matters to a shell facing a device owner: changing Private DNS or automatic time, force-stopping, clearing, disabling, suspending, hiding or uninstalling QuitLock, unsuspending what it suspended, new users, safe mode (platform facts, item 16, has the full table).
- The tamper watch. The shell can still change a few things: set a global proxy, cancel QuitLock’s jobs, restrict it in the background, take it off the battery allowlist, install an app, release an app from suspension. The watch looks every second, and at once on any global setting change, install, unsuspension or restriction change. The first change it finds closes the window and turns adb off, and the change is logged. In the release build tested on the API 36 emulator, adb was gone 222 ms after a proxy was set. The closing self-check then undoes what it can.
- What cannot be undone is reported. A background restriction and a lost battery exemption cannot be reversed by QuitLock. The self-check reports them on the status screen until they are fixed, and the log shows when they happened.
- Apps installed over adb are never trusted and are suspended.
- The log. Every window is recorded with how long it was open and why it closed, so a partner can see how often one is opened and whether one ended early.
What is left: a few shell commands were not tried (platform facts, item 16, “Not checked”), and manufacturer builds add their own. Commands chained in one line can all run before the watch reacts (it reacts in milliseconds, not instantly), so its job is to close the window and record what happened, not to prevent every command. adb reboot recovery reaches recovery mode, where a factory reset is possible (see above).
Secrets
| Secret | Where it lives | What protects it |
|---|---|---|
| Key (Ed25519 private key) | A file on the user’s computer | Encrypted with a key derived from a password (at least 10 characters) or PIN (at least 8 digits) by Argon2id. A PIN is weak against someone who copies the file, and the CLI says so |
| Recovery phrase (24 words) | Wherever the user writes it | Nothing but where it is kept. It is the key. The guide says to keep it on paper or in a password manager |
| Phone PIN or password | Only an Argon2id hash on the phone, in the app’s private storage | Typed on QuitLock’s own keypad (no keyboard app sees it), in a window that is black in screenshots and recordings, with its keys hidden from accessibility services and touches ignored while another app draws over it. Wrong guesses slow down, up to an hour per try, and never wipe |
| Release signing key | GitHub Actions secrets of the project only | Never on a developer machine (Releasing) |
The phone stores public keys only. No secret leaves the device it was made on, except a bundle’s signature.
Not covered: someone watching the screen while a phone PIN is typed; an accessibility service’s own screenshot (platform facts, item 18 is still open); malware on the computer that reads the key file while it is unlocked.
Partners
- A partner approves loosening changes; they never shorten a delay.
- A remote partner cannot see the phone. Until they check it in person once, they cannot be sure the key enrolled as “partner” is theirs: the owner could have enrolled a second key of their own and read out its fingerprint. The partner guide says so.
- A partner cannot trap the owner. Re-pairing replaces every key and clears both phone secrets after the longer of the delay tier and 72 hours, and the new key can then request an exit.
- A partner phone PIN is only as private as the moment it is typed.
Supply chain
- The app is signed in CI with a key that exists only as CI secrets. Before the release is drafted, the workflow checks the signed APK against the public certificate hash. The CLI carries that hash and refuses a release APK signed with anything else when setting up a phone.
- Updates must be signed like the installed app (Android enforces this), are signed by the user’s own key, and wait out the delay.
update --githubchecks the download againstSHA256SUMS, which only catches damage; the certificate check is what matters. - Anyone can check a release against the source:
scripts/verify-release.shrebuilds the APK and compares every file in it, and rebuilds the Linux CLI and compares its hash. Each release also carries a build provenance attestation (gh attestation verify). See Releasing. - Dependencies are pinned: by
Cargo.lockfor the CLI, and by exact versions in the Gradle build files for the app (whose one outside runtime library is Bouncy Castle, for Ed25519). Gradle does not verify their checksums, and a compromised dependency is not otherwise defended against. - Losing the release key would leave installed phones unable to update. They would need an exit and a reinstall. The key is backed up offline (Releasing).
Known limits
Known limits is the plain-language list. In short: recovery-mode factory reset; the debugging window; content inside apps that are not suspended; other devices; the accounts and profiles that setup requires removing; no internet on networks that block DNS over TLS; the remote partner’s fingerprint check; phone PINs typed in view of others; recovery phrases kept carelessly.