Skip to content

Commit 93a4c4f

Browse files
authored
fix(legacy): fix OK-16486 & OK-16489 & OK-16484 & OK-16483 & OK-16480 & OK-16346 (#303)
1 parent 52de3c1 commit 93a4c4f

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
@@ -149,6 +149,8 @@ const char *languages[][2] = {
149149
//
150150
{"Check this device with\nOneKey secure server?",
151151
"确定访问OneKey服务器对\n此设备进行防伪校验吗?"},
152+
// algorand.c
153+
{"Close to", "关闭账户并转移资产到"},
152154
// layout2.c
153155
{"CoSi commit index #?", ""},
154156
// layout2.c
@@ -521,6 +523,8 @@ const char *languages[][2] = {
521523
{"Not in Signing mode", ""},
522524
// u2f.c
523525
{"Not registered.", ""},
526+
// algorand.c
527+
{"Note", "备注"},
524528
// layout2.c u2f.c u2f.c fsm_msg_common.h
525529
{"OK", "确认"},
526530
// signing.c
@@ -633,6 +637,7 @@ const char *languages[][2] = {
633637
{"Re-enter new wipe code:", ""},
634638
// ethereum.c layout2.c
635639
{"Really send", "确认发送"},
640+
{"Receiver", "接收方"},
636641
//
637642
{"Recipient", "接收方"},
638643
//
@@ -641,6 +646,8 @@ const char *languages[][2] = {
641646
{"Redelegate", "重新委托"},
642647
// u2f.c
643648
{"Register", "注册"},
649+
// algorand.c
650+
{"Rekey to", "重新授权给"},
644651
// layout2.c
645652
{"Remaining times:", "剩余次数"},
646653
//
@@ -779,6 +786,8 @@ const char *languages[][2] = {
779786
// fsm_msg_coin.h
780787
{"Transaction must have at least one output", ""},
781788
{"Transfer", "发送"},
789+
// algo
790+
{"Txn type", "类型"},
782791
// ethereum.c
783792
{"Txtype out of bounds", ""},
784793
// cosmos.c

0 commit comments

Comments
 (0)