Skip to content

Commit 2d2503d

Browse files
authored
fix(legacy): fix OK-16486 & OK-16489 & OK-16484 & OK-16483 & OK-16480 & OK-16346 (#302)
1 parent 71779df commit 2d2503d

File tree

6 files changed

+17
-7
lines changed

6 files changed

+17
-7
lines changed

legacy/firmware/algo/parser_impl.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -707,12 +707,12 @@ static parser_error_t _readTxCommonParams(parser_context_t *c, parser_tx_t *v) {
707707

708708
if (_findKey(c, KEY_COMMON_GEN_ID) == parser_ok) {
709709
CHECK_ERROR(_readString(c, (uint8_t *)v->genesisID, sizeof(v->genesisID)))
710-
DISPLAY_ITEM(IDX_COMMON_GEN_ID, 1, common_num_items)
710+
// DISPLAY_ITEM(IDX_COMMON_GEN_ID, 1, common_num_items)
711711
}
712712

713713
CHECK_ERROR(_findKey(c, KEY_COMMON_GEN_HASH))
714714
CHECK_ERROR(_readBinFixed(c, v->genesisHash, sizeof(v->genesisHash)))
715-
DISPLAY_ITEM(IDX_COMMON_GEN_HASH, 1, common_num_items)
715+
// DISPLAY_ITEM(IDX_COMMON_GEN_HASH, 1, common_num_items)
716716

717717
if (_findKey(c, KEY_COMMON_GROUP_ID) == parser_ok) {
718718
CHECK_ERROR(_readBinFixed(c, v->groupID, sizeof(v->groupID)))

legacy/firmware/aptos.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ void aptos_get_address_from_public_key(const uint8_t *public_key,
2929
sha3_Final(&ctx, buf);
3030
address[0] = '0';
3131
address[1] = 'x';
32-
data2hex((const uint8_t *)buf, SIZE_PUBKEY, address + 2);
32+
data2hexaddr((const uint8_t *)buf, SIZE_PUBKEY, address + 2);
3333
}
3434

3535
void aptos_sign_tx(const AptosSignTx *msg, const HDNode *node,

legacy/firmware/cosmos/parser.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,8 @@ __Z_INLINE parser_error_t parser_formatAmountItem(uint16_t amountToken,
194194
return parser_unexpected_error;
195195
}
196196
number_inplace_trimming(bufferUI, 0);
197+
const size_t len = strlen(bufferUI);
198+
if (bufferUI[len - 1] == '.') bufferUI[len - 1] = '\0';
197199
snprintf(tmpDenom, sizeof(tmpDenom), " %s", COIN_DEFAULT_DENOM_REPR);
198200
} else {
199201
const CosmosNetworkType *n = cosmosnetworkByChainId(cosmos_chain_id);

legacy/firmware/fsm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ static bool fsm_layoutAddress(const char *address, const char *desc,
284284
const char *display_addr = address;
285285
// strip cashaddr prefix
286286
if (prefixlen) {
287-
display_addr += prefixlen;
287+
// display_addr += prefixlen;
288288
}
289289
layoutAddress(display_addr, desc, false, ignorecase, address_n,
290290
address_n_count, address_is_account);

legacy/firmware/fsm_msg_coin.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -249,9 +249,8 @@ void fsm_msgGetAddress(const GetAddress *msg) {
249249
}
250250

251251
bool is_cashaddr = coin->cashaddr_prefix != NULL;
252-
bool is_bech32 = msg->script_type == InputScriptType_SPENDWITNESS ||
253-
msg->script_type == InputScriptType_SPENDTAPROOT;
254-
if (!fsm_layoutAddress(address, desc, is_cashaddr || is_bech32,
252+
bool is_bech32 = msg->script_type == InputScriptType_SPENDTAPROOT;
253+
if (!fsm_layoutAddress(address, desc, is_bech32,
255254
is_cashaddr ? strlen(coin->cashaddr_prefix) + 1 : 0,
256255
msg->address_n, msg->address_n_count, false,
257256
msg->has_multisig ? &(msg->multisig) : NULL,

legacy/firmware/language.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,8 @@ const char *languages[][2] = {
200200
"down.",
201201
"接下来,请根据已写下的助\n记词选择正确的单词"},
202202
{"Click to Unlock", "按任意键解锁"},
203+
// algorand.c
204+
{"Close to", "关闭账户并转移资产到"},
203205
// layout2.c
204206
{"CoSi commit index #?", ""},
205207
// layout2.c
@@ -592,6 +594,8 @@ const char *languages[][2] = {
592594
{"Not in Signing mode", ""},
593595
// u2f.c
594596
{"Not registered.", ""},
597+
// algorand.c
598+
{"Note", "备注"},
595599
// layout2.c u2f.c u2f.c fsm_msg_common.h
596600
{"OK", "确认"},
597601
{"OK or Next", "确认或继续"},
@@ -730,6 +734,7 @@ const char *languages[][2] = {
730734
{"Re-enter new wipe code:", ""},
731735
// ethereum.c layout2.c
732736
{"Really send", "确认发送"},
737+
{"Receiver", "接收方"},
733738
{"Recipient", "接收方"},
734739
// reset.c
735740
{"Recovery Phrase", "助记词"},
@@ -741,6 +746,8 @@ const char *languages[][2] = {
741746
{"Redelegate", "重新委托"},
742747
// u2f.c
743748
{"Register", "注册"},
749+
// algorand.c
750+
{"Rekey to", "重新授权给"},
744751
// layout2.c
745752
{"Remaining times:", "剩余次数"},
746753
//
@@ -895,6 +902,8 @@ const char *languages[][2] = {
895902
// fsm_msg_coin.h
896903
{"Transaction must have at least one output", ""},
897904
{"Transfer", "发送"},
905+
// algo
906+
{"Txn type", "类型"},
898907
// ethereum.c
899908
{"Txtype out of bounds", ""},
900909
// cosmos.c

0 commit comments

Comments
 (0)