Skip to content

Commit 62ab308

Browse files
authored
Merge pull request #1614 from KeystoneHQ/fix/merge_1.8.2
merge 1.8.2 bug fix
2 parents 5ab29a1 + a86fec4 commit 62ab308

File tree

11 files changed

+117
-76
lines changed

11 files changed

+117
-76
lines changed

CHANGELOG-ZH.md

+10
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
## 1.8.2(2024-12-30)
2+
3+
### Bug 修复
4+
5+
1. 修复了输入密码后解锁时间较长的问题
6+
2. 修复了创建 SLIP39 钱包时快速切换助记词数量导致创建失败的问题
7+
3. 修复了 Solana 部分场景消息签名报错问题
8+
9+
10+
111
## 1.8.0(2024-12-19)
212

313
### 新增

CHANGELOG.md

+10
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
## 1.8.2(2024-12-30)
2+
3+
### Bug Fixes
4+
5+
1. Fixed the issue of long unlocking time after entering the password
6+
2. Fixed the issue where rapidly switching the number of mnemonics during SLIP39 wallet creation caused creation failure
7+
3. Fixed message signing errors in certain Solana scenarios
8+
9+
10+
111
## 1.8.0(2024-12-19)
212

313
### What's new

rust/apps/wallets/src/keystone.rs

+12-11
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,15 @@ fn get_device_id(serial_number: &str) -> String {
2222
hex::encode(&sha256(&sha256(serial_number.as_bytes()))[0..20])
2323
}
2424

25-
const BTC_LEGACY_PREFIX: &str = "m/44'/0'/0'";
26-
const BTC_SEGWIT_PREFIX: &str = "m/49'/0'/0'";
27-
const BTC_NATIVE_SEGWIT_PREFIX: &str = "m/84'/0'/0'";
28-
const ETH_STANDARD_PREFIX: &str = "m/44'/60'/0'";
29-
const BCH_PREFIX: &str = "m/44'/145'/0'";
30-
const DASH_PREFIX: &str = "m/44'/5'/0'";
31-
const LTC_PREFIX: &str = "m/49'/2'/0'";
32-
const TRX_PREFIX: &str = "m/44'/195'/0'";
33-
const XRP_PREFIX: &str = "m/44'/144'/0'";
25+
const BTC_LEGACY_PREFIX: &str = "44'/0'/0'";
26+
const BTC_SEGWIT_PREFIX: &str = "49'/0'/0'";
27+
const BTC_NATIVE_SEGWIT_PREFIX: &str = "84'/0'/0'";
28+
const ETH_STANDARD_PREFIX: &str = "44'/60'/0'";
29+
const BCH_PREFIX: &str = "44'/145'/0'";
30+
const DASH_PREFIX: &str = "44'/5'/0'";
31+
const LTC_PREFIX: &str = "49'/2'/0'";
32+
const TRX_PREFIX: &str = "44'/195'/0'";
33+
const XRP_PREFIX: &str = "44'/144'/0'";
3434

3535
fn path_to_coin_code(path: &str) -> String {
3636
let path = path
@@ -109,7 +109,8 @@ pub fn generate_crypto_multi_accounts(
109109
let mut coin_configs: Vec<CoinConfig> = vec![];
110110
for key in data.get_keys() {
111111
let mut accounts: Vec<AccountConfig> = vec![];
112-
let hd_path = "M/".to_string() + &*key.get_origin().unwrap().get_path().unwrap();
112+
let hd_path =
113+
"M/".to_string() + &*key.get_origin().unwrap().get_path().unwrap().to_string();
113114

114115
let x_pub = key.get_bip32_key();
115116

@@ -119,7 +120,7 @@ pub fn generate_crypto_multi_accounts(
119120
}
120121

121122
let account = AccountConfig {
122-
hd_path,
123+
hd_path: "M/".to_string() + &*hd_path,
123124
x_pub,
124125
address_length: 1,
125126
is_multi_sign: false,

src/crypto/account_public_info.c

+29
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,35 @@ static const ChainItem_t g_chainTable[] = {
322322
#endif
323323
};
324324

325+
#ifdef WEB3_VERSION
326+
ChainType CheckSolPathSupport(char *path)
327+
{
328+
int startIndex = -1;
329+
int endIndex = -1;
330+
for (int i = 0; i < XPUB_TYPE_NUM; i++) {
331+
if (XPUB_TYPE_SOL_BIP44_0 == g_chainTable[i].chain) {
332+
startIndex = i;
333+
}
334+
if (XPUB_TYPE_SOL_BIP44_CHANGE_49 == g_chainTable[i].chain) {
335+
endIndex = i;
336+
break;
337+
}
338+
}
339+
340+
if (startIndex == -1 || endIndex == -1) {
341+
return XPUB_TYPE_NUM;
342+
}
343+
344+
for (int i = startIndex; i <= endIndex; i++) {
345+
// skip the first two characters
346+
if (!strcmp(path, g_chainTable[i].path + 2)) {
347+
return g_chainTable[i].chain;
348+
}
349+
}
350+
return XPUB_TYPE_NUM;
351+
}
352+
#endif
353+
325354
static SimpleResponse_c_char *ProcessKeyType(uint8_t *seed, int len, int cryptoKey, const char *path, void *icarusMasterKey, void *ledgerBitbox02MasterKey)
326355
{
327356
switch (cryptoKey) {

src/crypto/account_public_info.h

+4
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,10 @@ void SetConnectWalletAccountIndex(const char* walletName, uint32_t index);
274274
uint32_t GetConnectWalletNetwork(const char* walletName);
275275
void SetConnectWalletNetwork(const char* walletName, uint32_t index);
276276

277+
#ifdef WEB3_VERSION
278+
ChainType CheckSolPathSupport(char *path);
279+
#endif
280+
277281
#ifdef BTC_ONLY
278282
void ExportMultiSigXpub(ChainType chainType);
279283
void MultiSigWalletSave(const char *password, MultiSigWalletManager_t *manager);

src/ui/gui_assets/font/cn/cnIllustrate.c

+46-31
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*******************************************************************************
22
* Size: 20 px
33
* Bpp: 2
4-
* Opts: --bpp 2 --size 20 --no-compress --font NotoSansSC-Regular.ttf --symbols "!#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~£¥·“”€、。一三上下不与专且业东丢个中为主久么之乏也了予争二于些交产享人什仅仍从仔他付代以们件任份优会传但位低体何余作你使例供保信修倒值做停储像充免入全公共关其具兼内册再写决况准凭出击分切列则创初删利别到制前剩功加务动助励勿包化匙匹区匿升单卡危即原参及反发取受口另只可台合同名后吗否含启告员味命和品哈响唯善器回因团固图在地场址坊块型域基境增备复外多够大天太失头奖如妥始威子字存学它安完官定实容密对寻导将小少尚尝就屏展属岁差己已币希帐带帮常幕平年并广序应底度建开异式引弱强当录影彻彼往径待律得循微心必志忘快态性总恢息您情想意感慎成我或户所手才打托扩扫批找技投护抬押担拥择括拭持指按振损换据捷授接推掷描提插摄撤播操擦支收改攻放政效敏教数整文断新方旁无既日旦时明易映是显景晰智暴更曾最有服望期未本术机权条来松构析果架某查标校核根格框案检概模次款止正此步段母每比气永求没法泛注洞派流测消涉添清港湿源溯滑满漏潜点然照熵片版牢物特状独率环现理生用由电留疑白的目直相看真着知短码破硬确示票禁离私种秒租积称移程稍空立站笔符第等策签简算管篡类系索约级纹线组细终经给络统继续维缆编缝缺网罗置署老考者而联股胁能脑自至致节芯花英荐获藏虑行衍表被装西要见观规觉解言警计认让议记许设访证识词试该详语误说请调谨负财责败账货质费资赌赔起超足路身转软轻载较输辖达过运这进连述追退送适逆选途通速造遇遵避邀邮部都酌配采释重量金钟钥钮钱铸链销锁错长门闭问间队防限除险随隐隔障难零需露非面页项顺须预题额风香验骰高默(),:? --format lvgl -o ../gui_assets/font/cn/cnIllustrate.c
4+
* Opts: --bpp 2 --size 20 --no-compress --font NotoSansSC-Regular.ttf --symbols "!#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~£¥·“”€、。一三上下不与专且业东丢个中为主久么之乏也了予争二于些交产享人什仅仍从仔他付代以们件任份优会传但位低体何余作你使例供保信修倒值做停储像充免入全公共关其具兼内册再写决况准凭出击分切列则创初删利别到制前剩功加务动助励勿包化匙匹区匿升单卡危即原参及反发取受口另只可台合同名后吗否含启告员味命和品哈响唯善器回因团固图在地场址坊块型域基境增备复外多够大天太失头奖如妥始威子字存学它安完官定实容密对寻导将小少尚尝就屏展属岁差己已币希帐带帮常幕平年并广序应底度建开异式引弱强当录影彻彼往径待律得循微心必志忘快态性总恢息您情想意感慎成我或户所手才打托扩扫批找技投护抬押担拥择括拭持指按振损换据捷授接推掷描提插摄撤播操擦支收改攻放政效敏教数整文断新方旁无既日旦时明易映是显景晰智暴更曾最有服望期未本术机权条来松构析果架某查标校核根格框案检概模次款止正此步段母每比气永求没法泛注洞派流测消涉添清港湿源溯滑满漏潜点然照熵片版牢物特状独率环现理生用由电留疑白的目直相看真着知短码破硬确示票禁离私种秒租积称移程稍空立站笔符第等策签简算管篡类系索约级纹线组细终经给络统继续维缆编缝缺网罗置署老考者而联股胁能脑自至致节芯花英荐获藏虑行衍表被装西要见观规觉解言警计认让议记许设访证识词试该详语误说请调谨负财责败账货质费资赌赔起超足路身转软轻载较输辖达过运这进连述追退送适逆选途通速造遇遵避邀邮部都酌配采释重量金钟钥钮钱铸链销锁错长门闭问间队防限除险随隐隔隙障难零需露非面页项顺须预题额风香验骰高默(),:? --format lvgl -o ../gui_assets/font/cn/cnIllustrate.c
55
******************************************************************************/
66

77
#ifdef LV_LVGL_H_INCLUDE_SIMPLE
@@ -9113,6 +9113,20 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t glyph_bitmap[] = {
91139113
0xb1, 0xc0, 0xd, 0x7, 0x2, 0xc7, 0x0, 0x34,
91149114
0x0, 0x3d, 0x0, 0x0, 0x0, 0x0, 0x0,
91159115

9116+
/* U+9699 "隙" */
9117+
0x0, 0x0, 0x1, 0x80, 0x1, 0xff, 0xc1, 0x87,
9118+
0x24, 0x7, 0x5b, 0xe, 0x1c, 0x74, 0x1c, 0x28,
9119+
0xb0, 0x70, 0xb0, 0x70, 0xd7, 0x1, 0xc0, 0xe1,
9120+
0xc7, 0xe, 0xaf, 0xaa, 0x7, 0x38, 0x39, 0x55,
9121+
0x6c, 0x1c, 0x70, 0xd0, 0x0, 0x70, 0x70, 0xa3,
9122+
0xff, 0xff, 0xc1, 0xc1, 0xce, 0x0, 0xb, 0x7,
9123+
0x3, 0x34, 0x0, 0x1c, 0x1c, 0xc, 0xff, 0xff,
9124+
0xf0, 0x71, 0xb0, 0x2, 0xc0, 0x1, 0xcf, 0x43,
9125+
0x47, 0x1c, 0x7, 0x0, 0x1c, 0x1c, 0x38, 0x1c,
9126+
0x0, 0xd0, 0x70, 0x74, 0x70, 0xf, 0x1, 0xc0,
9127+
0xb1, 0xc0, 0x30, 0x1b, 0x0, 0x87, 0x0, 0x2,
9128+
0xf8, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
9129+
91169130
/* U+969C "障" */
91179131
0x0, 0x0, 0x2, 0x40, 0x1, 0xff, 0xd0, 0xf,
91189132
0x0, 0x7, 0x5b, 0x3f, 0xff, 0xfd, 0x1c, 0x28,
@@ -10142,31 +10156,32 @@ static const lv_font_fmt_txt_glyph_dsc_t glyph_dsc[] = {
1014210156
{.bitmap_index = 58875, .adv_w = 320, .box_w = 19, .box_h = 19, .ofs_x = 1, .ofs_y = -2},
1014310157
{.bitmap_index = 58966, .adv_w = 320, .box_w = 18, .box_h = 19, .ofs_x = 1, .ofs_y = -2},
1014410158
{.bitmap_index = 59052, .adv_w = 320, .box_w = 19, .box_h = 20, .ofs_x = 1, .ofs_y = -3},
10145-
{.bitmap_index = 59147, .adv_w = 320, .box_w = 19, .box_h = 19, .ofs_x = 1, .ofs_y = -2},
10146-
{.bitmap_index = 59238, .adv_w = 320, .box_w = 20, .box_h = 19, .ofs_x = 0, .ofs_y = -2},
10147-
{.bitmap_index = 59333, .adv_w = 320, .box_w = 20, .box_h = 18, .ofs_x = 0, .ofs_y = -2},
10148-
{.bitmap_index = 59423, .adv_w = 320, .box_w = 18, .box_h = 19, .ofs_x = 1, .ofs_y = -3},
10149-
{.bitmap_index = 59509, .adv_w = 320, .box_w = 19, .box_h = 20, .ofs_x = 1, .ofs_y = -3},
10150-
{.bitmap_index = 59604, .adv_w = 320, .box_w = 19, .box_h = 19, .ofs_x = 1, .ofs_y = -2},
10151-
{.bitmap_index = 59695, .adv_w = 320, .box_w = 18, .box_h = 18, .ofs_x = 1, .ofs_y = -2},
10152-
{.bitmap_index = 59776, .adv_w = 320, .box_w = 18, .box_h = 18, .ofs_x = 1, .ofs_y = -2},
10153-
{.bitmap_index = 59857, .adv_w = 320, .box_w = 20, .box_h = 18, .ofs_x = 0, .ofs_y = -2},
10154-
{.bitmap_index = 59947, .adv_w = 320, .box_w = 20, .box_h = 19, .ofs_x = 0, .ofs_y = -2},
10155-
{.bitmap_index = 60042, .adv_w = 320, .box_w = 19, .box_h = 19, .ofs_x = 1, .ofs_y = -2},
10156-
{.bitmap_index = 60133, .adv_w = 320, .box_w = 20, .box_h = 19, .ofs_x = 0, .ofs_y = -2},
10159+
{.bitmap_index = 59147, .adv_w = 320, .box_w = 19, .box_h = 20, .ofs_x = 1, .ofs_y = -3},
10160+
{.bitmap_index = 59242, .adv_w = 320, .box_w = 19, .box_h = 19, .ofs_x = 1, .ofs_y = -2},
10161+
{.bitmap_index = 59333, .adv_w = 320, .box_w = 20, .box_h = 19, .ofs_x = 0, .ofs_y = -2},
10162+
{.bitmap_index = 59428, .adv_w = 320, .box_w = 20, .box_h = 18, .ofs_x = 0, .ofs_y = -2},
10163+
{.bitmap_index = 59518, .adv_w = 320, .box_w = 18, .box_h = 19, .ofs_x = 1, .ofs_y = -3},
10164+
{.bitmap_index = 59604, .adv_w = 320, .box_w = 19, .box_h = 20, .ofs_x = 1, .ofs_y = -3},
10165+
{.bitmap_index = 59699, .adv_w = 320, .box_w = 19, .box_h = 19, .ofs_x = 1, .ofs_y = -2},
10166+
{.bitmap_index = 59790, .adv_w = 320, .box_w = 18, .box_h = 18, .ofs_x = 1, .ofs_y = -2},
10167+
{.bitmap_index = 59871, .adv_w = 320, .box_w = 18, .box_h = 18, .ofs_x = 1, .ofs_y = -2},
10168+
{.bitmap_index = 59952, .adv_w = 320, .box_w = 20, .box_h = 18, .ofs_x = 0, .ofs_y = -2},
10169+
{.bitmap_index = 60042, .adv_w = 320, .box_w = 20, .box_h = 19, .ofs_x = 0, .ofs_y = -2},
10170+
{.bitmap_index = 60137, .adv_w = 320, .box_w = 19, .box_h = 19, .ofs_x = 1, .ofs_y = -2},
1015710171
{.bitmap_index = 60228, .adv_w = 320, .box_w = 20, .box_h = 19, .ofs_x = 0, .ofs_y = -2},
1015810172
{.bitmap_index = 60323, .adv_w = 320, .box_w = 20, .box_h = 19, .ofs_x = 0, .ofs_y = -2},
10159-
{.bitmap_index = 60418, .adv_w = 320, .box_w = 20, .box_h = 18, .ofs_x = 0, .ofs_y = -2},
10160-
{.bitmap_index = 60508, .adv_w = 320, .box_w = 20, .box_h = 20, .ofs_x = 0, .ofs_y = -3},
10161-
{.bitmap_index = 60608, .adv_w = 320, .box_w = 20, .box_h = 19, .ofs_x = 0, .ofs_y = -2},
10162-
{.bitmap_index = 60703, .adv_w = 320, .box_w = 19, .box_h = 19, .ofs_x = 1, .ofs_y = -2},
10163-
{.bitmap_index = 60794, .adv_w = 320, .box_w = 18, .box_h = 20, .ofs_x = 1, .ofs_y = -2},
10164-
{.bitmap_index = 60884, .adv_w = 320, .box_w = 20, .box_h = 19, .ofs_x = 0, .ofs_y = -2},
10165-
{.bitmap_index = 60979, .adv_w = 320, .box_w = 7, .box_h = 20, .ofs_x = 13, .ofs_y = -2},
10166-
{.bitmap_index = 61014, .adv_w = 320, .box_w = 7, .box_h = 20, .ofs_x = 0, .ofs_y = -2},
10167-
{.bitmap_index = 61049, .adv_w = 320, .box_w = 5, .box_h = 8, .ofs_x = 2, .ofs_y = -3},
10168-
{.bitmap_index = 61059, .adv_w = 320, .box_w = 4, .box_h = 14, .ofs_x = 3, .ofs_y = -1},
10169-
{.bitmap_index = 61073, .adv_w = 320, .box_w = 10, .box_h = 17, .ofs_x = 0, .ofs_y = -1}
10173+
{.bitmap_index = 60418, .adv_w = 320, .box_w = 20, .box_h = 19, .ofs_x = 0, .ofs_y = -2},
10174+
{.bitmap_index = 60513, .adv_w = 320, .box_w = 20, .box_h = 18, .ofs_x = 0, .ofs_y = -2},
10175+
{.bitmap_index = 60603, .adv_w = 320, .box_w = 20, .box_h = 20, .ofs_x = 0, .ofs_y = -3},
10176+
{.bitmap_index = 60703, .adv_w = 320, .box_w = 20, .box_h = 19, .ofs_x = 0, .ofs_y = -2},
10177+
{.bitmap_index = 60798, .adv_w = 320, .box_w = 19, .box_h = 19, .ofs_x = 1, .ofs_y = -2},
10178+
{.bitmap_index = 60889, .adv_w = 320, .box_w = 18, .box_h = 20, .ofs_x = 1, .ofs_y = -2},
10179+
{.bitmap_index = 60979, .adv_w = 320, .box_w = 20, .box_h = 19, .ofs_x = 0, .ofs_y = -2},
10180+
{.bitmap_index = 61074, .adv_w = 320, .box_w = 7, .box_h = 20, .ofs_x = 13, .ofs_y = -2},
10181+
{.bitmap_index = 61109, .adv_w = 320, .box_w = 7, .box_h = 20, .ofs_x = 0, .ofs_y = -2},
10182+
{.bitmap_index = 61144, .adv_w = 320, .box_w = 5, .box_h = 8, .ofs_x = 2, .ofs_y = -3},
10183+
{.bitmap_index = 61154, .adv_w = 320, .box_w = 4, .box_h = 14, .ofs_x = 3, .ofs_y = -1},
10184+
{.bitmap_index = 61168, .adv_w = 320, .box_w = 10, .box_h = 17, .ofs_x = 0, .ofs_y = -1}
1017010185
};
1017110186

1017210187
/*---------------------
@@ -10251,10 +10266,10 @@ static const uint16_t unicode_list_1[] = {
1025110266
0x9127, 0x912a, 0x912c, 0x912e, 0x93fc, 0x9402, 0x940b, 0x940e,
1025210267
0x9455, 0x945b, 0x945d, 0x945e, 0x9476, 0x94dc, 0x9545, 0x954a,
1025310268
0x954b, 0x9551, 0x957c, 0x958f, 0x95ad, 0x95c1, 0x95c6, 0x95ec,
10254-
0x95ed, 0x95f1, 0x95f9, 0x961b, 0x9653, 0x965d, 0x968f, 0x96bb,
10255-
0x96bf, 0x97d2, 0x97d6, 0x97d7, 0x97d8, 0x97e1, 0x97f5, 0x97fa,
10256-
0x982b, 0x98f6, 0x99e9, 0x9a0d, 0x9a35, 0x9e35, 0xfe65, 0xfe66,
10257-
0xfe69, 0xfe77, 0xfe7c
10269+
0x95ed, 0x95f1, 0x95f6, 0x95f9, 0x961b, 0x9653, 0x965d, 0x968f,
10270+
0x96bb, 0x96bf, 0x97d2, 0x97d6, 0x97d7, 0x97d8, 0x97e1, 0x97f5,
10271+
0x97fa, 0x982b, 0x98f6, 0x99e9, 0x9a0d, 0x9a35, 0x9e35, 0xfe65,
10272+
0xfe66, 0xfe69, 0xfe77, 0xfe7c
1025810273
};
1025910274

1026010275
/*Collect the unicode lists and glyph_id offsets*/
@@ -10265,7 +10280,7 @@ static const lv_font_fmt_txt_cmap_t cmaps[] = {
1026510280
},
1026610281
{
1026710282
.range_start = 163, .range_length = 65149, .glyph_id_start = 96,
10268-
.unicode_list = unicode_list_1, .glyph_id_ofs_list = NULL, .list_length = 643, .type = LV_FONT_FMT_TXT_CMAP_SPARSE_TINY
10283+
.unicode_list = unicode_list_1, .glyph_id_ofs_list = NULL, .list_length = 644, .type = LV_FONT_FMT_TXT_CMAP_SPARSE_TINY
1026910284
}
1027010285
};
1027110286

@@ -10368,7 +10383,7 @@ static const uint8_t kern_left_class_mapping[] = {
1036810383
0, 0, 0, 0, 0, 0, 0, 0,
1036910384
0, 0, 0, 0, 0, 0, 0, 0,
1037010385
0, 0, 0, 0, 0, 0, 0, 0,
10371-
0, 0, 0
10386+
0, 0, 0, 0
1037210387
};
1037310388

1037410389
/*Map glyph_ids to kern right classes*/
@@ -10465,7 +10480,7 @@ static const uint8_t kern_right_class_mapping[] = {
1046510480
0, 0, 0, 0, 0, 0, 0, 0,
1046610481
0, 0, 0, 0, 0, 0, 0, 0,
1046710482
0, 0, 0, 0, 0, 0, 0, 0,
10468-
0, 0, 0
10483+
0, 0, 0, 0
1046910484
};
1047010485

1047110486
/*Kern values between classes*/

src/ui/gui_chain/multi/web3/gui_sol.c

+2-30
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
#include "cjson/cJSON.h"
1212
#include "user_memory.h"
1313
#include "gui_qr_hintbox.h"
14-
static uint8_t GetSolPublickeyIndex(char* rootPath);
1514
typedef struct {
1615
const char* address;
1716
} SolanaAddressLearnMoreData;
@@ -100,7 +99,8 @@ void *GuiGetSolMessageData(void)
10099
void *data = g_isMulti ? g_urMultiResult->data : g_urResult->data;
101100
do {
102101
char *path = sol_get_path(data);
103-
char pubkeyIndex = GetSolPublickeyIndex(path);
102+
ChainType pubkeyIndex = CheckSolPathSupport(path);
103+
ASSERT(pubkeyIndex != XPUB_TYPE_NUM);
104104
char *pubKey = GetCurrentAccountPublicKey(pubkeyIndex);
105105
PtrT_TransactionParseResult_DisplaySolanaMessage parseResult = solana_parse_message(data, pubKey);
106106
free_ptr_string(path);
@@ -183,34 +183,6 @@ void GetSolMessageRaw(void *indata, void *param, uint32_t maxLen)
183183
}
184184
}
185185

186-
static uint8_t GetSolPublickeyIndex(char* rootPath)
187-
{
188-
if (strcmp(rootPath, "44'/501'/0'") == 0) return XPUB_TYPE_SOL_BIP44_0;
189-
if (strcmp(rootPath, "44'/501'/1'") == 0) return XPUB_TYPE_SOL_BIP44_1;
190-
if (strcmp(rootPath, "44'/501'/2'") == 0) return XPUB_TYPE_SOL_BIP44_2;
191-
if (strcmp(rootPath, "44'/501'/3'") == 0) return XPUB_TYPE_SOL_BIP44_3;
192-
if (strcmp(rootPath, "44'/501'/4'") == 0) return XPUB_TYPE_SOL_BIP44_4;
193-
if (strcmp(rootPath, "44'/501'/5'") == 0) return XPUB_TYPE_SOL_BIP44_5;
194-
if (strcmp(rootPath, "44'/501'/6'") == 0) return XPUB_TYPE_SOL_BIP44_6;
195-
if (strcmp(rootPath, "44'/501'/7'") == 0) return XPUB_TYPE_SOL_BIP44_7;
196-
if (strcmp(rootPath, "44'/501'/8'") == 0) return XPUB_TYPE_SOL_BIP44_8;
197-
if (strcmp(rootPath, "44'/501'/9'") == 0) return XPUB_TYPE_SOL_BIP44_9;
198-
if (strcmp(rootPath, "44'/501'") == 0) return XPUB_TYPE_SOL_BIP44_ROOT;
199-
if (strcmp(rootPath, "44'/501'/0'/0'") == 0) return XPUB_TYPE_SOL_BIP44_CHANGE_0;
200-
if (strcmp(rootPath, "44'/501'/1'/0'") == 0) return XPUB_TYPE_SOL_BIP44_CHANGE_1;
201-
if (strcmp(rootPath, "44'/501'/2'/0'") == 0) return XPUB_TYPE_SOL_BIP44_CHANGE_2;
202-
if (strcmp(rootPath, "44'/501'/3'/0'") == 0) return XPUB_TYPE_SOL_BIP44_CHANGE_3;
203-
if (strcmp(rootPath, "44'/501'/4'/0'") == 0) return XPUB_TYPE_SOL_BIP44_CHANGE_4;
204-
if (strcmp(rootPath, "44'/501'/5'/0'") == 0) return XPUB_TYPE_SOL_BIP44_CHANGE_5;
205-
if (strcmp(rootPath, "44'/501'/6'/0'") == 0) return XPUB_TYPE_SOL_BIP44_CHANGE_6;
206-
if (strcmp(rootPath, "44'/501'/7'/0'") == 0) return XPUB_TYPE_SOL_BIP44_CHANGE_7;
207-
if (strcmp(rootPath, "44'/501'/8'/0'") == 0) return XPUB_TYPE_SOL_BIP44_CHANGE_8;
208-
if (strcmp(rootPath, "44'/501'/9'/0'") == 0) return XPUB_TYPE_SOL_BIP44_CHANGE_9;
209-
ASSERT(0);
210-
211-
return -1;
212-
}
213-
214186
static void SetContainerDefaultStyle(lv_obj_t *container)
215187
{
216188
lv_obj_set_style_radius(container, 24, LV_PART_MAIN | LV_STATE_DEFAULT);

src/ui/gui_widgets/gui_create_share_widgets.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ void GuiCreateShareUpdateMnemonic(void *signalParam, uint16_t paramLen)
119119
ArrayRandom(SecretCacheGetSlip39Mnemonic(g_createShareTileView.currentSlice), g_randomBuff, g_selectCnt);
120120
GuiUpdateMnemonicKeyBoard(g_shareConfirmTile.keyBoard, g_randomBuff, true);
121121
GuiStopCircleAroundAnimation();
122-
if (g_pageWidget != NULL) {
122+
if (g_pageWidget != NULL && g_createShareTileView.currentTile == CREATE_SHARE_BACKUPFROM) {
123123
SetRightBtnLabel(g_pageWidget->navBarWidget, NVS_BAR_WORD_SELECT, g_selectCnt == 20 ? "20" : "33");
124124
SetRightBtnCb(g_pageWidget->navBarWidget, SelectParseCntHandler, NULL);
125125
}

src/ui/gui_widgets/gui_update_success_widgets.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ static void UpdateSuccessNextStepHandler(lv_event_t *e)
2424
#endif
2525
} else {
2626
GuiFrameOpenView(&g_homeView);
27-
}
27+
}
2828
}
2929

3030
void GuiUpdateSuccessInit(void)

0 commit comments

Comments
 (0)