Skip to content

Commit 0dca5a5

Browse files
authored
fix: opt change pin logic and update i18n (#167)
* update i18n * opt change pin logic
1 parent 0f2d652 commit 0dca5a5

File tree

13 files changed

+141
-46
lines changed

13 files changed

+141
-46
lines changed

legacy/firmware/config.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -497,8 +497,11 @@ bool config_verifyPin(const char *pin, pin_type_t pin_type) {
497497
if (!passphrase_protection && pin_type == PIN_TYPE_USER_AND_PASSPHRASE_PIN) {
498498
pin_type = PIN_TYPE_USER;
499499
}
500+
bool is_check_type = (pin_type == PIN_TYPE_USER_CHECK ||
501+
pin_type == PIN_TYPE_PASSPHRASE_PIN_CHECK ||
502+
pin_type == PIN_TYPE_USER_AND_PASSPHRASE_PIN_CHECK);
500503
bool result = (sectrue == se_verifyPin(pin, pin_type));
501-
if (!result) {
504+
if (!result && !is_check_type) {
502505
se_clearPinStateCache();
503506
is_passphrase_pin_enabled = false;
504507
session_seed_cached_btc = false;

legacy/firmware/i18n/i18n.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#include <stdio.h>
66
#include "keys.h"
77

8-
#define I18N_ITEMS_COUNT 427
8+
#define I18N_ITEMS_COUNT 430
99
#define I18N_LANGUAGE_ITEMS 8
1010

1111
typedef enum {

legacy/firmware/i18n/keys.h

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -867,31 +867,37 @@
867867
#define C__PIN_ALREADY_USED_DO_YOU_WANT_TO_OVERWRITE_IT 412
868868
// PIN already used! Please try a different one
869869
#define C__PIN_ALREADY_USED_PLEASE_TRY_A_DIFFERENT_ONE 413
870-
// Before start, verify your Standard Wallet PIN
871-
#define C__BEFORE_START_VERIFY_YOUR_TANDARD_WALLET_PIN 414
872870
// TRON Energy Rental
873-
#define T_ENERGY_RENTAL 415
871+
#define T_ENERGY_RENTAL 414
874872
// Recipient is a known energy rental service provider address.
875-
#define I_ENERGY_RENTAL 416
873+
#define I_ENERGY_RENTAL 415
876874
// Confirm Phrase
877-
#define T__CONFIRM_PHRASE 417
875+
#define T__CONFIRM_PHRASE 416
878876
// Save Passphrase
879-
#define T__SAVE_PASSPHRASE 418
877+
#define T__SAVE_PASSPHRASE 417
880878
// Remove PIN
881-
#define T__REMOVE_PIN 419
879+
#define T__REMOVE_PIN 418
882880
// Management Security Key
883-
#define M__MANAGEMENT_SECURITY_KEY 420
881+
#define M__MANAGEMENT_SECURITY_KEY 419
884882
// Incorrect PIN! The PIN you entered is incorrect
885-
#define C__INCORRECT_PIN_THE_PIN_YOU_ENTERED_IS_INCORRECT 421
883+
#define C__INCORRECT_PIN_THE_PIN_YOU_ENTERED_IS_INCORRECT 420
886884
// Lock the screen?
887-
#define C__LOCK_THE_SCREEN 422
885+
#define C__LOCK_THE_SCREEN 421
888886
// Confirm Typed Data
889-
#define T_CONFIRM_TYPED_DATA 423
887+
#define T_CONFIRM_TYPED_DATA 422
890888
// {} authorization. Check dApp trust first.
891-
#define I_TYPED_DATA_AUTHORIZATION_WARNING 424
889+
#define I_TYPED_DATA_AUTHORIZATION_WARNING 423
892890
// Review Struct
893-
#define I_REVIEW_STRUCT 425
891+
#define I_REVIEW_STRUCT 424
894892
// Tips: Press “ ” both at once to switch case / numbers / symbols.
895-
#define C__TIPS_PRESS_BOTH_AT_ONCE_TO_SWITCH_CASE_NUMBERS_SYMBOLS 426
893+
#define C__TIPS_PRESS_BOTH_AT_ONCE_TO_SWITCH_CASE_NUMBERS_SYMBOLS 425
894+
// Safe Transaction
895+
#define T_CONFIRM_SAFE_TX 426
896+
// Delegatecall may let external code affect your wallet.
897+
#define I_SAFE_DELEGATE_WARNING 427
898+
// View execTransaction
899+
#define I_VIEW_EXEC_TRANSACTION 428
900+
// Next, enter the PIN you want to change
901+
#define C__NEXT_ENTER_THE_PIN_YOU_WANT_TO_CHANGE 429
896902
#endif
897903
// clang-format on

legacy/firmware/i18n/locales/de.inc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,6 @@ const char *const languages_de[] = {
413413
"Sie haben Passphrase nicht aktiviert",
414414
"PIN bereits verwendet! Möchten Sie ihn überschreiben?",
415415
"PIN bereits verwendet! Bitte versuchen Sie einen anderen.",
416-
"Bevor Sie beginnen, überprüfen Sie Ihre Standard-Wallet-PIN",
417416
"TRON Energy-Miete",
418417
"Der Empfänger ist eine bekannte Adresse eines Energie-Mietdienstleisters.",
419418
"Phrase bestätigen",
@@ -426,4 +425,8 @@ const char *const languages_de[] = {
426425
"{}-Autorisierung. Überprüfe zuerst das Vertrauen in die dApp.",
427426
"Struktur bewerten",
428427
"Tipps: „ “drücken, um Buchstaben, Zahlen und Symbole zu wechseln.",
428+
"Safe-Transaktion",
429+
"Delegatecall kann es externem Code ermöglichen, Ihre Wallet zu beeinflussen.",
430+
"execTransaction anzeigen",
431+
"Geben Sie als Nächstes die PIN ein, die Sie ändern möchten",
429432
};

legacy/firmware/i18n/locales/en.inc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,6 @@ const char *const languages_en[] = {
413413
"You do not have Passphrase turned on",
414414
"PIN Already Used!
Do you want to overwrite it?",
415415
"PIN already used! Please try a different one",
416-
"Before start, verify your Standard Wallet PIN",
417416
"TRON Energy Rental",
418417
"Recipient is a known energy rental service provider address.",
419418
"Confirm Phrase",
@@ -426,4 +425,8 @@ const char *const languages_en[] = {
426425
"{} authorization. Check dApp trust first.",
427426
"Review Struct",
428427
"Tips: Press “ ” both at once to switch case / numbers / symbols.",
428+
"Safe Transaction",
429+
"Delegatecall may let external code affect your wallet.",
430+
"View execTransaction",
431+
"Next, enter the PIN you want to change",
429432
};

legacy/firmware/i18n/locales/es.inc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,6 @@ const char *const languages_es[] = {
413413
"No tienes activada la Passphrase",
414414
"¡PIN ya utilizado!
¿Deseas sobrescribirlo?",
415415
"¡PIN ya utilizado! Por favor, prueba con otro diferente",
416-
"Antes de comenzar, verifica el PIN de tu Billetera Estándar",
417416
"Alquiler de energía TRON",
418417
"El destinatario es una dirección conocida de un proveedor de servicios de alquiler de energía.",
419418
"Confirmar frase",
@@ -426,4 +425,8 @@ const char *const languages_es[] = {
426425
"{} autorización. Verifica primero la confiabilidad de la dApp.",
427426
"Estructura de revisión",
428427
"Consejos: Pulsa “ ”para cambiar entre letras, números y símbolos.",
428+
"Safe transacción",
429+
"Delegatecall puede permitir que el código externo afecte tu billetera.",
430+
"Ver execTransaction",
431+
"A continuación, introduce el PIN que quieres cambiar",
429432
};

legacy/firmware/i18n/locales/ja.inc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,6 @@ const char *const languages_ja[] = {
413413
"Passphrase が有効になっていません",
414414
"このPINはすでに使用されています!
上書きしますか?",
415415
"そのPINはすでに使用されています。別のものをお試しください。",
416-
"開始する前に、Standard WalletのPINを確認してください",
417416
"TRONエネルギーレンタル",
418417
"受取人は、既知のエネルギーレンタルサービスプロバイダーのアドレスです。",
419418
"フレーズの確認",
@@ -426,4 +425,8 @@ const char *const languages_ja[] = {
426425
"{} の認可。まず dApp の信頼性を確認してください。",
427426
"レビュー構造体",
428427
"ヒント:「 」を押すと、文字・数字・記号を切り替えられます。",
428+
"Safe 取引",
429+
"delegatecall により、外部コードがあなたのウォレットに影響を及ぼす可能性があります。",
430+
"execTransaction を表示",
431+
"次に、変更したいPINを入力してください",
429432
};

legacy/firmware/i18n/locales/ko_kr.inc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,6 @@ const char *const languages_ko_kr[] = {
413413
"Passphrase 가 활성화되어 있지 않습니다.",
414414
"이미 사용된 PIN입니다!
덮어쓰시겠습니까?",
415415
"이미 사용된 PIN입니다! 다른 PIN을 시도해 주세요",
416-
"시작하기 전에 Standard Wallet PIN을 확인하세요",
417416
"TRON 에너지 렌탈",
418417
"수신자는 알려진 에너지 렌탈 서비스 제공업체 주소입니다.",
419418
"문구 확인",
@@ -426,4 +425,8 @@ const char *const languages_ko_kr[] = {
426425
"{} 인가. 먼저 dApp 신뢰를 확인하세요.",
427426
"리뷰 구조체",
428427
"팁: 대/소문자·숫자·기호를 전환하려면 “ ”을(를) 동시에 누르세요.",
428+
"Safe 트랜잭션",
429+
"Delegatecall은 외부 코드가 지갑에 영향을 미치게 할 수 있습니다.",
430+
"execTransaction 보기",
431+
"다음으로, 변경하려는 PIN을 입력하세요",
429432
};

legacy/firmware/i18n/locales/pt_br.inc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,6 @@ const char *const languages_pt_br[] = {
413413
"Você não tem o Passphrase ativado",
414414
"PIN já utilizado! Deseja sobrescrever?",
415415
"PIN já utilizado! Por favor, tente um diferente",
416-
"Antes de começar, verifique o PIN da sua Carteira Padrão",
417416
"Aluguel de Energia TRON",
418417
"O destinatário é um endereço conhecido de provedor de serviços de aluguel de energia.",
419418
"Confirmar Passphrase",
@@ -426,4 +425,8 @@ const char *const languages_pt_br[] = {
426425
"Autorização de {}. Verifique a confiança do dApp primeiro.",
427426
"Revisar Struct",
428427
"Dicas: Pressione \" \" para alternar entre letras, números e símbolos.",
428+
"Transação Safe",
429+
"Delegatecall pode permitir que código externo afete sua carteira.",
430+
"Ver execTransaction",
431+
"Em seguida, digite o PIN que você deseja alterar",
429432
};

legacy/firmware/i18n/locales/zh_cn.inc

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ const char *const languages_zh_cn[] = {
392392
"编辑单词 #{}",
393393
"绑定 PIN 码",
394394
"禁用 Passphrase?隐藏钱包 PIN 码将无法解锁设备",
395-
"设置多个 PIN 码并分别关联不同的 Passphrase,您就可以轻松切换访问不同的钱包。输入对应的 PIN 码,就能打开相应的钱包",
395+
"通过为不同的 Passphrase 设置不同的 PIN 码,您可以轻松切换并访问对应的钱包。只需输入特定的 PIN 码,就能打开与之关联的钱包",
396396
"设置隐藏钱包 PIN 码",
397397
"达到限制:最多可设置 3 个 PIN 码!您想要删除一些隐藏钱包 PIN 码吗?",
398398
"绑定 Passphrase",
@@ -413,7 +413,6 @@ const char *const languages_zh_cn[] = {
413413
"您尚未开启 Passphrase",
414414
"此 PIN 码已被使用!您要覆盖它吗?",
415415
"PIN已被使用!请尝试其他的",
416-
"开始前,请验证您的标准钱包 PIN 码",
417416
"TRON 能量租赁",
418417
"收款地址是已知的能量租赁服务提供商。",
419418
"确认助记词",
@@ -426,4 +425,8 @@ const char *const languages_zh_cn[] = {
426425
"{} 授权。请先检查 dApp 信任度。",
427426
"审查结构体",
428427
"提示:同时按下\" \"来切换大小写/数字/符号。",
428+
"Safe 交易",
429+
"Delegatecall 可能让外部代码影响您的钱包。",
430+
"查看执行交易",
431+
"接下来,输入您要更改的 PIN 码",
429432
};

0 commit comments

Comments
 (0)