Skip to content

Add QR code export: GUI on-screen display + CLI ASCII-art (#45) - #103

Merged
sidick merged 1 commit into
mainfrom
qr-export-45
Jul 28, 2026
Merged

sidick merged 1 commit into
mainfrom
qr-export-45

Conversation

@sidick

@sidick sidick commented Jul 28, 2026

Copy link
Copy Markdown
Owner

Summary

QR import (decode) shipped in v1; this closes #45 by adding the reverse direction so an account can be added to a phone authenticator too.

  • Core: otpauth_build() (URI builder, the inverse of otpauth_parse) and base32_encode() — neither existed yet, both needed before any QR rendering was possible.
  • Vendored qrcodegen (Project Nayuki, MIT) alongside the existing quirc decoder — single .c/.h pair, no malloc, no floating point, pinned to a specific upstream commit (see THIRDPARTY.md).
  • GUI: "Show QR code..." (Account menu, RAmiga+S) opens a window rendering the module grid via direct RastPort drawing, mirroring the existing led_draw() pattern.
  • CLI: AmiAuth QR <account> prints ASCII-block art; forwards to a resident GUI via a new AAP_QR IPC command (same pattern as GET).
  • Docs: Managing-Accounts.md, CLI-Reference.md, GUI-Guide.md, THIRDPARTY.md, ARCHITECTURE.md.

Bug found and fixed during on-target verification

qrcodegen_Mask_AUTO (searches all 8 masks + penalty-scores each) took over a minute on real m68k hardware for a modest QR code — confirmed via Copperline. Switched to a fixed mask and disabled boostEcl, cutting this to ~4 seconds with no loss of correctness — any valid mask produces a scannable code, AUTO only optimises which one scans best.

Test plan

  • make test — 357 host tests pass, including a full encode → rasterize → decode round-trip through the real quirc decoder
  • make m68k-docker / make gui-docker — plain-68000 cross-builds succeed, zero warnings
  • Real on-target verification via Copperline: screenshot shows a correctly-rendered QR code (three finder patterns visible) in the GUI window after RAmiga+S
  • AmiAuth QR <account> manually verified on host CLI, producing a visually correct QR pattern
  • make guide (AmigaGuide doc conversion) succeeds

🤖 Generated with Claude Code

QR import (decode) shipped in v1; this adds the reverse direction so an
account can be added to a phone authenticator too.

- Core: otpauth_build() (URI builder, the inverse of otpauth_parse) and
  base32_encode(), neither of which existed yet.
- Vendor qrcodegen (Project Nayuki, MIT) alongside the existing quirc
  decoder - single .c/.h pair, no malloc, no floating point, pinned to
  a specific upstream commit (see THIRDPARTY.md).
- GUI: "Show QR code..." (Account menu, RAmiga+S) opens a window
  rendering the module grid via direct RastPort drawing, mirroring the
  existing led_draw() pattern.
- CLI: `AmiAuth QR <account>` prints ASCII-block art; forwards to a
  resident GUI via a new AAP_QR IPC command (same pattern as GET).
- docs/userdocs updated: Managing-Accounts.md, CLI-Reference.md,
  GUI-Guide.md, THIRDPARTY.md, ARCHITECTURE.md.

Found and fixed a real on-target bug during verification:
qrcodegen_Mask_AUTO (searches all 8 masks + penalty-scores each) took
over a minute on real m68k hardware for a modest QR code, confirmed via
Copperline. Switched to a fixed mask and disabled boostEcl, cutting
this to ~4 seconds with no loss of correctness - any valid mask
produces a scannable code, AUTO only optimises which one scans best.

Verified: 357 host tests pass (including a full encode -> rasterize ->
decode round-trip through the real quirc decoder), clean m68k
cross-builds (CLI + GUI), and a real on-target screenshot via
Copperline showing a correctly-rendered QR code in the GUI window.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@sidick
sidick enabled auto-merge (squash) July 28, 2026 07:16
@sidick
sidick merged commit 6b59cfe into main Jul 28, 2026
7 checks passed
@sidick
sidick deleted the qr-export-45 branch July 28, 2026 07:16
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.

QR code display for exporting accounts to a phone

1 participant