Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

QuitLock

QuitLock is an open-source commitment tool for people quitting porn. An Android app, set up as device owner, blocks most adult content and makes its own removal slow. A desktop command-line tool for Linux and Windows sets it up and authorises changes over a USB cable.

Preview. QuitLock has been built and tested on Android emulators (Android 10 and 16), but not yet on real phones, and no signed release has been published. Until the manual checks are done, treat it as a preview.

What it is and is not

QuitLock is for someone restricting their own phone. The person it guards against is you, during an urge, holding both the phone and the computer. It does not try to be unbreakable; it tries to make every way out slow, visible and deliberate.

  • No server, no account, no network protocol. The app’s own code never opens a network connection. It holds the internet permission only because Android’s call for setting Private DNS tests the DNS server from inside the app. The only network use anywhere is on the computer, when you ask the CLI to download an app update from GitHub.
  • No monitoring. It never records what you browse or which apps you use. The phone keeps a history of changes to QuitLock itself, and nothing else.
  • No stealth. The app is always visible and always shows whether it is armed.
  • You can always get out. With your key, quitlock exit request removes QuitLock after the delay. Without it, “Pair a new key” on the phone lets you enrol a new key, which can then do the same.

What it does, once armed

  • Locks Private DNS to a filtering DNS provider, and blocks VPNs, proxies and other users.
  • Keeps SafeSearch on and incognito off in Chrome, and applies domain block and allow lists there.
  • Suspends apps installed from outside trusted stores, and new browsers.
  • Makes every loosening change (a looser config, an update, an exit) wait out a delay of 3 to 72 hours, shown on the phone with a countdown anyone can cancel.
  • With a partner, needs their approval as well.

This book

  • User guide: installing, setting up a phone, everyday use, keys, partners, the phone app, leaving, known limits and troubleshooting.
  • How it works: the design, its invariants and the threat model.
  • Protocol: the bundle and connection formats, for anyone writing another client or checking this one.
  • Development: building, testing, releasing, the platform facts QuitLock relies on, and the decisions behind it.

QuitLock is free software under the GPLv3.

Installing

Releases are on the project’s GitHub releases page:

FileWhat it is
quitlock-<version>.apkThe phone app
quitlock-<version>-linux-x86_64The command-line tool for Linux
quitlock-<version>-windows-x86_64.exeThe command-line tool for Windows
SHA256SUMSChecksums of all of them
  1. Check the downloads: sha256sum -c SHA256SUMS --ignore-missing. Releasing shows how to check further, down to rebuilding a release from the source.
  2. Put the CLI on your path, named quitlock (quitlock.exe on Windows). On Linux: chmod +x it and move it to ~/.local/bin/quitlock.
  3. Get adb (Android’s platform tools) for setting the phone up. The CLI finds it on your path, or takes --adb <path>. After setup, Linux needs no adb at all.
  4. Linux only: let your user open the phone over USB. quitlock setup offers this when it is needed; on its own, run quitlock setup --udev. It shows a udev rule for /etc/udev/rules.d/70-quitlock.rules and, if you agree, writes it with sudo. Unplug the phone and plug it in again afterwards.

You do not need to install the APK yourself: quitlock setup (or quitlock provision) installs it, and refuses a QuitLock APK that is not signed with the release key. It can also download the latest release itself, checked against its SHA256SUMS.

Then: Setting up a phone.

Setting up a phone

Android lets an app become device owner, which QuitLock needs, only on a phone with no accounts and no other users or profiles (a work profile, Samsung’s Secure Folder, a guest). Setup removes users and profiles, after asking, and has you remove accounts by hand; you sign back in to your accounts afterwards.

Before you start: make sure you can sign back in to every account on the phone: its password, and a backup code or a second device for two-step verification. The contents of extra users and profiles are lost.

With quitlock setup

quitlock setup

It asks one question at a time and says what it is about to do before doing it. Menus are answered with the arrow keys and Enter (or the option’s number), yes-or-no questions with y or n; Ctrl-C or Esc stops at any question. With NO_COLOR set, or when the CLI is not in a terminal, every command asks plainly instead: numbered menus and typed answers.

  1. What to do: set up your phone, join as someone’s partner, or only check a phone (which changes nothing).
  2. Your key. Changes to the phone are signed with a key kept on your computer, locked by a PIN or a password. Choose a key you have, create one, or restore one from its recovery phrase. A new key shows its 24-word recovery phrase once; write it down. Setup then asks for three of the words to check your copy.
  3. The phone. Turn on USB debugging (Settings, About phone: tap Build number seven times; then Settings, System, Developer options: USB debugging) and plug the phone in. When it asks “Allow USB debugging?”, tick “Always allow from this computer”. On Linux, setup checks that you may open the phone over USB and offers the udev rule if not.
  4. The app: the latest release from GitHub, or an APK you downloaded.
  5. Settings: the recommended ones, or adjust the delay, the DNS filter, which new apps may run and the block lists. Setup checks that the DNS filter answers DNS over TLS, since arming fails if it does not. They are saved as quitlock.toml before anything is done to the phone, so they are not lost if setup stops. See Config for what each one means.
  6. Set up the phone. QuitLock checks the phone and helps clear what stops setup, installs the app, makes it device owner and enrols your key with your settings. It then reads the settings back from the phone and checks they are the ones you chose.

If setup stops partway, run it again, or send the saved settings with quitlock enrol --config quitlock.toml. Running setup again on a phone your key is already enrolled on sends the settings as an ordinary config change: tightening applies at once; loosening waits out the delay once armed.

Nothing is enforced yet. When you are ready, open QuitLock on the phone and tap Arm. Before arming, the phone asks whether QuitLock may ignore battery optimization: allow it, so Android cannot hold back the checks that turn USB debugging off again.

By hand

quitlock key new owner          # make your key; write down its recovery phrase
quitlock provision --check      # what stops this phone being set up; changes nothing
quitlock provision --github     # or: quitlock provision <apk>

provision --check lists what is in the way: accounts by type only (never their names), users and profiles, another device owner, an Android older than 10, and notes for Samsung, Xiaomi and OnePlus phones. provision then walks through it: it asks before removing each user or profile, opens the accounts screen for you to remove accounts, checks the APK, installs it, makes it device owner and enrols your key with the default config, or with --config <file> your own settings. If Android still refuses, the CLI says what the message means and shows Android’s own words. If you have several keys, add --key <name>.

Afterwards

  • Sign back in to your accounts.
  • Arm on the phone when you are ready. The phone must be online, and Chrome installed.
  • Uninstall other browsers before arming, or blocklist them: apps already installed when you arm are left alone.
  • Then: Everyday use.

Everyday use

Reaching the phone

Plug the phone in, unlock it, and run the command. There is nothing to tap: QuitLock answers any command while the phone is unlocked, and the command answers at once or says what to do. A locked phone is refused; the command asks you to unlock it and waits a minute.

  • Not armed (or a dev build): USB debugging is on, and the CLI uses adb.
  • Armed, on Linux: QuitLock keeps USB debugging off, so the CLI uses the USB accessory. The first time, Android asks which app to open for the QuitLock CLI: choose QuitLock and tick Always. While the cable stays in, file transfer is off; unplug to get it back.
  • Armed, on Windows: Windows’ own driver for the phone blocks the accessory, so the CLI needs adb. In QuitLock on the phone, tap Allow USB debugging (5 min) first; it turns off by itself after 5 minutes, or when you tap Turn off.
  • --transport usb or --transport adb picks one way.
  • No working connection? Commands that send something take --to-file <path> (or --out <path>). Copy the file to the phone and tap Import bundle from file.

Looking

quitlock status     # state, mode, countdown, self-check
quitlock dash       # a live view: overview, history, config; q quits
quitlock log pull   # the full history of changes, with its hash chain checked

On the phone, the main screen shows the state and any countdown; History lists recent changes, and Settings shows the protection in force.

Changing a setting

From the computer:

quitlock config edit

It opens the phone’s settings in your text editor ($VISUAL or $EDITOR; otherwise nano or vi, or Notepad on Windows). Save and close, and it sends what you changed. To keep the settings in a file instead, quitlock config pull quitlock.toml, edit it, then quitlock config push quitlock.toml.

A new DNS filter host is checked from the computer first: the phone only finds out it does not work when it switches to it, so arming would fail, and an armed phone would have no working internet. If it does not answer, the CLI says so and sends nothing unless you say yes.

Either way, the CLI shows every change and whether it tightens or loosens. A change that only tightens applies at once. Anything else waits out the delay on the phone (3 to 72 hours, as set in the config), shown with a countdown that can be cancelled with one tap; before sending one, the CLI asks “Send it?” (skip that with --yes). Only one such change can count down at a time. Shortening the delay is itself loosening, and waits out the old delay.

On the phone: Settings, then Propose a change. Edit, review, then Approve and send with your phone PIN, password or screen lock. The same rules apply. The first time, the phone asks you to set a phone PIN or password.

Apps that were suspended

With the default settings, an app installed from anywhere but the Play Store or F-Droid is suspended, and so is any new browser other than Chrome. The phone lists suspended apps and why. To allow one, tap Allow next to it and approve the change, or add it to allowlist (a browser to browser_allowlist) and config push. Either way it is a loosening change.

Updating the app

quitlock update --github     # or: quitlock update <apk>

An update is a loosening change too: while armed it waits out the delay and can be cancelled on the phone. The phone installs it only if it is the same app, signed with the same key, and not an older version; it then installs without asking and restarts. --github checks the download against the release’s SHA256SUMS (set GH_TOKEN for a private repository). A dev build cannot update itself; reinstall it with adb install -t -r.

Drafts

--draft on a command that changes something sends it unsigned. It waits on the phone until you approve it there with your phone PIN or password.

Keys, PINs and passwords

Your key

Your key lives on your computer, in a file encrypted under a password of at least 10 characters or a PIN of at least 8 digits. A password is better: anyone who copies the file can try every PIN on their own computer.

quitlock key new <name>              # make one; shows its recovery phrase once
quitlock key list                    # names, public keys and fingerprints
quitlock key export <name> <file>    # copy the encrypted file out, for backup
quitlock key import <name> <file>    # and in, on another computer

A wrong PIN or password is asked again, up to three times. For scripts, QUITLOCK_PASSPHRASE supplies it, and QUITLOCK_KEY_DIR (or --key-dir) says where key files are kept.

The recovery phrase

When a key is made, the CLI shows its recovery phrase: 24 words that are the key. quitlock key restore <name> rebuilds the key from them on any computer, under a new PIN or password, and nothing on the phone needs to change. quitlock key phrase <name> shows the words again.

Anyone with the words can sign as you. Write them on paper or keep them in a password manager, never in a photo or a chat.

More than one key

quitlock key add --owner <name or public key>
quitlock key remove --owner <name or public key>

Both are loosening changes: they wait out the delay, and in partner mode need your partner too.

Phone PINs and passwords

On the phone, each person can also have a phone PIN or password (the People screen, from the main screen). It is typed on QuitLock’s own keypad, which no keyboard app sees, in a window that screenshots show as black. Five wrong tries are free; after that each try waits longer, up to an hour, and nothing is ever wiped. The owner may use the phone’s own screen lock instead.

With one, the owner can:

  • confirm arming with it instead of typing ARM;
  • approve a draft on the phone;
  • request an exit on the phone;
  • propose a config change on the phone.

Forgotten phone PIN or password

quitlock phone-secret allow (or --partner), signed by that person’s key, clears it: for the next 10 minutes a new one can be set on the phone. Sign it only while you are with the phone, since whoever holds it in those 10 minutes could set one.

Lost key

If you have its recovery phrase, quitlock key restore brings it back. Otherwise:

  1. On the phone, under Leave or recover, tap Pair a new key.
  2. On the computer: quitlock key new <new name>, then, with the phone plugged in and unlocked, quitlock enrol.

The new key replaces every key on the phone and clears both phone PINs. In solo mode this is immediate. In partner mode the phone first waits the longer of the delay and 72 hours, so a partner cannot be dropped at once; Stop waiting cancels it. The phone stays armed and keeps its config, so the new key can loosen nothing without waiting out the delay.

Partners

A partner is someone you trust to approve loosening changes with you. Each of you can approve with a key on your own computer, a phone PIN or password, or both.

Adding a partner

On the phone: People, Add a partner. There are three ways:

  • A PIN or password on this phone. Hand the phone to your partner; they choose one there in private. No computer needed.
  • Their computer, in person. The phone waits 10 minutes for a key. Plug it into your partner’s computer, unlock it, and they run quitlock partner join (or quitlock setup, then “Be someone’s partner”). It makes their key, with its recovery phrase, and sends it. The phone and their computer show the same fingerprint, such as 266B 5A11 059C 338D; you check them and confirm on the phone.
  • Their computer, far away. You run quitlock partner invite and send them the file it writes. They run quitlock partner join <invite>, which makes their key and writes a reply file to send back. You run quitlock partner accept <reply>. Then compare fingerprints over a call.

Your partner cannot see the phone from far away. Only checking it in person once proves that it is really your phone and that they are its partner: you could otherwise have enrolled a second key of your own and read out its fingerprint.

What changes

Adding a partner takes effect at once, since it only makes things stricter. From then on, a loosening change, an app update, an owner key change and an exit all need both of you. Tightening changes need only you.

You run the command as usual, for example quitlock config push looser.toml. The phone keeps it as a waiting change, shown with what it does, who has approved it and who still needs to, and a Cancel button. The CLI also writes it to a file such as quitlock-config-20261116-0136.qlb.

Approving, three ways

  1. On the phone: they tap Approve as the partner and type their phone PIN or password.
  2. In person, with their computer: plug the phone into it, unlock it, and they run quitlock partner review. It shows the change in plain words, asks them to type yes, and sends their signature.
  3. Far away: send them the file; it holds no secrets. They run quitlock partner sign <file>, which shows the same summary and adds their signature. They send it back and you run quitlock send <file>.

The phone holds one waiting change at a time, and it expires after 7 days. Approval does not shorten the delay: once both of you have approved, a loosening change still waits it out and can still be cancelled. A config change names the config it replaces, so what your partner is shown is exactly what the phone will change; if the phone’s config has moved on since, the change is dropped.

Removing the partner

quitlock partner remove needs both of you and waits out the delay. It removes the partner’s key and phone PIN.

The phone app

The main screen

From the top:

  • Status: one of four states, each with one sentence on what comes next.

    • Not set up: QuitLock is not the device owner. Run quitlock setup on your computer.
    • Almost set up: QuitLock is the device owner, but your computer has not sent your key and settings yet. Run quitlock setup again.
    • Not armed: ready. Nothing is enforced until you tap Arm.
    • Armed.

    Below the state: the mode, delay and DNS filter, shown only once your settings have reached the phone; and, when armed, one self-check line. Tap it for the details.

  • Counting down: a loosening change waiting out the delay, with the time left and Cancel this change, which drops it at once and needs nothing.

  • Waiting for approval: a change that still needs someone, with what it changes, who has approved and who still needs to, Approve buttons and Cancel.

  • Computer: whether a computer is connected. On an armed phone, Allow USB debugging (5 min) for a computer that cannot use the USB accessory (Everyday use); while it is on, the time left and Turn off. Import bundle from file is here too.

  • A short list of other screens:

    • People: owner and partner, their key fingerprints and phone PINs; Add a partner.
    • Checks and apps: what the self-check found, a fix for battery optimization, and the apps QuitLock has suspended, each with why and, where a config change can allow it, Allow.
    • History: recent changes from the event log. quitlock log pull shows all of it.
    • Leave or recover: how to leave, Request exit, Pair a new key, and Remove now (when not armed, and in dev builds).

The state and any countdown are always on the main screen, and cannot be hidden. The ⚙ button opens Settings.

Settings

  • Appearance: the theme (follow the system, light or dark), how many entries History shows, and a 24-hour clock for them.
  • Computer: keep the screen on while a computer is connected or USB debugging is allowed (while QuitLock is showing), and the system settings for the notification shown meanwhile.
  • Protection in force: every setting of the config, in plain words, and Propose a change.
  • About: version and build, package, device ID, key fingerprints, licence.
  • Save a copy: save the history as a file (quitlock log verify <file> checks it on a computer), or a plain-text status report for someone helping you. Android’s own save dialog asks where; QuitLock needs no storage permission.

None of these can loosen protection.

Changing a setting on the phone

Propose a change edits a copy of the config in force: the delay, the DNS filter, which apps may run, SafeSearch and incognito, and every list. The review at the bottom lists each change and what will happen: a change that only tightens applies at once; anything else waits out the delay, and in partner mode needs your partner first. Approve and send asks for your phone PIN, password or screen lock. This is exactly like quitlock config push --draft approved on the phone.

Dev builds

A dev build shows DEV at the top, can be removed instantly even when armed, and has Developer tools in Settings: the app’s inner state, the event log with its chain checked, and buttons to finish or shorten a countdown and to run checks. None of it exists in a release build. A dev build is not for real use.

Leaving

How to remove QuitLock depends on its state, which the phone’s status screen always shows at the top.

State on the phoneHow to remove itWait
Not the device owner (setup never finished)Uninstall it like any appNone
Not armedIn QuitLock, under Leave or recover, tap Remove now, then confirm the uninstall promptNone
ArmedRequest an exit, wait out the delay, then confirm the uninstall promptThe delay tier in your config
Armed, key lostPair a new key first, then request an exitAs above; in partner mode at least 72 hours more first

Removal always ends the same way: QuitLock undoes everything it set (see the last section), stops being the device owner, and only then opens Android’s uninstall prompt. If that prompt is dismissed, uninstall QuitLock later from Settings like any app.

Not armed

Nothing is enforced yet, so removal is instant. Open QuitLock, go to Leave or recover, tap Remove now and confirm. If it reports that removal did not finish (for example, the phone went offline while Private DNS was being returned to automatic), tap it again: each step is safe to repeat.

Armed: requesting an exit

An exit is a loosening change, so it waits out the delay tier of the config in force (3, 12, 24 or 72 hours). Shortening the tier first does not help: that is itself a loosening change and waits out the old delay.

  1. Start the exit, one of two ways:
    • From your computer. Connect the phone with a USB cable, unlock it, and run:
      quitlock exit request
      
      If adb does not work on this computer, quitlock exit request --to-file exit.qlb writes the exit to a file instead. Copy it to the phone and use Import bundle from file.
    • On the phone, if you set an owner phone PIN or password (on the People screen): under Leave or recover, tap Request exit and type it.
  2. In partner mode, your partner must approve it before the countdown starts: on the phone with their phone PIN or password, with quitlock partner review on their computer while the phone is plugged in, or remotely with quitlock partner sign on the file the CLI wrote (send it back and run quitlock send <file>). See Partners.
  3. Wait. The phone shows “Removing QuitLock” with a countdown. It survives reboots, and changing the clock does not shorten it. Cancel this change stops it at once if you change your mind.
  4. When the countdown ends, QuitLock tears itself down: at once if the app is open, otherwise at its next periodic check (within about 15 minutes) or when you open it. Android’s uninstall prompt then appears; confirm it.

Only one change can be counting down at a time. If another one is already pending, cancel it on the phone or wait for it to finish, then request the exit.

Armed, and the key is lost

  • If you have the key’s recovery phrase (24 words), restore the key on any computer with quitlock key restore <name> and request the exit as above.
  • Otherwise, tap Pair a new key on the phone (under Leave or recover), make a new key with quitlock key new <name>, and run quitlock enrol with the phone plugged in. The new key replaces every key on the phone. In solo mode this is immediate. In partner mode the phone first waits the longer of the delay tier and 72 hours, so a partner cannot be dropped at once; Stop waiting, on the main screen, cancels it. Then request the exit with the new key. Protection stays on throughout, and the exit still waits out the delay.

A forgotten phone PIN or password does not block an exit: the key is enough in solo mode. To replace one, see Keys, PINs and passwords.

A dev build

A dev build (package dev.t342.quitlock.dev, marked DEV on its screen) can always be removed at once with Remove now, armed or not. It is for development only and not protection.

What removal undoes, and what it leaves

Teardown, in this order:

  1. Releases every app QuitLock suspended.
  2. Clears Chrome’s managed settings (incognito, SafeSearch, DNS-over-HTTPS, site lists).
  3. Returns Private DNS to automatic.
  4. Lifts every user restriction it set: Private DNS, VPN, debugging, safe mode, factory reset, network reset, adding users and profiles, date and time.
  5. Lifts the block on uninstalling QuitLock.
  6. Stops being the device owner.

Left as they were, for you to change if you want: automatic time stays on, and USB debugging stays in whatever state it was (off, on an armed phone unless it was allowed at that moment). QuitLock’s own data, including its history of changes, goes with the uninstall. Save the history first with quitlock log pull --out <file> if you want to keep it.

If teardown is interrupted (the phone switched off, or a step did not take), QuitLock is left not armed and finishes the removal on its own: at boot, at its next periodic check, or when you open it. You can also tap Remove now. Every step is safe to repeat. QuitLock stays device owner until every step it alone can undo is done, so nothing is left behind that nobody could remove.

Private DNS is the exception: if it cannot be set back to automatic (some phones refuse while other users exist), the removal still finishes, and QuitLock tells you the host it is left at. Its lock is already gone, so change it in Settings, under Network and internet, Private DNS.

If the countdown ended while QuitLock was closed, it shows Uninstall QuitLock the next time you open it.

What does not work

  • Uninstalling from Settings or the launcher while QuitLock is the device owner. Android blocks it.
  • adb uninstall, or removing the device owner over adb (dpm remove-active-admin). Android refuses both for a release build that is the device owner (platform facts, item 16).
  • Safe mode. It is turned off while armed.

The last resort: factory reset

A factory reset from recovery mode (started with the phone’s buttons) removes QuitLock along with everything else on the phone. The Settings menu’s reset is blocked while armed, but recovery mode cannot be. QuitLock does not try to stop this; it is the documented way out when nothing else is possible, and it wipes the phone. Back up what you need first, and know your account passwords: after a reset Android may ask for the Google account that was on the phone (factory reset protection).

Known limits

QuitLock makes every way out slow, visible and deliberate. It does not make them impossible. In plain words:

  • A factory reset from recovery mode removes QuitLock and wipes the phone.
  • Allow USB debugging turns adb on for at most 5 minutes. It is opened only on the phone, logged and followed by a self-check, but it is a window. On Linux the CLI uses the USB accessory and adb stays off; on Windows, for now, USB debugging is needed.
  • Content inside apps that are not suspended (social and messaging apps) is not filtered.
  • Browser detection finds apps that declare they open web links. An app that shows web pages without declaring that is not recognised as a browser.
  • Apps already installed when you arm are left alone, browsers included, unless they are on the blocklist. Uninstall other browsers before arming, or blocklist them.
  • An app installed while QuitLock’s process is not running may run for up to about 15 minutes before it is suspended.
  • Domain lists apply inside Chrome only, and an allowlist entry cannot unblock a domain the DNS provider blocks.
  • Other devices are unaffected.
  • Becoming device owner requires temporarily removing accounts, and permanently removing extra users and profiles such as Samsung Secure Folder.
  • DNS filtering fails closed: on a network that blocks DNS over TLS, the phone has no internet until it leaves that network. Arming checks that the DNS host works, so the phone must be online to arm.
  • Arming needs Chrome: it is the one browser QuitLock manages.
  • A remote partner cannot see the phone, so they cannot be sure the key enrolled as “partner” is theirs until they check the phone in person once.
  • A phone PIN or password is only as private as the moment it is typed: someone watching the screen learns it. The approval screen keeps keyboards, screenshots and accessibility services out, and hides its keys from screen readers too.
  • Anyone with a recovery phrase can sign as that person. It belongs on paper or in a password manager, never in a photo or a chat.

The threat model goes through each way out in detail.

Troubleshooting

A command cannot reach the phone

The CLI says what is wrong. The usual fixes:

  • Unlock the phone. QuitLock does not answer while it is locked.
  • Is the cable a data cable? Charging-only cables show nothing at all.
  • “did not answer over adb”: QuitLock on the phone is missing or older than the CLI. quitlock update (or quitlock setup) installs the matching app.
  • Linux: if the CLI says this computer may not open the phone over USB, run quitlock setup --udev, then unplug and replug.
  • The first time over the USB accessory, Android asks which app to open for the QuitLock CLI. Choose QuitLock and tick Always. If you dismissed it, unplug and plug in again.
  • Windows, or --transport adb, on an armed phone: in QuitLock, tap Allow USB debugging (5 min) first.

adb lists no phone, though USB debugging is on

The adb server on the computer can miss a phone that came back after switching USB modes (for example after the USB accessory was used). Restart it: adb kill-server, then adb devices. If the phone then shows as “unauthorized”, see below.

The phone says “Almost set up”

QuitLock is the device owner, but your key and settings never arrived, so setup stopped partway. Run quitlock setup again; it picks up where it stopped. If you have the settings saved, quitlock enrol --config quitlock.toml sends them directly.

Arming fails because of the DNS filter

The phone tests the DNS filter host when it switches to it, and refuses to arm if the host does not answer DNS over TLS. Check the phone is online. If it is, the host is probably wrong: quitlock config edit changes it, and checks the new one from the computer before sending it (quitlock config validate <file> checks a saved file).

Installing the APK by tapping it fails

  • “The package appears to be invalid” with a dev build: dev builds are marked test-only, and Android’s installer refuses those on purpose, so a dev build cannot be mistaken for a real install. Install it over USB instead: quitlock setup or quitlock provision <apk> do that, or adb install -t -r <apk>.
  • “This app may be harmful” (Play Protect): Google has not seen the app before, it is not from the Play Store, and it asks for device-admin powers. Tap More details, then Install anyway. Play Protect may offer to send the app to Google for scanning; QuitLock does not need that. Installing with adb or the CLI shows the same warning on some phones.

adb says “unauthorized” or “offline”

  • Unauthorized: unlock the phone and accept “Allow USB debugging?”, ticking “Always allow from this computer”. If no prompt appears, unplug and plug in again, or revoke USB debugging authorisations in Developer options and retry.
  • Offline: unplug and plug in again; restart adb with adb kill-server.
  • No permissions (Linux): run quitlock setup --udev. The rule covers adb too.

Setup refuses to make QuitLock the device owner

The CLI shows what Android’s message means, with Android’s own words below it. The usual causes:

Android says (in part)Meaning
accounts on the deviceAn account is still on the phone. Remove every account (Settings, Accounts), then try again.
several users, more than one userThere are extra users or profiles (a work profile, Secure Folder, a guest). Remove them.
already set, already has a device ownerAnother app is the device owner. Only one can be, and it cannot be taken over.
profile ownerAn app is a profile owner (a work profile or similar). Remove that profile first.
already provisionedSetup is complete and something is still present: usually an account or an extra user.
unknown admin, invalid componentQuitLock is not installed, or not the expected build.
not active adminAndroid had not finished cleaning up after an earlier attempt. Try again.
not allowed to set the device ownerThe phone does not let adb set a device owner. On Xiaomi, turn on “USB debugging (Security settings)” and turn off MIUI optimisation in Developer options.

quitlock provision --check lists what is in the way without changing anything.

USB debugging turned off early

The phone’s history says why. “Something was changed over USB” means the tamper watch saw a change an adb shell made (a proxy, an app installed over USB, a restriction lifted) and turned USB debugging off; the self-check then undid the change. Otherwise it turns off after 5 minutes.

Problems the self-check reports

  • A proxy in the old http_proxy setting: remove it while USB debugging is allowed, adb shell settings delete global http_proxy.
  • QuitLock is restricted in the background (only adb can set that; Settings cannot lift it): while USB debugging is allowed, adb shell cmd appops set dev.t342.quitlock RUN_ANY_IN_BACKGROUND allow.
  • Battery optimization: tap the self-check line on the main screen, then Leave QuitLock out of battery optimization, and allow it.

“The key file is damaged” or “wrong PIN or password”

Three tries are given. If the PIN or password is truly lost, restore the key from its recovery phrase (quitlock key restore), or see Lost key.

A change was refused

The phone and the CLI say why in plain words. The common ones: the bundle was made for another phone, has expired (bundles last 24 hours, or 7 days when they need a partner), or is older than the last change the phone accepted (check the computer’s clock); or another change is already counting down or waiting for approval.

CLI reference

quitlock --help and quitlock <command> --help give the full options of each command; this page is the overview.

Setting up

CommandWhat it does
quitlock setupSet up a phone step by step: your key, the phone, the app and a first config
quitlock setup --udevLinux: show, and offer to install, the udev rule the USB accessory needs
quitlock provision --checkWhat stops this phone being set up; changes nothing
quitlock provision <apk> or --github [--tag <tag>]Clear what blocks setup (asking first), install the app, make it device owner, enrol your key; --config <file> enrols those settings instead of the defaults
quitlock enrol [--config <file>]Enrol your key and settings on a new phone, or pair a new key after Pair a new key on the phone. On a phone your key is already enrolled on, --config sends the settings as a config change

Keys

CommandWhat it does
quitlock key new <name>Create a key, locked by a PIN or password; shows its recovery phrase once
quitlock key restore <name>Rebuild a key from its 24-word recovery phrase
quitlock key phrase <name>Show a key’s recovery phrase again
quitlock key listKeys with public keys and fingerprints
quitlock key export <name> <file>Copy the encrypted key file out, for backup
quitlock key import <name> <file>Copy an encrypted key file in
quitlock key add --owner <name or hex>Enrol another owner key on the phone
quitlock key remove --owner <name or hex>Remove an owner key from the phone

Looking at the phone

CommandWhat it does
quitlock statusState, mode, countdown and self-check result
quitlock dashA live view: overview, history, config. q quits
quitlock log pull [--out <file>]The phone’s history of changes, with its hash chain checked
quitlock log verify <file>Check a saved history (from log pull --out, or saved on the phone)
quitlock config editOpen the phone’s config in your editor; send what you changed
quitlock config pull [file]Fetch the config the phone is using (replaces an existing file after asking)

Changing things

CommandWhat it does
quitlock config init [file]Write a config file with the defaults, to edit
quitlock config validate [file]Check a config file, show what it says, and check its DNS filter host answers
quitlock config push <file>Show what would change, sign it, send it
quitlock update <apk> or --github [--tag <tag>]Sign and send a new version of the app
quitlock exit requestRemove QuitLock, after the delay
quitlock send <bundle>Send an already signed bundle
quitlock inspect <bundle>Show what a bundle would change, in plain words

Partners and phone secrets

CommandWhat it does
quitlock partner inviteOwner: write an invite file for a partner far away
quitlock partner join [<invite>]Partner: make your key and join, in person or from an invite
quitlock partner accept <reply>Owner: enrol a remote partner from their reply
quitlock partner reviewPartner, with the phone: approve the change waiting on it
quitlock partner sign <bundle>Partner, far away: check a change and approve it
quitlock partner removeOwner: remove the partner (needs both of you)
quitlock phone-secret allow [--partner]Replace a forgotten phone PIN or password

Options most commands take

OptionMeaning
--key <name>Which of your keys to use; the default is your only key, and a terminal offers a menu when there are several
--transport auto|usb|adbHow to reach the phone; auto uses adb when the phone has it on, otherwise the USB accessory (Linux)
--adb <path>The adb program, if not on your path
--to-file <path>, --out <path>Write the signed bundle to a file instead of sending it
--draftSend it unsigned, to be approved on the phone with your phone PIN or password
-y, --yesDo not ask “Send it?” before a loosening change
--key-dir <dir>Where key files are kept

Environment

VariableMeaning
QUITLOCK_KEY_DIRWhere key files are kept
QUITLOCK_PASSPHRASEThe key’s PIN or password, for scripts and tests
NO_COLORSet to turn colour off
GH_TOKEN, GITHUB_TOKENFor --github against a private repository

Overview

QuitLock has two parts and no server.

PartLanguageRole
Android appKotlinDevice owner. Applies and enforces policy. Shows status and countdowns.
CLI (quitlock)RustSets the phone up, keeps the keys, and sends signed changes to the phone.

They meet in two places:

  • The CLI connects to the app over USB for each command: over adb when the phone has it on, otherwise over the USB accessory. The phone answers while it is unlocked, with nothing to tap. See Connecting.
  • A bundle is one change: a config, an app update, a key, an exit. Every change is a bundle, whether it arrives over USB or as an imported file. It is signed on a computer, approved on the phone with a PIN or password, or both. See Authorisation and, for the format, Bundles.

The user should never have to think about bundles: they plug the phone in, run a command, and the change is sent. Files are a fallback.

No network

There is no server and no network protocol. Everything goes over the USB cable. The one exception is on the computer: quitlock update --github (and provision --github) downloads a release APK from the project’s GitHub releases. The phone never contacts anything, and a downloaded APK goes through the same signed, delayed update path as any other.

The app holds Android’s INTERNET permission for a single platform call, explained in Invariants (number 4).

Who it defends against

The user themselves, during an urge, holding both the phone and the computer. QuitLock does not try to be unbreakable. It tries to make every way out slow, visible and deliberate. The threat model goes through every way out.

Keys and the history

  • Keys are Ed25519 and live on the computer, in files encrypted with a key derived from a PIN or password (Argon2id, then XChaCha20-Poly1305). The plaintext key never touches disk. Each key also has a recovery phrase: its 32-byte seed as 24 BIP-39 words, which rebuild it on any computer. The phone stores public keys only. Format: Key files.
  • The phone keeps an event log of every change to QuitLock itself, each entry carrying the hash of the one before. It records nothing about browsing or app use: an app appears only when QuitLock acts on it. The phone keeps the newest 5000 entries. Format: Event log.

Out of scope for version 1

  • On-device image or screen content detection
  • A local filtering VPN, or system-wide custom domain lists
  • Hardware key attestation of the installed build
  • Managed browsers other than Chrome
  • iOS
  • Any network feature, except the CLI’s release download

Invariants

These hold in every mode and every build that is not a dev build. A change that would break one is a decision for the project owner, recorded in Decisions, never a workaround.

Each has the reason it exists and what enforces it.

1. Loosening is always delayed; tightening is immediate

Any change that weakens protection waits out the current delay tier on the phone. The delay starts when the phone accepts the change, not when it was created.

  • Why: the delay is the whole product. An urge passes; a countdown that can be cancelled with one tap outlasts it.
  • Enforced by: the tightening classifier (Config.isTightening, defaulting to loosening when unsure) and the delay engine in android/core; the shared vectors in protocol/vectors/classifier.json.

2. The holder of the phone can always get out

“Pair a new key”, started on the phone with no key, exists in every mode, partner mode included, and a newly paired key can always send a signed exit, which waits out the config’s delay. Nothing may remove either.

  • Why: a tool that can trap its user is a tool nobody should install. Losing a key must cost time, never the phone.
  • Enforced by: BundleProcessor.requestRePair asks for no key and no secret (in partner mode it only waits); the re-pair tests in SessionAndProcessorTest.

3. No stealth

The app is always visible in the launcher, always shows whether it is armed, and always shows any running countdown.

  • Why: QuitLock is a commitment the user makes to themselves, not something done to them.
  • Enforced by: the manifest’s launcher activity and the main screen, which has no way to hide the status or the countdown.

4. No monitoring

The app never records, stores or transmits what the user browses or which apps they use. It holds INTERNET for one reason only: the platform’s Private DNS call tests the resolver from inside the calling app and fails without it (platform facts, item 12). The app’s own code opens no network connection.

  • Why: a tool for a private struggle must not become a record of it.
  • Enforced by: scripts/check-invariants.sh, which fails the build on a permission outside an exact list and on any networking code in the app’s source.

5. Release builds contain no instant-removal code, and no developer tools

That code lives only in the debug source set; the release source set has a stub with a null hook.

  • Why: a release build that could be removed instantly would undo invariant 1.
  • Enforced by: scripts/check-invariants.sh: the release stubs must contain no functions, the debug-only classes must not appear in the main source set or the release APK’s dex, and the developer tools screen is declared in the debug manifest only.

6. Nothing is enforced until the user arms it

Before arming, removal is instant.

  • Why: setting up must be safe to try, and to abandon.
  • Enforced by: Lifecycle (NOT_OWNER, UNARMED, ARMED) and the Arm button, which only the user can press.

7. Shortening the delay is itself a loosening change

It waits out the old delay.

  • Why: otherwise a delay could be shortened first and then everything else loosened quickly.
  • Enforced by: the classifier: only raising the tier is tightening.

8. Signatures are checked over the exact bytes received

A payload is never re-serialised before it is verified.

  • Why: two encoders that disagree on one byte would make a signature mean something else.
  • Enforced by: the verifier works on the envelope’s payload bytes; the shared vectors.

9. Every signed command is bound to one device, carries a sequence number and expires

Replays and cross-device reuse are rejected.

  • Enforced by: Acceptance, steps 3 to 5; the shared vectors.

10. App updates are a loosening change

There is no automatic or silent self-update outside the bundle path.

  • Why: a new version could remove anything.
  • Enforced by: the update bundle type, which needs the same approvals and delay as any loosening change; the phone installs only the same app, signed with the same key, at a version no lower than the installed one.

11. Teardown reverses everything before device owner is cleared

  • Why: a half-removed QuitLock would leave a locked-down phone with nothing to unlock it.
  • Enforced by: Enforcer.teardown, in a fixed order and safe to re-run; RemovalTest and ExitTest on the emulator.

12. Security never depends on the transport

A bundle is verified the same way however it arrives. The connection to the computer is untrusted.

  • Enforced by: one acceptance path (BundleProcessor.process) that connections and file import both feed; the transport parity tests.

13. While armed, adb is on only during a debugging window the user opened on the phone

Connecting over the USB accessory leaves adb off. Allow USB debugging on the phone opens a window with a hard 5-minute limit, watched for tampering, ended by a self-check and logged (Connecting). The computer cannot open one.

  • Why: an adb shell can change things a device owner cannot fully lock (platform facts, item 16). A connection over the accessory carries only the connection protocol, where every change still needs a signature.
  • Enforced by: DebugWindow and Enforcer.keepsAdbOff; the self-check turns adb off whenever no window is open; AdbLockTest and LinksTest.

Lifecycle

StateMeaningRemoval
NOT_OWNERApp installed, not device ownerNormal uninstall
UNARMEDDevice owner; keys and config may be enrolled; nothing enforcedInstant, from the app
ARMEDPolicies enforcedDelayed exit only
ARMED, with a pending actionA loosening change is counting downCancelling it is instant

The main screen shows these as four stages: Not set up (NOT_OWNER), Almost set up (UNARMED, with no owner key and config yet), Not armed (UNARMED and enrolled) and Armed. Every screen takes its wording from that one stage (SetupStage), so none contradicts another.

quitlock provision takes a phone from nothing to UNARMED with a key and a config enrolled. Arming happens on the phone, never from the computer: the Arm button works only once an owner key and a config are enrolled. It shows a summary of what will be enforced and the delay, and asks for a typed ARM, or for the owner’s phone PIN or password if one is set.

Before arming, the app asks once to be left out of battery optimization, so Doze cannot hold back the checks that turn adb off after a debugging window. Arming goes ahead if the user declines; the self-check then says so, and the Checks and apps screen has a button that asks again.

The phone must be online to arm: setting Private DNS tests the resolver (Enforcement). A release build also refuses to arm without Chrome, the one browser QuitLock manages.

Arming is all or nothing: Private DNS is set first, since it is the step that can fail for outside reasons, and if any later step fails, everything applied so far is undone and the phone stays UNARMED.

From ARMED the only way back is an exit, which waits out the delay (Leaving).

Enforcement

What an armed phone enforces, and how. Android 10 (API 29) is the minimum; the app targets the current SDK.

DNS

  • Private DNS is set with DevicePolicyManager.setGlobalPrivateDnsModeSpecifiedHost, off the main thread, with its result code checked, and locked with DISALLOW_CONFIG_PRIVATE_DNS.
  • The default host is family-filter-dns.cleanbrowsing.org (adult content blocked, SafeSearch enforced). The host is a config field; changing it is a loosening change, whichever way it goes.
  • The call tests the resolver before accepting the host, so arming needs the phone online and refuses a host that does not serve DNS over TLS.
  • When the self-check has to restore a DNS setting that drifted and that test fails (no network, DNS over TLS blocked), it writes the Private DNS settings directly instead, without the test: the filter must come back even offline.
  • It fails closed. On a network that blocks DNS over TLS the phone has no name resolution. There is no fallback to unfiltered DNS.

Restrictions applied at arm

RestrictionPurpose
DISALLOW_CONFIG_PRIVATE_DNSLock DNS
DISALLOW_CONFIG_VPNStop a VPN bypass
DISALLOW_DEBUGGING_FEATURESKeep adb off outside a debugging window (Connecting)
DISALLOW_SAFE_BOOTStop a safe-mode bypass
DISALLOW_FACTORY_RESETClose the Settings reset path
DISALLOW_NETWORK_RESETStop a network settings reset
DISALLOW_ADD_USERStop a clean secondary user
DISALLOW_ADD_MANAGED_PROFILEStop a work profile
DISALLOW_CONFIG_DATE_TIMEProtect the countdown clock

Also: QuitLock blocks its own uninstall, and automatic time is forced on. Private Space (DISALLOW_ADD_PRIVATE_PROFILE, API 35 and later) needs nothing from QuitLock: Android already enforces it on any phone with a device owner, and a device owner cannot change it.

Two restrictions are deliberately not set: DISALLOW_INSTALL_UNKNOWN_SOURCES (it would block F-Droid; app rules replace it) and DISALLOW_USB_FILE_TRANSFER (the file fallback needs it).

Chrome

Chrome is the one managed browser. A release build refuses to arm without it. Its managed configuration (setApplicationRestrictions) sets:

  • incognito disabled
  • SafeSearch forced
  • Chrome’s own DNS over HTTPS off, so it uses the system’s DNS
  • the URL blocklist and allowlist from the config

Domain lists apply inside Chrome only, and an allowlist entry cannot unblock a domain the DNS provider blocks.

App rules

Checked on every package install (while QuitLock’s process runs), at boot and on a periodic job (at most every 15 minutes).

Config fieldEffect
install_policy = "open"No install-source check
install_policy = "trusted_installers" (default)Apps from other sources are suspended until allowed
install_policy = "approval_required"Every new app is suspended until allowed
trusted_installersDefault: the Play Store and F-Droid
blocklistAlways suspended
allowlistAllowed apps
browser_allowlistBrowsers exempt from automatic suspension
  • Browsers: any newly installed app that can open http or https links as a browser is suspended unless it is Chrome or on browser_allowlist, whatever the install policy.

  • Apps installed through adb (possible only while USB debugging is allowed) count as coming from an untrusted source.

  • Apps already installed when the phone is armed are left alone, browsers included, unless they are on the blocklist.

  • Suspension uses setPackagesSuspended. Some system packages cannot be suspended; failures are logged and shown in the status.

  • What the phone needs is never suspended, whatever the config, so the phone can always be unlocked and QuitLock reached (AppRules.kept):

    • core system apps: Settings, the system UI, the phone, telecom and emergency apps, the permission controller and the package installer, matched only against system apps, since another phone’s system app name can be taken by a sideloaded one;
    • a keyboard, home screen, dialer or SMS app that is a system app or was installed before arming;
    • if every app in one of those roles would be suspended, the one in use, whatever it is.

    An app installed after arming gets no protection from filling a role while another remains, so a new browser cannot escape the browser rule by also being a keyboard. The self-check names every app kept this way.

  • Updates to an app already allowed are not checked again.

  • To allow a suspended app: tap Allow next to it on the phone and approve the change, or add it to allowlist (a browser to browser_allowlist) and quitlock config push. Either way it is a loosening change.

Self-check

Runs at boot, when the app opens, on the periodic job and at the end of every debugging window. It checks every policy above, re-applies any that drifted, clears a global HTTP proxy, and, when armed with no debugging window open, makes sure adb is off and the debugging restriction applied (this covers the app being killed with a window open). Problems are shown on the status screen and written to the event log.

Teardown

In order: unsuspend everything QuitLock suspended, clear Chrome’s managed configuration, return Private DNS to automatic, clear every user restriction, lift the uninstall block, then clear device owner. Only then does the app offer to uninstall itself. Teardown is safe to re-run if it was interrupted.

Nothing may hold a removal up for good (invariant 2):

  • Every step is tried, whatever happened to the ones before it.
  • A removal is marked as started before anything is undone, and upkeep (boot, the periodic job, opening the app) finishes one left half-done.
  • Device owner is given up only once every step that only the device owner can undo has taken. Otherwise something could be left that nobody can remove.
  • Private DNS is the exception: once its lock is cleared the user can change it in Settings, so failing to set it back to automatic does not stop the removal; the screen and the log name the host it was left at.

Authorisation

Who may change what, and how they show they agree.

Keys and modes

  • Keys are Ed25519. The phone stores public keys only.
  • A key is identified by the SHA-256 of its public key. People compare keys by their fingerprint: the first 8 bytes of the key ID as four groups of four uppercase hex digits (A1B2 C3D4 E5F6 0718).
  • Solo mode: one or more owner keys.
  • Partner mode: while a partner exists (below).

People and approvals

There are two roles, owner and partner. Either can approve in two ways, and may set up either or both:

WayWhat it isWhere it is used
KeyAn Ed25519 key kept by the CLI on that person’s own computer, in a file unlocked by a PIN or a passwordSigns bundles on the computer
Phone secretA PIN or password set on the phone, stored there only as a slow hashTyped on the phone to approve a change waiting there
  • The owner always has at least one owner key (enrolment needs one) and may add one owner phone secret.
  • A partner exists while there is a partner key, a partner phone secret, or both. One partner at most, with at most one key and one phone secret.
  • The phone knows whose phone secret is whose. An owner phone secret never counts as the partner’s approval, and the reverse.
  • “Owner approval” below means a valid owner signature, or the owner phone secret typed on the phone; “partner approval” likewise. Neither skips or shortens a delay.
ActionSoloPartner modeDelay
Tightening config changeOwnerOwnerNone
Loosening config changeOwnerOwner and partnerConfig tier
App updateOwnerOwner and partnerConfig tier
Add another owner keyOwnerOwner and partnerConfig tier
Remove an owner key (not the last)OwnerOwner and partnerConfig tier
Add a partner (no partner yet)Owner, or a tap on the phone (see Becoming a partner)n/aNone
Give the partner a second way (a key, or a phone secret)n/aPartnerNone
Remove the partnern/aOwner and partnerConfig tier
ExitOwnerOwner and partnerConfig tier
Set the owner phone secret, when there is noneOn the phone, no approvalSameNone
Change or remove a phone secretThat person’s current phone secretSameNone
Replace a forgotten phone secretA key of that role (phone_secret_allow)SameNone
Pair a new key (on the phone)NothingNothingNone in solo mode; partner mode: the re-pair delay
Cancel a pending action or a waiting change (on the phone)NothingNothingInstant
Allow USB debugging for 5 minutes (on the phone)NothingNothingInstant

The rules in full, as the phone checks them: Who may do what.

Phone secrets

  • A PIN is at least 6 digits; a password at least 8 characters.
  • The phone stores only an Argon2id hash with its salt and parameters, in the app’s private storage. Nothing else on the phone, and nothing sent to a computer, contains the secret or the hash.
  • Wrong guesses slow down, never wipe. Five wrong tries are free; after that each try waits 30 seconds, doubling each time, at most one hour. The count survives a restart and a reboot, and the wait follows the countdown clock rules, so changing the clock earns nothing. A right answer resets the count. Wiping on failure is ruled out: guessing wrong on purpose would then remove the partner.
  • The screen that asks for one uses QuitLock’s own keypad and keyboard, never the system’s input method, so a keyboard app cannot record it. It blocks screenshots and screen recording, ignores touches while another app draws over it, and hides its keys from accessibility services. That hides them from screen readers too, a known limit.
  • The owner may use the phone’s own screen lock instead, where the phone has one: QuitLock asks Android to confirm it. The partner cannot, because the owner knows that screen lock.
  • On the computer, a key file is unlocked by a PIN of at least 8 digits or a password of at least 10 characters. Choosing a PIN shows a plain warning: anyone who copies the file can try every PIN offline, which a password resists far better.

Waiting changes

A change that still lacks an approval waits on the phone instead of being refused.

  • The phone holds at most one waiting change. It shows what the change does in plain words, who has approved it and who still needs to, its expiry and a Cancel button. Its countdown, if it has one, has not started.
  • A bundle waits when it passes every acceptance check except the approvals. It may be signed by the owner only, or by nobody: a draft, to be approved on the phone.
  • Missing approvals can arrive in any order and any way: a phone secret typed on the phone, the same bundle sent again with more signatures (over USB or as a file), or a signature added by quitlock partner review over USB.
  • When the last approval arrives, the change is accepted as if it had arrived then: a tightening change applies, a loosening one starts its countdown. If a countdown is already running, the change keeps waiting and the phone says why.
  • A waiting change does not consume the sequence number, and a newer bundle accepted meanwhile does not spoil it. It is checked again in full when it completes, except for the sequence number: a config that names the config it replaces is dropped if that config has changed since.
  • A waiting change is dropped when it expires, when it is cancelled, after a re-pair, and at teardown. Each step is in the event log.

Changes made on the phone

The owner can start two kinds of change on the phone itself, each approved there with the owner phone secret (a PIN, password or the screen lock):

  • Request exit.
  • Propose a change to the config (Settings, then Propose a change; or Allow next to a suspended app). The phone makes a config draft that names the config in force as the one it replaces.

Either is exactly the change the CLI would make with --draft, approved on the phone: it goes through the same acceptance steps. A tightening config applies at once; anything else waits out the delay in solo mode, and in partner mode first waits for the partner. With no owner phone secret, the phone asks for one to be set first, so that nobody else holding the phone can make changes.

Becoming a partner

Each way gives the phone a partner at once, since adding a partner tightens protection. A partner’s new key must also sign the bundle that adds it, which proves the partner holds it.

HowSteps
PIN or password on the phoneOn the phone: Add a partner, then With a PIN or password on this phone. The partner types it there in private.
CLI, in personOn the phone: Add a partner, then With your partner’s computer, in person. The phone waits 10 minutes for a partner key. It is plugged into the partner’s computer, unlocked, and the partner runs quitlock partner join. Their CLI creates the key and sends it. The phone and the partner’s CLI show the same fingerprint, and the owner confirms on the phone: with the owner phone secret if there is one, otherwise with a tap.
CLI, remoteThe owner runs quitlock partner invite, which writes an invite file naming the phone, and sends it. The partner runs quitlock partner join <invite>, which creates their key and writes a reply file to send back. The owner runs quitlock partner accept <reply>, which adds the owner’s signature and sends it. Both then compare fingerprints over a call.

A remote partner cannot see the phone. The owner could enrol a second key of their own as the “partner” and read out its fingerprint. Checking the phone in person once is the only proof the partner has.

A partner who already exists can add a second way in person: a key, with quitlock partner join approved by their phone secret on the phone; or a phone secret, after signing quitlock phone-secret allow --partner with their key, which lets them set one on the phone within 10 minutes. They sign that only while they are with the phone, since whoever holds it in those 10 minutes could set it.

Partner approvals, three ways

Where the partner isWhat they useHow it reaches the phone
On the phoneWith the phoneTheir phone secretTyped on the phone
In person, CLIWith the phoneTheir computerThe phone is plugged into their computer; quitlock partner review fetches the waiting change, shows it, signs it and sends the signature back
Remote, CLIAnywhereTheir computerA file: the owner sends it, the partner runs quitlock partner sign <file> and sends it back, and the owner sends it with quitlock send or imports it on the phone

partner review and partner sign show the same summary as quitlock inspect and require typing yes. A bundle that needs the partner expires after 7 days; one sent at once, after 24 hours.

Lost keys and forgotten secrets

  • A forgotten phone secret, with a key of the same role: quitlock phone-secret allow signed by that key clears it and lets a new one be set on the phone within 10 minutes.
  • A forgotten owner phone secret, with no other way: the owner still has their key; nothing is lost.
  • A partner with no way left (lost key, forgotten phone secret): “Pair a new key”, which in partner mode waits the re-pair delay.
  • A key whose recovery phrase is kept: quitlock key restore rebuilds it, and nothing on the phone changes.

“Pair a new key” exists for a lost key, or to move to a new one. From then on (after the re-pair delay, in partner mode) the phone accepts one new enrolment bundle, which replaces every key and clears both phone secrets; the old keys keep working until it arrives, and the user can stop waiting at any time. Policies stay enforced throughout. While armed, that enrolment must carry the config in force or a tightening of it, so a new key gains nothing a lost one did not have: everything loosening it signs still waits out the delay.

Damaged state on the phone

The phone keeps its keys, config, phone secrets and countdown in two copies. If the main one cannot be read, the copy is used. If neither can be read in full, the app still starts and keeps enforcing; a damaged file must never stop it, since that would leave every policy in place with nothing checking it. Each unreadable value is replaced by the strict one (StoredEnrolment):

  • a key: dropped;
  • the sequence number: the time now, so no bundle signed before can be replayed;
  • the config: the defaults;
  • the phone secrets and the waiting change: none.

Until the next enrolment, a partner is assumed, whether there was one or not. Nothing loosening can complete, and “Pair a new key” waits the partner-mode re-pair delay (at least 72 hours), after which a new enrolment starts clean. The status screen says so, and the event log has a state entry.

What counts as tightening

A config change is tightening only if every difference from the current config is one of:

  • an entry added to apps.blocklist or chrome.url_blocklist
  • an entry removed from apps.allowlist, apps.browser_allowlist, apps.trusted_installers or chrome.url_allowlist
  • the delay tier raised
  • install_policy moved toward stricter (open < trusted_installers < approval_required)
  • a Chrome safety flag turned on

Anything else, including a DNS host change or an unrecognised field, makes the whole change loosening. The classifier defaults to loosening when unsure, and is tested heavily against shared vectors: a bug there is a bypass.

Delays and the clock

TierDuration
short3 hours
medium12 hours
long (default)24 hours
very_long72 hours
  • One pending loosening action at a time. A second one arriving while one is pending is refused with a clear message; in partner mode a fully approved change keeps waiting until the slot is free.
  • A pending action keeps the deadline it started with, even if the tier later changes.
  • Countdowns survive a reboot.
  • Within one boot, progress is credited from the monotonic clock only. Across a reboot, the wall-clock difference is credited, never less than zero. A wall-clock jump within a boot earns nothing, and automatic time is forced on while armed.
  • Cancelling a pending action is instant and needs nothing: no key, no secret.
  • The countdown logic sits behind a clock interface, so tests drive it with a fake clock.

Re-pair delay (partner mode only): the longer of the config’s tier and 72 hours, before a key paired on the phone can be enrolled. Without it the owner could drop the partner at once. In solo mode a re-pair needs no wait, since a new key can still loosen nothing without waiting out the delay.

Phone-secret lockouts are measured by the same rules, so changing the clock does not shorten them (Authorisation).

Config

The config says what the phone enforces. It is not secret. The phone is the source of truth: quitlock config pull fetches the one in force, and the phone’s Settings screen shows it.

schema = 1

[dns]
provider_host = "family-filter-dns.cleanbrowsing.org"

[delay]
tier = "long"                 # short | medium | long | very_long

[apps]
install_policy = "trusted_installers"
trusted_installers = ["com.android.vending", "org.fdroid.fdroid"]
blocklist = []
allowlist = []
browser_allowlist = []

[chrome]
force_safesearch = true
disable_incognito = true
url_blocklist = []
url_allowlist = []

quitlock config init writes this file with comments; quitlock setup can adjust it as it goes.

Fields

FieldValuesTightening when
dns.provider_hostA DNS-over-TLS host name (two or more labels, not an IP address)Never: any change loosens
delay.tiershort (3 h), medium (12 h), long (24 h), very_long (72 h)Raised
apps.install_policyopen, trusted_installers, approval_requiredMoved toward approval_required
apps.trusted_installersPackage names of app stores whose installs are trustedAn entry removed
apps.blocklistPackage names always suspendedAn entry added
apps.allowlistPackage names allowed whatever the install policyAn entry removed
apps.browser_allowlistBrowsers other than Chrome that may runAn entry removed
chrome.force_safesearchtrue or falseTurned on
chrome.disable_incognitotrue or falseTurned on
chrome.url_blocklistChrome URL patterns, blocked in ChromeAn entry added
chrome.url_allowlistChrome URL patterns, allowed in ChromeAn entry removed
  • Package names have at least two dot-separated parts, each starting with a letter (com.example.app).
  • URL patterns follow Chrome’s URLBlocklist format and contain no spaces. They apply inside Chrome only, and an allowlist entry cannot unblock a domain the DNS provider blocks.
  • Lists are sets: order and repetition mean nothing. Each holds at most 1000 entries.
  • A key the phone does not know is kept, but any change involving a config with one counts as loosening.

The rules for tightening are in Authorisation; the wire form, in Bundles.

Connecting

The CLI reaches the app over USB, does its work and disconnects. There is nothing to open on the phone first: the app answers any computer while the phone is unlocked, and refuses while it is locked. The wire format is in Connection protocol.

A connection adds convenience, not trust. Every change is a signed bundle, checked exactly as an imported file is (Acceptance); the rest is read-only (status, the config, the waiting change, the event log).

Two transports

  • adb. When the phone has USB debugging on (not armed, or a dev build, or an armed phone during a debugging window, below), the CLI wakes the app with a broadcast (am broadcast -a dev.t342.quitlock.LISTEN) and connects to its socket through adb forward. Only the adb shell user can send the broadcast (the receiver requires android.permission.DUMP) or connect to the socket. The app listens for 30 seconds after the last connection ends.
  • The USB accessory (Android Open Accessory, Linux only). Used when adb cannot be: an armed phone keeps adb off. The CLI switches the phone into accessory mode, and Android hands the accessory to a screenless QuitLock activity. The first time, Android asks which app to open for the QuitLock CLI; choosing QuitLock and Always means it never asks again. Windows cannot do this switch while its own MTP driver holds the phone.

--transport auto (the default) uses adb when the phone has it on, otherwise the accessory, and never switches a phone that adb can already reach (so its file transfer mode stays as it is). --transport adb and --transport usb force one.

The CLI fails at once, with what to do, when it cannot connect: no phone, adb not authorised on the phone, adb offline, no USB permission on this computer, an armed phone with adb off and no accessory. It waits only for two things, a minute each, and says so: the phone to be unlocked, and Android’s accessory chooser.

The debugging window

An armed phone in a release build has adb off (invariant 13). For a computer that cannot use the accessory, the main screen has Allow USB debugging (5 min):

  1. The app runs the self-check, lifts the debugging restriction, turns adb on and starts a 5-minute timer. Installs from then on count as adb installs.
  2. While it is open, the app checks every second for what an adb shell could change against it: a proxy, an app installed over USB, a suspended app released, its own checks cancelled or restricted. On finding one it closes the window at once.
  3. It closes when the timer runs out, on Turn off (on the screen or in the notification), or on tampering. Closing turns adb off, puts the restriction back and runs the full self-check.

Opening and closing are both in the event log (debug_window_open, debug_window_close with the reason), so a partner can see how often it was used. If the app’s process dies with the window open, a one-off background job turns adb off when the limit passes, and the next start logs the window as closed.

Platform facts, item 16, lists what an adb shell can and cannot change.

What a connection exposes

Any computer the unlocked phone is plugged into can read the status, the config and the event log, and can send bundles, which the phone rejects unless they are signed by an enrolled key. Requiring the phone to be unlocked keeps a phone left on a desk from being read by whatever it is plugged into.

File fallback

Every CLI command that sends something accepts --to-file <path> (or --out), which writes the signed bundle instead of sending it. The user copies it to the phone over USB file transfer and taps Import bundle from file (the system file picker, so no storage permission). This works when neither transport works on the computer.

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

  1. 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.
  2. 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.
  3. 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.
  4. 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 outHow it is handledWhat is left
Uninstall, disable, force-stop, clear dataBlocked by Android for a device owner with the uninstall block (platform facts, item 16)None found on the emulators
Remove device owner over adbRefused 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 VPNLocked by user restrictions; checked by every self-check—
Another browserNew browsers are suspended unless allowlisted; Chrome is configuredBrowsers installed before arming are left alone (known limits)
An app that shows web pages without claiming to be a browserNot detectedKnown limit
An app from outside the Play Store or F-DroidSuspended under the default install policyUp 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 SpaceBlocked by user restrictions—
Factory reset from SettingsBlocked—
Factory reset from recovery modeNot preventable. It wipes the phone, which makes it slow and costlyStated in Known limits and Leaving
Change the clock to end a countdownWithin 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 firstShortening is itself loosening and waits out the old delay (invariant 7)—
Send a crafted or replayed bundleEd25519 over the exact bytes received; device binding, sequence number and expiry (invariants 8 and 9); shared test vectors—
Install a modified QuitLockAn 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 keyRe-pairing replaces keys but cannot loosen anything; loosening still waits—
Use a computer the phone is plugged intoOver the USB accessory, the computer gets only the connection protocol, and only while the phone is unlocked. With USB debugging, see the next sectionWith USB debugging, a window of at most 5 minutes
Kill QuitLock’s processA 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 useQuitLock 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 TLSFails closed: no name resolution on that networkNo internet there (known limits)
Another deviceNot coveredKnown 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

SecretWhere it livesWhat protects it
Key (Ed25519 private key)A file on the user’s computerEncrypted 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 itNothing 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 passwordOnly an Argon2id hash on the phone, in the app’s private storageTyped 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 keyGitHub Actions secrets of the project onlyNever 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 --github checks the download against SHA256SUMS, which only catches damage; the certificate check is what matters.
  • Anyone can check a release against the source: scripts/verify-release.sh rebuilds 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.lock for 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.

Bundles

These pages are normative for the bundle format (this page, Verification and Test vectors), the connection protocol with the event log it carries, and the files the CLI writes. The Rust CLI creates bundles and the Kotlin app verifies them; both are tested against the shared vectors in protocol/vectors/.

The words MUST, MUST NOT, SHOULD and MAY are used as in RFC 2119.

Status: bundle format version 1, session protocol version 1. Nothing has been released yet, so both may still change without a version bump until the first signed release.

Overview

A bundle is one signed command for one phone. It has two layers:

  • The payload: canonical JSON saying what to do, for which device, with a sequence number and an expiry time.
  • The envelope: a small binary frame holding the payload bytes and up to eight Ed25519 signatures over them. A bundle with no signature is a draft, which can only wait on the phone to be approved there (Waiting changes).

The phone treats a bundle the same way whether it arrives over a session or from an imported file. All security comes from the checks in Acceptance, never from how the bundle arrived.

Byte order is big-endian throughout. Hex strings are lowercase.

Envelope

OffsetSizeField
04Magic: ASCII QLB1 (51 4c 42 31)
44payload_len, unsigned 32-bit. At most 1 048 576 (1 MiB).
8payload_lenPayload bytes
8 + payload_len1sig_count. At most 8; may be 0 (a draft).
then, sig_count times32Key ID
64Ed25519 signature
  • A key ID is the SHA-256 of the 32-byte Ed25519 public key.
  • A signature covers the 19-byte prefix QuitLock bundle v1 followed by one zero byte (51 75 69 74 4c 6f 63 6b 20 62 75 6e 64 6c 65 20 76 31 00), followed by the payload bytes exactly as they appear in the envelope.
  • A receiver MUST verify signatures over the payload bytes it received. It MUST NOT parse and re-encode the payload to obtain the bytes to verify.
  • A signature whose S value is not reduced (S ≥ L, the group order) MUST be rejected, as RFC 8032 requires. The vector config_signature_s_not_reduced checks this. The phone’s verdict is the one that counts; signature results shown by the CLI are a preview.
  • The suggested file extension is .qlb.

Nothing may follow the last signature, with one exception: an update bundle stored in a file is followed immediately by the APK (update).

Canonical JSON

The payload is JSON restricted so that every value has exactly one encoding. A receiver MUST reject a payload that is not in this form. This removes any chance that the CLI (which shows a human what a bundle does) and the phone (which acts on it) read the same signed bytes differently.

  • Encoding is UTF-8 with no byte order mark.
  • No whitespace anywhere outside strings.
  • Value types are object, array, string, integer and boolean. There is no null and there are no fractional or exponent numbers.
  • Integers are non-negative, at most 2^53 − 1 (9007199254740991), written in decimal with no sign and no leading zeros (0 itself is allowed).
  • Strings contain no character below U+0020. The only escapes are \" and \\, and both of those characters MUST be escaped. Every other character, including non-ASCII, appears literally. \uXXXX, \n, \/ and the like are not allowed.
  • Object keys match [a-z0-9_]{1,64}, appear in ascending byte order, and are unique.
  • Objects and arrays nest at most 16 deep in total.

A receiver checks canonical form by parsing with a parser that accepts only this grammar. This check is separate from signature verification and does not change which bytes are verified.

Payload

The payload is an object with exactly these six keys:

KeyTypeMeaning
vintegerFormat version. 1.
typestringOne of enrol, config, update, key_add, key_remove, partner_remove, phone_secret_allow, exit.
device_idstring32 hex characters (16 bytes). The device this bundle is for.
seqintegerSequence number: the creation time in Unix milliseconds.
expiresintegerExpiry time in Unix milliseconds. MUST be greater than seq.
bodyobjectDepends on type; see below.

Example (an exit bundle):

{"body":{},"device_id":"514c000102030405060708090a0b0c0d","expires":1800086400000,"seq":1799999940000,"type":"exit","v":1}

The CLI needs no saved state to produce a sequence number, so a restored key works from a fresh desktop. The CLI sets expires to 24 hours after creation by default.

A body MUST contain exactly the keys listed for its type. The one exception is the config object (4.2), where unknown keys are allowed and handled by the classifier.

enrol

KeyTypeMeaning
device_idstringMUST equal the payload device_id.
owner_keysarray of stringsOne to eight owner public keys, each 64 hex characters. No duplicates.
partner_keystringOptional. The partner public key. MUST NOT also be an owner key. Omitted in solo mode.
configobjectThe initial config (4.2).

The device ID is 16 random bytes chosen by the CLI. The phone adopts it on first enrolment.

config

KeyTypeMeaning
configobjectThe full replacement config.
replacesobjectOptional. The config this one replaces, exactly as the phone reported it. The phone accepts the bundle only while that is the config in force (step 7d).

replaces makes a config bundle say what it changes, inside the signed bytes. A partner asked to approve a change can then be shown the difference from the current config without trusting anything the owner sends alongside, and an approval cannot be reused once the config has moved on. The CLI always includes it. Comparison is by value: the same JSON object, as canonical JSON compares.

The config object mirrors the TOML config file:

{"apps":{"allowlist":[],"blocklist":[],"browser_allowlist":[],"install_policy":"trusted_installers","trusted_installers":["com.android.vending","org.fdroid.fdroid"]},"chrome":{"disable_incognito":true,"force_safesearch":true,"url_allowlist":[],"url_blocklist":[]},"delay":{"tier":"long"},"dns":{"provider_host":"family-filter-dns.cleanbrowsing.org"},"schema":1}

Lists are sets: order and repetition carry no meaning. The CLI SHOULD write them sorted and without duplicates.

A config that has an unknown key anywhere is still valid, but the classifier treats the whole change as loosening. A config that is missing a known key, or has a known key with a value of the wrong type or an unknown enum value, is invalid.

Value rules, schema 1:

KeyRule
schemaThe integer 1.
dns.provider_hostA host name of at least two labels (letters, digits, inner hyphens; 253 characters at most). Not an IP address, no port.
delay.tiershort, medium, long or very_long.
apps.install_policyopen, trusted_installers or approval_required.
apps.trusted_installers, apps.blocklist, apps.allowlist, apps.browser_allowlistLists of package names: two or more dot-separated parts, each starting with a letter and continuing with letters, digits or underscores.
chrome.force_safesearch, chrome.disable_incognitoBooleans.
chrome.url_blocklist, chrome.url_allowlistLists of non-empty strings without whitespace.

A list holds at most 1000 entries, each at most 2048 bytes. The four sections dns, delay, apps and chrome and every key above are required.

update

KeyTypeMeaning
apk_sha256stringSHA-256 of the APK, 64 hex characters.
apk_sizeintegerSize of the APK in bytes.

The APK is not inside the signed payload. In a file it follows the envelope directly: the remaining bytes of the file are the APK and their count MUST equal apk_size. Over a connection it is sent in APK_DATA frames (Connection protocol). In both cases the phone MUST check the size and hash before using the APK (step 10a), and MUST also require that the APK is the same app, signed with the same certificates as the installed app, with a version code not lower than the installed one (step 10b).

A phone accepts APKs of at most 64 MiB. A session that sends more in APK_DATA frames is ended.

The phone keeps an accepted APK until it is installed or the pending update is cancelled, and checks its hash again while copying it into the installer. When an update’s delay has passed, the pending action is cleared before the install starts, because a successful install restarts the app. If the install then fails, the update is dropped and the failure is shown on the phone; the owner sends it again.

key_add and key_remove

KeyTypeMeaning
public_keystring64 hex characters.
rolestringowner or partner.

A key_add with role partner MUST also carry a signature by the key it adds (step 7c). That proves the partner holds the key, and it is what lets the in-person join (Who may do what) work with the partner’s signature alone.

key_remove removes owner keys only; with role partner it is not_permitted. The partner is removed with partner_remove.

exit

The body is the empty object.

partner_remove

The body is the empty object. It removes the partner: the partner key and the partner phone secret.

phone_secret_allow

KeyTypeMeaning
rolestringowner or partner.

It clears that role’s phone secret, if any, and for 10 minutes lets a new one be set on the phone without the old one. It needs that role’s approval (Who may do what), which in practice is a signature by that role’s key.

Verification

Acceptance

The phone runs these steps in order and stops at the first failure. Each failure has a result code. The order is normative, because the shared vectors expect one specific code per input.

The inputs are the received bytes and the device state: lifecycle state, device ID (if any), enrolled owner keys, enrolled partner key (if any), whether an owner phone secret and a partner phone secret are set, whether the phone is ready for a partner key (Who may do what), the last accepted sequence number, the active config, whether a loosening action is pending, the waiting change (Waiting changes) if any, and the current time.

StepCheckCode on failure
1The envelope decodes (Envelope).malformed
2aThe payload is canonical JSON and its root is an object with an integer v.malformed
2bv is 1.unsupported_version
2cThe root has exactly the six keys of Payload, with the right types; device_id is 32 hex characters; expires > seq.malformed
2dtype is a known type.unsupported_type
2eThe body has the shape given in Payload for its type (config contents are checked later, in step 8).malformed
2fNo bytes follow the envelope, unless type is update.malformed
3aAn enrol has at least one signature.missing_signature
3bNo key ID appears twice.malformed
3cTaking the signatures in order: the key ID belongs to a known key, then the signature verifies. Every signature must pass, not just enough of them.unknown_key, bad_signature
4device_id equals the device’s ID. Skipped only for an enrol on a device that has no ID yet.wrong_device
5now < expires.expired
6aseq > last accepted sequence number. Skipped when completing a waiting change (Waiting changes).stale_sequence
6bseq ≤ now + 24 hours. Skipped when completing a waiting change.sequence_in_future
7aThe type is allowed in the current lifecycle state (Who may do what).wrong_state
7bThe action exists in the current mode (Who may do what). For enrol on an ARMED device (a re-pair): its config equals the config in force or is tightening.not_permitted
7cA key_add with role partner is signed by the key it adds; an enrol is signed by an owner key it lists.insufficient_signatures
7dFor config with replaces: replaces equals the config in force.config_changed
8For enrol and config: the config is valid.invalid_config
9aIf the approvals are complete and the action is delayed: no other loosening action is pending.pending_action_exists
9bIf the approvals present do not include every role the action requires (Who may do what), the bundle will wait (Waiting changes): the waiting slot is free, or holds this same payload.approval_pending
10aFor update: the APK is present, is apk_size bytes long and has SHA-256 apk_sha256. A connection must not also carry bytes after the envelope. When completing a waiting update, an APK may be left out; the one stored with the waiting change is used.apk_mismatch (malformed for the second sentence)
10bFor update: the APK may replace the installed app (update).apk_rejected

Known keys in step 3c are the enrolled owner and partner keys, and for a key_add with role partner, the key it adds. For an enrol bundle they are instead the keys listed in its own body, since nothing is enrolled yet; an enrolment is trusted on first use, which is safe because it is only accepted when nothing is enforced, or after the user started a re-pair on the phone itself; and a re-pair while armed cannot loosen the config (step 7b), so the new keys gain nothing that skips the delay.

Approvals in step 9 are the roles of the signatures that verified, plus, for a waiting change, the roles approved on the phone. A signature by the key a key_add adds is not an approval by anyone: it only proves the key is held.

Step 6b exists because the sequence number is a timestamp. Without it, one bundle with a far-future seq would make the phone refuse every later bundle.

On acceptance with complete approvals, the phone stores the greater of seq and the last accepted sequence number, then applies the action at once or starts its countdown. The sequence number is consumed either way, including when the countdown is later cancelled. A rejected bundle changes nothing except the event log. A bundle that waits consumes nothing yet.

The time used in steps 5 and 6 is the phone’s wall clock. While armed, the user cannot change it (the date and time restriction, with automatic time forced on).

Waiting changes

The phone keeps at most one waiting change: the envelope exactly as received (payload and the signatures that verified), the roles approved on the phone, and for an update, the APK. The result is ok with effect waiting (Result).

  • More signatures. A bundle whose payload bytes equal the waiting change’s payload is checked by the steps above, with steps 6a and 6b skipped, and its verified signatures are added to the stored ones (at most 8 in all). If the approvals are then complete, the change is accepted; otherwise it stays waiting. Any other bundle that would wait while one is waiting is refused with approval_pending; a bundle that does not need to wait is handled as usual and leaves the waiting change alone.
  • Phone approvals. A person who still has to approve types their phone secret on the phone. A right answer adds their role. If the approvals are then complete, the phone runs the steps again on the stored envelope, with 6a and 6b skipped, and accepts or drops it.
  • A tap. One case accepts a tap in place of an owner approval: a key_add with role partner that arrived while the phone was ready for a partner, when no owner phone secret is set. It adds a partner and so tightens protection.
  • Dropped. If a later check fails (for example expired or config_changed), the waiting change is dropped. pending_action_exists does not drop it; it stays waiting until the countdown is over or cancelled. It is also dropped when it expires, when it is cancelled on the phone, after an enrol, and at teardown.
  • Drafts. A draft has no signatures; every approval is given on the phone. The phone also makes drafts itself, for actions started on the phone (Request exit): a payload with its own device ID, seq set to now, and expires set to 7 days later.

Who may do what

Lifecycle states. enrol is accepted only when the device is UNARMED with no keys enrolled, or while it waits for a re-pair (the user tapped “Pair a new key”; in partner mode, after that action’s delay). An accepted enrolment replaces every key, clears both phone secrets and any waiting change, and ends the wait. Every other type requires keys to be enrolled.

Modes. Solo mode has no partner. Partner mode has a partner: a partner key, a partner phone secret, or both.

“Owner” below means a valid signature from any one enrolled owner key, or the owner phone secret typed on the phone for a waiting change. “Partner” means a valid signature from the partner key, or the partner phone secret typed on the phone.

ActionSoloPartner modeTiming while ARMED
config, tighteningOwnerOwnerImmediate
config, looseningOwnerOwner and partnerDelayed
updateOwnerOwner and partnerDelayed
key_add, role ownerOwnerOwner and partnerDelayed
key_add, role partnerOwner (a tap, while ready for a partner; 5.1)Partner, if the partner has no key yet; otherwise not_permittedImmediate
key_remove (owner keys)OwnerOwner and partnerDelayed
partner_removenot_permittedOwner and partnerDelayed
phone_secret_allow, role ownerOwnerOwnerImmediate
phone_secret_allow, role partnernot_permittedPartnerImmediate
exitOwnerOwner and partnerDelayed

Further rules:

  • key_add is not_permitted if the key is already enrolled in either role. key_remove is not_permitted if the role is partner, if the key is not an enrolled owner key, or if it is the last owner key.
  • “Delayed” means the action waits out the config delay tier in force when its approvals become complete. Whether a config bundle is tightening or loosening is decided by the classifier in the main specification; when in doubt it is loosening.
  • While UNARMED nothing is enforced, so every accepted bundle applies immediately once its approvals are complete.
  • Ready for a partner. On the phone, Add a partner, then Use a computer, makes the phone ready for a partner key for 10 minutes, or until the user stops it. It is offered only while there is no partner. A key_add with role partner that arrives then, signed only by the key it adds, waits for the owner to confirm on the phone (Waiting changes).
  • The actions started on the phone (pair a new key, cancel a pending action, cancel a waiting change, allow USB debugging, add a partner with a phone secret, set or change a phone secret) involve no bundle. Pairing a new key is immediate in solo mode; in partner mode it is a pending action (key_replacement) that waits the longer of the tier and 72 hours.
  • A re-pair enrol on an ARMED device must carry the config in force or a tightening of it; otherwise not_permitted (step 7b). Before arming nothing is enforced, so any valid config is accepted.

Connection protocol

A connection carries bundles and read-only requests between the CLI and the app over USB: through the USB accessory, or through adb. It adds convenience, not trust: the app treats everything it receives as untrusted input and runs Acceptance on every bundle. Both transports carry the same frames; only how a connection starts differs. Why it works this way is in Connecting.

The app serves a connection only while the phone is unlocked. While it is locked it answers with a BYE whose reason is locked, in place of the hello or of the next answer (Ending).

Transport

USB accessory (Android Open Accessory)

  • The CLI looks for a phone by its USB interfaces: MTP (ff/ff/00 named MTP), PTP (06/01/01) or adb (ff/42/01). It never sends the requests below to any other device. With --transport auto it does this only when no phone is reachable over adb.
  • It switches the phone into accessory mode with AOA requests 51 (get protocol, at least 1), 52 (strings) and 53 (start). The strings are manufacturer QuitLock, model QuitLock CLI, description QuitLock command-line tool, version 1, and an empty URI and serial. The phone comes back as 18d1:2d00, or 18d1:2d01 with adb.
  • Android starts the app’s AccessoryActivity for that accessory (res/xml/accessory_filter.xml), which has no screen; it opens the accessory and finishes. The app keeps it open, reading on one thread, until the cable goes: a closed accessory cannot be opened again while a read on it is still blocked.
  • Sync. Each connection starts with a sync record from the CLI: 16 bytes 00 'QuitLock-sync' 00 01, then a 16-byte random nonce. The app sends the same 32 bytes back and then the hello. The app discards everything before the record; the CLI discards everything before the answer (at most 4 MiB). A record that reached the phone while the app was not listening gets no answer; the CLI sends it again after 1.5 seconds without one. A different record arriving during a connection means a new computer took the cable: the app ends the old connection and answers the next copy.
  • Packets. Every write on either side ends in a short USB packet: a write whose length is a multiple of 64 is sent as two, the last byte apart. No side sends a zero-length packet. The app reads 16384 bytes at a time.
  • A connection ends with a BYE, a protocol error, or the cable going. After one ends the app listens for the next sync.

adb

  • The CLI first wakes the app: adb shell am broadcast --include-stopped-packages -a dev.t342.quitlock.LISTEN -p <application id>. The receiver requires android.permission.DUMP, which the shell has and no app can get.
  • The app then listens on a Unix socket in the abstract namespace named <application id>.session (so dev.t342.quitlock.session, or dev.t342.quitlock.dev.session for a dev build), until 30 seconds pass with no connection open. The CLI sends the broadcast again if it needs to.
  • The CLI reaches it with adb forward tcp:<port> localabstract:<name> and removes the forward when done.
  • The app checks the peer credentials of each connection and closes any whose UID is not the adb shell user (2000), without a hello. A dev build also accepts UID 0, because adbd runs as root on some emulator images.
  • Up to three connections at a time; a fourth gets a BYE with reason busy.
  • On an armed phone in a release build adb is on only during a debugging window (Connecting).

Frames

Each frame is a 1-byte type, a 4-byte length, then that many bytes of body. The length is at most 1 MiB. JSON bodies are canonical JSON.

TypeNameDirectionBody
0x01HELLOapp → CLIJSON, see 8.3. Sent once, first.
0x02REQUESTCLI → appJSON {"op":"status"}, {"op":"config"}, {"op":"waiting"} (Waiting change) or {"op":"log","from":<n>} (the event log). Read-only; no signature.
0x03RESPONSEapp → CLIJSON answer to a REQUEST.
0x04BUNDLECLI → appOne envelope, with nothing after it.
0x05APK_DATACLI → appA chunk of the APK for the preceding update bundle. At most 64 KiB per frame.
0x06APK_ENDCLI → appEmpty. All APK bytes have been sent.
0x07RESULTapp → CLIJSON, see 8.4. One per BUNDLE; for an update, sent after APK_END.
0x08BYEeitherFrom the CLI: empty, the connection is done. From the app: JSON {"reason":...}, see Ending.

An unknown frame type, an oversized frame or a frame out of order ends the connection.

Ending

The CLI ends a connection with an empty BYE, which the app does not answer. The app ends one itself with a BYE carrying a reason, sent in place of the hello or of the next RESPONSE or RESULT:

ReasonMeaning
lockedThe phone is locked. The CLI asks the user to unlock it and tries again for up to a minute.
busyToo many connections are open.
errorThe app failed while answering.

A reader treats any other reason as a plain end of the connection.

Hello

{"app_version":"0.1.0","build":"release","device_id":"514c…0d","last_seq":1799913600000,"mode":"solo","pairing":false,"protocol":2,"state":"armed"}
KeyValues
protocolConnection protocol version. 2 since 2026-12-01, when the phone began sending BYE with a reason and serving without a tap; the CLI refuses any other.
app_versionThe app’s version name.
buildrelease or dev.
device_id32 hex characters, or the empty string before enrolment.
statenot_owner (installed, not yet device owner), unarmed or armed.
modenone (no keys), solo or partner.
last_seqLast accepted sequence number; 0 if none.
pairingtrue while the phone waits for a re-pair enrolment. Added 2026-11-15; a CLI treats a missing key as false.
partner_readytrue while the phone is ready for a partner key (Who may do what). Added 2026-11-15, milestone 9; missing means false.

A phone that reports pairing accepts one enrolment, which must carry the device ID the phone already has. While armed, its config must be the one in force or tighter, so the CLI sends the config it reads with {"op":"config"}.

The hello is not signed and proves nothing. The CLI uses it for display and to pick the device ID for new bundles.

Status response

The answer to {"op":"status"}:

KeyMeaning
state, modeAs in the hello.
owner_keysThe enrolled owner public keys, 64 hex characters each; empty before enrolment. Added 2026-11-15.
partner_keyThe enrolled partner public key; present only in partner mode. Added 2026-11-15.
dns_host, delay_tierFrom the enrolled config. Absent until a config has been enrolled; never defaults.
self_checkA list of strings, one per problem the last self-check found while armed; empty if every policy was in place. Reading status runs no check.
pendingPresent only while an action is counting down: kind (config, key_add, key_remove, partner_remove, exit, key_replacement or update), remaining_ms, and deadline (Unix milliseconds, an estimate).
phone_secretsowner and partner, each present only when set: pin, password or (owner only) screen_lock. Added 2026-11-15, milestone 9.
waitingPresent only while a change waits (Waiting changes): type, approved and needs (lists of roles), expires (Unix milliseconds). Added 2026-11-15, milestone 9.

Waiting change

The answer to {"op":"waiting"} is {} when nothing waits, otherwise {"bundle":"<hex>","approved":[...],"needs":[...]}: the stored envelope (payload and its signatures, without any APK), and the roles. The CLI shows it with the same summary as inspect; a partner who approves adds their signature and sends the envelope back as a BUNDLE, which completes it (Waiting changes). The hex proves nothing by itself: the partner’s CLI checks the signatures it can and the phone checks them all again.

Result

{"code":"ok","effect":"delayed","deadline":1800086400000}

code is ok or a failure code from Acceptance. On ok, effect is immediate, delayed or waiting (Waiting changes; needs then lists the roles still to approve), and deadline (Unix milliseconds, an estimate for display) is present when delayed.

Event log

The answer to {"op":"log","from":<n>} is {"entries":[<line>,...],"next":<n>}: entries whose i is at least from, oldest first, each the exact stored line as a JSON string. next is present when there is more; ask again with from set to it. A missing from means 0. A page is at most about 256 KiB.

Each line is canonical JSON:

{"data":{"code":"ok","effect":"delayed","type":"config","via":"session"},"i":41,"kind":"bundle","prev":"9f2c…","t":1800000000000}
KeyMeaning
iEntry number, from 0, never reused. The phone keeps the newest 5000 entries, so the first line received may not be entry 0.
tThe phone’s wall clock, Unix milliseconds.
kindWhat happened; see below.
prevSHA-256, as 64 hex characters, of the previous entry’s line exactly as stored; 64 zeros for entry 0.
dataAn object, by kind.

A reader checks that each line’s prev is the SHA-256 of the line before it and that i goes up by one; for entry 0, that prev is all zeros. It hashes the received string, never a re-encoding. The chain makes later edits, removals and reordering visible; it is not signed, and is read over an unsigned connection.

kinddata
armdns_host, delay_tier
disarmhow: exit or dev_removal
teardownprivate_dns_left: the host Private DNS is still set to, only when it could not be set back to automatic
statestep: restored (the backup copy was used) or damaged (salvaged; see Damaged state); fields: the stored values that could not be read
upkeep_errorerrors: a list of strings, one for each step of the background check (due, removal, self_check, update) that threw. Written only when the list changes.
teardown_failedfailed: a list of strings, one for each step that did not take. Device owner is kept, and the phone tries again; written again only when the failures change.
removal_abandonedwhy: enrolled. A removal that had not finished was dropped because keys were enrolled again; without this the next background check would finish it and wipe the new enrolment.
debug_window_openlimit_ms. USB debugging was allowed on the phone (Connecting).
debug_window_closereason (time_limit, turned_off, tamper, app_stopped, error), open_ms. error: something failed while the window was opening, so it was closed at once. app_stopped: the app’s process ended with the window open and this entry was written when it next started.
session_open, session_closeWritten by versions before 2026-12-01, which had sessions; session_close has a reason and open_ms like debug_window_close. Readers still show them.
tamperwhat: a list of codes, one for each change against policy found while a debugging window was open; package for adb_install. Codes: proxy, private_dns, restrictions, auto_time, uninstall_block, wireless_debugging, background_restricted, battery_optimized, job_cancelled, app_unsuspended, adb_install. Always followed by a debug_window_close (in older logs, session_close) with reason tamper. A reader shows a code it does not know as it is.
bundletype (as the bundle claims, or unreadable), via (session for a connection, or file), code (Acceptance), effect when ok
pending_startkind (as in 8.3.1), delay_ms
pending_cancel, pending_donekind
configconfig: the whole config now in force
keysreason (enrolment, re_pair, key_add, key_remove, partner_remove), owner_key_ids, partner_key_id if any
waitingstep (started, approved, completed, cancelled, expired, dropped), type; role and via (phone, tap or signature) for approved; code for dropped
phone_secretrole, step (set, changed, removed, allowed, cleared), kind (pin, password, screen_lock) for set and changed. Never the secret.
phone_secret_wrongrole, failures (the count so far), wait_ms before the next try
partner_readystep (ready, stopped, expired)
re_pairstep: ready or cancelled
self_checkproblems: a list of strings, empty when problems found earlier have cleared. Written only when the list changes.
apppackage, step (suspended, resuspended, released), reason (blocklist, browser, untrusted_source, needs_approval) unless released
updatestep (installing, installed, failed), version, error when failed

Entries that follow from a bundle (pending_start, config, keys) come after its bundle entry. A reader shows kinds it does not know rather than rejecting the log.

Key files and partner files

CLI key file

This format never leaves the computer it is on, except as a backup made with quitlock key export. The phone never sees it; the phone stores public keys only.

A key file is exactly 136 bytes:

OffsetSizeField
04Magic: ASCII QLK1
44Argon2id memory cost in KiB
84Argon2id iterations
124Argon2id parallelism
1616Salt
3224XChaCha20-Poly1305 nonce
5632Ed25519 public key
8848Ciphertext: the 32-byte Ed25519 seed, encrypted, with its 16-byte tag
  • The encryption key is 32 bytes from Argon2id (version 0x13) over the passphrase and salt, with the parameters in the header.
  • The first 88 bytes (the whole header) are the associated data, so changing any header field makes decryption fail.
  • New files use 64 MiB, 3 iterations, parallelism 1. Because the parameters are stored per file, they can be raised later without a format change. A reader refuses parameters above 4 GiB, 64 iterations or parallelism 16.
  • The public key is readable without the passphrase, so quitlock key list can show key IDs.
  • The default file extension is .qlkey.
  • A key file may be rebuilt from its recovery phrase: the 32-byte seed as 24 words of the BIP-39 English word list, with BIP-39’s 8-bit checksum. The words encode the seed itself; BIP-39’s own seed derivation is not used.

Partner invite and reply files

These carry a remote partner’s key to the owner (Becoming a partner). Neither holds a secret, and neither is trusted: the phone checks the bundle in full, and the two people compare fingerprints.

Invite. Written by quitlock partner invite; the default name is quitlock-invite-<time>.json. One canonical JSON object (Canonical JSON) followed by a newline:

KeyTypeMeaning
quitlock_inviteintegerFormat version, 1. A reader refuses any other.
device_idstringThe phone’s device ID, 32 hex characters.
owner_keysarray of stringsThe owner public keys enrolled when the invite was made, 64 hex characters each, 1 to 8 of them, so the partner can read out their fingerprints.
createdintegerUnix milliseconds.
expiresintegerUnix milliseconds; 7 days after created. A partner’s CLI refuses an expired invite.

Reply. Written by quitlock partner join <invite>; the default name is quitlock-partner-reply-<time>.qlb. It is an ordinary bundle (Envelope): a key_add with role partner for the invite’s device, signed by the key it adds and by nothing else. It expires at the invite’s expiry or 7 days after it was made, whichever is first. quitlock partner accept checks that it is exactly that, then adds an owner signature and sends it; the phone applies it at once (Who may do what).

Fingerprint. The form people compare, here and on the phone: the first 8 bytes of the key ID in upper-case hex, in groups of four, for example A1B2 C3D4 E5F6 0718.

Test vectors

vectors/bundles.json holds the shared vectors. Each has:

FieldMeaning
name, descriptionWhat the vector exercises.
bundle_hexThe bytes as received.
deviceDevice state before the bundle arrives: state (unarmed or armed), device_id (or null), owner_keys, partner_key (or null), last_seq, pending_action, config (or null), awaiting_re_enrolment (true while waiting for a re-pair). Optional, each false or null when missing: owner_phone_secret and partner_phone_secret (true when set), partner_ready (true while ready for a partner key), waiting (the waiting change: bundle_hex and phone_approvals, a list of roles).
now_msThe device’s clock.
expect{"result":"accept"} or {"result":"reject","code":"<code from [Acceptance](verification.md#acceptance)>"}. An accept may carry "effect": immediate, delayed or waiting. It is present wherever the timing does not depend on the tightening classifier.

vectors/classifier.json holds cases for step 8 and for the tightening classifier: changes (a current and a proposed config, and expect: tightening or loosening) and configs (a config and whether it is valid).

vectors/keys.json lists the public keys and key IDs of the test keys. See vectors/README.md for how the vectors are generated and how to regenerate them.

Both test suites MUST run every vector and get the expected result. A vector is only ever changed together with this document.

Contributing

Rules

  • The invariants hold. If a change seems to need breaking one, stop and ask the project owner. Changing one is a decision, recorded in Decisions with its date and reason.
  • No networking code in the app, and no permission outside the list scripts/check-invariants.sh allows. The app holds INTERNET for the Private DNS call only.
  • Never commit keys, keystores or secrets. The release signing key exists only in CI’s secrets (Releasing). Test keys are derived from public labels, never stored.
  • Platform facts are checked before code relies on them, against current Android and Chrome documentation and, where possible, an emulator. Record what was found in Platform facts; what an emulator cannot show goes in Manual checks.
  • Debug-only code (instant removal, the developer tools) lives in android/app/src/debug, behind an interface in src/main and a null stub in src/release.
  • The book describes QuitLock as it is. A change that alters behaviour updates the page that describes it in the same commit series, and a decision that the docs did not settle goes in Decisions.

Commits

  • One concern per commit, small where possible.
  • Subject: a lowercase area prefix and a plain summary, for example cli: quitlock setup or core, app: sessions over the USB accessory. Areas: cli, core, app, docs, scripts, ci.
  • The body says why, and what a reader would not see in the diff.

Before sending a change

cd cli && cargo fmt --check && cargo clippy --all-targets --locked -- -D warnings && cargo test --locked
cd android && ./gradlew :core:test :app:assembleDebug :app:assembleRelease
scripts/check-invariants.sh
scripts/check-docs.sh

Device-owner behaviour also needs scripts/emulator-test.sh (Testing).

Repository

PathContents
android/core/Plain Kotlin, no Android dependency: bundle verification, the tightening classifier, the delay engine, the event log, the connection protocol, the USB accessory link. Tested without an SDK.
android/app/src/main/The app: enforcement (Enforcer, AppGuard, TamperWatch), connecting (Links, LinkService, DebugWindow), storage (StateStore, Events, Prefs) and the screens (MainActivity and its sub-screens, SettingsActivity, ConfigActivity, built on QuitLockActivity)
android/app/src/debug/Dev builds only: instant removal and the developer tools
android/app/src/release/Null stubs for the debug-only hooks
android/app/src/androidTest/Device-owner tests, run on an emulator
android/testapps/Code-free apps the app-rules tests install
cli/The quitlock command-line tool (Rust). src/lib.rs holds the library parts (bundles, keys, config, the connection client, transports); src/main.rs and setup.rs, provision.rs, partner.rs, tui.rs the commands.
protocol/vectors/Test vectors shared by both test suites (Test vectors)
docs/This book: docs/src/ is its source, docs/book.toml its settings
scripts/build.sh, check-invariants.sh, check-docs.sh, emulator-test.sh, verify-release.sh
.github/workflows/ci.yml on every push; release.yml on version tags; book.yml publishes this book

The shared vectors matter: the Rust code creates bundles and the Kotlin code verifies them, so both must agree byte for byte. Every bundle type has valid and invalid vectors (bad signature, wrong device, stale sequence, expired, unknown key).

Building

scripts/build.sh builds the CLI and the app into dist/, with a SHA256SUMS file:

scripts/build.sh                  # CLI and dev APK
scripts/build.sh cli              # CLI only
scripts/build.sh apk              # dev APK only
scripts/build.sh apk --release    # release APK, unsigned (signed releases come from CI)
scripts/build.sh --help           # all options: --version-code, --version-name, --target

It needs Rust for the CLI, and a JDK (17 or newer) and the Android SDK for the app. The SDK is found through ANDROID_HOME, ANDROID_SDK_ROOT, android/local.properties or ~/Android/Sdk. The book needs mdbook 0.5: mdbook serve docs shows it while you edit.

Dev and release builds

Dev buildRelease build
Package IDdev.t342.quitlock.devdev.t342.quitlock
SigningThe local debug keyThe release key, held only in CI’s secrets
testOnlytruefalse
Instant removal and developer toolsPresent (src/debug/)Absent
adb while armedLeft onOff except while USB debugging is allowed on the phone (5 minutes)
Arming without Chrome or an enrolled keyAllowedRefused

The release certificate’s SHA-256 is compiled into the release CLI (QUITLOCK_RELEASE_CERT_SHA256 at build time). A CLI built without it provisions dev builds only, and says so. Builds aim to be reproducible, so anyone can check a release against the source (Releasing).

Testing

cd cli && cargo test                 # CLI and shared test vectors
cd cli && cargo test -- --ignored    # also the test that talks to GitHub
cd android && ./gradlew :core:test   # Kotlin logic; needs only a JDK
cd android && ./gradlew :app:assembleDebug :app:assembleRelease
scripts/check-invariants.sh          # permissions, no networking code, no dev code in release
scripts/check-docs.sh                # the book builds, and its links resolve

CI runs all of these on every push.

What is tested where

  • Kotlin unit tests (android/core): bundle verification against the shared vectors, the tightening classifier, the delay engine with a fake clock, replay and expiry, waiting changes and phone secrets, the event log chain, the connection protocol (including the phone’s BYE), the USB accessory link over in-memory pipes.
  • Rust unit tests (cli): key files, recovery phrases, bundle creation against the shared vectors, config validation and diff, preflight parsers against captured command output, prompts, the USB accessory sync.
  • Transport parity: the same vectors give the same result over a connection and by file import.
  • Device tests (android/app/src/androidTest, on an emulator): arming and the self-check, policy drift and re-apply, teardown leaving nothing behind, app rules, updates, connecting and the debugging window (adb off after every kind of close, the time limit, a non-shell peer refused), the tamper watch, the PIN screen.

On an emulator

An AOSP image without Google services has no accounts, so the dev build can be made device owner directly. Boot one (the project uses AVDs named quitlock-36 and quitlock-29), then:

ANDROID_HOME=~/Android/Sdk scripts/emulator-test.sh

The script refuses to run against anything that is not an emulator. Emulators have no Chrome and no USB accessory; what they cannot show is in Manual checks.

Developer tools

A dev build has Settings, Developer tools: the app’s state (enrolment, keys, the config in force, the pending action, the connection and debugging window’s inner state), the event log with its chain checked and a filter by kind, and buttons to finish or shorten a countdown, drop the waiting change, end the partner-ready window, clear phone-secret lockouts, and run the self-check, the drift check, policy re-apply and upkeep. They change the dev build’s own state directly, so they are for testing flows quickly, not for checking that the rules hold.

Releasing

How QuitLock releases are made, and how anyone can check one. The workflow is .github/workflows/release.yml.

What a release contains

FileWhat it is
quitlock-<version>.apkThe app, signed with the release key
quitlock-<version>-linux-x86_64The CLI for Linux (static, musl)
quitlock-<version>-windows-x86_64.exeThe CLI for Windows
SHA256SUMSSHA-256 of each file above, as sha256sum writes it

While the repository is public, each file also has a build provenance attestation on GitHub: a signed statement that the release workflow built it from the tagged commit. (GitHub does not offer these for private repositories on ordinary plans, so the workflow skips the step there.)

The release CLI carries the SHA-256 of the release signing certificate. quitlock provision uses it to refuse an APK that claims to be QuitLock but is signed by anyone else. A CLI built without it (any local build) provisions dev builds only.

Release certificate SHA-256: not yet made. It will be written here once the key exists, and it never changes after that.

Checking a release

From the least effort to the most:

  1. The download is intact. In the folder with the downloads and SHA256SUMS:
    sha256sum -c SHA256SUMS --ignore-missing
    
    This only catches damage on the way: whoever could replace a file could replace SHA256SUMS too.
  2. GitHub’s workflow built it from the tagged commit, with the GitHub CLI:
    gh attestation verify quitlock-<version>.apk --repo <owner>/<repo>
    
  3. The APK is signed with the release key. Compare the certificate hash above with:
    apksigner verify --print-certs quitlock-<version>.apk
    
    (apksigner comes with the Android SDK build tools.) quitlock provision does this check for you.
  4. The files match the source. Check out the release’s tag and rebuild:
    git checkout v<version>
    scripts/verify-release.sh quitlock-<version>.apk quitlock-<version>-linux-x86_64
    
    For the APK, it builds the unsigned release APK at the same version and compares every file inside the two. The signature sits outside those files (APK Signature Scheme v2 and v3; the old v1 scheme, which adds files, is turned off), so any difference is real. For the Linux CLI, it builds with the same Rust version, target and path remapping as the workflow, with the certificate hash from the APK compiled in, and compares the two binaries’ SHA-256. The script’s header lists what it needs.

How reproducible the builds are has been checked locally only, not yet against a CI build:

  • Two builds of the CLI from copies of the source in different directories, with the workflow’s path remapping, gave byte-identical binaries (x86_64 Linux, glibc target; no local paths left in the binary).
  • A release APK built in a fresh copy of the source at a different path had exactly the same files inside as one built in the working tree and then signed.
  • A different JDK or Android build tools version may change the APK. The workflow uses Temurin 21 and the newest build tools on the runner; use the same if a comparison fails.

Making the release key (once)

The release signing key never exists on a developer machine (Building). It is made on a system that is not one, put into the repository’s secrets, backed up offline, and the system is then shut down.

The package ID is fixed before the first release. It is dev.t342.quitlock (Decisions). Android treats a different package ID as a different app, so it cannot change once phones run a release. It is under the owner’s domain t342.dev, which must stay renewed.

  1. Boot a clean system that is not a developer machine: for example, a Linux live USB on a computer whose disks are not mounted. It needs a JDK (for keytool), gh, and network access only for the upload in step 3.

  2. Make the key:

    keytool -genkeypair -keystore quitlock-release.p12 -storetype PKCS12 \
        -alias quitlock -keyalg RSA -keysize 4096 -validity 18250 -dname "CN=QuitLock"
    

    Choose a long random password (openssl rand -base64 30, written on paper). With PKCS12, the key password is the same as the keystore password. The key is valid for 50 years: Android refuses to update an app with a different key, so this one has to last.

    The distinguished name is written into the certificate, which anyone can read from every release with apksigner verify --print-certs. Android does not check it, and it cannot change without a new key. CN=QuitLock is enough; leave out personal names, email addresses and places.

    The alias does not matter either: the workflow signs with the keystore’s only key, whatever it is called. A keystore with more than one key is refused.

  3. Read the certificate hash (it shows the alias too):

    keytool -list -v -keystore quitlock-release.p12
    

    It is the SHA256: line, in upper case with colons. The workflow wants it as 64 lower-case hex digits with no colons:

    keytool -list -v -keystore quitlock-release.p12 | sed -n 's/.*SHA256: //p' | tr -d : | tr A-F a-f
    

    The certificate hash is public. It is a repository variable, not a secret, so it shows in logs and can be published.

  4. Put it into the repository. The secrets belong in an environment named release, not in the repository’s own secrets: repository secrets can be read by a workflow run from any branch, environment secrets only by jobs that the environment allows, here version tags.

    • In the repository settings, create the environment release (Settings → Environments). Under deployment branches and tags, allow only tags matching v*. Optionally, add required reviewers.
    • Add a ruleset protecting tags v*, so only maintainers can push them.
    • A secret is text, and the keystore is a binary file, so it is stored in base64. Turn it into text first:
      base64 -w0 quitlock-release.p12 > keystore.txt
      
    • In the browser: in the release environment, add the environment secrets QUITLOCK_KEYSTORE (paste the whole of keystore.txt, one line), QUITLOCK_KEYSTORE_PASSWORD and QUITLOCK_KEY_PASSWORD (the same password). Under Settings → Secrets and variables → Actions → Variables, add the repository variable QUITLOCK_RELEASE_CERT_SHA256 with the hash from step 3.
    • Or with the GitHub CLI, which needs --repo on a system without a clone of the repository:
      gh auth login
      R=<owner>/<repo>
      gh secret set QUITLOCK_KEYSTORE --env release --repo $R < keystore.txt
      gh secret set QUITLOCK_KEYSTORE_PASSWORD --env release --repo $R   # prompts
      gh secret set QUITLOCK_KEY_PASSWORD --env release --repo $R        # the same password
      gh variable set QUITLOCK_RELEASE_CERT_SHA256 --repo $R --body <the 64 hex digits>
      
    • Delete keystore.txt: it is the key, only encoded.
  5. Back it up offline: the .p12 file on two encrypted USB drives kept in different places, and the password on paper with each. If this key is lost, phones running QuitLock can never be updated again. They would need an exit (which waits out the delay) and a fresh install of a new key’s build.

  6. Shut the system down. Nothing of the key may stay on it or be copied to another computer. To read the backup again later (for its hash or alias), use a live system again, not a developer machine.

  7. Write the certificate hash at the top of this page and in Installing, and commit that.

Making a release

  1. Check that main is green in CI.
  2. Tag the commit and push the tag. The version is MAJOR.MINOR.PATCH, each from 0 to 999. The app’s versionCode follows from it (1.2.3 becomes 1002003), and Android refuses to update to a lower one.
    git tag -s v0.1.0 -m "QuitLock 0.1.0"
    git push origin v0.1.0
    
  3. The workflow then:
    • runs the tests;
    • builds the release APK and checks that it is the release package, at that version, not test-only;
    • signs it, and checks the signature against QUITLOCK_RELEASE_CERT_SHA256;
    • builds the CLI for Linux and Windows with the hash compiled in;
    • writes SHA256SUMS, attests every file, and creates a draft release.
  4. Read the draft. Download the files and check them as in “Checking a release”, at least steps 1, 3 and 4.
  5. Publish it. Only then does quitlock update --github see it.

A tag that is not vMAJOR.MINOR.PATCH, or a repository without the variable or the secrets, fails in the first job, before anything is built or signed.

Platform facts

QuitLock relies on these facts about Android and Chrome. Each was checked against current documentation, and where possible on an emulator, before the code relied on it. This page records the result for each: what was checked, where, when, and what was found.

Each item is checked in the milestone that first depends on it. Details for checked items are under Findings.

#AssumptionNeeded by milestoneStatus
1clearDeviceOwnerApp still works for a non-test device owner1Confirmed on API 36 and API 29 emulators; see below
2Chrome policy names, types and Android support4Confirmed from the Chromium source; behaviour in real Chrome not tested; see below
3How to learn about new installs reliably6Runtime receiver plus periodic job, checked on API 36 and API 29 emulators; see below
4Package visibility for listing apps and resolving browser intents6Needs QUERY_ALL_PACKAGES, even as device owner; checked on API 36; see below
5Installer-source API per API level; Play and F-Droid package names; adb installs6Confirmed for adb installs on API 36 and API 29 emulators; Play and F-Droid names from documentation only; see below
6Device owner can install an APK without a user prompt9 (done early)Confirmed on API 36 and API 29 emulators, with release-variant builds; dev builds cannot update themselves; see below
7DISALLOW_CONFIG_VPN stops installed VPN apps connecting4Documentation read; see below. Not yet tested
8Automatic-time API at API 29 versus 30 and later4Confirmed from documentation and by test; see below
9API level of the Private Space restriction4API 35; see below
10Ed25519 verification library for Android API 29 and later2Chosen: Bouncy Castle; see below
11Output formats of dumpsys account, pm list users, dumpsys device_policy7Captured on API 36 and API 29 emulators, with the dpm set-device-owner errors; accounts only without any; see below
12Private DNS call with unaffiliated users or profiles; result codes1Works only with the INTERNET permission; see below
13Device owner can toggle adb with no developer-options step3Confirmed on API 36 and API 29 emulators, and in a release build on API 36; see below
14adb authorisation survives adb being switched off and on3Cannot be checked on an emulator; on the manual checklist
15App-local socket reachable through adb forwarding; peer is checkable as shell3Confirmed on the API 36 emulator, partly on API 29; see below
16What an adb shell can change against a device owner3, 10Examined on API 36 and API 29 emulators: four ways through, each now caught by the tamper watch or the self-check; see below
17Where adb can push a file the system file picker can see3Confirmed on the API 36 emulator; see below
18FLAG_SECURE keeps screenshots and recordings out9Confirmed for screencap and screenrecord on API 36 and API 29; an accessibility service’s screenshot not checked; see below
19Views marked not important for accessibility are hidden from services9False; fixed with an accessibility delegate, tested on API 36 and API 29; see below
20Confirm-credential screen usable by the device owner app9Confirmed on API 29 with a PIN; see below
21Argon2id time on a low-end phone9Not checked: no such phone; see below
22The USB accessory transport on real phones12Not checked on a phone: emulators have no accessory; both ends’ logic unit-tested; see below

Findings

1. clearDeviceOwnerApp (checked 2026-11-14)

  • Documentation (DevicePolicyManager reference): deprecated since API 26, described as “expected to be used for testing purposes only”. It is still present and no restriction to test-only apps is stated. The reference also says clearing policies afterwards is “a best-effort process and some other policies will still remain in place”, which is why teardown undoes every policy itself before calling it (invariant 11).
  • Experiment: a debug-signed build without android:testOnly was made device owner on AOSP emulators and RemovalTest was run. The call succeeded and dpm list-owners reported no owners afterwards.
  • Not checked: real devices from any manufacturer. This goes on the manual checklist.

2. Chrome policies (checked 2026-11-14)

Source: the policy definitions in the Chromium repository (components/policy/resources/templates/policy_definitions/Miscellaneous/<name>.yaml, branch main).

PolicyTypeAndroid supportValue used
IncognitoModeAvailabilityinteger enumfrom Chrome 301 (disabled) when disable_incognito is on, else 0. Value 2 (forced) is not supported on Android.
ForceGoogleSafeSearchbooleanfrom Chrome 41as force_safesearch
DnsOverHttpsModestring enum: off, automatic, securefrom Chrome 85always off
URLBlocklistlist of stringsfrom Chrome 86chrome.url_blocklist
URLAllowlistlist of stringsfrom Chrome 86chrome.url_allowlist
ForceYouTubeRestrictinteger enum 0, 1, 2from Chrome 55not set; it is not among the Chrome settings and there is no config field for it

The app passes these to setApplicationRestrictions for com.android.chrome as an int, a boolean, a string and two string arrays, which are among the value types that method documents. Checked by test: the stored restrictions read back with these keys and values (PolicyTest). Not checked: that Chrome obeys them. The AOSP emulator images have no Chrome; this is on the manual checklist. Setting restrictions for a package that is not installed works.

3. Learning about new installs (checked 2026-11-15)

  • A manifest receiver does not get PACKAGE_ADDED. On the API 29 emulator the system log shows “Background execution not allowed” for it, as expected since API 26 made it an implicit broadcast. A receiver registered at run time does get it, also with RECEIVER_NOT_EXPORTED on API 33 and later (system broadcasts still arrive with that flag).
  • The app therefore uses three triggers: a runtime receiver for PACKAGE_ADDED and PACKAGE_CHANGED, registered whenever the app’s process starts; a periodic JobScheduler job every 15 minutes (the shortest period allowed), persisted across reboots; and the boot receiver. Each runs the self-check, which includes the app rules. The screen’s refresh runs it too.
  • Checked by test (AppRulesTest.aNewInstallIsCaughtWhileTheAppRuns): an app installed with the process running is suspended within 15 seconds without anything else being called. Passes on both images.
  • So an app installed while the process is not running can run for up to about 15 minutes before the job catches it. Not measured: how late the job runs under Doze on a real phone; the system may defer it further while the phone is idle.

4. Package visibility (checked 2026-11-15)

  • Being device owner gives no exemption from package visibility filtering (API 30 and later). Without a <queries> entry, getPackageInfo for a test app threw NameNotFoundException and getInstalledPackages left it out, on the API 36 emulator, with the app as device owner.
  • The app now holds QUERY_ALL_PACKAGES. It must see every installed app to judge it, and a <queries> element cannot name packages not known in advance. Play restricts this permission to listed uses; QuitLock is not published on Play (it is a device-owner app installed by the CLI), so this is accepted. API 29 has no visibility filtering and the permission does nothing there.
  • Browser detection asks the package manager for activities of that one package that handle ACTION_VIEW + CATEGORY_BROWSABLE for http:// and https:// links to a host that cannot exist (quitlock-browser-check.invalid, RFC 2606). An app that opens links only for its own sites does not match. MATCH_ALL is needed; without it the system answers only with the default browser. Checked by test with a code-free test app that declares only that intent filter (android/testapps/browser), on both images.
  • Cannot be detected: an app that shows web pages without declaring that it opens links (a “browser” inside another app). That is outside what the rules can see; see Known limits.

5. Installer source (checked 2026-11-15)

API levelCall usedadb install (pm install)pm install -i com.android.vending
30 and latergetInstallSourceInfo: initiatingPackageName, else installingPackageNameinitiating com.android.shell (API 36)initiating still com.android.shell; the installer name was not set (API 36, an image without Play)
29getInstallerPackageNamenot checked separatelyinstaller recorded as com.android.vending: adb can claim any installer
  • The initiating package is recorded by the system and cannot be claimed by the installer, so on API 30 and later an adb install is always recognised. The app treats com.android.shell as never trusted.
  • On API 29 the installer name can be faked from adb. Since adb is on only during a session, the app records when sessions are open and, on API 29, treats any app first installed during a session (with two seconds of slack either side) as coming through adb. Checked by test (AppRulesTest.anInstallDuringASessionIsNeverTrusted, which installs with -i com.android.vending during a session) on both images. From API 30 the window is not applied (changed 2026-11-15 at the owner’s request): there the initiating package is recorded by the system and an adb install always shows com.android.shell whatever -i says, as checked on API 36, so a real Play Store install that happens to finish during a session is judged normally. API 30 to 35 were not run; that they behave like 36 rests on the documentation of InstallSourceInfo.getInitiatingPackageName (added in API 30). The decision itself is unit-tested (AppRulesTest.theSessionWindowCountsOnlyWhereTheInstallerCanBeFaked).
  • Package names of the default trusted installers: com.android.vending (Play Store) and org.fdroid.fdroid (F-Droid). From documentation only; the test images have neither. Not checked: what is recorded when F-Droid installs through its privileged extension (org.fdroid.fdroid.privileged), or by F-Droid forks and other stores. Those can be added to trusted_installers. On the manual checklist.

6. A device owner installing an APK without a prompt (checked 2026-11-15)

Pulled forward from milestone 9 at the project owner’s request.

  • Silent self-update works on the API 36 and API 29 emulators: a PackageInstaller session created and committed by the device owner app installs a newer version of the same app with no prompt. No extra permission was needed (no REQUEST_INSTALL_PACKAGES). The app stays device owner, its stored state survives, and the process restarts. Checked by hand with release-variant builds signed with a throwaway key, versions 1 to 2 (API 36) and 1 to 3 (API 29).
  • A dev build cannot update itself. It is marked testOnly, and the installer then fails with INSTALL_FAILED_TEST_ONLY. Setting the hidden INSTALL_ALLOW_TEST flag by reflection was allowed by the hidden-API check but had no effect (API 36): the platform evidently honours it only for installs from the shell. Dev builds are updated with adb install -t -r; the CLI warns.
  • Reading an archive’s signer: on API 29, getPackageArchiveInfo(path, GET_SIGNING_CERTIFICATES) returns signingInfo == null. Adding GET_SIGNATURES to the flags fills it. On API 36 the PackageInfoFlags form works with GET_SIGNING_CERTIFICATES alone. The app passes both flags below API 33; API 30 to 32 were not tested. UpdateTest covers this on both test images.
  • Refused, on both images, with apk_rejected before anything was consumed: an older version code, the same package signed by another key, and another package. A bundle whose APK was changed after signing was refused with apk_mismatch.
  • On API 36 the delayed path was run with a dev build: the APK was kept through the countdown, a cancel deleted it, and when the countdown was made to finish (by editing the dev build’s stored state) the install ran and its result (INSTALL_FAILED_TEST_ONLY, as expected for a dev build) was shown on the status screen.
  • A side note from testing: adb uninstall of a device owner app on API 29 left the device-owner record in place with no active admin, and installs then needed user confirmation (STATUS_PENDING_USER_ACTION). That emulator had to be wiped. Normal use never uninstalls a device owner app this way.

Not checked: a real phone; a delayed update reaching a real install (needs a release build armed; on the emulator a stub app named com.android.chrome makes that possible, see item 13, but the update itself was not run); updates across an Android version upgrade.

7. DISALLOW_CONFIG_VPN (documentation read 2026-11-14)

The UserManager reference says the restriction “also prevents VPNs from starting”, and that from Android 12 (API 31) enforcing it “clears currently active VPN if it was configured by the user”. So on API 29 and 30 a VPN that is already connected when QuitLock arms may stay up until it next restarts. To be tested with a real VPN app in milestone 4.

8. Automatic time (checked 2026-11-14)

setAutoTimeEnabled was added in API 30; setAutoTimeRequired is deprecated from API 30 in its favour. The app calls setAutoTimeEnabled(true) on API 30 and later and setAutoTimeRequired(true) on API 29, with DISALLOW_CONFIG_DATE_TIME on both. PolicyTest confirms the auto_time setting is 1 after arming on the API 36 and API 29 emulators.

9. Private Space restriction (documentation read 2026-11-14)

UserManager.DISALLOW_ADD_PRIVATE_PROFILE was added in API 35. The reference says that on a device with a device owner the default is already true “and the device owner currently cannot change it to false”. So Private Space is blocked on any QuitLock phone from provisioning on, not only once armed, and teardown has nothing to undo for it beyond clearing device owner.

10. Ed25519 verification on Android (checked 2026-11-14)

  • The platform’s own Ed25519 support is not available across the supported range: it arrived in the Android 13 (API 33) crypto provider, and the minimum here is API 29. This is from memory of the platform release notes and was not re-read; it does not matter for the choice below, which avoids the platform provider entirely.
  • Chosen: Bouncy Castle bcprov-jdk18on 1.87, using the low-level org.bouncycastle.math.ec.rfc8032.Ed25519.verify. It is pure Java with no dependence on the Android version or on any security provider being registered, so the same code runs in JVM unit tests and on the phone.
  • Checked by test: all shared vectors pass in android/core on the JVM, including a signature with the group order added to S, which it rejects, as does the Rust side (verify_strict).
  • Not checked: the verifier running on a device. Nothing on the phone calls it until milestone 3. The dependency makes the unshrunk release APK about 8 MB; code shrinking for the release build is a milestone 10 matter.

11. Preflight command output (checked 2026-11-15)

Captured on the API 36 and API 29 emulators into cli/tests/fixtures/preflight/api36 and api29; the parsers in cli/src/preflight.rs are tested against them.

  • pm list users: the same on both, Users: then one UserInfo{id:name:flags} line per user, running after it when running. A name given to pm create-user through adb shell is cut at the first space by the phone’s shell (it is not quoted), so the test user is just “Preflight”.
  • dumpsys account: a block per user (User UserInfo{0:Owner:...}:) with Accounts: N. No account could be added on these images (no Google services), so the line for an account, Account {name=..., type=...}, comes from the AOSP source (AccountManagerService) and the test using it is synthesised, not captured. The parser keeps the type and drops the name at once. Check against a real phone with accounts.
  • dumpsys device_policy: with a device owner, both show a Device Owner: heading with admin=ComponentInfo{package/class} under it; API 29 also has package=. Without one, API 36 still prints Device Owner Type: -1, so the parser matches the heading exactly. A profile owner’s heading (Profile Owner (User N):) is from the AOSP source; not captured, since a work profile could not be made on these images.
  • dpm set-device-owner errors. API 36 prints Exception occurred while executing 'set-device-owner': and the exception with its stack; API 29 prints only the exception for some errors, and for an unknown component the whole dpm usage text, then Error: Unknown admin: ... (API 36 says Invalid component ... for device owner). The usage text mentions device and profile owners, so errors are matched on the Error: and ...Exception: lines only. Captured: several users, already set, unknown admin.
  • On API 36, the attempt after a refused one failed with Not active admin, and the one after that worked. The refused attempt seems to leave an admin half set up. quitlock provision tries once more after two seconds when it sees that. On API 29 the next attempt simply worked.
  • dpm list-owners does not exist on API 29, so the CLI reads dumpsys device_policy for owners on every version.
  • The emulators report ro.product.manufacturer as unknown; the manufacturer notes were not seen on a real phone.
  • A real phone (2026-12-01): a Samsung Galaxy S20 FE on Android 13 was set up end to end by quitlock setup (the owner’s test, dev build): preflight, device owner, enrolment, arming. Its output was not captured as fixtures.

12. Setting Private DNS (checked 2026-11-14)

Enforcement calls setGlobalPrivateDnsModeSpecifiedHost and check its result code.

What the reference documents: the result codes PRIVATE_DNS_SET_NO_ERROR (0), PRIVATE_DNS_SET_ERROR_HOST_NOT_SERVING (1), PRIVATE_DNS_SET_ERROR_FAILURE_SETTING (2); that the call blocks on “a connectivity check to the resolver”; and that it fails when unaffiliated secondary users or profiles exist.

What it does not say, found by experiment on the API 36 emulator:

  • The connectivity check runs inside the calling app’s own process (android.net.PrivateDnsConnectivityChecker, called from DevicePolicyManager, seen in a stack trace). Without the INTERNET permission the app cannot open a socket, the check fails with EPERM, and the call returns HOST_NOT_SERVING every time without reaching the system service.
  • This contradicted invariant 4 as first written (no INTERNET). Decision by the project owner, 2026-11-14: the app holds INTERNET for this one call, and invariant 4 was amended. scripts/check-invariants.sh now enforces an exact list of permissions and the absence of networking code instead.
  • With an unaffiliated secondary user present, setGlobalPrivateDnsModeOpportunistic throws SecurityException (“operation not allowed when device has unaffiliated users”) rather than returning code 2. The code treats an exception from either call as a failure.

How the code uses it:

  • Arming uses the documented call only. No network, or a host that does not serve DNS over TLS, means arming is refused and nothing is left applied (ArmTest.armIsRefusedWhenTheResolverCannotBeReached).
  • Self-check repair tries the documented call, and if that fails writes the settings private_dns_specifier and private_dns_mode directly with DevicePolicyManager.setGlobalSetting, which makes no connectivity check. So a drifted setting is restored even offline (ArmTest.selfCheckRestoresDnsEvenWhenOffline).
  • Teardown uses setGlobalPrivateDnsModeOpportunistic, with the same direct write as fallback so that extra users cannot block removal.

About the fallback: the setGlobalSetting reference lists the settings it supports and these two are not among them. The system accepted them on the API 29 and API 36 emulators, including with an unaffiliated user present, but this is undocumented and a future Android version or a manufacturer build could refuse it. If it is refused, the self-check reports that it could not re-apply the setting.

Also observed with the filter in place (API 36 emulator): a domain in the blocked category stopped resolving and an ordinary domain still resolved.

Not checked: real devices; teardown with an unaffiliated user present was tested with the earlier settings-only code, not re-run since the documented call was put first.

13. Device owner switching adb on and off (checked 2026-11-14)

  • Documentation: the setGlobalSetting reference lists Settings.Global.ADB_ENABLED as supported and says to use it “to turn adb on”, with UserManager.DISALLOW_DEBUGGING_FEATURES to stop the user enabling it. The restriction’s own entry says that set by a device owner “it disables debugging features altogether, including USB debugging”.
  • Experiment (AdbLockTest): arming set adb_enabled to 0 with the restriction on, and the host lost its adb connection. Opening a session cleared the restriction and set adb_enabled to 1; closing it, and the time limit, reversed that. No developer-options step was involved. Setting adb on by hand while no session was open was caught and reversed by the self-check.
  • Release build (2026-11-16, API 36 emulator): a release APK signed with a throwaway key, made device owner, enrolled with a CLI carrying that key’s certificate hash, and armed (with a stub app installed as com.android.chrome, since arming needs Chrome). On arming, adb devices showed the emulator offline. A tap on Connect to PC, sent through the emulator console, brought adb back; quitlock status reported “0.1.0 (release build)”, all policies in place; adb was offline again as soon as the CLI finished.
  • Not checked: a real phone, where developer options may additionally have to be enabled once for adb to start. On the manual checklist (Manual checks).

14. adb authorisation surviving an off/on cycle

The AOSP emulator images have ro.adb.secure=0, so there is no authorisation to lose. This can only be checked on a real phone.

15. Session socket through adb (checked 2026-11-14)

  • An abstract-namespace LocalServerSocket in the app is reachable with adb forward tcp:0 localabstract:<name>; tcp:0 makes adb pick a free port and print it.
  • LocalSocket.getPeerCredentials() reports UID 2000 (shell) for a connection that arrives through adb: the CLI completed sessions against the API 36 emulator with the check in force. A connection from the app’s own UID is refused (then SessionTest, now LinksTest; API 36 and API 29).
  • On API 29 the full path through adb was not exercised with the CLI; only the listening socket, the refusal of a non-shell peer, and that adb shell runs as UID 2000 there.
  • Closing a LocalServerSocket does not wake a thread blocked in accept(); the app wakes it with a throwaway connection.

16. What an adb shell can change (checked 2026-11-16)

Checked on the API 36 and API 29 AOSP emulators, with the dev build armed as device owner, by running each command from adb shell (UID 2000, the same as a session gives).

Refused, on both API levels:

CommandResult
settings put global private_dns_mode off, ... private_dns_specifier <host>Silently ignored: the value stays (the DISALLOW_CONFIG_PRIVATE_DNS restriction covers shell writes)
settings put global auto_time 0Silently ignored
am force-stop, am stop-app (API 36)Ignored: logcat says “Ignoring request to force stop protected package”
pm clearRefused (API 36: no CLEAR_APP_USER_DATA; API 29: “protected package”)
pm disable-userRefused: “Cannot disable a protected package”
pm suspend of QuitLock; pm unsuspend of an app QuitLock suspendedAPI 36: no change; API 29: “Cannot suspend/unsuspend packages. User 0 has an active DO or PO”
pm hideNeeds MANAGE_USERS
pm uninstall [-k] --user 0DELETE_FAILED_DEVICE_POLICY_MANAGER (36), DELETE_FAILED_OWNER_BLOCKED (29)
pm create-userRefused: no_add_user
setprop persist.sys.safemode 1Refused
pm revoke of QUERY_ALL_PACKAGESNot a changeable permission
am set-standby-bucketIgnored: a device owner stays EXEMPTED (36) or ACTIVE (29)
am crash (API 36)No effect

Allowed:

  1. A global proxy (settings put global http_proxy host:port). The system copies it into global_http_proxy_host, and the shell can also write that directly. The self-check clears it with setRecommendedGlobalProxy(null), but the http_proxy string stays, a device owner cannot clear it, and at the next boot Android turns it back into a global proxy (seen on API 36 after a cold start). The boot receiver’s self-check clears that each time. The self-check now also reports the stored string, with the command that removes it (adb shell settings delete global http_proxy, while USB debugging is allowed).

  2. Cancelling QuitLock’s jobs (cmd jobscheduler cancel <package>). Without the periodic job nothing checks while the app is closed. The self-check now schedules it again.

  3. Restricting QuitLock in the background (cmd appops set <package> RUN_ANY_IN_BACKGROUND ignore). Settings cannot do this for a device owner: on both API levels its battery page shows the control greyed out (“Background usage can’t be restricted” on 29, “This app requires unrestricted battery usage” on 36), and its battery optimization list says “Battery optimization not available” for QuitLock. Only a shell can set it, and a device owner cannot lift it. What it does differs:

    • API 29: the periodic job never runs (dumpsys jobscheduler shows readyNotRestrictedInBg: false).
    • API 36: no effect on the job (readyNotRestrictedInBg: true, job marked “User BG restricted”), since a device owner sits in the EXEMPTED standby bucket.
    • On Android’s power allowlist (cmd deviceidle whitelist +<package>), the job is ready again on API 29 with the restriction in place.

    A device owner cannot add itself to that allowlist: DevicePolicyManager.setApplicationExemptions needs MANAGE_DEVICE_POLICY_APP_EXEMPTIONS, which is internal|role (API 36 emulator). Settings showing QuitLock as not optimized does not put it on the list either (dumpsys deviceidle whitelist does not name it). So QuitLock asks once before arming, through the system dialog (ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS, permission REQUEST_IGNORE_BATTERY_OPTIMIZATIONS). A shell can take it back (cmd deviceidle whitelist -<package>), which the tamper watch counts (battery_optimized). The self-check reports a restriction with the adb command that lifts it, and a missing exemption with a tap that asks again.

  4. Killing QuitLock’s process with am kill once the app is not on screen. Combined with 3 (on API 29, without the battery exemption), during a session this would leave adb on until the next boot or until the app is opened. Now, a foreground service runs for the length of each session, and am kill left the process alone with it running (both API levels). A process that dies anyway is followed by a one-off job just after the session’s time limit, and its session is logged as closed (app_stopped) when the app starts again.

The tamper watch (TamperWatch) checks, every second and at once on any global setting change, install, unsuspension or restriction change, for: a proxy, Private DNS mode or lock, the restrictions, automatic time, the uninstall block, wireless debugging, a background restriction, the periodic job, released apps, and an install that came through adb. The first finding ends the session, is logged and is repaired by the closing self-check. A background restriction or missing battery exemption that was already there when the session opened does not end it: QuitLock cannot undo either, and the restriction can only be lifted from a session. TamperTest covers the proxy, the job, the background restriction and the battery exemption (each new and existing), an install over adb, drift from before the session and QuitLock’s own changes, on both API levels.

Checked by hand only: that am kill leaves the process alone during a session (the instrumented test runs in the app’s own process); that a session whose process was killed (as root, standing in for a crash or a low-memory kill) is logged as app_stopped when the app next starts. On API 29, with the process killed and the app left alone, the one-off job started it again 6 minutes after the session opened (the limit is 5 minutes; the job may run from 30 to 60 seconds after it), which logged the session as closed; the self-check that turns adb off in that case is covered by AdbLockTest.

Not checked:

  • Wireless debugging. settings put global adb_wifi_enabled 1 stayed 0 on the API 36 emulator, which has no real Wi-Fi to debug over. Whether a device owner may write it with setGlobalSetting is not known; the code tries and relies on DISALLOW_DEBUGGING_FEATURES otherwise.
  • Commands not tried: device_config, cmd overlay, cmd role, cmd netpolicy, and settings in the secure and system tables beyond those above. The watch looks only at global settings. None of those found so far affects DNS, restrictions or app suspension, but the list of shell commands is long and changes with each Android version.
  • Real phones. Manufacturer builds add their own shell commands and may treat a device owner differently.

In a release build (2026-11-16, API 36 emulator, the build described under item 13): dpm remove-active-admin was refused (“Attempt to remove non-test admin”), and adb uninstall and pm uninstall --user 0 gave DELETE_FAILED_DEVICE_POLICY_MANAGER, all before arming. Armed, in a session opened on the phone, settings put global http_proxy ended the session: adb was offline 222 ms later. The next session’s quitlock log pull showed the tamper entry, the closing self-check clearing the proxy, and an intact chain.

Known and not closed here: adb reboot recovery reaches recovery mode, where a factory reset removes QuitLock (a known limit); a phone can also be put into recovery with its buttons.

17. Getting a bundle file to the file picker (checked 2026-11-14)

A file pushed with adb push <file> /sdcard/Download/ appears under Downloads in the system file picker opened by ACTION_OPEN_DOCUMENT, and importing it worked. It did not appear under Recent. Checked on API 36 only.

18. FLAG_SECURE against screenshots and recordings (checked 2026-11-15)

  • API 36 emulator: adb exec-out screencap while the PIN dialog was open gave the rest of the screen with the dialog’s area solid black.
  • API 29 emulator: screencap refused to capture at all while the dialog was open (no output, exit status 1), as it did for Android’s own confirm-credential screen. A 3-second screenrecord showed the dialog’s area black.
  • Not checked: a screenshot taken by an accessibility service (AccessibilityService.takeScreenshot, API 30 and later).

19. Hiding views from accessibility services (checked 2026-11-15)

  • IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS is not enough. A service that sets FLAG_INCLUDE_NOT_IMPORTANT_VIEWS sees such views anyway, and any service may set it. uiautomator dump, which does so by default, listed every key label of the password keyboard on API 29; a test listening that way received TYPE_VIEW_CLICKED with the text 7, then 3, as the keys were pressed: the PIN, digit by digit.
  • What works: an AccessibilityDelegate on the keys and the typed-text display that gives their node no text, content description or hint, and sends no events, and on the dialog’s root one whose onRequestSendAccessibilityEvent returns false, so nothing from inside reaches a service. From Android 14 the root is also marked ACCESSIBILITY_DATA_SENSITIVE_YES, which keeps it from every service that is not an accessibility tool.
  • SecretPadTest (instrumented) checks it: listening as a service that includes not-important views, it sees the dialog’s title but no key label, nothing typed and no click. It fails on the earlier code and passes on the new, on API 29 and (from 2026-11-16) API 36.
  • A service can still see that the dialog has unlabelled clickable boxes, and their positions. Without events it cannot tell which were pressed.

20. Confirming the phone’s screen lock (checked 2026-11-15)

API 29 emulator, with a PIN set by locksettings set-pin: once the phone had a screen lock, “This phone’s screen lock” was offered for the owner. KeyguardManager.createConfirmDeviceCredentialIntent opened Android’s ConfirmLockPassword from the device owner app. A wrong PIN kept that screen up; the right one returned RESULT_OK and the draft waiting for the owner was approved. Back returned without RESULT_OK and the change kept waiting. Not checked on API 36, or with a pattern or biometrics.

A side effect seen on the way: after a restart with a screen lock set, the app’s activity “does not exist” until the user unlocks, because the app is not direct-boot aware. Enforcement does not depend on the activity.

21. Argon2id time on a low-end phone

Not checked: there is no low-end phone here. On the emulators (x86_64, desktop CPU) setting and checking a phone secret at 64 MiB and 3 iterations took well under the 4 seconds the scripted steps waited. The parameters are stored with each secret, so they can be lowered for new secrets if a real phone is too slow.

22. The USB accessory transport

Not checked on a phone: emulators have no USB accessory, and no phone was attached. What was checked:

  • Both ends’ logic, in unit tests. AccessoryLinkTest (Kotlin, android/core) drives the phone’s link over in-memory pipes: stale bytes and an old sync before a session listens are discarded; the sync is answered before the hello; a session served over adb gets no answer; a closed session’s channel can neither read nor write into the next one; whole-packet writes are split; the cable going ends the link. aoa.rs (Rust) tests the CLI’s search for the answer at every split point, past stale bytes, an older answer and a near miss.
  • No other device is touched. On the development PC (a Keychron keyboard, a Razer mouse, an Elgato Stream Deck and an ASUS AURA LED controller, whose interface is vendor-specific ff/ff/ff), no device matched the filter, so none was opened or sent a request.
  • Builds: the CLI type-checks and passes clippy for Linux (glibc and musl) and Windows; nusb is a Linux-only dependency, so the Windows build does not change.

What rests on documentation and kernel source, to be checked on phones (Manual checks):

  • AOA requests 51 to 53 work in MTP, PTP and charging-only modes; the phone re-enumerates as 18d1:2d00 (or 2d01 with adb).
  • Closing an accessory file descriptor does not wake a blocked read, and opening it again fails until that read returns (f_accessory’s exclusive open). This is why the link stays open between sessions.
  • A read shorter than a packet loses data, and a zero-length read reaches Java as the end of the stream. This is why the app reads 16384 bytes at a time and neither side sends a zero-length packet.
  • Turning adb on while in accessory mode re-enumerates USB; the app reopens the accessory after a second.
  • The “Always” choice in Android’s attach dialog grants the accessory permission for later sessions.

Other findings

  • DISALLOW_ADD_MANAGED_PROFILE is always in force on a device with a device owner, armed or not, and clearing it as device owner has no effect (API 36 and API 29 emulators). The app still applies it at arm, which is harmless, and it goes away when device owner is cleared.
  • ACTION_DELETE for the app’s own package needs REQUEST_DELETE_PACKAGES. Without it the system uninstaller refuses silently. The app declares it; the user still confirms in the system prompt.
  • The API 37.0 AOSP emulator image (revision 6) does not boot: system_server crashes in a loop in AdvancedProtectionService. Device tests run on API 36 and API 29 instead.

Manual checks

What the emulators cannot show (Testing). Each item says how to check it and what should happen. When one is done, record the phone, its Android version and the result under the matching item in Platform facts.

Use a phone you can wipe. Use a release build where the item says so; elsewhere a dev build will do (it can be removed instantly with Remove now). A release build that is armed can only be removed by an exit that waits out the delay, so set the delay tier to short (3 hours) in its config first.

Setting up

  • Provisioning on real phones (platform facts, item 11). Run quitlock provision --check on a phone with a Google account, a second user and, on a Samsung, Secure Folder. Expected: each is listed, accounts by type only, never by name. Then quitlock provision gets the phone to device owner. Note anything a manufacturer does differently, for Samsung, Xiaomi and OnePlus at least.
  • adb on Windows. Run the Windows CLI against a phone through the Google USB driver, and the manufacturer’s driver if there is one. Expected: provision --check and quitlock status work.
  • The battery dialog on manufacturer builds. Tap Arm. Expected: Android’s dialog asking to let QuitLock run in the background. After Allow, the self-check is clean. Some manufacturers add their own battery managers; note whether QuitLock shows up in them and whether they can restrict it.

Connecting (any build unless noted)

  • No tap. (Galaxy S20 FE, Android 13, dev build, armed, 2026-12-01: quitlock status in 0.4 seconds.) On a phone set up with quitlock setup (not armed), run quitlock status with the phone unlocked. Expected: the answer within about 2 seconds, nothing tapped on the phone.
  • adb not authorised. Revoke USB debugging authorisations in Developer options, replug, and dismiss the prompt. Run quitlock setup and quitlock status. Expected: both stop at once and say to accept “Allow USB debugging?”.
  • Locked. Lock the phone and run quitlock status. Expected: “The phone is locked” and a wait; unlocking within a minute lets it finish. Lock the phone during quitlock dash. Expected: it says the phone is locked, and reconnects after unlocking.
  • Setup twice. Run quitlock setup again with a different setting. Expected: no “already has keys” stop; it sends a config change, reads it back and shows the settings match. The main screen shows the new settings.
  • Old app. With an app from before 2026-12-01 on the phone, run quitlock status. Expected: it says the app did not answer and to update it.

USB accessory (Linux computer, release build armed)

  • First connection (platform facts, item 22). With the phone in file transfer mode, run quitlock status. Expected: Android asks which app to open for the QuitLock CLI. Choose QuitLock and Always. Expected: the status appears with nothing else tapped; adb stays off throughout (adb devices lists nothing).
  • The other USB modes. Repeat from charging only, and from photo transfer (PTP). Note whether the CLI finds the phone in each.
  • Later connections. Run quitlock status twice more, unplugging between them and not. Expected: no dialog after Always; each works.
  • A large transfer. quitlock log pull with a long history, and quitlock update with a release APK. Expected: no hang, no error.
  • Killed CLI. Press Ctrl-C during quitlock dash, then run quitlock status with the cable still in. Expected: it works (the stale data is skipped).
  • Without permission. On a Linux account without the udev rule, expected: the CLI prints the rule. After installing it and replugging, it works.

The debugging window (release build, armed)

  • adb switched by the device owner (platform facts, item 13). Arm. Expected: the computer loses adb; quitlock status --transport adb says to tap Allow USB debugging. Tap it. Expected: adb comes back, with no developer-options step; several commands work in a row; the screen counts down from 5:00; at 0:00 adb goes, and the history shows it opened and closed.
  • Turn off. Allow USB debugging, then tap Turn off, on the screen and in the notification. Expected: adb goes at once.
  • adb authorisation survives (platform facts, item 14). Open a second window. Expected: no new “Allow USB debugging?” prompt on the phone.
  • Wireless debugging (platform facts, item 16). If the phone offers it: try to turn it on during a window. Expected: the window closes, and wireless debugging is off afterwards.
  • Shell commands the emulators lack. During a window, look at adb shell cmd -l for manufacturer services, and try any that look as if they could change networking, apps or policy. Expected: either refused, or the window closes. Add what is found to platform facts, item 16.

The main screen

  • Each stage says one thing. Not set up (app installed, not device owner), almost set up (device owner, before enrolment: stop quitlock setup after the device-owner step), not armed, armed. Expected: the main screen, Settings and Propose a change agree each time; no settings are shown before enrolment.

Filtering

  • Chrome obeys its managed settings (platform facts, item 2). With real Chrome, after arming: incognito is unavailable; a Google search shows SafeSearch locked on; Chrome’s secure DNS setting is off and managed; a domain from url_blocklist is blocked; a domain from url_allowlist opens if the DNS provider allows it.
  • DNS fails closed. On a network that blocks port 853 (DNS over TLS), or with a firewall rule doing so, expected: no names resolve, and nothing falls back to unfiltered DNS. Back on a normal network, browsing works again.
  • A VPN app (platform facts, item 7). Install a VPN app before arming, then arm. Expected: it cannot connect.

App rules

  • Installs from stores (platform facts, item 5). After arming, install an app from the Play Store and one from F-Droid. Expected: both run. Install one from a browser download. Expected: suspended, and listed on the status screen. Also note what is recorded for F-Droid’s privileged extension, if present.
  • A new browser from the Play Store. Expected: suspended.
  • What the phone needs is kept (milestone 14). With a password screen lock, blocklist the keyboard in use, the home screen, the dialer and com.android.settings, then push the config. Expected: none of them is suspended, the status screen names them as kept, and after a reboot the password can be typed. Note which packages the maker uses for each.
  • How late the periodic check runs (platform facts, item 3). With QuitLock’s process stopped (reboot, don’t open it), install an app from a browser download and leave the phone idle. Note how long until it is suspended, with the battery exemption allowed.

Secrets and screens

  • Argon2id timing (platform facts, item 21). On a low-end phone, set a phone PIN. Expected: a few seconds at most.
  • Screen lock as the owner’s approval (platform facts, item 20). On API 36 or later, and with a pattern or a fingerprint: approve a draft with the phone’s screen lock. Expected: success approves it; Back leaves it waiting.
  • An accessibility service’s screenshot (platform facts, item 18). With a test accessibility service using takeScreenshot (API 30 and later), capture the PIN screen. Expected: the keypad area is black.

Changes over time (release build)

  • A delayed update. With a release armed on the short tier, send quitlock update with a newer release APK. Expected: a 3-hour countdown, then the app updates itself without a prompt and restarts, still armed.
  • A countdown across a reboot and a clock change. Start an exit, reboot partway, and try to change the time. Expected: the time is locked, and the countdown carries on from where it was.
  • The exit. Let an exit finish. Expected: teardown, then Android’s uninstall prompt; all settings back as Leaving says.

Added in milestone 13 (any build unless noted)

None of these could be run on 2026-11-17: neither emulator image would boot on the development computer. Those ticked were done on a Samsung Galaxy S20 FE, Android 13, dev build, on 2026-12-01.

  • quitlock setup end to end. On a fresh phone (or emulator) with USB debugging on, run quitlock setup and take each default. Expected: a key is made and its phrase checked back, the app is installed and made device owner, and the phone shows Not armed with the chosen config. Run it again with a config adjusted in the wizard; quitlock config pull shows exactly those settings.
  • quitlock setup --udev (Linux). Expected: the rule is shown, written with sudo after asking, and after replugging, quitlock status reaches the phone over the accessory.
  • Theme. Settings, Theme: Light, then Dark, then Follow the system. Expected: every screen and dialog follows at once, including the main screen behind Settings, and the choice survives a restart.
  • Dark mode or language changing mid-flow. Settings, Theme: Follow the system. Start arming with the screen lock as the owner’s approval; on the confirmation screen, switch the system’s dark mode (from the quick settings). Expected: arming still goes ahead, and QuitLock takes the new colours the next time it is shown. With Developer options, Don’t keep activities on, do the same: Expected: a message says the step did not go ahead.
  • Proposing while a change counts down (armed). Start a loosening change, then Settings, Propose a change. Expected: a note at the top says loosening is refused until it ends; a loosening edit cannot be sent; a tightening one can, and applies at once.
  • Rotation mid-flow. Start arming with a screen lock as the owner’s approval and rotate the phone on the confirmation screen. Expected: arming still goes ahead after confirming.
  • Propose a tightening change on the phone. With an owner phone PIN, Settings, Propose a change: add an app to the blocklist, review, Approve and send. Expected: it applies at once; the history shows it.
  • Propose a loosening change on the phone (armed, solo). Turn SafeSearch off. Expected: the review says it waits the delay; after approving, the countdown appears on the main screen and Cancel drops it. In partner mode it waits for the partner instead.
  • Allow a suspended app. Install an app from a browser download while armed. Expected: it is listed with an Allow button that opens the editor with the app added to the allowlist.
  • Save the history. Settings, Save the history, to Downloads. Copy it to the computer and run quitlock log verify <file>. Expected: the chain is unbroken.
  • The notification. While a computer is connected or USB debugging is allowed, tap the notification: QuitLock opens.
  • Developer tools (dev build). Settings, Developer tools. With an exit counting down, “Finish the countdown now”. Expected: teardown runs. In a release build there is no Developer tools row.

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-11-17: dev.t342.quitlock (dev builds dev.t342.quitlock.dev), under the owner’s domain t342.dev. The Kotlin packages follow it (dev.t342.quitlock, dev.t342.quitlock.core). It replaced the placeholder org.quitlock.app, which claimed quitlock.org, a domain the project does not own, and could have been registered first by someone else with Google or a store.

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 without Chrome

A release build refuses to arm without Chrome, the one managed browser. The alternative is to arm and suspend every browser until Chrome is installed, which would let people without Chrome use QuitLock, but leaves them with no browser at all. Left to the owner, since it changes who can use the app.

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 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 auto uses 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.toml before 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, dash and 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 --draft approved 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.setApplicationNightMode on 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. --yes skips 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.
  • INTERNET is 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: SHA256SUMS only 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.
  • config bundles 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 are offered in every session. The accessory stays open between sessions, 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 in QUITLOCK_KEY_DIR, --key-dir, ~/.config/quitlock/keys or %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_add for; the phone checks the reply, and fingerprints are compared by voice.
  • partner join makes a key called partner unless --key names 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 sign replaces the file in place, atomically, unless --out is 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 :core and 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_SERVICE and FOREGROUND_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 Chrome and without enrolment, since the test images have neither. It still stores Chrome’s configuration.
  • ForceYouTubeRestrict is 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

  • allowlist does not exempt a browser; only browser_allowlist does.
  • Browsers installed before arming are left alone; the guide says to uninstall or blocklist them first.
  • 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_allowlist later 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

  • provision removes 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-owner after Not 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.
  • versionCode from 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 release environment only v* 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.sh simple.
  • 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 --github is compiled in, overridable with QUITLOCK_GITHUB_REPO at build time or --repo.

Settled defaults

QuestionAnswer
Length of the short tier3 hours
USB debugging window on an armed phone5 minutes
A limit on how often it can be openedNone; each one is logged
Whether partner approval shortens or skips the delayNo
Whether arming needs a signatureNo: a button on the phone with a typed confirmation, or the owner phone secret

Open items

What has not been checked yet, and what is known to be missing. Decisions waiting for the owner are under Decisions.

Not yet checked

  • Real phones. One so far: a Samsung Galaxy S20 FE on Android 13 (2026-12-01, dev build): setup, arming, the policies and connecting over adb worked. Other makers, a release build, and the rest of Manual checks are still to do.
  • The USB accessory on a phone (platform facts, item 22): the switch from each USB mode, the attach dialog and “Always”, reads, writes and packet ends, re-enumeration when adb is switched, unplugging.
  • Milestone 13 on any device. On 2026-11-17 the emulators’ QEMU crashed during boot on the development computer (both API 36 and API 29), so the device suite has not run. On the Galaxy S20 FE (2026-12-01) setup and the rebuilt main screen were used; Settings, Propose a change, the developer tools and the theme were not checked item by item. Run scripts/emulator-test.sh and the milestone 13 items in Manual checks before relying on them.
  • The release workflow on GitHub: its first run is the first tag. The musl and Windows CLI builds, the attestation, and reproducing CI’s own builds.
  • Windows: the CLI type-checks for it, but has not run there, nor have its adb drivers.
  • Two people on two computers: the partner flows were run with two key folders on one machine.
  • Argon2id on a low-end phone (item 21), and an accessibility service’s own screenshot of the PIN screen (item 18).
  • The adb shell (platform facts, item 16): device_config, cmd overlay, cmd role, cmd netpolicy, secure and system settings were not tried; manufacturer builds add their own commands. Wireless debugging could not be tried on an emulator.
  • The tamper watch in a release build with adb really switched off.
  • Arming with a waiting change and a countdown on a device: arming turns adb off, which ends a scripted emulator run.

Known gaps

  • The self-check’s problem texts are English, built in Kotlin, and go to the event log and the CLI as text. Translating them needs stable problem codes in the log format, which is a protocol change of its own.
  • No command lists the phone’s suspended apps from the CLI; the phone’s screen shows them.
  • Screen readers cannot read the PIN keypad, by design: hiding its keys from accessibility services hides them from screen readers too.
  • Android 13 and later may not show the connection notification, since QuitLock does not ask to post notifications.

Changelog

QuitLock was built in milestones. Each entry says what it added; the reasons for choices along the way are in Decisions, and what is still unchecked in Open items. The full record is in the git history.

15. Fixes from the first phone test (2026-12-01)

The first armed test on a real phone (Android 13) went badly; these are the fixes. Decisions has the reasons.

  • No more sessions, and no tap. A command plugs in, connects, works and disconnects. The phone answers while it is unlocked, and says so when it is locked. Over adb the CLI wakes the app with a broadcast only the shell can send; over the USB accessory a screenless activity takes the accessory. Connection protocol 2: the phone ends a connection with a BYE that says why.
  • The CLI no longer hangs. It used to wait 5 minutes for Connect to PC. It now answers at once or says what to do: an unauthorised, offline or unpermitted phone stops setup at once, adb calls time out, and only an unlock and Android’s accessory chooser are waited for (a minute each).
  • Allow USB debugging (5 min) replaces Connect with USB debugging, for armed phones on computers without the accessory. New events debug_window_open and debug_window_close; old session entries still show.
  • Setup’s settings reach the phone, or are kept. They are saved to quitlock.toml first, sent, read back and compared. enrol and provision take --config. Running setup again on an enrolled phone sends them as a config change. An unfinished removal no longer wipes a new enrolment (new event removal_abandoned). The phone no longer shows default settings as if they were in force, and status no longer runs a self-check.
  • A short main screen. One setup stage (not set up, almost set up, not armed, armed) drives every message. The screen keeps the state, the settings once they exist, one self-check line, any countdown or approval, and the computer line; People, Checks and apps, History, and Leave or recover are now their own screens.
  • quitlock dash reconnects by itself and reads only new log entries.
  • The DNS filter host is checked before the phone uses it. Setup, config validate, config push and enrol/provision --config try it from the computer (DNS over TLS on port 853, as Android does). Before, a wrong host showed up only when arming failed.
  • quitlock config edit opens the phone’s settings in your editor and sends the change. config pull replaces an existing file after asking; it used to refuse, though setup told you to run it on the file setup wrote.
  • Tested 2026-12-01 by the owner on a Samsung Galaxy S20 FE on Android 13, with a dev build: quitlock setup from start to end, the chosen settings on the phone, arming, the policies in effect, and CLI commands over adb with nothing tapped (quitlock status answered in 0.4 seconds). Not covered there, because a dev build leaves adb on: the USB accessory and Allow USB debugging, which need a release build armed.

14. Review fixes (2026-11-18)

Fixes from a review of the whole project, safety first.

  • What the phone needs is never suspended, whatever the blocklist or install policy: core system apps (Settings, the system UI, the phone and emergency apps, the permission controller, the package installer), and the keyboard, home screen, dialer and SMS app in use when they are system apps or were there at arming. If every app in one of those roles would be suspended, the one in use is kept. The self-check names what was kept. The CLI warns when a blocklist names a well-known one.
  • Removal can no longer get stuck. Teardown tries every step even when one fails. It keeps device owner until all of them have taken, and upkeep finishes a removal left half-done. A Private DNS that will not go back to automatic no longer stops it; the screen names the host instead. After a removal that finished while the app was closed, the screen says so and offers Uninstall. New event: teardown_failed.
  • A failing step no longer stops the background check. Applying a due change, finishing a removal, the self-check and starting an update each run on their own. A failure is shown on the status screen and logged once (upkeep_error). Boot and the periodic job no longer crash the app.
  • Arming is all or nothing. If a step fails after Private DNS was set, every policy applied so far is undone, so a phone is never left restricted while it shows as not armed.
  • Damaged state no longer stops the app. The stored state is read whole, under one lock shared by every writer, and kept in two copies. If both are damaged, each unreadable value is replaced by the strict one and a partner is assumed until a new key is paired; the screen and the log say so. Teardown takes the bundle processor’s lock first, so a bundle cannot save its keys back after a removal.
  • A session that fails while opening is closed at once, rather than left open with adb on until its time limit. Closing a session turns adb off even if logging or stopping the tamper watch fails.
  • The phone no longer claims USB debugging is off when QuitLock leaves it alone. A dev build never controls adb, and neither does an unarmed phone. The arm dialog, the Computer section and the session notification said it was off outside sessions anyway. They now say what is true for that build and state.
  • Builds use --locked again in scripts/build.sh, and say how to fix a lockfile that fell behind Cargo.toml.

13. Usability (2026-11-17)

  • CLI: quitlock setup, a guided first run (key, phone, app, a first config, provisioning), and setup --udev. A new key’s recovery phrase is checked back. Keys are unlocked before a session opens, and typos are asked again. provision gets its APK before changing the phone and enrols over adb. enrol --key is optional; several keys give a menu. “Send it?” before loosening (--yes skips). Questions in every command use arrow-key menus, yes/no toggles and hidden PIN fields that collapse to one line once answered, drawn with crossterm, which the CLI already used; a plain fallback for scripts and NO_COLOR. Clearer errors throughout; --out as an alias of --to-file; the udev rule covers Pixel phones.
  • Phone: Settings (theme, history, keep the screen on, notification settings, the protection in force, saving the history and a status report, About). Config changes proposed on the phone, and Allow for a suspended app. Developer tools in dev builds. The session notification opens the app and has Disconnect.
  • Fixes: the main screen no longer reads the phone’s state on the main thread every second; no crash when work finishes after the screen closes; rotation keeps an arm or approval in progress; buttons are disabled while a phone secret is checked; plain-language refusals; the USB accessory’s session hand-offs (a claimed session that never started, a sync sent twice, a dead CLI blocking the next one).
  • Sessions over the accessory last 15 minutes; with adb, still 5.
  • The package ID is dev.t342.quitlock, under the owner’s domain, in place of the placeholder org.quitlock.app.
  • Docs: this book replaces the build specification, the protocol specification and the docs folder; the README is short and for users.
  • Not run: the device suite and every UI check, because neither emulator image would boot on the development computer.

12. Sessions over the USB accessory (2026-11-17)

Android Open Accessory is the default session transport on Linux, with no adb; adb stays for Windows and as the fallback. A new Connect with USB debugging button turns adb on for one session. The phone’s link stays open between sessions; the CLI finds phones by their USB interfaces and nothing else. Unit-tested on both sides; not yet run on a phone.

11. Release pipeline (2026-11-16)

Signed releases from CI on version tags, SHA256SUMS, provenance attestations, scripts/verify-release.sh to rebuild a release and compare it, the README, the threat model, the uninstall guide and the manual checklist for real phones.

10. Updates, the event log, the tamper watch (2026-11-16)

The session’s tamper watch (a proxy, an install over USB, a released app, cancelled jobs, background restrictions, the battery exemption) ends a session on any of them. A foreground service keeps the app alive during a session; boot and periodic self-checks. QuitLock asks to leave battery optimization before arming.

9. People and approvals (2026-11-15)

Phone PINs and passwords for both people, on QuitLock’s own keypad; the owner may use the screen lock. Waiting changes on the phone, drafts, Request exit on the phone, three ways for a partner to join and to approve, partner_remove, phone_secret_allow, recovery phrases.

8. Partner mode (2026-11-15)

Two signatures for loosening changes, partner sign, plain-language summaries in inspect, replaces in config bundles.

7. Provisioning assistant (2026-11-15)

quitlock provision --check and provision: preflight for accounts, users, profiles and other owners, guided removal, the dpm error messages explained, manufacturer notes.

Between 6 and 7: re-pairing, history, looks (2026-11-15)

“Pair a new key” replaced the keyless exit; the signed exit works in solo mode. The event log, log pull and log verify. The app restyled with a dark theme; colour in the CLI and quitlock dash.

6. App rules (2026-11-15)

Install policies, trusted installers, block and allow lists, browser detection, suspension, a periodic job.

Between 5 and 6: builds and updates (2026-11-15)

scripts/build.sh; update bundles, checked and installed silently after the delay; quitlock update and update --github.

5. Delays (2026-11-14)

The delay engine and its clock rules, pending actions with Cancel, and the keyless exit (later replaced by re-pairing).

4. Config and enforcement (2026-11-14)

Config apply, the user restrictions, Chrome’s managed configuration, teardown, config push and config pull. The INTERNET permission was allowed for the Private DNS call.

3. Sessions and file import (2026-11-14)

Connect to PC over adb, the hello, status, send, enrol; Import bundle from file as the second transport; adb switched off outside sessions.

2. Keys and bundles (2026-11-14)

CLI keys and encrypted key files, bundle creation and signing, inspect; the Kotlin verifier passing the shared vectors.

1. Device owner (2026-11-14)

The admin receiver, device owner on an emulator, the three lifecycle states, the DNS lock, dev-build removal.

0. Scaffold (2026-11-14)

Repository, licence, CI, the protocol specification and the first shared test vectors.