Decisions
Every decision the design pages do not explain on their own, with its date and reason. Open ones wait for the project owner; the rest are settled until someone reopens them. When a decision changes, its entry is updated, and the old reasoning is kept in a sentence.
Package ID
Settled 2026-12-02: org.quitlock (dev builds org.quitlock.dev, tester builds org.quitlock.tester), under the project’s own domain quitlock.org. The Kotlin packages follow it (org.quitlock, org.quitlock.core).
It was dev.t342.quitlock from 2026-11-17, under the owner’s domain t342.dev, because the earlier placeholder org.quitlock.app claimed quitlock.org before the project owned it, and someone else could have registered it first with Google or a store. Once the project held quitlock.org, the ID moved to it. No phone ran a release yet, so the move cost only reinstalling test phones.
It cannot change once phones run a release: Android treats another package ID as another app, and device owner cannot move to it, so every phone would need an exit and a fresh setup. The domain must stay renewed, so no one else can appear to own the name.
Open
Arming when the battery dialog is declined (milestone 10)
Arming goes ahead; the self-check then reports it on every check, and a tap asks again. Refusing to arm would be stricter, but would also block arming on a phone whose battery settings misbehave. No better option found; kept.
Re-pairing replaces the config (milestone 5)
The enrolment after a re-pair carries a config, so it replaces the config as well as the keys. While armed it may only keep or tighten the config in force, so this cannot loosen anything. No better option found; kept.
looks_like_android matches cameras (milestone 12)
The CLI looks for a phone by its MTP, PTP or adb interface. A PTP camera matches too, and is then sent AOA request 51, which it should stall. Harmless as far as is known; narrowing the match would miss phones in PTP mode.
Made for groups (2026-12-03)
Asked for so a church youth group could use QuitLock, with two leaders as partners for each member.
- Up to ten partners per phone, each with a key of their own. A partner phone PIN or password stays possible only with at most one partner key: it would not say whose it is.
- The member is always needed to loosen. Partners alone can never loosen protection; they can only approve, and, when the rule says so, tighten.
- The partners’ rule sets how many partners a loosening change needs (then the delay), how many make it apply at once, and how many may tighten without the member. This amends invariant 1: at once is off by default, needs the owner too, and a weaker rule always waits.
- Approvals are by key only for several partners; the phone takes no per-partner PIN.
- A change sent with enough approvals for the delay starts counting down at once; the phone does not hold it for more. Signatures for at once are gathered in a file first.
- Damaged rule: all partners, never at once, no tightening by partners.
Made for the desktop app (2026-12-02)
- One library, two programs.
desktop/core(quitlock-core) holds every operation;desktop/cli(quitlock) and the desktop app only ask questions and show answers. The library prints nothing and depends on no terminal or window library, whichscripts/check-invariants.shchecks. Emphasis in the library’s text goes through a painter each program installs (style.rs), so the CLI keeps its colours and the app gets plain text. - The desktop app is a second program,
quitlock-gui, rather than a window insidequitlock. On Windows a program is either a console program or a window program; one that is both opens a console window behind the app, or loses its output in a terminal. Two programs keep each simple, at the cost of a second download. - egui with OpenGL (glow), for one look on Windows and Linux, a single file with nothing to install, and no web engine. Rejected: a web view (Tauri), which brings a browser engine and JavaScript to a program that holds signing keys; GTK or Qt, which Windows lacks. Native file dialogs (rfd) were left out too, since on Linux they need GTK or an async runtime that cargo-deny bans; the app has a small file chooser of its own.
- On Linux the desktop app is a glibc program, since a window needs the system’s OpenGL and display libraries, which a static musl program cannot load. It is built on the oldest Ubuntu runner for an older glibc.
- Cancelling stays on the phone. The app shows a countdown or a waiting change and says to tap Cancel on the phone. Cancelling from a computer would need a new kind of bundle, and adds nothing: anyone holding the phone can already cancel.
- What the app does that the CLI asks about, it asks about too: it removes users and profiles only after a confirmation, sends a DNS filter that does not answer only when told to, and never runs
sudo. - Dependencies are checked with cargo-deny (
desktop/deny.toml): RustSec advisories, GPL-compatible licences, crates.io only, and bans on a second TLS or HTTP stack and on async runtimes, so the rule that only the GitHub download and the DNS filter check use the network stays checkable as the app adds crates. Its first run found RUSTSEC-2026-0620 in curve25519-dalek 5.0.0; QuitLock never builds the affected AVX-512 backend, and 5.1.0 is used now.
Made after the first phone test (2026-12-01)
The owner’s first armed test on a real phone (Android 13) found the CLI hanging, setup’s settings never reaching the phone, and a main screen that contradicted itself. Decisions, each confirmed by the owner:
- Sessions are gone; the phone answers while it is unlocked, with no tap. A session had to be opened on the phone before every command; the CLI then waited up to 5 minutes for it, which looked like a hang, and each command used up the session. Unarmed and in dev builds the tap protected nothing, since adb was on anyway. Now a command connects, works and disconnects. Requiring the phone to be unlocked keeps an idle phone from answering whatever it is plugged into. Every change still needs a signature, so serving without a tap adds no way out.
- The 5-minute USB debugging tap stays for armed phones (renamed Allow USB debugging), with its limit, tamper watch, self-check and log entries, because an adb shell is still a shell. Invariant 13 is unchanged in substance.
- The CLI fails at once when adb says the phone is unauthorised, offline or not permitted, with what to do, instead of waiting. It waits only for the phone to be unlocked and for Android’s accessory chooser.
--transport autouses adb first when the phone has it on, and the USB accessory only otherwise, so a phone that adb reaches is never switched out of file transfer.- Running setup again on an enrolled phone sends the settings as a config change, signed with the enrolled owner key, instead of stopping. Setup saves the settings to
quitlock.tomlbefore touching the phone and reads them back afterwards. - The phone shows no settings until some have arrived, instead of the defaults it would enforce, so a failed enrolment is visible.
Made in milestone 14 (2026-11-18)
- A hard never-suspend rule, decided on the phone. A blocklisted keyboard could leave a phone with a password screen lock impossible to unlock, and undoing it needs the CLI, which needs the unlocked phone: a lockout only a recovery wipe ends. The phone works out what it needs each time it applies the rules, rather than trusting a fixed list of names, because names differ between makers and an absent system app’s name can be taken by a sideloaded app. Exempting every system app was the alternative; rejected, since some system apps are browsers. Role holders installed after arming are protected only when they are the last one left, which leaves a narrow, visible gap (a browser that is the only keyboard) in exchange for never locking the owner out.
Made in milestone 13 (2026-11-17)
- Sessions over the USB accessory last 15 minutes; with adb, 5. The 5-minute limit exists because adb is a shell on the phone. An accessory session exposes only the session protocol, where every change needs a signature, so its length gives no extra way out, and 5 minutes was tight for
quitlock setup,dashand a partner reading a review. Changes invariant 13. Superseded 2026-12-01: there are no sessions; the adb window keeps its 5 minutes. - Config changes can start on the phone (Propose a change, and Allow for a suspended app), behind the owner phone secret. Replaces “no config editing on the phone”. It adds no way out: a phone-made change is exactly a
config push --draftapproved with the owner phone secret, so loosening still waits and still needs the partner. Closes milestone 6’s gap that allowing an app needed a computer. - Settings are display preferences only, stored apart from enrolment (
quitlock_settings), so nothing there can weaken protection. No adb default: adb stays a choice made on the phone each time. - The theme setting applies through a configuration override in every QuitLock screen, rather than
UiModeManager.setApplicationNightModeon API 31 and later: one way for every API level. - Screens keep their state across rotation (
configChanges), rather than saving and restoring each pending step: the screens are built in code, so nothing needs reloading, and a dialog’s answer is not lost. - The developer tools change state directly (finish a countdown, drop a waiting change). They exist only in dev builds, which can be removed instantly anyway.
- The CLI asks “Send it?” before a loosening change that will start a countdown, an exit, a key change and an update while armed. Tightening changes are sent without asking.
--yesskips it for scripts. - The setup wizard checks the recovery phrase by asking for three random words, which can be skipped by typing
skip. - The spec is retired for this book. It was a brief for building QuitLock; the book describes it as it is. Amendment notes moved out of the normative pages into this log.
Owner amendments, earlier
- The holder of the phone can always get out by re-pairing (2026-11-15, invariant 2). Originally a keyless exit started on the phone. Replaced by “Pair a new key” plus the CLI’s signed exit, which in solo mode gives the same total delay with one way out instead of two. Partner mode keeps a 72-hour minimum on re-pairing, so the owner cannot drop the partner at once.
INTERNETis held for the Private DNS call (2026-11-14, invariant 4). Originally forbidden outright, which made the documented call impossible: it tests the resolver from inside the app. What this costs: “no monitoring” used to show in the manifest alone; it now rests on the source containing no networking code, which the build checks and a reader can confirm.- The CLI may download a release from GitHub (2026-11-15). The only network code in the project, in the CLI; the phone stays offline, and a download goes through the signed, delayed update path. It trusts nothing it fetches:
SHA256SUMSonly catches a damaged download; the signer checks, the owner’s signature and the delay protect the phone. - People and approvals (2026-11-15, milestone 9): phone secrets for both people, waiting changes, three ways for a partner to join and to approve, recovery phrases. Before, approval meant a signature only.
configbundles may name the config they replace (2026-11-15, milestone 8), so a partner is shown exactly what changes, and an approval cannot be reused once the config has moved on.- Sessions over the USB accessory (2026-11-17, milestone 12), with adb kept as the fallback. Since 2026-12-01 adb comes first when the phone has it on, and there are no sessions. Windows keeps adb: its MTP driver blocks the switch, and the alternative (libusb with the UsbDk driver) would need every user to install a driver. Both transports were offered in every session, and are on every connection now. The accessory stays open between connections, because a closed accessory cannot be reopened while a read on it is blocked; while plugged in, the phone stays in accessory mode and file transfer is off.
Protocol and keys
- Canonical JSON payloads (milestone 0): one encoding per value, anything else rejected. Two parsers that disagree (duplicate keys, say) would let a bundle show one thing and do another. Signatures are still verified over the received bytes.
- A binary envelope (
QLB1) rather than a text format. - Every signature must be valid and from a known key; one good and one bad is rejected.
sequence_in_future: more than 24 hours ahead of the phone’s clock is rejected, since one far-future bundle would otherwise block all later ones.- Enrolment is self-signed by an owner key it lists.
- Bundles last 24 hours; those that need a partner, and drafts, 7 days.
- Small-order keys are not rejected (milestone 2); unreduced S is. The two libraries do not promise the same behaviour on small-order points, and such a key can only be enrolled by the person it would fool.
- Key files: Argon2id at 64 MiB, 3 iterations, 1 lane; names of 1 to 32 characters from
a-z 0-9 _ -; kept inQUITLOCK_KEY_DIR,--key-dir,~/.config/quitlock/keysor%APPDATA%\quitlock\keys. - Phone secrets: PIN 6 to 32 digits, password 8 to 128 printable ASCII characters; key files on the computer need 8 digits or 10 characters, since a copied file can be attacked offline without the phone’s lockout. Argon2id 64 MiB and 3 iterations, stored with each secret so they can change.
- Invite files are plain, unsigned JSON. They only say which phone to make a
key_addfor; the phone checks the reply, and fingerprints are compared by voice. partner joinmakes a key calledpartnerunless--keynames one.- A partner-mode change is both sent and written to a file, so a partner far away can approve it with no other step from the owner.
partner signreplaces the file in place, atomically, unless--outis given. - The phone’s status lists public keys, which are not secret; the CLI needs the partner’s to remove it.
The phone
- No UI library: the screens are plain platform views, so the app depends on nothing but
:coreand Bouncy Castle. Smaller, easier to reproduce and audit. - Permissions added, each for one call:
REQUEST_DELETE_PACKAGES(the uninstall prompt),RECEIVE_BOOT_COMPLETED(countdowns after reboot),QUERY_ALL_PACKAGES(seeing new installs on API 30 and later),FOREGROUND_SERVICEandFOREGROUND_SERVICE_SPECIAL_USE(keeping the process alive while it serves a computer or USB debugging is allowed; the closer types need network permissions),REQUEST_IGNORE_BATTERY_OPTIMIZATIONS(asking out of Doze). No notification permission: on Android 13 and later the notification may not show, and the service keeps the process alive regardless. - The typed confirmation is
ARM, in capitals; the field asks for them. - Cancel asks for confirmation: one extra tap, no key, no delay.
- A tightening change is accepted while something is pending; only a second loosening action is refused.
- A delayed action that cannot be fully enforced when it completes is applied in the fail-closed way, and the self-check reports what is wrong.
- The wall-clock credit across a reboot counts from the last checkpoint, saved whenever the countdown is looked at.
- Teardown leaves automatic time and adb as they are and lifts only the locks on them.
- A dev build arms without a managed browser and without enrolment, since the test images have neither. It still stores the browsers’ configuration.
ForceYouTubeRestrictis not set; there is no config field for it.- A failed update install drops the update, because a successful one restarts the app and must not repeat. The owner sends it again.
App rules
allowlistdoes not exempt a browser; onlybrowser_allowlistdoes.- Browsers installed before arming are judged like new ones (issue #15). Samsung Internet came with the phone and ran unfiltered. An unmanaged browser in the baseline is now suspended unless it is on
browser_allowlist. Already-armed phones apply this on update, as tightening. - Managed browsers come from a table (
Browsers.kt, Browsers): verified, candidate or unsupported. Candidates get the configuration in every build, but are exempt from the browser rule only in dev and tester builds until a phone test verifies them. Unknown browsers are unsupported. - A release build arms once any managed browser is installed, not only Chrome. This replaces the open item “Arming without Chrome”: with only Chrome verified, nothing changes yet.
- Apps disabled at arm are dormant: enabling one later counts as a new install.
- Facts are kept, the verdict recomputed: taking a browser off
browser_allowlistlater suspends it again. - The adb window (an app first installed while USB debugging was allowed is untrusted) applies on API 29 only. On API 30 and later the system records the shell as the installer whatever adb claims. On API 29 any install during the window also closes it.
- An app installed while QuitLock’s process is dead may run for up to about 15 minutes, the shortest period of a periodic job.
- Package names are logged when QuitLock suspends or releases an app: QuitLock’s own action, not monitoring of use.
Connecting
- The hello reports
not_owner, so the CLI can talk to an app that is not yet device owner. - A dev build accepts a root peer, for emulator images whose adbd runs as root.
- A tamper closes the debugging window; it does not lock the button out. Every tamper is in the log for a partner to see.
- A background restriction already in place when the window opens does not close it, since only an adb shell can lift it. The self-check reports it, with the command, until it is lifted.
- The window runs the self-check as it opens, which can take a few seconds if DNS has to be set again.
- Status reports the last self-check, not a new one, since a new one repairs and can take longer than the CLI waits.
Setup and releases
provisionremoves users itself, after a yes for each; accounts are left for the user to remove on the phone. User names are shown so the user knows what they agree to delete; account names never are.- One automatic retry of
dpm set-device-ownerafterNot active admin. - A dump that cannot be parsed does not block provisioning; Android checks again when the owner is set.
- Releases are drafts until a maintainer publishes them after checking the files.
versionCodefrom the tag: MAJOR×1,000,000 + MINOR×1,000 + PATCH, each at most 999.- The signing key is made on a live system, backed up offline on two encrypted drives; the secrets live in a
releaseenvironment onlyv*tags may use. - APK signature schemes v2 and v3 only, so the files inside a signed APK equal those of the unsigned build, which keeps
verify-release.shsimple. - The Linux CLI is static (musl); Windows uses MSVC; there is no macOS build.
- Provenance attestations are skipped while the repository is private.
- The default repository for
--githubis compiled in, overridable withQUITLOCK_GITHUB_REPOat build time or--repo.
Settled defaults
| Question | Answer |
|---|---|
Length of the short tier | 3 hours |
| USB debugging window on an armed phone | 5 minutes |
| A limit on how often it can be opened | None; each one is logged |
| Whether partner approval shortens or skips the delay | Only when the phone’s rule allows it (off by default); see Made for groups |
| Whether arming needs a signature | No: a button on the phone with a typed confirmation, or the owner phone secret |