mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-01-11 16:00:57 +00:00
legacy: fix oledSCA in simple recovery
(cherry picked from commit ddd3e9c577
)
This commit is contained in:
parent
0e224644b6
commit
8190bf3819
@ -448,16 +448,29 @@ void next_word(void) {
|
|||||||
if (word_pos == 0) {
|
if (word_pos == 0) {
|
||||||
const char *const *wl = mnemonic_wordlist();
|
const char *const *wl = mnemonic_wordlist();
|
||||||
strlcpy(fake_word, wl[random_uniform(2048)], sizeof(fake_word));
|
strlcpy(fake_word, wl[random_uniform(2048)], sizeof(fake_word));
|
||||||
layoutDialogSwipe(&bmp_icon_info, NULL, NULL, NULL,
|
|
||||||
_("Please enter the word"), NULL, fake_word, NULL,
|
layoutLast = layoutDialogSwipe;
|
||||||
_("on your computer"), NULL);
|
layoutSwipe();
|
||||||
|
oledDrawStringCenter(OLED_WIDTH / 2, 8, _("Please enter the word"), FONT_STANDARD);
|
||||||
|
oledDrawStringCenter(OLED_WIDTH / 2, 24, fake_word, FONT_FIXED | FONT_DOUBLE);
|
||||||
|
oledDrawStringCenter(OLED_WIDTH / 2, 48, _("on your computer"), FONT_STANDARD);
|
||||||
|
// 30 is the maximum pixels used for a pixel row in the BIP39 word "abstract"
|
||||||
|
oledSCA(24 - 2, 24 + 15 + 2, 30);
|
||||||
|
oledInvert(0, 24 - 2, OLED_WIDTH - 1, 24 + 15 + 2);
|
||||||
|
oledRefresh();
|
||||||
} else {
|
} else {
|
||||||
fake_word[0] = 0;
|
fake_word[0] = 0;
|
||||||
char desc[] = "##th word";
|
char desc[] = "##th word";
|
||||||
format_number(desc, word_pos);
|
format_number(desc, word_pos);
|
||||||
layoutDialogSwipe(&bmp_icon_info, NULL, NULL, NULL, _("Please enter the"),
|
layoutLast = layoutDialogSwipe;
|
||||||
NULL, (word_pos < 10 ? desc + 1 : desc), NULL,
|
layoutSwipe();
|
||||||
_("of your mnemonic"), NULL);
|
oledDrawStringCenter(OLED_WIDTH / 2, 8, _("Please enter the"), FONT_STANDARD);
|
||||||
|
oledDrawStringCenter(OLED_WIDTH / 2, 24, (word_pos < 10 ? desc + 1 : desc), FONT_FIXED | FONT_DOUBLE);
|
||||||
|
oledDrawStringCenter(OLED_WIDTH / 2, 48, _("of your mnemonic"), FONT_STANDARD);
|
||||||
|
// 30 is the maximum pixels used for a pixel row in the BIP39 word "abstract"
|
||||||
|
oledSCA(24 - 2, 24 + 15 + 2, 30);
|
||||||
|
oledInvert(0, 24 - 2, OLED_WIDTH - 1, 24 + 15 + 2);
|
||||||
|
oledRefresh();
|
||||||
}
|
}
|
||||||
recovery_request();
|
recovery_request();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user