A ring buffer made of audio files
The app runs as an Android foreground service of the microphone and location types, with a persistent notification, so Android lets it record with the screen off. Audio is encoded as 16 kHz mono AAC and written as short pieces (segments) of a couple of minutes each. When the total passes the window you chose, the oldest piece is deleted. Keeping copies a range of pieces out of the loop into protected storage.
- Crash-safe pieces. Each piece is a self-contained file, so if Android kills the app, everything up to the last piece survives and the service tries to restart itself; if Android won't give it the microphone from the background, a notification asks you to tap to resume. After the phone itself restarts, recording resumes with a tap on a notification. The gap is visible in the chain.
- Plays anywhere. A kept recording is joined into one standard
.m4a, and its original pieces travel with it in the evidence pack. - Gaps are explained. Each gap in the loop is matched against the app's health log (stopped, error, phone restart, update, restart refused) and Android's own record of why it closed the app, so the phone can say when each gap was and why.
- Scheduled windows are protected. Pieces inside a scheduled keep's window are exempt from pruning until it's kept, even if the window is longer than the loop.
What it gets you: the moment was recorded before anyone knew it mattered, and you only spend storage on what you choose to keep.
Keep controls, schedules and playback
- Keep from anywhere. The recording notification is public on the lock screen, and its Keep button starts the recorder service directly, so it works without unlocking. A home-screen widget and a Quick Settings tile do the same. Keep saves the last 15 minutes, or another length set in Settings; Keep custom time opens a zoomable timeline with handles that snap to whole seconds and a bar to listen from any point. With an app passcode set, the notification's Stop opens the app to ask for it.
- Scheduled keeps. A window set for any day is kept automatically when it ends, named and tagged. Ten minutes before, an alarm checks the recorder: if it isn't running it tries to start it, and if that fails it posts a notification to tap. Windows that ended while the phone was off are kept after it restarts or when the app opens, as long as their audio is still in the loop.
- From the calendar. Calendar sync reads Android's calendar store (CalendarContract), so Google Calendar and other calendars synced to the phone work without signing in. It looks from 24 hours back to 14 days ahead, every 3 hours, when the app opens and when its settings change. With no keywords set, every appointment is scheduled; all-day and declined ones are skipped. Each appointment's window can start up to an hour before and run up to two hours after, as set. A schedule follows its appointment while it's still upcoming. Nothing from the calendar leaves the phone.
- Organising. Names, tags and private notes. Search covers names, notes, tags and, with transcripts, what was said; filters by date range and by tags in use.
- Time of day. Playback shows the recording's start time plus the position. The start time comes from the phone's clock: timestamps bound it from above, and with location on, a GPS fix's time cross-checks the clock.
- Maps. With location on, a recording's fixes open on an OpenStreetMap map, with accuracy circles and a pin that follows playback. The map is loaded only when you open it: Leaflet from unpkg.com and tiles from tile.openstreetmap.org, which therefore see the area being viewed.
- Battery. Android gives apps their usage times, not their energy, so the battery screen multiplies the time Android records for each of the app's activities (microphone, keeping the phone awake, processing, GPS, mobile data, Bluetooth scanning) by a current measured once on a Galaxy A54 running Android 16. It's an estimate; other phones differ, rarely by more than a factor of two.
Unchanged, made on this phone, and existed by a certain time.
Each layer stands alone and is checked independently. An attacker would have to defeat all of them, including ones run by organisations that have nothing to do with us.
A SHA-256 hash chain
Each audio piece is hashed with SHA-256, a fingerprint that changes completely if a single bit of the audio does. Each piece's link then hashes the previous link together with that fingerprint, the piece's name and its start and end times. It's the same idea that holds a blockchain together, without the blockchain.
link = sha256( prev | sha256(audio) | name | startMs | endMs | ctx ) prev 3a6a5288…ec88b audio 9f04c1d7…b2e10 link 40caf634…45096
ctx commits to the optional surroundings for that piece (see Where and who), so they're as tamper-evident as the audio.
What it gets you: nobody, including you, can cut out a sentence, swap a section or reorder the audio without it showing. Gaps from when recording stopped are visible, not hidden.
Signed in hardware, attested by Google
On first run the app creates an ECDSA P-256 key in the Android Keystore, inside the phone's trusted execution environment, or a StrongBox security chip where the phone has one. The private key can sign but can never be read out, not even by the app. Every chain link is signed with it.
The key comes with a key attestation certificate chain, rooted in Google, that describes it from the hardware's point of view:
key held in trusted execution environment made by package com.tonyandfam.legalrecorder app signed by 5d4d11cb…efb7af bootloader locked, verified boot revocation list not revoked
The verifier checks the chain against Google's attestation roots and its live revocation list, and that the attested app signature is ours.
What it gets you: the recording provably came from this app, on one particular physical phone running unmodified Android. A copy of the app on a rooted phone, or a script on a laptop, can't produce these signatures.
RFC 3161 trusted timestamps
A phone's clock can be set to anything. So every ten minutes, and on every keep, the app sends the latest chain link (only the hash) to a public timestamp authority: Sectigo, with DigiCert as a fallback. The authority signs a token saying "I saw this hash at this time", following RFC 3161, the standard used to timestamp code signatures and signed PDFs. Kept recordings get their joined recording.m4a timestamped too.
authority Sectigo Public Time Stamping Signer time 2026-10-02 22:43:53 UTC for hash 40caf634…45096 signature valid, chains to trusted root
No signal?
Requests queue on the phone (Android WorkManager) and go out as soon as there's a connection. Because a link commits to everything before it, one later stamp still covers the whole recording up to then. The same setting turns off both timestamps and the log; requests already queued still go out.
What it gets you: an independent, commercial certificate authority vouches that the recording existed by a given time, so it can't have been made up afterwards. The token is signed, so it can be checked years later without contacting anyone.
An append-only Merkle-tree log
The same hashes, signed by the phone's key, also go to the Legal Recorder log. Every ten minutes the server gathers the new entries into a Merkle tree and gets the tree's root timestamped by the same authorities. The phone then fetches its Merkle path: the few sibling hashes that lead from its entry up to the root. It's the design behind Certificate Transparency, which keeps the web's HTTPS certificates honest.
What it gets you: a second, independent record of when each recording existed, that the people running it (us) can't quietly rewrite. Adding a backdated entry would change a root that's already been timestamped by someone else.
The evidence pack
Share sends two things: a playable recording.m4a, and a .zip evidence pack that carries everything needed to check it, offline, forever.
recording.m4a | The kept recording, trimmed to the range you chose. |
|---|---|
| Original pieces | The untouched audio pieces it was cut from, which the chain hashes cover. They run a little past the trimmed recording at each end. |
| Manifest | The SHA-256 of every file in the pack and its place in the hash chain. |
proof/ | The hash chain, each link signed by the phone's hardware key; that key's certificates, attested by Google; the RFC 3161 tokens; and the log's receipts and Merkle paths. |
surroundings/ | Only if turned on, and only the fields you chose to include. The rest go in as digests. |
transcript/ | Only if you tick it when sharing: the transcript as text, and with word timings and the model used, so it can be made again from the audio. It isn't part of the proof; it's software's reading of the audio. |
README.txt | What the pack is, the recording's name and times, and how to check it. |
What it gets you: the proof travels with the recording. Email it, put it on a USB stick or file it with the court; it doesn't depend on our servers, our company or the app still existing.
Verify in the browser, or with OpenSSL
The verify page
Drop the pack on the verify page. Every check runs in your browser with its built-in Web Crypto; the recording is never uploaded. You get plain-language results, a map if location was included, and the satellite and hum analyses.
Offline, for experts
tools/verify.py needs only Python and OpenSSL, and reads trusted roots from the repository. An expert witness can audit every step.
$ python3 tools/verify.py pack.zip [PASS] 9 of 9 original audio pieces unchanged [PASS] The hash chain is intact (9 links) [PASS] Phone key attested by Google, held in the TEE [PASS] Chain timestamped by Sectigo, 22:43:53 UTC [PASS] In the Legal Recorder log, batch #2
What it gets you: nobody has to take our word for anything. The other side's expert can check your recording with their own tools.
Context that's as hard to fake as the audio.
Each is a separate switch in Settings. While recording, observations are sealed into the same chain as the audio, so they get the same signatures and timestamps.
Location, cells, Wi-Fi and Bluetooth
Every two minutes
- A GPS fix and a network fix, with accuracy, satellites used and Android's mock-location flag
- The mobile cells in range and a Wi-Fi scan
- A short Bluetooth LE scan of nearby devices
Cross-checked
A GPS fix's time comes from the satellites, which also checks the phone's clock. The verify page can compare the Wi-Fi networks and cells against BeaconDB, an open database of where networks are, through a server endpoint that keeps nothing.
Selective disclosure
Observations are sealed per audio piece. The link's ctx is a hash over one salted digest per field:
ctx = sha256( "<field>=" sha256(salt | field | data) "\n" ... ) # fields sorted by name
When sharing you pick which fields to include. The rest go in as digests only: the chain still verifies, and you can reveal them later. The random salt stops anyone guessing a withheld field (say, which cell tower) by trying candidates against its digest.
What it gets you: you can prove where you were without giving away more than you need to, and you can't be accused of adding location afterwards: it was sealed while recording.
Recomputing the position from the signals
A location fix is only the phone's answer, and an app can fake it. So on phones that report them, every ten minutes the app can save fifteen seconds of the GPS chip's raw inputs (Android GnssMeasurement): each satellite's signal transmit time, Doppler shift, carrier phase and strength, plus the receiver clock and gain.
- Physics checks. The verifier checks the measurements behave like real signals: distance and Doppler agree, distances are physically possible, strengths vary between satellites, receiver gain is steady.
- Independent position. It solves the position from the measurements and the satellites' published orbits and compares it with the location the phone reported. On a real Pixel 7 log, that lands within about 10 m, as does RTKLIB run on the RINEX export.
- Offline too.
node tools/gnss.mjs pack.zip --rinex out.obsexports standard RINEX for anyone's GNSS software.
What it gets you: a mock-location app can't fake this. It would take a radio transmitter that fakes every satellite at once, consistent with real orbits for that day.
Two phones vouching for each other
Each phone broadcasts a short token over Bluetooth LE, and logs the tokens it hears from other Legal Recorder phones.
token = sha256(secret)[0..16) # fresh random secret every 10 minutes phone A commits secret in its signed chain, broadcasts token phone B logs "heard token" in its own timestamped chain later A reveals secret → sha256(secret) matches B's log ✓
B's timestamped record of hearing the token, plus A's signed commitment to the secret behind it, shows the two phones were within Bluetooth range at that time, typically tens of metres. The match is worked out on the verify page, with both packs. Tokens are random and change every ten minutes, so they can't be used to track anyone.
The one way to fake it is a relay: someone near A passing the token to someone near B in real time.
What it gets you: two independent recordings that corroborate each other, from two different phones with two different keys.
The hum of the power grid
Mains power hums at about 50 Hz, but the exact frequency drifts by millihertz from moment to moment, in step across a whole grid, and grid operators log it. Recordings made near anything mains-powered pick up that hum. Matching it is an established forensic technique.
"Analyse the hum" on the verify page, or node tools/enf.mjs pack.zip --reference grid.csv offline, traces the hum once a second, flags jumps, and finds where the trace matches a grid frequency log you supply as a CSV file. Phone microphones often filter out 50 Hz itself, so it looks at harmonics up to the 4th too.
It only works if something mains-powered was near the phone.
What it gets you: a date and time written into the sound itself by the national grid, completely independent of the phone, the app and us.
Done on the phone, outside the proof.
Neither changes what the proof covers. A transcript is software's reading of the audio, kept beside it; a call is ordinary audio in the loop, sealed like the rest.
Speech recognition on the phone
Off until you turn it on. Kept recordings are transcribed by Meta's Omnilingual ASR, a CTC model that handles English, Afrikaans and speech that mixes them, run on the phone with sherpa-onnx and ONNX Runtime. Silero VAD finds the speech first, so silence isn't transcribed.
Two sizes
- Standard: the 300M-parameter model, a 292 MB download
- Most accurate: the 1B model, 787 MB, about twice the time and battery
- Plus a 135 MB search model and tokenizer, once: about 430 MB in all with Standard, 920 MB with Most accurate
Downloaded from the projects' own releases on GitHub and Hugging Face, each checked against a pinned SHA-256. Wi-Fi only unless you allow mobile data.
Held to the languages spoken
The model knows 1,600 languages. You say which were spoken when you keep a recording (English and Afrikaans unless changed; the other official South African languages are offered too), and each decoding step may only write those languages' letters. Anything it could only spell in another alphabet comes out as (unclear).
- Automatic, or when asked. Every kept recording, optionally only while charging, after a two-minute wait for its languages. Changing them later makes the transcript again.
- Search by word and by meaning. Word search forgives spelling. Meaning search embeds each passage with multilingual-e5-small, so an English query finds an Afrikaans line. Both run on the phone, and the computer page asks the phone rather than searching itself.
- Kept beside the evidence, not in it. A transcript lives in the recording's
transcript/folder, never in its manifest or hash chain. It records the model it was made with, so it can be made again fromrecording.m4a.
Every transcript, on screen and in files, carries the notice: "Machine transcript, made on this phone by speech recognition software and not checked by a person. It may contain mistakes, especially with names, numbers, accents, and people talking at once. The recording is the record."
What it gets you: the line that matters in a four-hour hearing, found in seconds, without the audio or the words leaving your phone.
Keeping phone calls
During a call Android gives the microphone to the call, and other apps get silence. The one exception is an accessibility service, so the app has a small one, "Legal Recorder call recording", that you turn on in Accessibility. It does nothing but let the recorder keep the microphone; it can't see your screen or what you type.
- Calls go into the loop. The audio is sealed like any other. The app notes where each call started and ended, and whether it was a phone or an internet call; one that drops and resumes within five seconds counts as one.
- Offered when it ends. Each call is listed, ready to keep until it's recorded over, or kept automatically if you choose. A kept call runs five seconds either side.
- Named, if you allow it. With call-log access, a kept call is named "Call with" the contact or number, read on the phone.
- Installed outside the Play Store? Android 13 and later grey out the switch until you choose "Allow restricted settings" in the app's App info.
The phone records through its microphone, not the call itself. Your side is always clear; the other person is clearest on speaker. On WhatsApp and other internet calls, only your side is recorded.
Sealed from one phone to another.
Contacts are people whose phones you've added and checked. A recording sent to one is sealed so only their phone can open it, nearby or through our server.
Adding contacts and sending recordings
Each phone has a long-term sharing key (ECDH P-256, sealed by a hardware-backed key and vouched for by the device key). A contact card holds the name you chose (or the phone's name), that sharing key, the device key's certificate and signature, and a mailbox address.
- In person. One phone shows a QR code and the other scans it. The phones connect over Nearby Connections (Bluetooth, Wi-Fi Direct or the same Wi-Fi, no internet), derive keys from the code's secret, show the same six-digit code, and swap cards once both tap Add. A phone advertises itself under a random name, not yours.
- By invite link. A one-time link, valid 7 days, to send any way. Its secret is after the
#, which browsers don't send to a website; our server holds only the inviter's card, encrypted with that secret. Opening it shows who it's from and a six-digit code to compare, say on a call. Contacts added by link show as unchecked until the codes are confirmed. - Sealed envelopes. A recording goes as an evidence pack in an envelope sealed with P-256 key agreement and AES-GCM, so only the recipient's phone can open it and only the sender's could have made it. The recording's name travels inside. Surroundings start ticked and the transcript unticked; anything left out goes in as digests, so the pack still verifies. Tags and notes are never included. A recording passed on says who it came from originally.
- Nearby or online. Nearby is the default: the recipient waits on Received, Receive nearby, sees who it's from, and accepts or declines before anything is sent. Over the internet, when both the setting and that contact allow it, the envelope is uploaded in 16 MB parts to the contact's mailbox on our server, whose address is a hash of a secret only their phone holds. Their phone checks every 15 minutes and when the app opens, and downloads only once they accept. Accepted or declined, it's deleted from the server, and the sender gets a sealed receipt. Anything not collected is deleted after 7 days.
- Limits. 2 GB per recording; a mailbox holds up to 20 items and 4 GB.
Our server can't open an envelope, but it does see each item's size, when it was uploaded and collected, and how many are waiting in a mailbox. It keeps a hash of the IP address that created a mailbox for a day, to limit abuse.
What it gets you: a recording reaches the right person with all of its proof, without email attachments or file-sharing links, and without us being able to listen.
Recordings from other people
- Kept apart. Received recordings are unpacked under their own folder and never join this phone's chain or its list of recordings.
- Checked on arrival. Every piece's fingerprint, chain link and signature, with the signing phone matched against your contacts.
- Full check in the app. The verify page is built into the app and run on the pack exactly as it came. Its lookups (timestamp receipts, attestation status) go to legalrecorder.app when online.
- Yours to organise. Give one your own name, tags and notes (they stay on your phone and aren't sent on), search and filter them, and transcribe one that came without a transcript.
- Import. An evidence pack saved or shared from the app, as a .zip or an unzipped folder, can be imported. It's checked the same way and filed as imported.
Getting at your recordings, and keeping others out.
Recordings live on the phone. These are the two ways that's managed: a sealed link to a computer you approve, and a passcode on the app itself.
An end-to-end encrypted link, set up by QR code
legalrecorder.app/desk lets a computer browse, play, verify and save the phone's kept recordings, with nothing to install. The page shows a QR code holding a session id and a fresh P-256 public key. The app scans it, and both sides derive AES-256-GCM keys and a six-digit check code with ECDH and HKDF. You compare the codes and allow the computer on the phone, with the passcode if one is set.
- Sealed through a relay. Until a direct path opens, frames go through a relay (a Cloudflare Durable Object per session) that can't read them and keeps nothing. Frames are numbered, so none can be dropped, replayed or reordered unnoticed.
- Direct when possible. Once allowed, the page offers a WebRTC connection, signalled through the relay, using Cloudflare's STUN server to find a path. On the local network or peer to peer, messages move to it, sealed the same way. If it drops, the page asks again through the relay. Both screens show which route is in use.
- The phone serves, the computer only asks. The list (names, tags, notes and times) and one evidence pack at a time, built as for sharing. The page verifies each pack as it arrives, and saves the .zip or the audio alone.
- Transcripts and search. Where a recording has a transcript, the page fetches it in parts and plays from any line. Searching asks the phone, which searches its transcripts by word and by meaning; results come back with the times they were said. Transcripts are held only in the open tab, never in the stored copies.
- A waveform you can steer. The player draws the recording as its waveform, decoded in the browser, with the transcript's speech marked underneath. Click or drag anywhere to jump there, and zoom in down to 5 seconds across.
- Surroundings and map. Tiles for location, Wi-Fi, cells, Bluetooth and nearby Legal Recorder phones, the location checks, and the fixes on an OpenStreetMap map (loaded once asked for, then always), with a pin that follows playback.
- Received, sending and saving. Recordings contacts sent you have their own tab, with the same search and filters, and get the page's full check. Send to a contact goes over the internet through the phone's own queue. Save with choices writes a pack with only the fields you pick.
- Remembered computers. When allowing a computer, the phone offers Remember this computer (ticked), set to Ask me each time or Connect straight away. Both derive a long-term secret, and the phone keeps a quiet connection to the relay for each remembered computer, pinged every 4 minutes. A page opened later proves it holds the secret and is let in, straight away or once allowed. Settings lists linked computers with Unlink; the phone forgets one unused for 14 days, the browser after 30.
- Kept for next time, encrypted. Packs the computer has received stay in that browser, encrypted with a key it won't export, filed by phone and recording. A copy is used only while the phone's fingerprint of that recording still matches, so new proof or a rename fetches it afresh. Copies go after 30 days unopened, and Remove clears them all.
- Short-lived. The link ends after 30 minutes unused, after 4 hours or 4 GB whatever happens, from the phone's "Computer link" notification, or when the tab closes. A reloaded tab reconnects without another scan.
What it gets you: a big screen for listening and preparing, without your recordings being stored on any server. The packs the computer gets are the same ones you'd share, checked the same way.
A passcode, with recovery by email
Optional, in Settings. The app locks as soon as the phone's screen goes off, whether it was open or minimised, and asks again when it starts afresh (swiped away, phone restarted) or after a day away. Switching to another app with the screen on doesn't lock it, so you can fetch an email code without losing your place. Only a salted PBKDF2 hash is stored. The fifth wrong try starts a 30-second wait, and each one after that doubles it, up to an hour.
Keeping is never locked
Keep still works from the notification, widget and tile without the passcode. The notification's Stop goes through the app and always asks for it, however recently it was entered. The Stop button inside the app, which is already unlocked, asks you to confirm.
Recovery email
Confirmed with a code when you add it. To reset, the phone makes a six-digit code and the server emails it (at most 5 an hour and 20 a day per address). The phone checks it: 15 minutes, 5 tries. The server keeps only one-way hashes of the address and of the IP address that asked, for a day, to enforce those limits (and 10 an hour and 50 a day per IP).
Without a recovery email, a forgotten passcode means clearing the app's data, recordings included.
We only ever see hashes
A SHA-256 hash is one-way: it reveals nothing about the audio, and the audio can't be reconstructed from it. That, with the phone's signature, is all the timestamp authorities and our log ever see.
What leaves the phone
- SHA-256 hashes of the audio, the phone key's signature on each, and its public key
- What you share, when you share it. A pack carries the recording's name, and its transcript only if ticked
- Recordings you send a contact over the internet, sealed for their phone, on our server until collected or for 7 days at most
- Your contact card, when you add someone: in person over Nearby, or by invite link, encrypted on our server for up to 7 days
- Your recordings list (names, tags, notes and times), and the recordings and transcripts you open, to your own computer, end-to-end encrypted
- A recovery email address, only to send a code; the server keeps hashes of it and of the requesting IP address for a day, for rate limits
- The area of a map you open, to OpenStreetMap's tile servers
- Wi-Fi networks heard, to BeaconDB through our server, only when you run that check on the verify or computer page
What we never see
- The audio or its transcripts; what passes through us is sealed
- Your tags and notes, which stay out of shared and sent packs too
- Calendar contents and the call log, read on the phone
- Anything for an advertiser or analytics service
Turning on transcripts downloads the speech and search models from GitHub and Hugging Face, once. Nothing of yours is sent with the request.
Online timestamps can be turned off in Settings. That stops both the timestamp authority and our log for new recordings, and recordings then rely on the hash chain and the phone's signature alone.
Our server runs on Cloudflare, with request logging switched on. Nearby Connections runs through Google Play services on the phone.
What the proof shows, and what it doesn't
Evidence is only as good as the claims made about it. These are ours.
It shows
- The audio hasn't changed since it was recorded
- It existed by the time of its timestamp
- It was made on a particular phone, by this app
- Where the recording has gaps, for instance when it was stopped
It doesn't show
- Who is speaking, or what was meant
- That a transcript is right. It's software's reading of the audio, outside the proof
- What was said outside the part that was kept
- The exact start time beyond the phone's clock; timestamps bound it from above
- Anything from a time the recorder was off
- Whether a court will admit it. That is for the court to decide.