Add QR code export: GUI on-screen display + CLI ASCII-art (#45) - #103
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.
otpauth_build()(URI builder, the inverse ofotpauth_parse) andbase32_encode()— neither existed yet, both needed before any QR rendering was possible.qrcodegen(Project Nayuki, MIT) alongside the existingquircdecoder — single.c/.hpair, nomalloc, no floating point, pinned to a specific upstream commit (seeTHIRDPARTY.md).RastPortdrawing, mirroring the existingled_draw()pattern.AmiAuth QR <account>prints ASCII-block art; forwards to a resident GUI via a newAAP_QRIPC command (same pattern asGET).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 disabledboostEcl, 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 decodermake m68k-docker/make gui-docker— plain-68000 cross-builds succeed, zero warningsAmiAuth QR <account>manually verified on host CLI, producing a visually correct QR patternmake guide(AmigaGuide doc conversion) succeeds🤖 Generated with Claude Code