Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat(mobile): Device Settings for FW revision check #16435

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from

Conversation

Lemonexe
Copy link
Contributor

@Lemonexe Lemonexe commented Jan 17, 2025

Description

🚧 Depends on #16455 and #16454

  • add Additional Settings section to Device Settings modal
  • create Advanced Settings screen
  • create confirmation modal to Turn off FW authenticity check

👁️ CR commit by commit is recommended ℹ️ you may skip first 2 commits (extracted to sub-PRs):

  • feat(icons): add code icon to native, regenerate = #16455
  • feat(suite-native): add more params to IconListItem for reusability = #16454

Related Issue

Resolve #16447

Screenshots:

Device Settings:
Feature flag Firmware Revision check = off is unchanged
Feature flag Firmware Revision check = on:
image

On press Advanced Setings section go to Advanced Settings:
image

On press Turn off button go to Turn off modal:
image

On press checkbox:
image

Back to Advanced settings, but Turn on the button now turns it on instantly:
image

Copy link

github-actions bot commented Jan 17, 2025

🚀 Expo preview is ready!

  • Project → trezor-suite-preview
  • Platforms → android, ios
  • Scheme → trezorsuitelite
  • Runtime Version → 22
  • More info

Learn more about 𝝠 Expo Github Action

@Lemonexe Lemonexe force-pushed the feat/native-FW-revision-check-DeviceSettings branch from 2dcc93f to a91440a Compare January 17, 2025 16:39
@@ -112,7 +112,7 @@ export const HELP_CENTER_EVM_ADDRESS_CHECKSUM: Url =
export const HELP_CENTER_EVM_SEND_TO_CONTRACT_URL =
'https://trezor.io/support/a/where-is-my-ethereum';
export const HELP_CENTER_FIRMWARE_REVISION_CHECK: Url =
'https://trezor.io/learn/a/trezor-firmware-revision-check';
'https://trezor.io/learn/a/trezor-firmware-authenticity-check';
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

incidental fix of outdated URL, you can see that the former 308's to the new one

type SoftWarningBehavior = { type: 'softWarning'; shouldReport: true };
// display `SuiteBanners`, show `DeviceCompromised` modal, block receiving address
// display "Device Compromised" modal, after closing it dispaly a warning banner, block receiving address
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is the suite config. I only reworded comments to match the new mobile config (see same-named file below)

DeviceAuthenticityStackParamList,
DeviceAuthenticityStackRoutes,
DeviceSettingsStackParamList
>;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

btw is there any simpler way than having to boilerplate everytime we need to navigate? 🤔

"@suite-native/toasts": "workspace:*",
"@trezor/connect": "workspace:*",
"@trezor/device-utils": "workspace:*",
"@trezor/env-utils": "workspace:*",
"@trezor/styles": "workspace:*",
"@trezor/urls": "workspace:*",
Copy link
Contributor Author

@Lemonexe Lemonexe Jan 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is first time @trezor/urls are used in suite-native altogether. Is that alright, or would you prefer me duplicating them somewhere in suite-native? 🤔

@@ -504,6 +505,32 @@ export const en = {
},
},
},
advancedSettings: {
title: 'Advanced settings',
subtitle: 'Very nerdy stuff here',
Copy link
Contributor Author

@Lemonexe Lemonexe Jan 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ PLACEHOLDER, wait for actual copy 🚧
Other copies are likely final.

@Lemonexe Lemonexe force-pushed the feat/native-FW-revision-check-DeviceSettings branch from a91440a to 721ae36 Compare January 17, 2025 17:36
'firmware-version-unknown': { type: 'hardModal', shouldReport: true },
'cannot-perform-check-offline': { type: 'softWarning', shouldReport: true },
'other-error': { type: 'softWarning', shouldReport: true },
} satisfies RevisionCheckErrorScenarios;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file may seem like overkill, but the experience on Suite Desktop/web shown that having the ifs distributed across components is untenable. We were changing it a lot, especially hash check 🙉
See same-named file above for full config.
In mobile we start with only revision check, but we'll add hash check too eventually.

@Lemonexe Lemonexe added the mobile Suite Lite issues and PRs label Jan 17, 2025
@Lemonexe Lemonexe marked this pull request as ready for review January 17, 2025 17:43
@Lemonexe Lemonexe requested review from marekrjpolak and a team as code owners January 17, 2025 17:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mobile Suite Lite issues and PRs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Device Settings for FW revision check
1 participant