From 4aa8f7e1f554aa0b91c044850d4eb3f9fc6147e6 Mon Sep 17 00:00:00 2001 From: ww3512687 <15809188520@163.com> Date: Wed, 19 Feb 2025 15:58:58 +0800 Subject: [PATCH 1/2] merge 1.8.2 bug fix --- CHANGELOG-ZH.md | 10 +++ CHANGELOG.md | 10 +++ rust/apps/wallets/src/keystone.rs | 22 +++--- src/crypto/account_public_info.c | 29 +++++++ src/crypto/account_public_info.h | 4 + src/ui/gui_assets/font/cn/cnIllustrate.c | 77 +++++++++++-------- src/ui/gui_chain/multi/web3/gui_sol.c | 32 +------- src/ui/gui_widgets/gui_create_share_widgets.c | 2 +- .../gui_widgets/gui_update_success_widgets.c | 2 +- src/ui/lv_i18n/data.csv | 2 +- src/ui/lv_i18n/lv_i18n.c | 2 +- 11 files changed, 116 insertions(+), 76 deletions(-) diff --git a/CHANGELOG-ZH.md b/CHANGELOG-ZH.md index 2f51d5d2a..911cd22c3 100644 --- a/CHANGELOG-ZH.md +++ b/CHANGELOG-ZH.md @@ -1,3 +1,13 @@ +## 1.8.2(2024-12-30) + +### Bug 修复 + +1. 修复了输入密码后解锁时间较长的问题 +2. 修复了创建 SLIP39 钱包时快速切换助记词数量导致创建失败的问题 +3. 修复了 Solana 部分场景消息签名报错问题 + + + ## 1.8.0(2024-12-19) ### 新增 diff --git a/CHANGELOG.md b/CHANGELOG.md index 5774ecee6..ecd28d27e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,13 @@ +## 1.8.2(2024-12-30) + +### Bug Fixes + +1. Fixed the issue of long unlocking time after entering the password +2. Fixed the issue where rapidly switching the number of mnemonics during SLIP39 wallet creation caused creation failure +3. Fixed message signing errors in certain Solana scenarios + + + ## 1.8.0(2024-12-19) ### What's new diff --git a/rust/apps/wallets/src/keystone.rs b/rust/apps/wallets/src/keystone.rs index 038ee3f16..b13409039 100644 --- a/rust/apps/wallets/src/keystone.rs +++ b/rust/apps/wallets/src/keystone.rs @@ -22,15 +22,15 @@ fn get_device_id(serial_number: &str) -> String { hex::encode(&sha256(&sha256(serial_number.as_bytes()))[0..20]) } -const BTC_LEGACY_PREFIX: &str = "m/44'/0'/0'"; -const BTC_SEGWIT_PREFIX: &str = "m/49'/0'/0'"; -const BTC_NATIVE_SEGWIT_PREFIX: &str = "m/84'/0'/0'"; -const ETH_STANDARD_PREFIX: &str = "m/44'/60'/0'"; -const BCH_PREFIX: &str = "m/44'/145'/0'"; -const DASH_PREFIX: &str = "m/44'/5'/0'"; -const LTC_PREFIX: &str = "m/49'/2'/0'"; -const TRX_PREFIX: &str = "m/44'/195'/0'"; -const XRP_PREFIX: &str = "m/44'/144'/0'"; +const BTC_LEGACY_PREFIX: &str = "44'/0'/0'"; +const BTC_SEGWIT_PREFIX: &str = "49'/0'/0'"; +const BTC_NATIVE_SEGWIT_PREFIX: &str = "84'/0'/0'"; +const ETH_STANDARD_PREFIX: &str = "44'/60'/0'"; +const BCH_PREFIX: &str = "44'/145'/0'"; +const DASH_PREFIX: &str = "44'/5'/0'"; +const LTC_PREFIX: &str = "49'/2'/0'"; +const TRX_PREFIX: &str = "44'/195'/0'"; +const XRP_PREFIX: &str = "44'/144'/0'"; fn path_to_coin_code(path: &str) -> String { let path = path @@ -109,7 +109,7 @@ pub fn generate_crypto_multi_accounts( let mut coin_configs: Vec = vec![]; for key in data.get_keys() { let mut accounts: Vec = vec![]; - let hd_path = "M/".to_string() + &*key.get_origin().unwrap().get_path().unwrap(); + let hd_path = "M/".to_string() + &*key.get_origin().unwrap().get_path().unwrap().to_string(); let x_pub = key.get_bip32_key(); @@ -119,7 +119,7 @@ pub fn generate_crypto_multi_accounts( } let account = AccountConfig { - hd_path, + hd_path: "M/".to_string() + &*hd_path, x_pub, address_length: 1, is_multi_sign: false, diff --git a/src/crypto/account_public_info.c b/src/crypto/account_public_info.c index b294ad97c..72830b2ca 100644 --- a/src/crypto/account_public_info.c +++ b/src/crypto/account_public_info.c @@ -322,6 +322,35 @@ static const ChainItem_t g_chainTable[] = { #endif }; +#ifdef WEB3_VERSION +ChainType CheckSolPathSupport(char *path) +{ + int startIndex = -1; + int endIndex = -1; + for (int i = 0; i < XPUB_TYPE_NUM; i++) { + if (XPUB_TYPE_SOL_BIP44_0 == g_chainTable[i].chain) { + startIndex = i; + } + if (XPUB_TYPE_SOL_BIP44_CHANGE_49 == g_chainTable[i].chain) { + endIndex = i; + break; + } + } + + if (startIndex == -1 || endIndex == -1) { + return XPUB_TYPE_NUM; + } + + for (int i = startIndex; i <= endIndex; i++) { + // skip the first two characters + if (!strcmp(path, g_chainTable[i].path + 2)) { + return g_chainTable[i].chain; + } + } + return XPUB_TYPE_NUM; +} +#endif + static SimpleResponse_c_char *ProcessKeyType(uint8_t *seed, int len, int cryptoKey, const char *path, void *icarusMasterKey, void *ledgerBitbox02MasterKey) { switch (cryptoKey) { diff --git a/src/crypto/account_public_info.h b/src/crypto/account_public_info.h index 9faff9ef8..ceda03564 100644 --- a/src/crypto/account_public_info.h +++ b/src/crypto/account_public_info.h @@ -274,6 +274,10 @@ void SetConnectWalletAccountIndex(const char* walletName, uint32_t index); uint32_t GetConnectWalletNetwork(const char* walletName); void SetConnectWalletNetwork(const char* walletName, uint32_t index); +#ifdef WEB3_VERSION +ChainType CheckSolPathSupport(char *path); +#endif + #ifdef BTC_ONLY void ExportMultiSigXpub(ChainType chainType); void MultiSigWalletSave(const char *password, MultiSigWalletManager_t *manager); diff --git a/src/ui/gui_assets/font/cn/cnIllustrate.c b/src/ui/gui_assets/font/cn/cnIllustrate.c index 953aafdc8..565b3c9cf 100644 --- a/src/ui/gui_assets/font/cn/cnIllustrate.c +++ b/src/ui/gui_assets/font/cn/cnIllustrate.c @@ -1,7 +1,7 @@ /******************************************************************************* * Size: 20 px * Bpp: 2 - * Opts: --bpp 2 --size 20 --no-compress --font NotoSansSC-Regular.ttf --symbols "!#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~£¥·“”€、。一三上下不与专且业东丢个中为主久么之乏也了予争二于些交产享人什仅仍从仔他付代以们件任份优会传但位低体何余作你使例供保信修倒值做停储像充免入全公共关其具兼内册再写决况准凭出击分切列则创初删利别到制前剩功加务动助励勿包化匙匹区匿升单卡危即原参及反发取受口另只可台合同名后吗否含启告员味命和品哈响唯善器回因团固图在地场址坊块型域基境增备复外多够大天太失头奖如妥始威子字存学它安完官定实容密对寻导将小少尚尝就屏展属岁差己已币希帐带帮常幕平年并广序应底度建开异式引弱强当录影彻彼往径待律得循微心必志忘快态性总恢息您情想意感慎成我或户所手才打托扩扫批找技投护抬押担拥择括拭持指按振损换据捷授接推掷描提插摄撤播操擦支收改攻放政效敏教数整文断新方旁无既日旦时明易映是显景晰智暴更曾最有服望期未本术机权条来松构析果架某查标校核根格框案检概模次款止正此步段母每比气永求没法泛注洞派流测消涉添清港湿源溯滑满漏潜点然照熵片版牢物特状独率环现理生用由电留疑白的目直相看真着知短码破硬确示票禁离私种秒租积称移程稍空立站笔符第等策签简算管篡类系索约级纹线组细终经给络统继续维缆编缝缺网罗置署老考者而联股胁能脑自至致节芯花英荐获藏虑行衍表被装西要见观规觉解言警计认让议记许设访证识词试该详语误说请调谨负财责败账货质费资赌赔起超足路身转软轻载较输辖达过运这进连述追退送适逆选途通速造遇遵避邀邮部都酌配采释重量金钟钥钮钱铸链销锁错长门闭问间队防限除险随隐隔障难零需露非面页项顺须预题额风香验骰高默(),:? --format lvgl -o ../gui_assets/font/cn/cnIllustrate.c + * Opts: --bpp 2 --size 20 --no-compress --font NotoSansSC-Regular.ttf --symbols "!#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~£¥·“”€、。一三上下不与专且业东丢个中为主久么之乏也了予争二于些交产享人什仅仍从仔他付代以们件任份优会传但位低体何余作你使例供保信修倒值做停储像充免入全公共关其具兼内册再写决况准凭出击分切列则创初删利别到制前剩功加务动助励勿包化匙匹区匿升单卡危即原参及反发取受口另只可台合同名后吗否含启告员味命和品哈响唯善器回因团固图在地场址坊块型域基境增备复外多够大天太失头奖如妥始威子字存学它安完官定实容密对寻导将小少尚尝就屏展属岁差己已币希帐带帮常幕平年并广序应底度建开异式引弱强当录影彻彼往径待律得循微心必志忘快态性总恢息您情想意感慎成我或户所手才打托扩扫批找技投护抬押担拥择括拭持指按振损换据捷授接推掷描提插摄撤播操擦支收改攻放政效敏教数整文断新方旁无既日旦时明易映是显景晰智暴更曾最有服望期未本术机权条来松构析果架某查标校核根格框案检概模次款止正此步段母每比气永求没法泛注洞派流测消涉添清港湿源溯滑满漏潜点然照熵片版牢物特状独率环现理生用由电留疑白的目直相看真着知短码破硬确示票禁离私种秒租积称移程稍空立站笔符第等策签简算管篡类系索约级纹线组细终经给络统继续维缆编缝缺网罗置署老考者而联股胁能脑自至致节芯花英荐获藏虑行衍表被装西要见观规觉解言警计认让议记许设访证识词试该详语误说请调谨负财责败账货质费资赌赔起超足路身转软轻载较输辖达过运这进连述追退送适逆选途通速造遇遵避邀邮部都酌配采释重量金钟钥钮钱铸链销锁错长门闭问间队防限除险随隐隔隙障难零需露非面页项顺须预题额风香验骰高默(),:? --format lvgl -o ../gui_assets/font/cn/cnIllustrate.c ******************************************************************************/ #ifdef LV_LVGL_H_INCLUDE_SIMPLE @@ -9113,6 +9113,20 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t glyph_bitmap[] = { 0xb1, 0xc0, 0xd, 0x7, 0x2, 0xc7, 0x0, 0x34, 0x0, 0x3d, 0x0, 0x0, 0x0, 0x0, 0x0, + /* U+9699 "隙" */ + 0x0, 0x0, 0x1, 0x80, 0x1, 0xff, 0xc1, 0x87, + 0x24, 0x7, 0x5b, 0xe, 0x1c, 0x74, 0x1c, 0x28, + 0xb0, 0x70, 0xb0, 0x70, 0xd7, 0x1, 0xc0, 0xe1, + 0xc7, 0xe, 0xaf, 0xaa, 0x7, 0x38, 0x39, 0x55, + 0x6c, 0x1c, 0x70, 0xd0, 0x0, 0x70, 0x70, 0xa3, + 0xff, 0xff, 0xc1, 0xc1, 0xce, 0x0, 0xb, 0x7, + 0x3, 0x34, 0x0, 0x1c, 0x1c, 0xc, 0xff, 0xff, + 0xf0, 0x71, 0xb0, 0x2, 0xc0, 0x1, 0xcf, 0x43, + 0x47, 0x1c, 0x7, 0x0, 0x1c, 0x1c, 0x38, 0x1c, + 0x0, 0xd0, 0x70, 0x74, 0x70, 0xf, 0x1, 0xc0, + 0xb1, 0xc0, 0x30, 0x1b, 0x0, 0x87, 0x0, 0x2, + 0xf8, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + /* U+969C "障" */ 0x0, 0x0, 0x2, 0x40, 0x1, 0xff, 0xd0, 0xf, 0x0, 0x7, 0x5b, 0x3f, 0xff, 0xfd, 0x1c, 0x28, @@ -10142,31 +10156,32 @@ static const lv_font_fmt_txt_glyph_dsc_t glyph_dsc[] = { {.bitmap_index = 58875, .adv_w = 320, .box_w = 19, .box_h = 19, .ofs_x = 1, .ofs_y = -2}, {.bitmap_index = 58966, .adv_w = 320, .box_w = 18, .box_h = 19, .ofs_x = 1, .ofs_y = -2}, {.bitmap_index = 59052, .adv_w = 320, .box_w = 19, .box_h = 20, .ofs_x = 1, .ofs_y = -3}, - {.bitmap_index = 59147, .adv_w = 320, .box_w = 19, .box_h = 19, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 59238, .adv_w = 320, .box_w = 20, .box_h = 19, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 59333, .adv_w = 320, .box_w = 20, .box_h = 18, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 59423, .adv_w = 320, .box_w = 18, .box_h = 19, .ofs_x = 1, .ofs_y = -3}, - {.bitmap_index = 59509, .adv_w = 320, .box_w = 19, .box_h = 20, .ofs_x = 1, .ofs_y = -3}, - {.bitmap_index = 59604, .adv_w = 320, .box_w = 19, .box_h = 19, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 59695, .adv_w = 320, .box_w = 18, .box_h = 18, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 59776, .adv_w = 320, .box_w = 18, .box_h = 18, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 59857, .adv_w = 320, .box_w = 20, .box_h = 18, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 59947, .adv_w = 320, .box_w = 20, .box_h = 19, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 60042, .adv_w = 320, .box_w = 19, .box_h = 19, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 60133, .adv_w = 320, .box_w = 20, .box_h = 19, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 59147, .adv_w = 320, .box_w = 19, .box_h = 20, .ofs_x = 1, .ofs_y = -3}, + {.bitmap_index = 59242, .adv_w = 320, .box_w = 19, .box_h = 19, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 59333, .adv_w = 320, .box_w = 20, .box_h = 19, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 59428, .adv_w = 320, .box_w = 20, .box_h = 18, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 59518, .adv_w = 320, .box_w = 18, .box_h = 19, .ofs_x = 1, .ofs_y = -3}, + {.bitmap_index = 59604, .adv_w = 320, .box_w = 19, .box_h = 20, .ofs_x = 1, .ofs_y = -3}, + {.bitmap_index = 59699, .adv_w = 320, .box_w = 19, .box_h = 19, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 59790, .adv_w = 320, .box_w = 18, .box_h = 18, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 59871, .adv_w = 320, .box_w = 18, .box_h = 18, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 59952, .adv_w = 320, .box_w = 20, .box_h = 18, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 60042, .adv_w = 320, .box_w = 20, .box_h = 19, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 60137, .adv_w = 320, .box_w = 19, .box_h = 19, .ofs_x = 1, .ofs_y = -2}, {.bitmap_index = 60228, .adv_w = 320, .box_w = 20, .box_h = 19, .ofs_x = 0, .ofs_y = -2}, {.bitmap_index = 60323, .adv_w = 320, .box_w = 20, .box_h = 19, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 60418, .adv_w = 320, .box_w = 20, .box_h = 18, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 60508, .adv_w = 320, .box_w = 20, .box_h = 20, .ofs_x = 0, .ofs_y = -3}, - {.bitmap_index = 60608, .adv_w = 320, .box_w = 20, .box_h = 19, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 60703, .adv_w = 320, .box_w = 19, .box_h = 19, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 60794, .adv_w = 320, .box_w = 18, .box_h = 20, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 60884, .adv_w = 320, .box_w = 20, .box_h = 19, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 60979, .adv_w = 320, .box_w = 7, .box_h = 20, .ofs_x = 13, .ofs_y = -2}, - {.bitmap_index = 61014, .adv_w = 320, .box_w = 7, .box_h = 20, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 61049, .adv_w = 320, .box_w = 5, .box_h = 8, .ofs_x = 2, .ofs_y = -3}, - {.bitmap_index = 61059, .adv_w = 320, .box_w = 4, .box_h = 14, .ofs_x = 3, .ofs_y = -1}, - {.bitmap_index = 61073, .adv_w = 320, .box_w = 10, .box_h = 17, .ofs_x = 0, .ofs_y = -1} + {.bitmap_index = 60418, .adv_w = 320, .box_w = 20, .box_h = 19, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 60513, .adv_w = 320, .box_w = 20, .box_h = 18, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 60603, .adv_w = 320, .box_w = 20, .box_h = 20, .ofs_x = 0, .ofs_y = -3}, + {.bitmap_index = 60703, .adv_w = 320, .box_w = 20, .box_h = 19, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 60798, .adv_w = 320, .box_w = 19, .box_h = 19, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 60889, .adv_w = 320, .box_w = 18, .box_h = 20, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 60979, .adv_w = 320, .box_w = 20, .box_h = 19, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 61074, .adv_w = 320, .box_w = 7, .box_h = 20, .ofs_x = 13, .ofs_y = -2}, + {.bitmap_index = 61109, .adv_w = 320, .box_w = 7, .box_h = 20, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 61144, .adv_w = 320, .box_w = 5, .box_h = 8, .ofs_x = 2, .ofs_y = -3}, + {.bitmap_index = 61154, .adv_w = 320, .box_w = 4, .box_h = 14, .ofs_x = 3, .ofs_y = -1}, + {.bitmap_index = 61168, .adv_w = 320, .box_w = 10, .box_h = 17, .ofs_x = 0, .ofs_y = -1} }; /*--------------------- @@ -10251,10 +10266,10 @@ static const uint16_t unicode_list_1[] = { 0x9127, 0x912a, 0x912c, 0x912e, 0x93fc, 0x9402, 0x940b, 0x940e, 0x9455, 0x945b, 0x945d, 0x945e, 0x9476, 0x94dc, 0x9545, 0x954a, 0x954b, 0x9551, 0x957c, 0x958f, 0x95ad, 0x95c1, 0x95c6, 0x95ec, - 0x95ed, 0x95f1, 0x95f9, 0x961b, 0x9653, 0x965d, 0x968f, 0x96bb, - 0x96bf, 0x97d2, 0x97d6, 0x97d7, 0x97d8, 0x97e1, 0x97f5, 0x97fa, - 0x982b, 0x98f6, 0x99e9, 0x9a0d, 0x9a35, 0x9e35, 0xfe65, 0xfe66, - 0xfe69, 0xfe77, 0xfe7c + 0x95ed, 0x95f1, 0x95f6, 0x95f9, 0x961b, 0x9653, 0x965d, 0x968f, + 0x96bb, 0x96bf, 0x97d2, 0x97d6, 0x97d7, 0x97d8, 0x97e1, 0x97f5, + 0x97fa, 0x982b, 0x98f6, 0x99e9, 0x9a0d, 0x9a35, 0x9e35, 0xfe65, + 0xfe66, 0xfe69, 0xfe77, 0xfe7c }; /*Collect the unicode lists and glyph_id offsets*/ @@ -10265,7 +10280,7 @@ static const lv_font_fmt_txt_cmap_t cmaps[] = { }, { .range_start = 163, .range_length = 65149, .glyph_id_start = 96, - .unicode_list = unicode_list_1, .glyph_id_ofs_list = NULL, .list_length = 643, .type = LV_FONT_FMT_TXT_CMAP_SPARSE_TINY + .unicode_list = unicode_list_1, .glyph_id_ofs_list = NULL, .list_length = 644, .type = LV_FONT_FMT_TXT_CMAP_SPARSE_TINY } }; @@ -10368,7 +10383,7 @@ static const uint8_t kern_left_class_mapping[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0 + 0, 0, 0, 0 }; /*Map glyph_ids to kern right classes*/ @@ -10465,7 +10480,7 @@ static const uint8_t kern_right_class_mapping[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0 + 0, 0, 0, 0 }; /*Kern values between classes*/ diff --git a/src/ui/gui_chain/multi/web3/gui_sol.c b/src/ui/gui_chain/multi/web3/gui_sol.c index ede9d409c..bbd914043 100644 --- a/src/ui/gui_chain/multi/web3/gui_sol.c +++ b/src/ui/gui_chain/multi/web3/gui_sol.c @@ -11,7 +11,6 @@ #include "cjson/cJSON.h" #include "user_memory.h" #include "gui_qr_hintbox.h" -static uint8_t GetSolPublickeyIndex(char* rootPath); typedef struct { const char* address; } SolanaAddressLearnMoreData; @@ -100,7 +99,8 @@ void *GuiGetSolMessageData(void) void *data = g_isMulti ? g_urMultiResult->data : g_urResult->data; do { char *path = sol_get_path(data); - char pubkeyIndex = GetSolPublickeyIndex(path); + ChainType pubkeyIndex = CheckSolPathSupport(path); + ASSERT(pubkeyIndex != XPUB_TYPE_NUM); char *pubKey = GetCurrentAccountPublicKey(pubkeyIndex); PtrT_TransactionParseResult_DisplaySolanaMessage parseResult = solana_parse_message(data, pubKey); free_ptr_string(path); @@ -183,34 +183,6 @@ void GetSolMessageRaw(void *indata, void *param, uint32_t maxLen) } } -static uint8_t GetSolPublickeyIndex(char* rootPath) -{ - if (strcmp(rootPath, "44'/501'/0'") == 0) return XPUB_TYPE_SOL_BIP44_0; - if (strcmp(rootPath, "44'/501'/1'") == 0) return XPUB_TYPE_SOL_BIP44_1; - if (strcmp(rootPath, "44'/501'/2'") == 0) return XPUB_TYPE_SOL_BIP44_2; - if (strcmp(rootPath, "44'/501'/3'") == 0) return XPUB_TYPE_SOL_BIP44_3; - if (strcmp(rootPath, "44'/501'/4'") == 0) return XPUB_TYPE_SOL_BIP44_4; - if (strcmp(rootPath, "44'/501'/5'") == 0) return XPUB_TYPE_SOL_BIP44_5; - if (strcmp(rootPath, "44'/501'/6'") == 0) return XPUB_TYPE_SOL_BIP44_6; - if (strcmp(rootPath, "44'/501'/7'") == 0) return XPUB_TYPE_SOL_BIP44_7; - if (strcmp(rootPath, "44'/501'/8'") == 0) return XPUB_TYPE_SOL_BIP44_8; - if (strcmp(rootPath, "44'/501'/9'") == 0) return XPUB_TYPE_SOL_BIP44_9; - if (strcmp(rootPath, "44'/501'") == 0) return XPUB_TYPE_SOL_BIP44_ROOT; - if (strcmp(rootPath, "44'/501'/0'/0'") == 0) return XPUB_TYPE_SOL_BIP44_CHANGE_0; - if (strcmp(rootPath, "44'/501'/1'/0'") == 0) return XPUB_TYPE_SOL_BIP44_CHANGE_1; - if (strcmp(rootPath, "44'/501'/2'/0'") == 0) return XPUB_TYPE_SOL_BIP44_CHANGE_2; - if (strcmp(rootPath, "44'/501'/3'/0'") == 0) return XPUB_TYPE_SOL_BIP44_CHANGE_3; - if (strcmp(rootPath, "44'/501'/4'/0'") == 0) return XPUB_TYPE_SOL_BIP44_CHANGE_4; - if (strcmp(rootPath, "44'/501'/5'/0'") == 0) return XPUB_TYPE_SOL_BIP44_CHANGE_5; - if (strcmp(rootPath, "44'/501'/6'/0'") == 0) return XPUB_TYPE_SOL_BIP44_CHANGE_6; - if (strcmp(rootPath, "44'/501'/7'/0'") == 0) return XPUB_TYPE_SOL_BIP44_CHANGE_7; - if (strcmp(rootPath, "44'/501'/8'/0'") == 0) return XPUB_TYPE_SOL_BIP44_CHANGE_8; - if (strcmp(rootPath, "44'/501'/9'/0'") == 0) return XPUB_TYPE_SOL_BIP44_CHANGE_9; - ASSERT(0); - - return -1; -} - static void SetContainerDefaultStyle(lv_obj_t *container) { lv_obj_set_style_radius(container, 24, LV_PART_MAIN | LV_STATE_DEFAULT); diff --git a/src/ui/gui_widgets/gui_create_share_widgets.c b/src/ui/gui_widgets/gui_create_share_widgets.c index aad972550..7938329bc 100644 --- a/src/ui/gui_widgets/gui_create_share_widgets.c +++ b/src/ui/gui_widgets/gui_create_share_widgets.c @@ -119,7 +119,7 @@ void GuiCreateShareUpdateMnemonic(void *signalParam, uint16_t paramLen) ArrayRandom(SecretCacheGetSlip39Mnemonic(g_createShareTileView.currentSlice), g_randomBuff, g_selectCnt); GuiUpdateMnemonicKeyBoard(g_shareConfirmTile.keyBoard, g_randomBuff, true); GuiStopCircleAroundAnimation(); - if (g_pageWidget != NULL) { + if (g_pageWidget != NULL && g_createShareTileView.currentTile == CREATE_SHARE_BACKUPFROM) { SetRightBtnLabel(g_pageWidget->navBarWidget, NVS_BAR_WORD_SELECT, g_selectCnt == 20 ? "20" : "33"); SetRightBtnCb(g_pageWidget->navBarWidget, SelectParseCntHandler, NULL); } diff --git a/src/ui/gui_widgets/gui_update_success_widgets.c b/src/ui/gui_widgets/gui_update_success_widgets.c index 547cc5c95..ddba559f8 100644 --- a/src/ui/gui_widgets/gui_update_success_widgets.c +++ b/src/ui/gui_widgets/gui_update_success_widgets.c @@ -24,7 +24,7 @@ static void UpdateSuccessNextStepHandler(lv_event_t *e) #endif } else { GuiFrameOpenView(&g_homeView); -} + } } void GuiUpdateSuccessInit(void) diff --git a/src/ui/lv_i18n/data.csv b/src/ui/lv_i18n/data.csv index bc8da5d9a..c54e9d48f 100644 --- a/src/ui/lv_i18n/data.csv +++ b/src/ui/lv_i18n/data.csv @@ -703,7 +703,7 @@ About Terms,20,about_terms_website_url,https://keyst.one/terms,https://keyst.one Device Info,24,device_info_title,Device Info,Об устройстве,장치 정보,设备信息,Información del dispositivo,Geräteinfo,デバイス情報 USB connect,24,usb_connection_title,Connection,Соединение,연결,连接方式,Conexión,Verbindung,接続 ,24,usb_connection_subtitle,Air-Gap Mode,Режим воздушного зазора,에어갭 모드,气隙模式,Modo Air-Gap,Air-Gap-Modus,エアギャップモード -,20,usb_connection_desc,"When enabled, the USB port can only be used for battery charging purposes.","Если этот режим включен, USB-порт можно использовать только для зарядки аккумулятора.",비활성화된 경우 usb는 배터리 충전에만 사용할 수 있습니다,"禁用后,USB接口将仅用于充电","Cuando está habilitado, el puerto USB solo puede utilizarse para cargar la batería.","Wenn aktiviert, kann der USB-Anschluss nur zum Aufladen des Akkus verwendet werden.",有効になっている場合、USBポートはバッテリーの充電用にしか使用できません. +,20,usb_connection_desc,"When enabled, the USB port can only be used for battery charging purposes.","Если этот режим включен, USB-порт можно использовать только для зарядки аккумулятора.",비활성화된 경우 usb는 배터리 충전에만 사용할 수 있습니다,"启用气隙模式后,USB接口将仅用于充电","Cuando está habilitado, el puerto USB solo puede utilizarse para cargar la batería.","Wenn aktiviert, kann der USB-Anschluss nur zum Aufladen des Akkus verwendet werden.",有効になっている場合、USBポートはバッテリーの充電用にしか使用できません. ,20,sdcard_format_confirm,Format,Формат,포맷,格式化,Formato,Format,フォーマット ,24,sdcard_formating,Formatting,в процессе форматирования,포맷 진행중 ,正在格式化,Formateo,Formatierung,フォーマット ,20,sdcard_formating_desc,Do not remove the MicroSD card while formatting is in progress.,Не извлекайте карту microSD во время выполнения форматирования.,포맷 과정에서 MicroSD 카드를 제거하지 마십시오.,在格式化过程中请勿移除 MicroSD 卡.,No retires la tarjeta MicroSD mientras se está formateando,"Entfernen Sie die MicroSD-Karte nicht, während der Formatierungsvorgang läuft.",フォーマット中はMicroSDカードを取り外さないでください. diff --git a/src/ui/lv_i18n/lv_i18n.c b/src/ui/lv_i18n/lv_i18n.c index 59085b378..8ed1c0877 100644 --- a/src/ui/lv_i18n/lv_i18n.c +++ b/src/ui/lv_i18n/lv_i18n.c @@ -6299,7 +6299,7 @@ const static lv_i18n_phrase_t zh_cn_singulars[] = { {"unlock_device_use_password", "使用密码"}, {"unlock_device_use_pin", "使用 PIN码"}, {"update_success", "升级成功"}, - {"usb_connection_desc", "禁用后,USB接口将仅用于充电"}, + {"usb_connection_desc", "启用气隙模式后,USB接口将仅用于充电"}, {"usb_connection_subtitle", "气隙模式"}, {"usb_connection_title", "连接方式"}, {"usb_connectioning_wallet_desc", "请等待软件钱包完成连接,然后点击关闭。"}, From a86fec454df477f75e9049b9a10baec652ce7d25 Mon Sep 17 00:00:00 2001 From: ww3512687 <15809188520@163.com> Date: Wed, 19 Feb 2025 16:08:46 +0800 Subject: [PATCH 2/2] Refactor keystone.rs: Improve code formatting for HD path generation --- rust/apps/wallets/src/keystone.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rust/apps/wallets/src/keystone.rs b/rust/apps/wallets/src/keystone.rs index b13409039..dbccc4dc3 100644 --- a/rust/apps/wallets/src/keystone.rs +++ b/rust/apps/wallets/src/keystone.rs @@ -109,7 +109,8 @@ pub fn generate_crypto_multi_accounts( let mut coin_configs: Vec = vec![]; for key in data.get_keys() { let mut accounts: Vec = vec![]; - let hd_path = "M/".to_string() + &*key.get_origin().unwrap().get_path().unwrap().to_string(); + let hd_path = + "M/".to_string() + &*key.get_origin().unwrap().get_path().unwrap().to_string(); let x_pub = key.get_bip32_key();