Recovery minted the replacement code twice — one sent to the account
service, a different one wrapped into the identity record and shown on
screen. The first recovery looked perfect and left the account openable
only with a code nobody had ever seen. It takes a second recovery to
notice, which is to say it would have been noticed by somebody who had
already lost a passphrase twice. One code now reaches both writes.
The passphrase and recovery-code fields never told the keyboard what they
were, so autocorrect was live on both. A passphrase is chosen to be long
and memorable rather than dictionary-shaped, which is exactly the sort of
text autocorrect likes to improve, and an improved passphrase cannot be
recovered — only replaced with the code. The recovery code is twenty-eight
characters of base32 typed once, from paper, under stress. Both now
declare themselves, and the handle no longer gets a capital letter it
never asked for.
The recovery code is also laid out four groups to a line: left to wrap, the
last group split across lines as "…-YR" and "RK", on the one screen
somebody copies by hand with no way to check it afterwards.
Rows this device can read now come before the ones it cannot. An area is
shared by everyone cleared for it, so the listing carries other people's
files as rows without names — showing them is deliberate, but arriving at
a screenful of "Encrypted for another key" with your own folder below the
fold is a poor way to meet the thing.
The instrumented suites are new: registration, sign-in, recovering twice,
folders, upload, share links with the secret asserted to be in the
fragment, switching areas within a clearance, and a visual tour that
photographs each screen. Shared helpers live in one file, because the same
row-finder was copied into three and then fixed in one of them — and the
first version scrolled inside a `waitUntil`, which ran on the main thread
often enough for Android to declare the app unresponsive and kill the run.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The default was the clearance maximum, which is usually the wrong choice
for this command: the recipient has to be cleared for the same area, and
the reason to hand one over is often to meet somebody lower down.
Until now every account was an island: two people cleared for the same
label could see each other's rows and decrypt none of them, because each
had minted its own key for that label on first use.
The key is wrapped to the recipient's public key on this device. The
server stores a blob it cannot open and never sees the label key, which is
why this cannot be an administrative action performed on somebody's
behalf.
The dialog says "give them the key" rather than "share", because that is
what it does: durable read access to everything filed at the label, now
and in future, and there is no revocation yet.
Running the app on a phone threw "No AlgorithmParameterSpec classes are
supported" the first time anyone tapped Create account. Android's provider
is Conscrypt, not the JDK's, and its XDH key-pair generator rejects every
parameter spec while its key factory does not speak the XEC* specs at all
— none of which the JVM suite could see, because it passes there.
X25519 now goes through PKCS#8 and X.509 encodings, which both providers
already speak. That also removes the RFC 7748 little-endian BigInteger
conversion entirely, and with it a class of byte-order bug that produces
plausible keys agreeing with nothing.
An instrumented suite runs the published vectors on a device, so the next
provider difference fails in CI rather than in someone's hands.
Three consequences worth stating plainly:
minSdk is 33, not 26. Android exposes XDH from API 33; below that a
provider has to be registered at startup and nothing here does that, so
claiming 26 was claiming something untrue.
Cleartext is refused with a reason rather than failing as an unexplained
connection error. Bearer tokens ride every request, so a plain-http server
would put an account on a café network.
material-icons-extended is gone. It generates a class per icon and added
44 MB of dex for the five glyphs this app uses; three hand-written vector
paths replace it.
An APK now builds. Three things stood between the code and a binary, and
none of them announced itself:
The Android Gradle Plugin rejects JDK 26, which is what Homebrew installs
as plain `openjdk`. It needs 21.
AGP 8.7 does not support Gradle 9, and the system Gradle here is 9.7. The
wrapper pins 8.11.1 so the build does not depend on what happens to be
installed — which is what a wrapper is for, and this repository should
have had one from the start.
`Http` is internal to :client on purpose, so the app could not reach its
base64 helpers. Rather than widening the HTTP layer, base64 moves to a
public `Encoding` object and `Http` delegates to it — one implementation,
and the wire layer stays shut.
Also swapped ArrowBack for the auto-mirrored one, which is the only
deprecation the build had left to say.
Matching the web client. The error is asymmetric: start low and a
sensitive file lands in the open area because nobody touched a picker,
and once it has been read that cannot be undone. Start high and
everything is over-classified, which is irritating and reversible.
Sign in, register with a recovery code shown once, browse, switch area,
upload, download through a share sheet, and create password-protected
links. All of it sits on :client, which is already exercised end to end
by filesctl against both a self-hosted stack and files.flamenet.io.
The area banner is always on screen rather than tucked into a menu. Which
area you are working in decides where a new file lands and who can ever
read it, and finding that out afterwards is too late.
Rows this session cannot decrypt are shown, and say so. Hiding them would
be a lie about what the server knows.
⚠️ Not compiled. The Android SDK is not installed on the development
machine, so this module has never been through a build — noted in the
README rather than left for someone to discover.
Everything between the engine and an app: server discovery, the account
service, the file API, and a session that ties them together.
Recovery codes and share links move into the engine, and both agree with
the browser character for character — the vectors file now carries codes
generated by the JavaScript implementation, including one containing a Q,
because folding Q is the mistake that once corrupted a third of all codes.
BigInteger drops leading zero bytes, so decoding left-pads rather than
trusting the length; there is a test for exactly that.
`X25519.publicFromPrivate` recovers the public half by agreeing with the
basepoint. JCA hands back a public key only from a freshly generated pair,
and a session that unlocked a stored record has just the scalar — storing a
second copy would only create something that could disagree with itself.
`filesctl` exists so the cryptography can be exercised without an app, an
emulator, or a person tapping. Verified against the iOS engine as well:
one uploads, the other downloads, and the digests match.
MIT, matching the server. CI runs the suite on a plain JDK image, which is
the point of keeping this out of an Android module.
Implements the published specification in Kotlin: the lattice and its canonical
encoding, two-stage key derivation, the key hierarchy, keyed filename digests,
and chunked content encryption with truncation and reorder resistance.
A plain JVM library rather than an Android module, so `gradle test` runs without
an emulator or the SDK. Crypto that can only be tested on a device is crypto
that gets tested rarely.
Ten interop tests decrypt material produced by the JavaScript reference — an
identity record written in a browser, the key hierarchy beneath it, a filename,
and file content — so a framing or authenticated-data mistake fails there rather
than in the field.
Three platform details the specification did not have to state until now: the
X25519 wire format is a little-endian u-coordinate while JCA models it as a
BigInteger, HKDF is absent from JCA and is written out here, and WebCrypto's
PKCS#8 private keys need converting to raw scalars.
⚠️ XDH needs Android API 33; below that the engine needs a provider registered,
which it is written to accept without change.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>