Skip to content

Add native passkey integration and Android password autofill - #2

Open
zy6p wants to merge 13 commits into
Nerzouille:devfrom
zy6p:fix/system-passkeys
Open

zy6p wants to merge 13 commits into
Nerzouille:devfrom
zy6p:fix/system-passkeys

Conversation

@zy6p

@zy6p zy6p commented Nov 10, 2026 •

Copy link
Copy Markdown

Website passkey requests lacked an Activity-result bridge and Credential Manager origin permissions, and page views disabled Android's password Autofill service. This PR adds native WebAuthn integration and system password suggestions for review and real-device/provider testing, while retaining Koan's existing interface, gestures, login store and sync.

  • Add lifecycle-owned AndroidX IntentSender routing with unique request IDs and retained callbacks. Handle recreation, stopped/destroyed hosts and stale results without completing a later request.
  • Give native Credential Manager UI operations an Activity-backed context. Deliver outcomes after the same logical host resumes, so sequential website requests do not overtake a closing selector.
  • Map provider/user dismissal to NotAllowedError, while preserving the DOM's pre-aborted AbortError and other native results.
  • Preserve remote-only preparation handles alongside local credentials and authentication actions. The exact-version GeckoView 160 adapter also addresses capability detection without GMS and missing legacy FIDO failure/cancellation completion. Build-time guards check the reviewed native signatures and call sites.
  • Keep origins, RP IDs, challenges and response parsing in Gecko/Android/provider code. No JavaScript shim, user-agent change or provider-trust bypass.

Checks rerun after syncing with upstream dev 3be7319 on 2026-11-16: 446 app JVM tests and 11 adapter tests passed, with no failures or skips. The app, Android integration-test sources and standalone credential fixture compile successfully, including the transformed engine classes. No device/emulator integration run or new R8 APK build was performed on this updated head. Upstream's baseline-profile configuration and current app version are retained; the passkey changelog entries are under Unreleased.

Earlier validation, before this upstream sync: 15 Android integration tests passed covering request ownership, recreation, late results, lifecycle and error classification (callback-owner loss simulation, not a full process-kill test). The ARM64 R8 preview .6 was tested on a disposable Android 16/API 36 emulator with GMS disabled and a separate localhost-only synthetic provider. Tested paths include normal default-browser links, bound external Custom Tabs, registration, P-256-verified assertions, discoverable login, authentication-action handoff, no-match/cancellation/error retries and username/password Autofill. The opt-in BiometricPrompt/CryptoObject fixture also completed 17 per-use AndroidKeyStore operations, plus two manually canceled biometric flows followed by selector cancellation and successful retries. These are fixture/emulator results, not end-to-end validation of real password managers or physical fingerprint sensors.

Still to validate: real-device/provider interoperability. A vivo user running 1Password 8.12.44 reports that the fingerprint prompt opens, then fails/closes and falls back to the account password when invoked from Koan, for both Autofill and passkeys. Edge and the standalone 1Password app still unlock biometrically. This is a user report; the cause, first affected build and a fix have not been established. It is not confirmed to be an allowlist issue. No fix for this report is claimed by this PR.

Related provider lead, checked 2026-11-12: 1Password's Android index lists 8.12.44 as the latest stable release. 8.12.46-26 beta mentions a biometric-unlock loading-indicator fix (DV-2, !43428); its relevance to prompt closure/password fallback is unconfirmed, and the real-provider beta has not been tested here. These observations belong to the PR discussion, rather than repository incident records.

Known boundaries: providers must trust the browser package/certificate; Gecko Android conditional passkey suggestions and native in-flight cancellation remain unimplemented. Physical security keys, QR/cross-device authentication, real-provider biometrics and navigation/tab cancellation parity still need device/provider testing. The changes add integration capabilities; they do not establish feature parity with mature browsers or compatibility with every provider.

The standalone fixture, its keys and the ASM build tooling are excluded from browser APKs. Technical design: docs/PASSKEYS.md; source comparison/install identity: docs/PASSKEYS_REVIEW.md; reproducible fixture setup: tools/passkey-test/README.md.

Related to #1.

@Nerzouille

Copy link
Copy Markdown
Owner

Thanks a lot for the investigation and the PR, this is great! 🙏 (bahahah you just made my day honestly)
I'm finishing a review of a big batch of changes first, then I'll go through your PR carefully and test passkeys on my side. Could you retarget it to the dev branch? main only gets releases now.

@zy6p
zy6p changed the base branch from main to dev November 11, 2026 06:06
@zy6p zy6p changed the title Enable system passkey prompts and Android password autofill Fix system passkey flows, capability detection and password autofill Nov 11, 2026
@zy6p zy6p changed the title Fix system passkey flows, capability detection and password autofill Add native passkey integration and Android password autofill Nov 12, 2026
@zy6p

zy6p commented Nov 12, 2026

Copy link
Copy Markdown
Author

Koan is absolutely brilliant. The clean interface, bottom controls and gestures all fit together so well; the whole thing feels carefully designed. It captures the simplicity and elegance I loved about Arc Search, and it feels so good to use on Android. This is exactly the kind of mobile browser I've been looking for.

“安卓之光” is the best way I can describe it — a shining light for Android! Thank you for putting so much thought and care into it. 🙌

Do you have plans to publish Koan on Google Play in the future? If so, do you have any rough timeline in mind? I'd love to see more Android users discover it.

@Nerzouille

Copy link
Copy Markdown
Owner

Thank you so much, this genuinely made my day!

Google Play is the goal, but not yet: Koan signs in to Firefox Sync by identifying as Firefox, and I want to sort that out properly with Mozilla before putting it in front of many more people. Until then, GitHub releases and Obtainium are the way to get it.

About your PR: it's my first priority for beta 2, and your investigation is excellent. The missing Credential Manager permissions and the missing activity delegate were exactly the gap, and your write-up made the review easy.

I tested the permissions + activity bridge alone on two phones. They do their job: the request now reaches the password manager, while without them Android rejects it before any provider is asked. But both Google Password Manager and the Mi password manager then refuse Koan because it's not on their list of trusted browsers (Google says so explicitly and checks the signing certificate), the same wall you hit with 1Password. So nothing in Koan's code can fully fix passkeys for now; the next step would be getting Koan onto those allowlists (Bitwarden's community list might be the easiest start).

Koan is a one-person app, so I have to keep what I maintain small. I'd like to split it up:

  1. Passkeys, minimal: the two manifest permissions, WebAuthnController plus the MainActivity wiring, its unit test, and a few lines in FEATURES/PRIVACY. It's the right base for any provider that accepts Koan, and I'd merge it for beta 2.
  2. System autofill: happy to take it as a separate PR behind a setting (off by default), and never in private tabs. Koan fills its own logins, so I want to avoid double "save password" prompts and keep private tabs away from third-party services.
  3. The GeckoView bytecode patches: I can't take these, even though the fixes look right. The build fails on any GeckoView version but one, and engine updates come every few weeks, so I'd be re-reviewing bytecode on every bump. They'd make great bug reports for Mozilla (bugzilla.mozilla.org, GeckoView component), I'm happy to help file them, and Koan gets the fixes with the next engine.
  4. The fixture APK and emulator scripts: please keep them in your fork and link them from the docs, same for the preview-channel notes.

Could you open the first one as its own PR (squashed, on top of current dev)? I'd rather you do it so the contribution stays fully yours in the history. But if you're short on time, just tell me and I'll split it myself, keeping you as the commit's co-author.

Also, feel free to add me on Discord (nerzouille). It'll be easier to discuss about it if needed!

Thanks again, really appreciated 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants