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

A commitment tool for Android that makes leaving slow, visible and deliberate.

CI CodeQL Licence: GPLv3 Android 10 and later Desktop app and CLI for Linux and Windows Tested on a Galaxy S20 FE Status: preview

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 app and a command-line tool for Linux and Windows set it up and authorise changes over a USB cable.

Warning

Preview. QuitLock has been tested on Android emulators and on one real phone, with a dev build (Tested devices), and no signed release has been published yet. Until the manual checks are done, use it on a phone you could wipe.

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: downloading an app update from GitHub when you ask for it, and checking that a DNS filter you chose answers before the phone is told to use it.
  • 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 other supported browsers, applies domain block and allow lists there, and suspends browsers it cannot configure (Browsers).
  • 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

New here? Start with Installing, then Setting up a phone. QuitLock is free software under the GPLv3; to report a security problem, see the security policy.

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
quitlock-gui-<version>-linux-x86_64The desktop app for Linux
quitlock-gui-<version>-windows-x86_64.exeThe desktop app 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. Choose the desktop app, the CLI, or both. The desktop app does setup, everyday use, partners and the exit in a window; the CLI does all of that too, and also app updates, the dash view, bundles written as files and the Linux udev rule. Both use the same keys. Run the desktop app from wherever you saved it (on Linux, chmod +x it first).
  3. Put the CLI on your path, named quitlock (quitlock.exe on Windows). On Linux: chmod +x it and move it to ~/.local/bin/quitlock.
  4. Get adb (Android’s platform tools) for setting the phone up. Both programs find it on your path; the CLI also takes --adb <path>. After setup, Linux needs no adb at all.
  5. 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, or the desktop app’s Set up page) 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.

Important

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.

Save your browser data too. Browsers QuitLock cannot filter, such as Samsung Internet, Firefox or Opera, cannot be opened once the phone is armed (Browsers). Their data is not deleted, but export any bookmarks, passwords or other data you want from them first. Removing accounts for setup can also stop their sync. Setup names the ones it finds: the desktop app asks you to tick that you have saved what you want, and quitlock setup asks before going on.

In the desktop app

Open the desktop app and choose Set up: the same steps as below, one page each. The rest of this page describes quitlock setup; what it says about the phone applies to both.

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. It also names browsers that will be suspended once armed, as a warning that does not stop setup. 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 a supported browser installed (Chrome; see Browsers).
  • Other browsers, including the one that came with the phone (such as Samsung Internet), are suspended once armed unless you add them to browser_allowlist. An allowed one is filtered by DNS only.
  • Then: Everyday use.

Everyday use

Reaching the phone

Plug the phone in, unlock it, and run the command, or press Connect to phone in the desktop app, which shows the phone, changes its settings and approves changes in a window. How the phone is reached applies to both. 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 USB debugging.
  • --transport usb or --transport adb picks one way.
  • No working connection? exit request, config push, update and enrol take --to-file <path> --device-id <ID>, with the device ID QuitLock shows under Leave or recover, and write the signed file without connecting. 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 browser QuitLock cannot configure, even one that came with the phone (Browsers). 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.

Caution

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.

A partner needs a key of their own for this. A partner who has only a phone PIN or password and forgot it is removed as a partner (quitlock partner remove: the owner, the partner’s approval and the delay) and added again.

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. Without a connection, use the device ID the phone shows: quitlock enrol --to-file pair.qlb --device-id <ID> --config <your settings file>, and import the file on the phone.

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.

A phone can have up to ten partners: two group leaders, say. With more than one, each partner approves with their own key (a phone PIN or password would not say whose it is), and the phone’s rule says how many of them a change needs. See Several partners.

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”; or, in the desktop app, People, then Join as the 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. The desktop app does each step in People: Write an invite…, Join from an invite…, Open their reply… (The desktop app).

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, unless the phone’s rule lets enough partners make it apply at once (off unless you turn it on): 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.

Several partners

To add another partner, do as for the first: in person (the phone offers Add another partner) or with an invite. The partners you have already approve the new one too, and it waits out the delay. Further partners need keys of their own; if your one partner has a phone PIN or password, clear it first.

The rule has three numbers. quitlock partner list and the desktop app’s People page say them in words, for example:

  • A change that loosens protection needs you and any 1 partner, then waits 24 hours.
  • With you and both partners, it applies at once.
  • Both partners can add protection without you.
NumberMeansDefault
To loosenPartners who, with you, can loosen protection, which then waits out the delay1
At oncePartners who, with you, make it apply at once instead (0: never)0
To tightenPartners who may add protection without you (0: none)0

You are always needed to loosen. Change the rule with quitlock partner rule --delayed 1 --at-once 2 --tighten 2 or in People, Change this…. A rule that asks no less of your partners applies at once with your key; one that asks less needs your partners as the present rule says, and always waits out the delay.

Getting it applied at once. A change sent with enough approvals for the delay starts counting down, and more approvals cannot stop it. So collect the signatures first: in the desktop app choose Save it for my partners to sign; each partner opens the file under Approvals, Approve a change sent as a file, and passes it on; then send it under Approvals, Send a change from a file. With the CLI: --to-file, quitlock partner sign, quitlock send.

Removing a partner

quitlock partner remove (with --partner naming one, when there are several) needs you and your partners as the rule says, and waits out the delay. Removing the last partner removes their key and phone PIN, and the phone returns to solo mode. Removing one of several leaves the others; if the rule asked for more partners than are left, it is brought down to them.

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 USB debugging. Import bundle from file is here too.

  • A short list of other screens:

    • People: the owner and every partner (up to ten), their key fingerprints and phone PINs, and the partners’ rule in words; Add a partner, then Add another 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.

If the main screen will not open, or has crashed twice in 10 minutes, QuitLock opens Recovery instead; long-pressing QuitLock’s icon offers it too. It shows the state and the device ID, and has the ways out on a plain screen of its own: Import bundle from file, Pair a new key, Remove now (when not armed), the tester code in tester builds, and Leave or recover. It lifts no protection by itself (Leaving).

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 and tester builds

Note

These are for testing QuitLock, not for real use.

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.

A tester build shows TESTER at the top and otherwise behaves exactly as a release. Leave or recover has one extra button, Remove with the tester code, which removes it at once with the code made when it was built (Building).

None of this exists in a release build.

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 no connection works on this computer, quitlock exit request --to-file exit.qlb --device-id <ID>, with the device ID QuitLock shows under Leave or recover, writes the exit to a file without connecting. 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.

If the computer cannot reach the phone at all, pair the new key from a file instead: after Pair a new key, the phone shows its device ID. Run quitlock enrol --to-file pair.qlb --device-id <ID> --config <your settings file>, copy the file to the phone and use Import bundle from file. Give the settings the phone already has (or tighter ones): an armed phone refuses a re-pair that loosens them.

The app stops working

If QuitLock’s main screen will not open, or keeps closing, it opens Recovery instead; long-pressing QuitLock’s icon opens it too. Recovery has the ways out on a screen of its own: import a bundle from a file, Pair a new key, Remove now when not armed, and Leave or recover. It lifts no protection by itself (When the app fails).

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.

Dev and tester builds

A dev build (package org.quitlock.dev, marked DEV on its screen) can always be removed at once with Remove now, armed or not. A tester build (org.quitlock.tester, marked TESTER) works like a release, but Remove with the tester code, under Leave or recover, removes it at once with the code made when it was built (Building). Both are for testing, not protection.

What removal undoes, and what it leaves

Teardown, in this order:

  1. Releases every app QuitLock suspended.
  2. Clears the browsers’ 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.

Caution

A factory reset 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).

Browsers

QuitLock filters browsing in two layers:

  • DNS (Private DNS, locked): applies to every app, including every browser, unless the browser goes around the system’s DNS.
  • Browser settings (Android managed configuration): site lists, SafeSearch, incognito, and the browser’s own secure DNS. These apply only in a browser that reads Android managed configuration. In practice that means browsers built on Chromium that keep its policy support.

A browser QuitLock can configure is supported: it gets the settings and runs. Every other browser is suspended, including one that came with the phone or was installed before arming, unless you add it to browser_allowlist. Allowing an unsupported browser leaves it filtered by DNS only, and not even that if it has its own VPN or proxy.

QuitLock finds browsers by what they do: any app that opens links to any web site counts. A browser missing from the table below is unsupported.

Support

Status values:

  • Supported: tested on a phone. Configured and allowed in every build.
  • Candidate: expected to work, not yet tested. It is configured in every build, but allowed without browser_allowlist only in dev and tester builds, so it can be tested there first.
  • Unsupported: suspended unless allowed.

Feature columns: “yes” or “no” is what a phone test found; “untested” means no test yet.

BrowserPackageStatusSite listsIncognito offSafeSearchSecure DNS offOwn VPN or proxyNotes
Chromecom.android.chromeSupporteduntesteduntesteduntesteduntestednoneThe reference browser. Supported before the table existed; still to be checked item by item (manual checks)
Chrome Beta, Dev, Canarycom.chrome.beta, com.chrome.dev, com.chrome.canaryCandidateuntesteduntesteduntesteduntestednoneSame code as Chrome
Microsoft Edgecom.microsoft.emmxCandidateuntesteduntesteduntesteduntesteduntestedMicrosoft documents URLBlocklist and DnsOverHttpsMode for Android. Check whether its built-in VPN (Secure Network) exists on Android, and whether it can be turned off
Bravecom.brave.browserCandidateuntesteduntesteduntesteduntestedBrave VPN is an Android VPN, which the VPN lock blocksBrave says it supports Chromium’s policies; Android is not documented
Vivaldicom.vivaldi.browserCandidateuntesteduntesteduntesteduntesteduntestedBuilt on Chromium; no policy docs found
Samsung Internetcom.sec.android.app.sbrowser (and .beta)UnsupportednonononononeIts policies exist only on Windows. Tested on a Galaxy S20 FE: blocked sites load
Firefox (all channels), Firefox Focusorg.mozilla.firefox, org.mozilla.firefox_beta, org.mozilla.fenix, org.mozilla.focusUnsupportednononononone built inNo managed configuration on Android. Its own secure DNS can be turned on in its settings
Tor Browserorg.torproject.torbrowserUnsupportednonononoyes (Tor)All traffic goes through Tor, around the DNS filter
Opera, Opera GXcom.opera.browser, com.opera.gxUnsupportednonononoyes (proxy)The free “VPN” is a proxy inside the browser, so neither the VPN lock nor the DNS filter applies to it
Opera Minicom.opera.mini.nativeUnsupportednonononountestedNo managed configuration
DuckDuckGocom.duckduckgo.mobile.androidUnsupportednonononononeNo managed configuration

The table is kept in the code too: android/core/src/main/kotlin/org/quitlock/core/Browsers.kt for the phone, and desktop/core/src/browsers.rs for the warnings on the computer. scripts/check-invariants.sh checks that the two match.

VPNs and proxies

Browsers get around the DNS filter in three ways. Android stops only the first:

  • A VPN app (Brave VPN, Mozilla VPN, the Opera VPN app, any app using Android’s VPN service): stopped. QuitLock locks VPN settings (DISALLOW_CONFIG_VPN), so no VPN can be switched on.
  • The browser’s own secure DNS (DNS over HTTPS): turned off by the DnsOverHttpsMode setting, but only in a browser that reads it. Firefox does not, which is one reason it is unsupported.
  • A proxy or VPN built into the browser (Opera’s and Opera GX’s free VPN, Tor): Android cannot see it, so no Android setting stops it. Such a browser can be supported only if a managed setting turns the feature off.

Testing a browser

On a spare phone, with a dev or tester build armed (so candidates are allowed):

  1. Install the browser after arming. It should run, not be suspended.
  2. Open its policy page (chrome://policy, edge://policy, brave://policy or vivaldi://policy) and reload policies. URLBlocklist, URLAllowlist, IncognitoModeAvailability, ForceGoogleSafeSearch and DnsOverHttpsMode should be listed with QuitLock’s values.
  3. Check each column:
    • Site lists: add a site to chrome.url_blocklist (for example example.com) and push the config. The site must be refused in this browser.
    • Incognito off: no way to open a private or incognito tab.
    • SafeSearch: a Google search shows SafeSearch locked on.
    • Secure DNS off: the browser’s secure DNS setting is greyed out or off.
    • Own VPN or proxy: look through its settings and menus for a VPN, proxy or Tor mode. If there is one, check whether it can be switched on.
  4. Record the results in the table above. If every column passes and the browser has no VPN or proxy left on, change it to VERIFIED in both Browsers.kt and browsers.rs.

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 unless they are on the blocklist, except browsers: an unsupported browser is suspended even if it came with the phone (Browsers).
  • An allowed unsupported browser (on browser_allowlist) is filtered by DNS only, and not at all if it has its own VPN or proxy, such as Opera’s.
  • 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 only inside supported browsers (Browsers), 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 a supported browser, for now Chrome, since every other browser is suspended.
  • 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.

Tested devices

QuitLock relies on Android’s device-owner features, and phone makers change those in small ways. This page lists the phones and emulators QuitLock has run on, what was checked and what was not. Until your phone or a close relative of it is here, treat setup on it as a first test: use a phone you can wipe, and a tester build or a dev build first.

Phones

PhoneAndroidBuildDateResult
Samsung Galaxy S20 FE13 (One UI)Dev2026-12-01Works for what was checked; see below
Samsung Galaxy S20 FE13 (One UI)Tester, armed2026-12-03Works: the USB accessory from Linux

Samsung Galaxy S20 FE, Android 13

The owner’s own test phone, set up from a Linux computer over adb.

CheckedResult
quitlock setup from start to end: preflight, install, device owner, enrolmentWorks
The settings chosen in setup reach the phone, and read back the sameWorks
ArmingWorks
The policies in effect once armedWorks
CLI commands over adb with nothing tapped on the phone (quitlock status in 0.4 seconds)Works
The USB accessory (Linux, adb off), with a tester build armed (2026-12-03)Works, after a fix to the program (Changelog, milestone 17); the details in Manual checks are still to do
Allow USB debugging (5 min) on an armed phoneNot yet: needs a release or tester build armed
Self-update, a delayed exit, Chrome’s managed settings item by itemNot yet
From a Windows computerNot yet

One thing learned: after the phone switched USB modes, the computer’s adb server stopped listing it until it was restarted (adb kill-server). Troubleshooting has the fix.

Emulators

QuitLock was developed on Android’s emulators until milestone 12 (November 2026), with the device test suite (scripts/emulator-test.sh, see Testing). What they confirmed is recorded item by item in Platform facts.

EmulatorAndroidUsed for
API 29 image10, the oldest QuitLock supportsDevice owner, adb control, app rules, updates
API 36 image16All of the above, plus connecting over adb

Emulators have no Chrome and no USB accessory, and they cannot show what a phone maker changes. Since 2026-11-17 both images crash at boot on the development computer, so later milestones have not run there (Open items).

Adding your phone

If you set QuitLock up on another phone, please open an issue with:

  • the phone’s maker and model, and its Android version;
  • which build you used (release, tester or dev), and the app and CLI versions (quitlock status shows the app’s, quitlock --version the CLI’s);
  • your computer’s system (Linux or Windows);
  • which of the manual checks you went through, and what happened, especially anything that differed from what they expect.

Leave out account names, your device ID and anything from your history you would rather keep private. A security problem goes to the security policy instead.

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 cannot help, since it needs the app to answer. On a phone not set up yet, quitlock setup installs the matching app. On a phone where QuitLock is already the device owner, install the APK of the same version as the CLI over adb: adb install -r quitlock-<version>.apk (adb install -t -r for a dev build). It must be signed by the same key as the app on the phone.
  • 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 org.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.

The desktop app

quitlock-gui does in a window what most people need the CLI for: connect to the phone, see its state, change its settings, approve changes and set a phone up. It is built on the same library as the CLI, so it signs and sends exactly what the CLI would, and the phone checks it the same way.

Starting it

  • Windows: download quitlock-gui-<version>-windows-x86_64.exe and run it.
  • Linux: download quitlock-gui-<version>-linux-x86_64, chmod +x it and run it from your desktop. It needs a desktop session (X11 or Wayland) with OpenGL, which every desktop has. The USB accessory needs the udev rule from Installing; the app does not install it, since that needs sudo: run quitlock setup --udev once.

Both use the same keys as the CLI (%APPDATA%\quitlock\keys on Windows, ~/.config/quitlock/keys on Linux, or QUITLOCK_KEY_DIR). Setting a phone up needs adb, found on your path, as for the CLI. quitlock-gui --page settings opens on a given page: phone, settings, approvals, people, history or setup.

Connecting

Plug the phone in, unlock it and press Connect to phone. While it connects, the top of the window says what it is waiting for, such as unlocking the phone or choosing QuitLock in Android’s accessory prompt. If the phone cannot be reached, it says why (adb not allowed yet, no phone found) and tries again every few seconds by itself; Try again now tries at once.

Once connected it reads the phone every 5 seconds, and reconnects by itself if the cable comes out. Disconnect stops it and lets go of the phone, so a quitlock command can use it; only one program at a time can talk to the phone. An armed phone on a computer without the USB accessory (Windows) needs Allow USB debugging (5 min), tapped in QuitLock on the phone, as for the CLI.

Phone

The phone’s state (not set up, almost set up, not armed, armed) and what it means, its mode, delay and DNS filter, and the app’s version. Dev and tester builds are marked as not for real use. Below that:

  • A countdown, when a change waits out the delay: what it is, a progress bar and the time left. To stop it, tap Cancel this change on the phone. The desktop app cannot cancel, by design: cancelling needs nothing but the phone.
  • A change waiting for approval: who has approved it and who still must. Review it opens Approvals.
  • The self-check, on an armed phone.
  • People: the owner keys and every partner key, marked when one of them is on this computer, which kind of phone lock each person has, and the partners’ rule in words.
  • Leave QuitLock: Request exit… signs an exit with your key; Request exit, to approve on the phone… sends it unsigned, to approve with your phone PIN or password. Either asks first. On an armed phone the exit waits out the delay and can be cancelled on the phone until then; in partner mode the partners approve it too, as many as the rule says (Leaving).

Settings

The phone’s settings, laid out as the phone’s own Propose a change: the delay, the DNS filter (with Check, which tries it from this computer), which apps may be installed, SafeSearch and incognito, and the six lists. Entries are checked as you type them.

The Review panel compares your edits with the phone’s settings as you go: each change marked as tightening or loosening, and what will happen when you send it (applies at once, waits out the delay, needs partners’ approval). It also warns about a blocklisted app the phone needs, and says when the phone would refuse the change, for example while another change waits for approval, or a loosening change while a countdown runs.

  • Sign and send asks for your key’s PIN or password, then signs and sends the new settings. When they apply at once, the app reads them back from the phone and says so. A change to the DNS filter is checked first, since a filter that does not answer leaves an armed phone without internet; you can send it anyway.
  • Send to approve on the phone sends it unsigned, when you have a phone lock set: approve it on the phone with your phone PIN or password.
  • When the change needs partners who are far away, the app offers to save a copy for them to approve (Partners).
  • Open file… and Save as file… read and write the same quitlock.toml files as the CLI. With no phone connected, Start from the recommended settings makes one to edit and save.
  • Start again drops your edits.

Approvals

Waiting on the phone shows the change waiting for approval, described in full. If a partner key is on this computer, Approve as a partner, with ‘name’ asks for its PIN or password and approves it. Otherwise the page says how partners can approve; the owner approves on the phone with their phone PIN or password. Nothing changes until it is approved, and it can be dropped on the phone.

Send a change from a file is for the owner: open a .qlb file, such as one your partner approved and sent back, check what it does, and send it to the phone. The CLI’s quitlock send does the same.

Approve a change sent as a file is for a partner far away: open the .qlb file the owner sent, check what it does, approve it with your key and save the approved file to send back. The CLI’s quitlock partner sign does the same.

People

  • Keys on this computer: each key, its fingerprint and whether it is an owner or partner key on the connected phone. Make a key and Restore from a recovery phrase work as in setup. Recovery phrase… shows a key’s 24 words again, after its PIN or password. Save a copy… writes the key’s encrypted file, still locked by its PIN or password, as a backup or for another computer; Import a key file… reads one. Each key has its own PIN or password: one key’s never opens another.
  • Partners: up to ten, each with a key of their own.
    • Joining in person: when the owner has tapped Add a partner (or Add another partner), then With your partner’s computer, in person, on the phone, plug it into the partner’s computer and connect. Join as the partner uses a key on that computer, or makes one, and sends it. Check that the phone shows the same fingerprint; the owner confirms there.
    • Far away: the owner, connected, presses Write an invite… and sends the file. The partner, with no phone needed, presses Join from an invite…, chooses or makes a key and saves a reply to send back. The owner opens it with Open their reply…, ticks that the partner read out the same fingerprint, and presses Enrol them as the partner.
    • Another partner joins the same way, approved by the partners already there as the rule says, and waits out the delay.
    • Remove… beside each partner key, for the owner. It needs partners’ approval, as the rule says, and waits out the delay on an armed phone. A partner with only a phone PIN or password has Remove the partner… instead.
    • What your partners decide: the rule in words. Change this… edits it: how many partners a loosening change needs, how many make one apply at once, and how many may tighten without the owner. Send the new rule… sends it; a weaker rule waits out the delay.
  • Owner keys: add another of your keys as an owner key (a backup on another computer), or remove one. On an armed phone both wait out the delay.
  • A forgotten phone PIN or password: a key clears its person’s phone PIN or password, so a new one can be set on the phone within 10 minutes. Do it only while you are with the phone.

History

The phone’s history of changes, newest first, and whether its hash chain is intact. Choose an entry to see its details. Save a copy… writes the file quitlock log verify checks.

Set up

The same five steps as quitlock setup (Setting up a phone):

  1. Your key: one on this computer, a new one, or one restored from its recovery phrase. A new key shows its 24-word recovery phrase; write it down, then type three of the words to check your copy.
  2. The phone: how to turn on USB debugging, then Look for the phone. It lists what stops setup. Other users and profiles can be removed from here, after a confirmation; for accounts, it opens the accounts screen on the phone for you to remove them. Look again when you have.
  3. The app: the latest release from GitHub, checked against its SHA256SUMS, or an APK file. A phone where QuitLock is already the device owner keeps its app.
  4. Settings: the recommended ones, to change as you like. The DNS filter is checked from this computer before the last step.
  5. Set up: installs QuitLock, makes it the device owner and sends your key and settings, then reads them back. Each step is listed as it happens.

While setup uses the phone, the rest of the window leaves it alone. When it is done, sign back in to your accounts and tap Arm on the phone when you are ready.

Opening and saving files

The app has its own file browser: Up, Home, the working folder, a folder typed in (Enter goes there) and, on Windows, each drive. It never overwrites a file; choose another name.

What needs the CLI

The desktop app covers everyday use. These stay in the CLI (CLI reference): updates (quitlock update), the live dashboard (quitlock dash), writing changes to a file instead of sending them (--to-file, including a re-pair with quitlock enrol --to-file --device-id), and the udev rule (quitlock setup --udev).

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; --partner <hex> (up to ten times) enrols partners with it, and --rule DELAYED,AT_ONCE,TIGHTEN their rule
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 listShow the phone’s partners and its rule, in words
quitlock partner rule [--delayed N] [--at-once N] [--tighten N]Owner: change how many partners changes need (Several partners)
quitlock partner remove [--partner <hex or name>]Owner: remove a partner (needs your partners as the rule says); name which when there are several
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. It still connects to read the phone’s ID and state; when a partner must approve, it sends the bundle and also writes it, for them
--device-id <hex>With --to-file, for enrol, exit request, config push and update: write the file without connecting, for the phone with this ID (shown under Leave or recover). With enrol, it pairs a new key on a phone that already has one
--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
QUITLOCK_PHRASEThe recovery phrase for key restore, 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.
Desktop programs: the desktop app (quitlock-gui) and the CLI (quitlock)RustSet the phone up, keep the keys, and send signed changes to the phone. Both are built on one library, quitlock-core (desktop/).

They meet in two places:

  • The desktop programs connect 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 exceptions are on the computer: quitlock update --github (and provision --github, and the desktop app’s setup) downloads a release APK from the project’s GitHub releases, and a DNS filter host is checked to answer DNS over TLS before the phone is told to use it. 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
  • Browsers that do not read Android managed configuration (see Browsers); Chromium-based ones that do are managed
  • iOS
  • Any network feature, except the computer’s release download and DNS filter check

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 delayed unless the owner and enough partners agree; 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.

The one exception is the partners’ rule (The partners’ rule): a phone may let a loosening change apply at once when the owner and a set number of partners have all signed it. It is off unless the owner turns it on, it always needs the owner, and a rule change that asks less of the partners always waits out the delay. An owner decision of 2026-12-03 (Decisions).

  • 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; Verifier and Rule for the partners’ rule; the shared vectors in protocol/vectors/classifier.json and protocol/vectors/bundles.json (group_*, rule_*).

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 dev build’s source set (src/debug), and the tester build’s override code only in its own (src/qa), with the removal both share in src/instantRemoval. The release build gets stubs with null hooks.

  • Why: a release build that could be removed instantly would undo invariant 1.
  • Enforced by: scripts/check-invariants.sh: the stubs must contain no functions, the dev-only and tester-only classes must not appear in the main source set or the release APK’s dex, the tester code file is never tracked by git, 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 a browser QuitLock manages (for now Chrome; see Browsers), since every other browser is suspended.

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).

Browsers

The browsers QuitLock can configure are listed in Browsers.kt (Browsers): Chrome, which is verified, and Chromium-based candidates. Every verified and candidate browser gets the same managed configuration (setApplicationRestrictions), installed or not, so one installed later has it before it first opens. Keys are Chromium policy names:

  • incognito disabled
  • SafeSearch forced
  • the browser’s own DNS over HTTPS off, so it uses the system’s DNS
  • the URL blocklist and allowlist from the config’s [chrome] section, which keeps its name but applies to every configured browser

Verified browsers are exempt from the browser rule below. Candidates are exempt only in dev and tester builds (BuildConfig.TRUST_CANDIDATE_BROWSERS) until a phone test marks them verified. A release build refuses to arm unless an exempt browser is installed, since every other browser is suspended.

Domain lists apply only inside browsers that honour the configuration, 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 app that can open http or https links as a browser is suspended unless it is a managed browser (see above) or on browser_allowlist, whatever the install policy. This includes browsers installed before arming, such as one that came with the phone. A browser found in the baseline is remembered, so it stays suspended even if, once suspended, it no longer answers the browser query.

  • 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 unless they are on the blocklist or are browsers.

  • 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.

When the app fails

The policies above stay in force whatever happens to the app; only the app can lift them. So a fault in the app must never take away the ways out. A factory reset from recovery mode always remains, but it erases the phone.

  • A fault in a connection ends that connection, not the app. Every connection, wake-up, upkeep and boot thread runs under a guard (Crashes.thread) that catches anything thrown, records it and lets that thread’s work end. The USB accessory’s reader and session catch everything too, and the session answers a fault on its side with a BYE, error.
  • Garbage from a computer is only refused. Unit tests feed every parser (canonical JSON, payloads, envelopes, frames, the sync scanner, a whole connection) random and damaged input, and the bundle processor every shared vector cut short, flipped and padded. None may throw.
  • A record of what went wrong. Before anything else starts, the app installs a handler that records each crash: the time, the thread’s name and the exception’s class, never a message. The last 20 records stay on the phone.
  • Recovery, apart from the main screen. If the main screen fails to show, or has crashed twice in 10 minutes, it opens Recovery instead. Long-pressing QuitLock’s icon offers it too. Recovery is a plain screen that shares as little as it can with the rest of the app. It shows the state and the phone’s device ID, and offers Import a bundle from a file, Pair a new key, Remove now (when not armed), the tester code (tester builds), the Leave screen, and the main screen again. It goes through the same bundle processor and teardown as everything else, so it can do nothing the other ways out cannot: it lifts no protection by itself.
  • Ways out that do not need the computer’s connection: a bundle from a file (--to-file with --device-id, for an exit, a config, an update or a re-pair), and Request exit on the phone with the owner phone secret. Setup recommends setting one.

Teardown

In order: unsuspend everything QuitLock suspended, clear the browsers’ 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. Up to ten partners, each with a key of their own; a partner phone secret only while there is at most one partner key, since it would not say whose it is.
  • 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. With several partners, “owner and partner” below means the owner and as many partners as the phone’s rule asks (The partners’ rule). Approvals never shorten a delay, except that the rule may let the owner and a set number of partners apply a change at once; that is off unless the owner turns it on.
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
Add another partner keyn/aOwner and partner, and the new key’s own signatureConfig tier
Remove a partnern/aOwner and partnerConfig tier
Change the partners’ rule to ask no less of themn/aOwnerNone
Change the partners’ rule to ask less of themn/aOwner and partnerConfig tier, always
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)Same; for the partner, only the one partner’s key (a partner known only by a phone secret is removed instead)None
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 partner who has a phone secret but no key cannot clear it this way: that would remove the partner, which needs the owner, the partner and the delay (Remove a partner).
  • 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 browser safety flag (chrome.force_safesearch, chrome.disable_incognito) 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 QuitLock cannot configure that may run anyway (Browsers)An entry removed
chrome.force_safesearchtrue or falseTurned on
chrome.disable_incognitotrue or falseTurned on
chrome.url_blocklistChromium URL patterns, blocked in supported browsersAn entry added
chrome.url_allowlistChromium URL patterns, allowed in supported browsersAn 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 supported browsers only (the [chrome] section keeps its name but covers every one; see Browsers), 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 org.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). A phone with USB debugging on is never switched at all while adb runs on the computer, even before the adb server lists it: just after the phone is plugged in, adb lists it a moment late, or offline at first, so the program waits up to 10 seconds for it. Switching it then would change its USB setup under the adb server, which can lose the phone until it is restarted (adb kill-server). --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 USB debugging (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). A bundle names the phone it is for, so these commands still connect to read its device ID, and most of them to read its state. When neither transport works on the computer, enrol, exit request, config push and update also take --device-id <ID>, with the ID QuitLock shows under Leave or recover: they then write the file without connecting at all, and the phone shows what it does with the bundle when it is imported.

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; managed settings for Chrome and other supported browsers (no incognito, SafeSearch, the browser’s own DNS-over-HTTPS off, site lists); app rules that suspend browsers QuitLock cannot configure 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 browserBrowsers QuitLock cannot configure are suspended unless allowlisted, including ones there before arming; supported browsers are configured (Browsers)An allowlisted unsupported browser is filtered by DNS only; one with its own VPN or proxy (Opera, Tor) not at all
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

Connections and the debugging 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 on their own. The partners’ rule can let the owner and a set number of partners apply a change at once: collusion of the owner with that many partners is by design, so the owner chooses the number. It is off by default, it always needs the owner, and weakening it waits out the delay.
  • Partners cannot loosen anything without the owner, and cannot cancel a countdown; only the phone can.
  • 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, connection protocol version 2. 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 sixteen 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 connection 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 16; may be 0 (a draft). Sixteen is enough for an owner, ten partners and a key being added.
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, rule, 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 (config), 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_keysarray of stringsOptional. One to ten partner public keys. No duplicates, and none of them an owner key. Omitted in solo mode.
ruleobjectOptional, and only with partner_keys. The partners’ rule (rule); it MUST fit the number of partner keys. Omitted, it is {"at_once":0,"delayed":1,"tighten":0}.
configobjectThe initial config (config).

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 includes it, except when it writes the bundle with --device-id and never reads the phone’s config. 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 connection 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.

A phone has at most ten partner keys. A second or later partner key is a loosening action: it needs the owner and as many partners as the rule asks for loosening (Who may do what). It is not_permitted while a partner phone secret is set, since a phone secret belongs to one partner and would no longer say whose it is.

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

exit

The body is the empty object.

partner_remove

The body is the empty object, or names one partner key:

KeyTypeMeaning
public_keystringOptional. The partner key to remove, 64 hex characters. Required when the phone has two or more partner keys.

Removing the last partner returns the phone to solo mode: the partner phone secret and the rule go too. Removing one of several leaves the others; the rule is brought down to the partners left, if it asks for more (The partners’ rule).

rule

KeyTypeMeaning
ruleobjectThe new rule: exactly the keys at_once, delayed and tighten, each an integer from 0 to 10.
  • delayed: how many partners, with the owner, a loosening action needs. At least 1.
  • at_once: how many partners, with the owner, make a loosening action apply at once instead of waiting out the delay. 0 means never; otherwise at least delayed.
  • tighten: how many partners may approve a tightening config without the owner. 0 means none may.

A rule that breaks these is malformed. One that asks for more partners than the phone has is not_permitted. A phone in solo mode has no rule.

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 keys and the partners’ rule, 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. An update that would wait is refused too while an update counts down, since the phone keeps one staged APK.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 16 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 one to ten partners: partner keys, or one partner with a partner phone secret, or one partner with 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. “D partners” means valid signatures from D different partner keys; the partner phone secret typed on the phone counts as one, and only on a phone with at most one partner key. D, N and T are the numbers in the phone’s rule (The partners’ rule).

ActionSoloPartner modeTiming while ARMED
config, tighteningOwnerOwner, or T partners when T > 0Immediate
config, looseningOwnerOwner and D partnersDelayed; immediate with the owner and N partners
updateOwnerOwner and D partnersAs config, loosening
key_add, role ownerOwnerOwner and D partnersAs config, loosening
key_add, role partnerOwner (a tap, while ready for a partner)With no partner key yet, the partner (by phone secret). With partner keys, owner and D partners; not_permitted with ten, or beside a partner phone secretImmediate when it is the first partner key; otherwise as config, loosening
key_remove (owner keys)OwnerOwner and D partnersAs config, loosening
partner_removenot_permittedOwner and D partnersAs config, loosening
phone_secret_allow, role ownerOwnerOwnerImmediate
phone_secret_allow, role partnernot_permittedThe partner’s key; not_permitted unless the phone has exactly one partner key (with none, clearing the secret would remove the partner)Immediate
rule, asking no less of the partnersnot_permittedOwnerImmediate
rule, asking lessnot_permittedOwner and D partnersDelayed, always
exitOwnerOwner and D partnersAs config, loosening

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.
  • A key_add with role partner MUST carry the signature of the key it adds (step 7c) in every case.
  • “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; 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 (or Add another partner), then With your partner’s computer, in person, makes the phone ready for a partner key for 10 minutes, or until the user stops it. It is offered while the phone can take another partner key: fewer than ten, and no partner phone secret. 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), and for the partners the rule asks for when there are partners already.
  • 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.

The partners’ rule

Every phone in partner mode has a rule: {delayed: D, at_once: N, tighten: T} (rule). It is set at enrolment, or by a rule bundle, and defaults to {1, 0, 0}: the owner and one partner, then the delay, which is partner mode as it was with a single partner.

  • Loosening needs the owner and D partners, then waits out the delay. With the owner and N partners (N > 0), it applies at once. The owner is always needed: partners alone can never loosen.
  • Tightening a config needs the owner, or T partners (T > 0) without the owner.
  • Changing the rule to one that asks no less of the partners (D and N not lower, T not higher, where 0 counts as never for N and T) needs the owner and applies at once. Any other new rule is loosening, and always waits out the delay, however many approve: a moment’s agreement must not switch the delay off for good.
  • Fitting: 1 ≤ D ≤ n, N is 0 or D ≤ N ≤ n, and T ≤ n, where n is the number of partners. When a partner is removed, each number is brought down to the partners left, so the rule can always be met.
  • A damaged store (Damaged state on the phone) reads as the strictest rule: D = n, never at once, no tightening by partners.
  • Sending with fewer approvals. A bundle that arrives with the owner and D partners is accepted and starts its countdown; the phone does not hold it waiting for N. Signatures for N are collected in the file before it is sent. A waiting change completed on the phone (by an owner phone secret or a tap) is judged with every signature it carries, so it can apply at once too.

The bundle result says immediate for a loosening action applied at once, and the event log marks it at_once.

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 org.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 org.quitlock.session, or org.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 Hello. 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 Result. 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, tester 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_keysThe enrolled partner public keys, 64 hex characters each; present only when there are any. Replaced partner_key (a single key) on 2026-12-03; a CLI still reads that.
ruleThe partners’ rule in force (The partners’ rule); present only in partner mode. Added 2026-12-03.
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, rule, 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), approved_partners (the partner public keys that signed it) and partners_needed (how many more partners must). Added 2026-11-15, milestone 9; the partner fields 2026-12-03.

Waiting change

The answer to {"op":"waiting"} is {} when nothing waits, otherwise {"bundle":"<hex>","approved":[...],"needs":[...],"approved_partners":[...],"partners_needed":n}: 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 partners_needed how many partners), 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, dev_removal (a dev build) or tester_override (a tester build, with its code)
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; at_once: true for a loosening action that enough partners let apply at once
pending_startkind (as in the status response), 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_ids if any. Logs written before 2026-12-03 have partner_key_id, a single key ID; readers still show it.
rulerule: the partners’ rule now in force (The partners’ rule), written when it is set at enrolment or changed
waitingstep (started, approved, completed, cancelled, expired, dropped), type; role and via (phone, tap or signature) for approved, and key_id for a partner’s signature; code for dropped: a result code, or re_pair when a new key was paired
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_keys (a list, empty in solo mode), rule (optional; missing or null means the default, {"at_once":0,"delayed":1,"tighten":0}), 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, gui, desktop (the Rust library), core, app, docs, scripts, ci.
  • The body says why, and what a reader would not see in the diff.

Before sending a change

From the repository’s root:

(cd desktop && cargo fmt --all --check && cargo clippy --workspace --all-targets --locked -- -D warnings && cargo test --workspace --locked && cargo deny check)
(cd android && ./gradlew :core:test :app:assembleDebug :app:assembleQa :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; RescueActivity, the Recovery screen, apart from them; AccessoryActivity, which takes the USB accessory)
android/app/src/debug/Dev builds only: instant removal and the developer tools
android/app/src/release/Null stubs for the debug-only hooks (also used by tester builds)
android/app/src/qa/Tester builds only: the override code (Building)
android/app/src/noOverride/A null stub for the tester override, in dev and release builds
android/app/src/instantRemoval/Removal without the delay, shared by dev and tester builds
android/app/src/androidTest/Device-owner tests, run on an emulator
android/testapps/Code-free apps the app-rules tests install
desktop/The Rust workspace for computers, with one Cargo.lock and the dependency policy deny.toml
desktop/core/quitlock-core, the library: bundles, keys, config, reaching the phone (adb, the USB accessory, the connection protocol), the setup checks. No terminal or window code
desktop/cli/quitlock, the command line: main.rs and setup.rs, provision.rs, partner.rs the commands, ui.rs and prompt.rs the terminal, tui.rs the dashboard
desktop/gui/quitlock-gui, the desktop app (egui): app.rs the window and its connection, one file per page (phone.rs, settings.rs, people.rs, approvals.rs, history.rs, setup.rs), jobs.rs and task.rs the work done over the connection and in the background, keymaker.rs making and restoring keys, dialogs.rs the key and file dialogs, theme.rs the colours, assets/ the icons
protocol/vectors/Test vectors shared by both test suites (Test vectors)
docs/This book: docs/src/ is its source, docs/book.toml its settings, docs/theme/ its stylesheet and icon
SECURITY.mdHow to report a vulnerability
scripts/build.sh, check-invariants.sh, check-docs.sh, emulator-test.sh, verify-release.sh
.github/workflows/ci.yml on pushes to main and dev and on pull requests; codeql.yml scans the code; 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, the desktop app and the phone app into dist/, with a SHA256SUMS file:

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

It needs Rust for the CLI and the desktop app, 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, tester and release builds

Dev buildTester buildRelease build
Package IDorg.quitlock.devorg.quitlock.testerorg.quitlock
Gradle build typedebugqarelease
SigningThe local debug keyThe local debug keyThe release key, held only in CI’s secrets
testOnly, debuggableYesNoNo
Instant removalAlways (Remove now), and developer toolsOnly with the tester codeNever
adb while armedLeft onOff except while USB debugging is allowed on the phone (5 minutes)Same as tester
Updates itselfNo (test-only apps cannot)Yes, with APKs signed by the same computerYes, with release APKs
Arming without a managed browser or an enrolled keyAllowedRefusedRefused
Marked on its screenDEVTESTERNothing

The release certificate’s SHA-256 is compiled into the release CLI and desktop app (QUITLOCK_RELEASE_CERT_SHA256 at build time). A program built without it provisions dev and tester builds only, and says so.

Tester builds

A dev build hides what a release does: adb stays on, removal is always instant, and it cannot update itself. To check the real thing on a phone you can wipe, build a tester build:

scripts/build.sh apk --tester              # writes dist/quitlock-tester.apk
quitlock provision dist/quitlock-tester.apk

It runs the release’s code in every way, with one addition: an override code that removes QuitLock at once, armed or not, apart from the exit and its delay. The first tester build on a computer makes the code and keeps it in android/tester-code.txt (20 characters, such as 7K2M-QX4D-...; git ignores the file). Only its SHA-256 goes into the APK, and each later build on that computer uses the same code.

Warning

Keep android/tester-code.txt. Without it, an armed tester build is as hard to remove as a release: an exit that waits out the delay, or a factory reset.

To use it: on the phone, Leave or recover, Remove with the tester code, and type the code (case, spaces and dashes do not matter). Removal is the same teardown as an exit, and the history records it as removed with the tester code.

The Gradle build type is qa (./gradlew :app:assembleQa), because Gradle refuses build type names that begin with “test”. The code lives only in the src/qa source set, with the removal it shares with dev builds in src/instantRemoval; a release build contains neither (Invariants, invariant 5). Builds aim to be reproducible, so anyone can check a release against the source (Releasing).

Dependencies

The desktop programs live in one Rust workspace, desktop/, with one Cargo.lock. Every build uses --locked, so a build from the same commit uses the same crates.

cargo deny check (in desktop/, after cargo install --locked cargo-deny) checks them against desktop/deny.toml:

  • Advisories: any RustSec advisory against a crate in use fails, and so does a yanked version.
  • Licences: only licences compatible with the GPL-3.0-or-later.
  • Banned crates: a second TLS or HTTP stack (OpenSSL, native-tls, reqwest, hyper) or an async runtime. The only network code is the GitHub download and the DNS filter check, both through ureq and rustls (Decisions).
  • Sources: crates.io only.

CI runs it on every push, and scripts/check-invariants.sh runs it when cargo-deny is installed.

The desktop app

The desktop app (desktop/gui) uses egui with its OpenGL renderer. It builds with nothing but Rust on Windows and Linux: on Linux, X11, Wayland, OpenGL and the keyboard library are loaded when it starts, so no -dev packages are needed, and the program links only to the C library. cargo run -p quitlock-gui (in desktop/) starts it; -- --page settings opens on a page.

Releases build it for Linux on the oldest Ubuntu runner, for an older glibc than the newest, so it runs on more systems; the CLI stays a static musl program. scripts/verify-release.sh checks the CLI only: the desktop app is built the same way, but no one has yet confirmed that its builds match byte for byte.

Testing

From the repository’s root; each line can be pasted on its own or all together:

(cd desktop && cargo test --workspace)                        # library, CLI, desktop app and shared test vectors
(cd desktop && cargo test --workspace -- --include-ignored)   # also the two tests that use the network (GitHub, a DNS filter)
(cd desktop && cargo deny check)                              # advisories, licences, banned crates
(cd android && ./gradlew :core:test)                          # Kotlin logic; needs only a JDK
(cd android && ./gradlew :app:assembleDebug :app:assembleQa :app:assembleRelease)
scripts/check-invariants.sh                                   # permissions, no networking code, no dev code in release
scripts/check-docs.sh                                         # the book builds, its links resolve, every page is listed

CI runs all of these, except the two network tests, on every push to main and dev and on pull requests; the desktop tests run on Linux and Windows.

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 (desktop): 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
quitlock-gui-<version>-linux-x86_64The desktop app for Linux
quitlock-gui-<version>-windows-x86_64.exeThe desktop app 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 and desktop app carry the SHA-256 of the release signing certificate. Provisioning uses it to refuse an APK that claims to be QuitLock but is signed by anyone else. A program built without it (any local build) provisions dev and tester 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 org.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 project’s domain quitlock.org, 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 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 and the desktop app for Linux and Windows with the hash compiled in, and checks it is there;
    • 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 phones12Works on a Galaxy S20 FE (Android 13) with an armed tester build, from Linux (2026-12-03); other phones and the details not yet; 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 browser settings and there is no config field for it

The app passes these to setApplicationRestrictions for com.android.chrome, and since issue #15 for every verified and candidate browser in Browsers, 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, or any other browser, obeys them. The AOSP emulator images have no Chrome; this is on the manual checklist, and the results go in the Browsers table. Setting restrictions for a package that is not installed works (PolicyTest.everyConfiguredBrowserGetsThePolicyInstalledOrNot). Not checked: that a browser installed later reads them on first launch.

Other browsers (2026-12-05, from vendor documentation, not tested): Microsoft documents these policies for Edge on Android, and Brave says it supports Chromium’s policies. Mozilla offers no managed configuration in Firefox for Android. Samsung documents its browser policies for Windows only. Opera documents none, and its free VPN is a proxy inside the browser.

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 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. New installs are asked about one package at a time; at each check, one query without a package finds browsers in the arming baseline, which are then remembered. 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.
  • From the computer, setup asks the same with cmd package query-activities --components, once with --query-flags 0x20000 (MATCH_ALL) and once without, and adds known browsers from pm list packages -e. Not checked: which Android versions take --query-flags, and whether a query without it names only the default browser (on the manual checklist).
  • 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 desktop/core/tests/fixtures/preflight/api36 and api29; the parsers in desktop/core/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 checks 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

Works on one phone. On 2026-12-03 the owner used the accessory from a Linux computer with a tester build armed on a Galaxy S20 FE (Android 13), adb off. It first failed with “the sync was answered before it was sent”: the phone answered in the same moment the computer’s write reported done. The program now collects that write and goes on (Changelog, milestone 17), and then it worked. The USB modes, a large transfer and a killed program, in Manual checks, are still to do.

Before that, emulators had no USB accessory and no phone was attached. What was checked then:

  • 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. Where an item says “release build”, a tester build will do: it runs the release’s code, and its tester code removes it at once if something goes wrong. Elsewhere a dev build will do (it can be removed instantly with Remove now). A real 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.

  • The tester code. Arm a tester build, then Leave or recover, Remove with the tester code. Expected: a wrong code is refused and nothing changes; the right one removes QuitLock at once, and the history (quitlock log pull before the uninstall) shows it.

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.
  • Setup names browsers that will be suspended (issue #15). On a phone with Samsung Internet, and another browser installed (Firefox, say), run quitlock provision --check and the desktop app’s Set up. Expected: both are named and Chrome is not; the desktop app does not go on until the box is ticked; quitlock setup asks before going on. Also run adb shell cmd package query-activities --components --query-flags 0x20000 -a android.intent.action.VIEW -c android.intent.category.BROWSABLE -d https://quitlock-browser-check.invalid/ and note whether this Android takes --query-flags and lists every browser, or only the default one without it (platform facts, item 4).

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 USB debugging, 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 that is not supported (Firefox, Opera GX). Expected: suspended, and the status screen says why.
  • A browser that came with the phone (issue #15). On a Samsung phone, arm with Samsung Internet installed and enabled. Expected: Samsung Internet is suspended, links open in Chrome, and nothing the phone needs is suspended with it (note any other app suspended as a browser). Add it to browser_allowlist: after the delay it runs. Also update an already-armed phone from a build before this change. Expected: Samsung Internet is suspended at the first check.
  • Candidate browsers (Browsers, “Testing a browser”). With a dev or tester build, for each of Edge, Brave, Vivaldi and Chrome Beta: install it after arming, check each column, and record the results in the table. Then, with a release build: the browser is suspended until it is marked verified.
  • 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.

When the app fails (added 2026-12-03; any build unless noted)

  • Recovery from the icon. Long-press QuitLock’s icon and tap Recovery. Expected: the Recovery screen, with the state and, after Pair a new key, the device ID; Try the main screen again opens the main screen.
  • Recovery when the main screen keeps crashing (dev build). With Developer tools, or adb shell am crash org.quitlock.dev twice while the main screen is open, then open QuitLock. Expected: Recovery opens instead, and lists the two crashes under Recent problems.
  • A broken connection is only that. Pull the cable mid-command (adb, then the USB accessory). Expected: the CLI reports the lost connection; QuitLock keeps running, and the next command works.
  • Re-pair from a file (armed). Pair a new key on the phone, then on the computer quitlock key new spare and quitlock enrol --key spare --to-file pair.qlb --device-id <ID shown> --config <the phone's settings>. Import it in Recovery. Expected: accepted, and quitlock status with the new key shows it as the owner key.

Review fixes (added 2026-12-04)

Fixed in code and unit-tested where a unit test can reach; these need a phone.

  • The Leave screen at rest. Open Leave or recover and leave it for a minute. Expected: it does not flicker or reload by itself; after Pair a new key or Request exit, it shows the new state once.
  • The tamper watch after it trips (release or tester build, armed). During a debugging window, do something the watch catches (as in The debugging window), then open another window and catch it again. Expected: both trips are logged and each window closes; no second watch keeps running after a window closes.
  • An update across a process kill. Send an update while USB debugging is allowed, then kill QuitLock (adb shell am force-stop, or reboot) before the window closes. Expected: when the window closes, or at the next start, the update installs, or the main screen shows why it did not; it is never silently lost.
  • A partner phone PIN reset refused without a key. On a phone whose partner has a phone PIN or password and no key, send a reset of the partner’s phone PIN signed by the owner alone. Expected: refused as not permitted; with one partner key, the partner’s signature resets it.
  • The desktop app’s error box (Windows, in a virtual machine or over Remote Desktop with no OpenGL 2). Start quitlock-gui. Expected: a message box says the window could not open and points to the CLI.

Decisions

Every decision the design pages do not explain on their own, with its date and reason. Open ones wait for the project owner; the rest are settled until someone reopens them. When a decision changes, its entry is updated, and the old reasoning is kept in a sentence.

Package ID

Settled 2026-12-02: org.quitlock (dev builds org.quitlock.dev, tester builds org.quitlock.tester), under the project’s own domain quitlock.org. The Kotlin packages follow it (org.quitlock, org.quitlock.core).

It was dev.t342.quitlock from 2026-11-17, under the owner’s domain t342.dev, because the earlier placeholder org.quitlock.app claimed quitlock.org before the project owned it, and someone else could have registered it first with Google or a store. Once the project held quitlock.org, the ID moved to it. No phone ran a release yet, so the move cost only reinstalling test phones.

It cannot change once phones run a release: Android treats another package ID as another app, and device owner cannot move to it, so every phone would need an exit and a fresh setup. The domain must stay renewed, so no one else can appear to own the name.

Open

Arming when the battery dialog is declined (milestone 10)

Arming goes ahead; the self-check then reports it on every check, and a tap asks again. Refusing to arm would be stricter, but would also block arming on a phone whose battery settings misbehave. No better option found; kept.

Re-pairing replaces the config (milestone 5)

The enrolment after a re-pair carries a config, so it replaces the config as well as the keys. While armed it may only keep or tighten the config in force, so this cannot loosen anything. No better option found; kept.

looks_like_android matches cameras (milestone 12)

The CLI looks for a phone by its MTP, PTP or adb interface. A PTP camera matches too, and is then sent AOA request 51, which it should stall. Harmless as far as is known; narrowing the match would miss phones in PTP mode.

Made for groups (2026-12-03)

Asked for so a church youth group could use QuitLock, with two leaders as partners for each member.

  • Up to ten partners per phone, each with a key of their own. A partner phone PIN or password stays possible only with at most one partner key: it would not say whose it is.
  • The member is always needed to loosen. Partners alone can never loosen protection; they can only approve, and, when the rule says so, tighten.
  • The partners’ rule sets how many partners a loosening change needs (then the delay), how many make it apply at once, and how many may tighten without the member. This amends invariant 1: at once is off by default, needs the owner too, and a weaker rule always waits.
  • Approvals are by key only for several partners; the phone takes no per-partner PIN.
  • A change sent with enough approvals for the delay starts counting down at once; the phone does not hold it for more. Signatures for at once are gathered in a file first.
  • Damaged rule: all partners, never at once, no tightening by partners.

Made for the desktop app (2026-12-02)

  • One library, two programs. desktop/core (quitlock-core) holds every operation; desktop/cli (quitlock) and the desktop app only ask questions and show answers. The library prints nothing and depends on no terminal or window library, which scripts/check-invariants.sh checks. Emphasis in the library’s text goes through a painter each program installs (style.rs), so the CLI keeps its colours and the app gets plain text.
  • The desktop app is a second program, quitlock-gui, rather than a window inside quitlock. On Windows a program is either a console program or a window program; one that is both opens a console window behind the app, or loses its output in a terminal. Two programs keep each simple, at the cost of a second download.
  • egui with OpenGL (glow), for one look on Windows and Linux, a single file with nothing to install, and no web engine. Rejected: a web view (Tauri), which brings a browser engine and JavaScript to a program that holds signing keys; GTK or Qt, which Windows lacks. Native file dialogs (rfd) were left out too, since on Linux they need GTK or an async runtime that cargo-deny bans; the app has a small file chooser of its own.
  • On Linux the desktop app is a glibc program, since a window needs the system’s OpenGL and display libraries, which a static musl program cannot load. It is built on the oldest Ubuntu runner for an older glibc.
  • Cancelling stays on the phone. The app shows a countdown or a waiting change and says to tap Cancel on the phone. Cancelling from a computer would need a new kind of bundle, and adds nothing: anyone holding the phone can already cancel.
  • What the app does that the CLI asks about, it asks about too: it removes users and profiles only after a confirmation, sends a DNS filter that does not answer only when told to, and never runs sudo.
  • Dependencies are checked with cargo-deny (desktop/deny.toml): RustSec advisories, GPL-compatible licences, crates.io only, and bans on a second TLS or HTTP stack and on async runtimes, so the rule that only the GitHub download and the DNS filter check use the network stays checkable as the app adds crates. Its first run found RUSTSEC-2026-0620 in curve25519-dalek 5.0.0; QuitLock never builds the affected AVX-512 backend, and 5.1.0 is used now.

Made after the first phone test (2026-12-01)

The owner’s first armed test on a real phone (Android 13) found the CLI hanging, setup’s settings never reaching the phone, and a main screen that contradicted itself. Decisions, each confirmed by the owner:

  • Sessions are gone; the phone answers while it is unlocked, with no tap. A session had to be opened on the phone before every command; the CLI then waited up to 5 minutes for it, which looked like a hang, and each command used up the session. Unarmed and in dev builds the tap protected nothing, since adb was on anyway. Now a command connects, works and disconnects. Requiring the phone to be unlocked keeps an idle phone from answering whatever it is plugged into. Every change still needs a signature, so serving without a tap adds no way out.
  • The 5-minute USB debugging tap stays for armed phones (renamed Allow USB debugging), with its limit, tamper watch, self-check and log entries, because an adb shell is still a shell. Invariant 13 is unchanged in substance.
  • The CLI fails at once when adb says the phone is unauthorised, offline or not permitted, with what to do, instead of waiting. It waits only for the phone to be unlocked and for Android’s accessory chooser.
  • --transport 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 were offered in every session, and are on every connection now. The accessory stays open between connections, because a closed accessory cannot be reopened while a read on it is blocked; while plugged in, the phone stays in accessory mode and file transfer is off.

Protocol and keys

  • Canonical JSON payloads (milestone 0): one encoding per value, anything else rejected. Two parsers that disagree (duplicate keys, say) would let a bundle show one thing and do another. Signatures are still verified over the received bytes.
  • A binary envelope (QLB1) rather than a text format.
  • Every signature must be valid and from a known key; one good and one bad is rejected.
  • sequence_in_future: more than 24 hours ahead of the phone’s clock is rejected, since one far-future bundle would otherwise block all later ones.
  • Enrolment is self-signed by an owner key it lists.
  • Bundles last 24 hours; those that need a partner, and drafts, 7 days.
  • Small-order keys are not rejected (milestone 2); unreduced S is. The two libraries do not promise the same behaviour on small-order points, and such a key can only be enrolled by the person it would fool.
  • Key files: Argon2id at 64 MiB, 3 iterations, 1 lane; names of 1 to 32 characters from a-z 0-9 _ -; kept 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 a managed browser and without enrolment, since the test images have neither. It still stores the browsers’ 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 judged like new ones (issue #15). Samsung Internet came with the phone and ran unfiltered. An unmanaged browser in the baseline is now suspended unless it is on browser_allowlist. Already-armed phones apply this on update, as tightening.
  • Managed browsers come from a table (Browsers.kt, Browsers): verified, candidate or unsupported. Candidates get the configuration in every build, but are exempt from the browser rule only in dev and tester builds until a phone test verifies them. Unknown browsers are unsupported.
  • A release build arms once any managed browser is installed, not only Chrome. This replaces the open item “Arming without Chrome”: with only Chrome verified, nothing changes yet.
  • Apps disabled at arm are dormant: enabling one later counts as a new install.
  • Facts are kept, the verdict recomputed: taking a browser off browser_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 delayOnly when the phone’s rule allows it (off by default); see Made for groups
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; on 2026-12-03, with a tester build armed, the USB accessory worked. Other makers, a release build, and the rest of Manual checks are still to do.
  • The USB accessory in detail (platform facts, item 22). It worked on the S20 FE with an armed tester build; not yet checked: 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: CI builds the CLI and the desktop app and runs their tests on Windows, but neither has been used against a phone there, nor have its adb drivers. The message box shown when the desktop app’s window cannot open has not been seen.
  • Fixes from the 2026-12-04 review that only a phone can show: an update across a process kill, the tamper watch after it trips, the Leave screen at rest, the self-check going on past a failing step, and a partner phone PIN reset refused without a partner key (Manual checks).
  • 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.

21. Browsers (2026-12-05)

Issue #15: Samsung Internet came with the phone and ran unfiltered, since browsers installed before arming were left alone and only Chrome was configured.

  • A browser table (Browsers.kt, mirrored in desktop/core/src/browsers.rs): Chrome verified; Chrome Beta, Dev and Canary, Edge, Brave and Vivaldi candidates; Samsung Internet, Firefox, Tor, Opera, Opera GX and others unsupported, each with the reason. A new guide page, Browsers, lists what each honours and how to test one.
  • Every verified and candidate browser gets the browser settings, installed or not. Candidates are exempt from the browser rule in dev and tester builds only, until a phone test verifies them.
  • Browsers in the arming baseline are judged too: an unsupported one is suspended unless on browser_allowlist, on already-armed phones as well.
  • A release build arms with any managed browser installed, not only Chrome.
  • Setup warns about browsers that will be suspended (Finding::UnmanagedBrowsers, never a blocker) and asks you to save their data first: a tick box in the desktop app, a question in quitlock setup.
  • The phone names why a known browser is unsupported; the computer warns when browser_allowlist names one, and the change list says “browser” instead of “Chrome”.

20. Review fixes (2026-12-04)

A review of the whole repository, asked for by the owner.

  • A partner’s phone PIN can no longer be cleared without a partner key. With a partner known only by a phone PIN, phone_secret_allow for the partner (approved with that PIN on the phone) cleared it, which ended partner mode at once, with no owner signature and no delay. The phone now refuses it unless there is exactly one partner key; one shared vector added.
  • Damaged storage that lost every owner key no longer hides Pair a new key: Leave or recover shows it while QuitLock is device owner. The re-pair dialogs say the real wait (72 hours or more when armed with a partner or damaged settings; at once otherwise), on Recovery too.
  • The self-check runs each check on its own, so one that throws can no longer skip turning USB debugging off or rescheduling the periodic check. “Automatic time was off (re-applied)” is no longer said while it is still off.
  • Arming holds the bundle processor’s lock, so a change judged while the phone was not armed cannot be applied at once to a phone that has just armed.
  • Reading damaged settings no longer fails on a full disk; the reading stands and is made again next time.
  • The Leave or recover screen no longer reads the phone’s state over and over while it is open (or left in the background).
  • The tamper watch is taken down after it reports, instead of leaving its observer, receivers and thread running.
  • An update is no longer lost when the app’s process dies between writing it and installing it: the installer session is kept on disk, and the next start installs it (or says why it could not).
  • A torn last line in the event log (a power cut during a write) no longer starts the numbering again at 0.
  • History names a waiting change dropped by a re-pair (“a new key was paired”) instead of showing re_pair.
  • Builds other than the tester build no longer make or read tester-code.txt.
  • One damaged key file no longer hides every key on the computer. A key write cut short (a crash, a full disk) left a half file that made key list, key picking and the desktop app fail, or show no keys at all and refuse every name. A failed write now removes what it wrote; unreadable key files are left out, and both programs name them.
  • Files replaced in place (config pull, partner sign, quitlock.toml) are flushed before the swap, a .partial left by an interrupted run no longer blocks the next, and Windows says when the file is open in another program.
  • The desktop app keeps no copies of PINs, passwords or recovery phrases in its fields’ undo history, and the three typed check words are wiped like the rest. It warns when it cannot find the folder for keys.
  • Windows: the desktop app no longer opens a console window for every adb call; if its window cannot open (no OpenGL 2, as in some virtual machines and Remote Desktop), it says so in a message box instead of doing nothing; the file browser lists drives without touching each one, so an offline network drive no longer freezes it. config edit passes EDITOR to cmd correctly, and waits when Notepad returns before the file is edited. The recovery phrase check clears the screen on every console. Setup no longer says an armed phone talks over USB without USB debugging on Windows, where only adb works.
  • An adb call can no longer hang past its time limit waiting for output held open by an adb server it started.
  • Bundles as files with no connection at all. exit request, config push and update take --device-id with --to-file, and then write the signed file without connecting; before, every command but enrol connected first, so --to-file did not help when no connection worked. Leave or recover now always shows the phone’s device ID.
  • CLI fixes: the “Approving it” instructions after a change that waits for a partner were never shown (they looked for partner_key, which the phone no longer sends); --draft --to-file on a partnered phone sent the change and wrote no file; enrolling again with --partner or --rule on a phone that already has your key said it worked and set neither, and now says how to; --transport help said the accessory comes first. An empty GH_TOKEN no longer hides GITHUB_TOKEN.
  • Partner approvals: a partner key being added now reads as needing a partner’s approval (the new partner’s own, and on a phone with partners, theirs), in partner review and the desktop app.
  • Desktop app: Save it for my partners to sign checks the DNS filter first, as sending does; a failed read of a waiting change can be tried again; after a setup that failed, the phone can be given back to the Phone page, and Connect elsewhere no longer uses the phone while setup has it; closing the window waits at most 2 seconds for the connection; a Disconnect pressed just before a retry is no longer lost; a waiting rule change is named.
  • The desktop programs read config entries as the phone does (its whitespace, and lengths in UTF-16 units), so the phone can never hold a config they cannot read; oversized bundles and frames are errors, not crashes.
  • Checks: CI runs on pushes to dev too, builds the tester APK, uses the release workflow’s Rust toolchain and pins third-party actions to commits. The check that a release APK has no dev-only code could pass when it found some (a pipe under pipefail); it now reads the code whole, and checks tester APKs too. The release workflow checks the certificate hash in the Windows programs as well. The book check fails on a page missing from the summary.
  • Docs: --to-file and --device-id; the desktop app in the overview, releases and installing; several partners and the real button names in the desktop and phone app guides; Recovery in the phone app guide; the DNS filter check as network use; the USB accessory recorded as working on the S20 FE with an armed tester build; protocol pages without the old section numbers, with sixteen signatures and connection protocol 2; testing commands that can be pasted together.

19. Several partners and their rule (2026-12-03)

Asked for by the owner, for a church youth group with two leaders as partners for each member (Decisions).

  • Up to ten partners per phone, each with a key of their own. Enrolment takes partner_keys; another partner joins in person or by invite as the first did, approved by the partners already there, and waits out the delay. A partner phone PIN or password stays possible with one partner only.
  • The partners’ rule: how many partners, with the member, a loosening change needs (then the delay); how many make it apply at once; and how many may tighten without the member. The default is partner mode as before. A weaker rule always waits; a damaged one reads as the strictest. Invariant 1 is amended to allow at once, off by default.
  • Protocol: a rule bundle; partner_remove names a key; 16 signatures per envelope; status reports partner_keys, rule, and for a waiting change approved_partners and partners_needed; the log has partner_key_ids, a rule entry and at_once. 28 new shared vectors, run by both the phone and the desktop.
  • Phone: People lists every partner and says the rule in words; Add another partner; the waiting change says how many partners still need to approve.
  • CLI: quitlock partner list, quitlock partner rule, partner remove --partner; --partner (repeatable) and --rule when enrolling.
  • Desktop app: People lists every partner with Remove… for each, says the rule in words and edits it; wherever enough partners could make a change apply at once, Save it for my partners to sign writes the signed file for them first, since sending starts the delay.

18. The desktop app does the rest (2026-12-03)

  • Partners in the desktop app. Found by the owner: the app held the phone’s connection, so a partner could not run quitlock partner join beside it, and the app itself had no way to add a partner. A new People page joins as the partner in person (with a key on that computer, or a new one), writes an invite, joins from one and accepts the reply, removes the partner, adds and removes owner keys, and clears a forgotten phone PIN or password (The desktop app). The phone’s own partner messages now mention the app.
  • Keys in the desktop app: make, restore, show a recovery phrase again, save a copy and import one. Making a key is one widget, shared by Set up, People and joining, and refuses a taken name before anything is typed.
  • Request exit on the Phone page, signed or to approve on the phone; Send a change from a file in Approvals, for a change the partner approved and sent back, which before could only be sent with the CLI.
  • The file browser takes a typed folder and, on Windows, every drive.
  • Fixes: the Settings page lost what was being typed into a list’s field at every read of the phone (every 5 seconds); a bug in a job or while reading the phone ended the connection’s thread and left the window waiting for ever (now it is reported and the connection made again); a background task that stopped on a bug left a spinner for ever; several fields had no name for screen readers.
  • Tests that drive the window: egui_kittest clicks and types through making a key and checking its phrase, restoring one, setup’s first step, showing a phrase, joining from an invite, joining in person, request exit, a refresh while typing, and copying a key out and in; and draws every page in both themes, which fails on a character missing from the fonts or a field with no name.

17. The desktop app (2026-12-02 to 03)

  • quitlock-gui, a desktop app for Windows and Linux (The desktop app): connect in one click (it reconnects by itself), the phone’s state with any countdown or waiting change, a settings editor with a live review of what tightens and what loosens, approvals on the phone and from a file, the history, and the five setup steps. Releases carry it for both systems.
  • One library for both programs. The CLI’s code moved into desktop/: core (quitlock-core) does every operation, cli (quitlock) and gui (quitlock-gui) only ask and show. The CLI’s commands and output are unchanged (Repository).
  • cargo-deny checks the dependencies on every push: advisories, licences, banned crates and sources (Building). Its first run moved curve25519-dalek to 5.1.0 (RUSTSEC-2026-0620, in a part QuitLock never built).
  • Smaller programs: release builds use link-time optimisation and leave out symbols.
  • The USB accessory no longer refuses a fast answer. Found by the owner on the first armed tester build: the phone often answers the sync in the same moment the computer’s write of it reports done, and the program took the not-yet-collected write for one not yet sent (“the sync was answered before it was sent”). The answer carries the sync’s fresh nonce, so the phone had read it; the program now collects the write and goes on. Never seen before because the accessory had not been used on a real phone.
  • Replugging should no longer lose the phone to adb. Found by the owner with the desktop app: after a replug, adb did not show the phone again until adb kill-server. Just after a replug the adb server lists the phone a moment late, and the program then switched the phone to the USB accessory under it. A phone with USB debugging on is now never switched while adb runs; the program waits up to 10 seconds for adb instead, and for a phone adb reports offline for a moment (Connecting).
  • The app cannot trap anyone by failing (When the app fails). Asked for by the owner after the accessory bugs: a fault in a connection now ends only that connection, crashes are recorded (no messages), and a main screen that fails or keeps crashing opens Recovery, also on the icon’s long-press, with the ways out on a screen of its own. Random and damaged input tests cover every parser and the bundle processor.
  • Re-pairing from a file. quitlock enrol --to-file --device-id <ID> makes a re-pair bundle without a connection; the phone shows its ID during a re-pair. Before, a file enrolment always carried a new device ID, which a phone that already had one refused.
  • Setup recommends the owner phone PIN, so Request exit on the phone works without the computer.
  • Desktop app: no more empty boxes. Some marks were missing from the app’s fonts; they are replaced, and a test checks every character the window can show.

16. Own domain, tester builds (2026-12-02)

  • Tester builds (scripts/build.sh apk --tester, package org.quitlock.tester): a release build in every way, signed with the local debug key, plus an override code made on the computer that built it, which removes QuitLock at once. For testing what a release does without dev-build shortcuts in the way (Building).
  • Package ID org.quitlock (dev builds org.quitlock.dev), now that the project owns quitlock.org (Decisions). A phone with an older build must remove it first; quitlock provision --check says so.
  • A security policy (SECURITY.md): report privately through GitHub’s vulnerability reporting; what counts, and what the documented limits leave out.
  • CodeQL: quitlock status was reported as logging sensitive data. It prints only which kind of phone lock each person has (PIN, password, screen lock), never the PIN itself; the helper was renamed to say so.
  • The book and README have a logo, badges, callouts for warnings and a new Tested devices page.

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.