aboutsummaryrefslogtreecommitdiff
path: root/source/app/Fixtures.mc
diff options
context:
space:
mode:
authorcirakg <cirakg@cirakg.xyz>2026-10-21 03:55:10 +0200
committercirakg <cirakg@cirakg.xyz>2026-10-21 03:55:10 +0200
commit5e8ac1e2f5a660e55ea132996e1d5730cfa4fa64 (patch)
tree9bb99bdca1ef8f33c93c5100816448681329d810 /source/app/Fixtures.mc
parent88f1cac4fa530fc30fd6ef01970af11c7a959b8e (diff)
feat(glance): show the favourite code in the glance (opt-in)
With "Show the favourite code in the glance" on, the glance shows the code of the first favourite TOTP or Steam entry without the PIN, with a countdown bar. The glance can't open the vault, so the About scan seals that entry under "g" (device key, aad OTPW-GL-1) after every change, and removes it when the option is off or no entry qualifies; the glance also reads the option itself. HKDF moves to its own module so the glance loads only the crypto it needs (37 % of its 64 KB). Manage entry gains "Mark as favourite (glance)" and "Remove favourite", queued for locked entries like the other changes. Lines are inset on round screens so the Instinct 3's curved glance corner doesn't cut them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'source/app/Fixtures.mc')
-rw-r--r--source/app/Fixtures.mc12
1 files changed, 9 insertions, 3 deletions
diff --git a/source/app/Fixtures.mc b/source/app/Fixtures.mc
index 463780c..7c21d9a 100644
--- a/source/app/Fixtures.mc
+++ b/source/app/Fixtures.mc
@@ -36,7 +36,9 @@ module Fixtures {
vault.session.unlock(Bytes.fromHex(FIXTURE_MASTER_KEY));
}
var rfcKey = "12345678901234567890"; // lint: allow-literal (RFC 4226 test key)
- vault.add(otp("GitHub", "alice@example.com", "Work", Entry.OTP_TOTP, Hashes.SHA1, 6, 30, rfcKey, false));
+ var github = otp("GitHub", "alice@example.com", "Work", Entry.OTP_TOTP, Hashes.SHA1, 6, 30, rfcKey, false);
+ github.favorite = true; // the glance code (UI test: optGlanceCode is on)
+ vault.add(github);
vault.add(otp("Google", "bob@example.com", "Personal", Entry.OTP_TOTP, Hashes.SHA256, 8, 30,
"12345678901234567890123456789012", false)); // lint: allow-literal (RFC 6238 test key)
vault.add(otp("Bank", "carol", "Finance", Entry.OTP_TOTP, Hashes.SHA512, 6, 30,
@@ -71,14 +73,18 @@ module Fixtures {
}
}
- // UI-test build: the other forms, filled in as the phone would (README
- // 16, M7 end-to-end): Add OTP (a TOTP whose code the screenshot shows),
+ // UI-test build: the glance option, and the other forms, filled in as
+ // the phone would (README 16, M7 end-to-end): Add OTP (a TOTP whose code the screenshot shows),
// Add code (a Code 128 card whose screenshot must decode) and Manage
// entry (Bank's group renamed: Bank is locked, so the change waits for
// the PIN, which the UI flow confirms from the menu). They are applied
// after the import, in README 10.3 order, so the new entries end the
// list.
function sendForms(vault as Vault) as Void {
+ // The glance shows GitHub's code after the flow (the About scan
+ // seals it for the glance).
+ Application.Properties.setValue("optGlanceCode", true);
+ vault.glanceCode = true;
Application.Properties.setValue("otpType", Entry.OTP_TOTP);
Application.Properties.setValue("otpIssuer", "Mailbox");
Application.Properties.setValue("otpAccount", "fixture@example.com");