Skip to content

Commit 71280e5

Browse files
committed
qr: use larger guides for seedqr/totp scanning on jade plus
1 parent 346ceba commit 71280e5

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

main/process/mnemonic.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,11 @@ static bool mnemonic_export_qr(const char* mnemonic, bool* export_qr_verified)
207207

208208
// Verify QR by scanning it back
209209
qr_data_t qr_data = { .len = 0 };
210+
#ifdef CONFIG_IDF_TARGET_ESP32S3
211+
const qr_frame_guides_t qr_frame_guides = QR_GUIDES_LARGE;
212+
#else
210213
const qr_frame_guides_t qr_frame_guides = QR_GUIDES_SMALL;
214+
#endif
211215
jade_camera_scan_qr(&qr_data, "Scan QR to verify", qr_frame_guides, "blkstrm.com/seedqr");
212216
if (qr_data.len == entropy_len && !memcmp(qr_data.data, entropy, entropy_len)) {
213217
// QR Code scanned, and it matched expected entropy
@@ -1161,7 +1165,11 @@ static bool mnemonic_qr(char* mnemonic, const size_t mnemonic_len)
11611165
mnemonic[0] = '\0';
11621166

11631167
// We return 'true' if we scanned any string data at all
1168+
#ifdef CONFIG_IDF_TARGET_ESP32S3
1169+
const qr_frame_guides_t qr_frame_guides = QR_GUIDES_LARGE;
1170+
#else
11641171
const qr_frame_guides_t qr_frame_guides = QR_GUIDES_SMALL;
1172+
#endif
11651173
const bool qr_scanned
11661174
= jade_camera_scan_qr(&qr_data, NULL, qr_frame_guides, "blkstrm.com/scanwallet") && qr_data.len > 0;
11671175
if (!qr_scanned) {

main/process/register_otp.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,11 @@ bool register_otp_qr(void)
349349
SENSITIVE_PUSH(&qr_data, sizeof(qr_data));
350350

351351
// Get URI from qr code scan
352+
#ifdef CONFIG_IDF_TARGET_ESP32S3
353+
const qr_frame_guides_t qr_frame_guides = QR_GUIDES_LARGE;
354+
#else
352355
const qr_frame_guides_t qr_frame_guides = QR_GUIDES_SMALL;
356+
#endif
353357
if (!jade_camera_scan_qr(&qr_data, NULL, qr_frame_guides, "blkstrm.com/otp") || !qr_data.len) {
354358
// User exit without scanning
355359
JADE_LOGW("No qr code scanned");

0 commit comments

Comments
 (0)