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): firmware upgrade #15184

Merged
merged 9 commits into from
Dec 3, 2024
Merged

feat(mobile): firmware upgrade #15184

merged 9 commits into from
Dec 3, 2024

Conversation

Nodonisko
Copy link
Contributor

@Nodonisko Nodonisko commented Nov 4, 2024

It's quite huge but lot of changes are just moving things around. Check it commit by commit for easier review.

Description

Doesn't work or not implemented yet

=> #15584

Notes for QA

What not to test

  • Anything mentioned in mobile: firmware upgrade follow-up #15584
  • Also update box in device settings will show all the time and will trigger FW reinstall in case you have latest FW (this is meant to simplify development and I will keep it for now)

What to test

  1. FW upgrade for all our devices - happy path
  2. FW upgrade failed
    • update rejected on device button request
    • cable disconnected during all different steps of FW upgrade
    • shitty USB cable (if possible)
    • when nothing happens for more than minute it should show button What if it gets stuck? (pressing buttons does nothing for now) and it should dissapear when something happens (progress or user accepts button request on device)
    • Retry button should work in all of these error cases
  3. Test devices with PIN and also without PIN set
  4. Test that remembered devices stays remembered and not remember stays not
  5. Test that discovery doesn't run again for not remembered devices
  6. BTC only FW should work too and stay BTC only and same for Universal FW
  7. FW translations should work too
  8. Everything should be nicely animated and smooth - I put lot of work into this so don't hesitate to pinpoint details if something doesn't feel right
  9. Desktop
    • FW upgrade and onboarding (I did some refactors in common code so I could break something)
    • FW types BTC and Universal stays correct during update

Related Issue

Resolve #14614

Screenshots:

@Nodonisko Nodonisko force-pushed the feat/firmware-upgrade branch from a57b375 to 898e243 Compare November 6, 2024 15:27
@Nodonisko Nodonisko force-pushed the feat/firmware-upgrade branch 2 times, most recently from 3bc13b7 to 1d9c900 Compare November 20, 2024 20:04
@vytick vytick added the mobile Suite Lite issues and PRs label Nov 20, 2024
@Nodonisko Nodonisko force-pushed the feat/firmware-upgrade branch from 0fdc1c2 to f8fe6b0 Compare November 22, 2024 10:18
import { tryLocalAssetRequire } from './assetUtils';

export const httpRequest = (url: string, _type: string): any => tryLocalAssetRequire(url);
export function httpRequest<T extends HttpRequestType>(
Copy link
Member

Choose a reason for hiding this comment

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

This might close this issue too, right? #13271

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I think it should, be we should test it including FW translations.

@Nodonisko Nodonisko force-pushed the feat/firmware-upgrade branch 3 times, most recently from 635c080 to e8cb1e7 Compare November 26, 2024 15:56
@Nodonisko Nodonisko marked this pull request as ready for review November 26, 2024 15:57
Copy link

github-actions bot commented Nov 26, 2024

🚀 Expo preview is ready!

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

Learn more about 𝝠 Expo Github Action

@Nodonisko Nodonisko force-pushed the feat/firmware-upgrade branch 2 times, most recently from 991adca to 03c6bd9 Compare November 26, 2024 17:02
@komret komret force-pushed the feat/firmware-upgrade branch from 57aaea9 to 7e82d6e Compare November 26, 2024 19:21
Copy link
Contributor

@komret komret left a comment

Choose a reason for hiding this comment

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

Approving of c3daee4. I noticed that useFirmware didn't make much sense anymore and its logic could be split between components and selectors. I didn't want to bother you with it as it is out of scope so I did it myself and added the commits here.

Copy link
Contributor

@PeKne PeKne left a comment

Choose a reason for hiding this comment

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

I was looking mostly into the suite-native part.

resetReducer,
translatedText,
mayBeStucked,
} = useFirmware({});
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
} = useFirmware({});
} = useFirmware();

Please set params = {} as default value in native useFirmware.

return;
}
setTimeout(() => {
// setting this to false will trigger standart device connection flow
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// setting this to false will trigger standart device connection flow
// setting this to false will trigger standard device connection flow

}, []);

const handleContactSupport = useCallback(() => {
Linking.openURL('https://trezor.io/support');
Copy link
Contributor

@yanascz yanascz Nov 27, 2024

Choose a reason for hiding this comment

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

We already have SUITE_LITE_SUPPORT_URL from @suite-native/link on different places. Would it make sense to use the same URL?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Definitely

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed 61b3b75

Copy link
Contributor

@mroz22 mroz22 left a comment

Choose a reason for hiding this comment

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

ack connect part. did not test

@Nodonisko Nodonisko force-pushed the feat/firmware-upgrade branch from 7e82d6e to 61b3b75 Compare November 29, 2024 15:38
Copy link

github-actions bot commented Nov 29, 2024

Fingerprint is changed, new EAS Build(s) are now in pipeline.

Build with commit f0cdf36

Name Build Details
🤖 Android build View build page
DetailsDistribution: INTERNAL
Build profile: preview
SDK version: 52.0.0
App version: 24.11.3
🍎 iOS build View build page
DetailsDistribution: INTERNAL
Build profile: preview
SDK version: 52.0.0
App version: 24.11.3
Fingerprint diff
[
  {
    "op": "changed",
    "beforeSource": {
      "type": "contents",
      "id": "expoConfig",
      "contents": "{\"android\":{\"adaptiveIcon\":{\"backgroundColor\":\"#E59D17\",\"foregroundImage\":\"./assets/appIcon_android.png\",\"monochromeImage\":\"./assets/appIcon_android.png\"},\"intentFilters\":[{\"action\":\"VIEW\",\"autoVerify\":true,\"category\":[\"BROWSABLE\",\"DEFAULT\"],\"data\":[{\"host\":\"dev.suite.sldev.cz\",\"pathPattern\":\"/connect/.*/.*/deeplink/.*\",\"scheme\":\"https\"},{\"host\":\"dev.suite.sldev.cz\",\"pathPattern\":\"/connect/.*/deeplink/.*\",\"scheme\":\"https\"}]}],\"package\":\"io.trezor.suite.preview\",\"permissions\":[\"android.permission.CAMERA\"]},\"androidStatusBar\":{\"backgroundColor\":\"#25292E\"},\"extra\":{\"commitHash\":\"f7dd25b803538b443f07f880f4fdceaa4faadd1a\",\"eas\":{\"projectId\":\"15998f8a-e75c-4b60-959d-6f68e5ff4936\"}},\"ios\":{\"associatedDomains\":[\"applinks:dev.suite.sldev.cz\"],\"bundleIdentifier\":\"io.trezor.suite.preview\",\"icon\":\"./assets/preview/appIcon.png\",\"infoPlist\":{\"ITSAppUsesNonExemptEncryption\":false,\"NSAppTransportSecurity\":{\"NSAllowsArbitraryLoads\":true,\"NSExceptionDomains\":{\"data.trezor.io\":{\"NSExceptionAllowsInsecureHTTPLoads\":true,\"NSIncludesSubdomains\":true},\"localhost\":{\"NSExceptionAllowsInsecureHTTPLoads\":true}}},\"NSCameraUsageDescription\":\"$(PRODUCT_NAME) needs access to your Camera to scan your XPUB.\",\"NSFaceIDUsageDescription\":\"$(PRODUCT_NAME) needs Face ID and Touch ID to keep sensitive data about your portfolio private.\",\"NSMicrophoneUsageDescription\":\"This app does not require access to the microphone.\",\"UIRequiredDeviceCapabilities\":[\"armv7\"]},\"supportsTablet\":true},\"name\":\"Trezor Suite Lite Preview\",\"orientation\":\"portrait\",\"owner\":\"trezorcompany-develop\",\"platforms\":[\"android\",\"ios\"],\"plugins\":[\"./plugins/withGradleProperties.js\",\"./plugins/withRemoveXcodeLocalEnv.js\",\"./plugins/withRemoveiOSNotificationEntitlement.js\",\"@trezor/react-native-usb/plugins/withUSBDevice.js\",[\"./plugins/withAndroidMainActivityAttributes.js\",{\"android:allowBackup\":false}],[\"@config-plugins/detox\",{\"subdomains\":\"*\"}],[\"@sentry/react-native/expo\",{\"organization\":\"satoshilabs\",\"project\":\"suite-native\",\"url\":\"https://sentry.io/\"}],[\"expo-build-properties\",{\"android\":{\"kotlinVersion\":\"1.9.24\",\"minSdkVersion\":28},\"ios\":{\"deploymentTarget\":\"15.1\"}}],[\"expo-camera\",{\"cameraPermission\":\"Allow $(PRODUCT_NAME) to access camera for QR code scanning.\",\"microphonePermission\":false,\"recordAudioAndroid\":false}],[\"expo-font\",{\"fonts\":[\"../../packages/theme/fonts/TTSatoshi-DemiBold.otf\",\"../../packages/theme/fonts/TTSatoshi-Medium.otf\",\"../../suite-common/icons/iconFontsMobile/TrezorSuiteIcons.ttf\"]}],[\"expo-image-picker\",{\"microphonePermission\":false,\"photosPermission\":\"Allow $(PRODUCT_NAME) to access your photos to let you import QR code images.\"}],[\"expo-splash-screen\",{\"backgroundColor\":\"#25292E\",\"image\":\"./assets/splash_icon.png\",\"imageWidth\":\"200\"}],[\"expo-video\"]],\"runtimeVersion\":\"16\",\"scheme\":\"trezorsuitelite\",\"sdkVersion\":\"52.0.0\",\"slug\":\"trezor-suite-preview\",\"updates\":{\"requestHeaders\":{\"expo-channel-name\":\"preview\"},\"url\":\"https://u.expo.dev/15998f8a-e75c-4b60-959d-6f68e5ff4936\"},\"userInterfaceStyle\":\"automatic\",\"version\":\"24.11.3\"}",
      "reasons": [
        "expoConfig"
      ],
      "hash": "c94fb4164b1c5564bf4940721e0c1417d96ad47c"
    },
    "afterSource": {
      "type": "contents",
      "id": "expoConfig",
      "contents": "{\"android\":{\"adaptiveIcon\":{\"backgroundColor\":\"#E59D17\",\"foregroundImage\":\"./assets/appIcon_android.png\",\"monochromeImage\":\"./assets/appIcon_android.png\"},\"intentFilters\":[{\"action\":\"VIEW\",\"autoVerify\":true,\"category\":[\"BROWSABLE\",\"DEFAULT\"],\"data\":[{\"host\":\"dev.suite.sldev.cz\",\"pathPattern\":\"/connect/.*/.*/deeplink/.*\",\"scheme\":\"https\"},{\"host\":\"dev.suite.sldev.cz\",\"pathPattern\":\"/connect/.*/deeplink/.*\",\"scheme\":\"https\"}]}],\"package\":\"io.trezor.suite.preview\",\"permissions\":[\"android.permission.CAMERA\"]},\"androidStatusBar\":{\"backgroundColor\":\"#25292E\"},\"extra\":{\"commitHash\":\"e735cb3895c6208a59e09f1f7b2d0f20512c827a\",\"eas\":{\"projectId\":\"15998f8a-e75c-4b60-959d-6f68e5ff4936\"}},\"ios\":{\"associatedDomains\":[\"applinks:dev.suite.sldev.cz\"],\"bundleIdentifier\":\"io.trezor.suite.preview\",\"icon\":\"./assets/preview/appIcon.png\",\"infoPlist\":{\"ITSAppUsesNonExemptEncryption\":false,\"NSAppTransportSecurity\":{\"NSAllowsArbitraryLoads\":true,\"NSExceptionDomains\":{\"data.trezor.io\":{\"NSExceptionAllowsInsecureHTTPLoads\":true,\"NSIncludesSubdomains\":true},\"localhost\":{\"NSExceptionAllowsInsecureHTTPLoads\":true}}},\"NSCameraUsageDescription\":\"$(PRODUCT_NAME) needs access to your Camera to scan your XPUB.\",\"NSFaceIDUsageDescription\":\"$(PRODUCT_NAME) needs Face ID and Touch ID to keep sensitive data about your portfolio private.\",\"NSMicrophoneUsageDescription\":\"This app does not require access to the microphone.\",\"UIRequiredDeviceCapabilities\":[\"armv7\"]},\"supportsTablet\":true},\"name\":\"Trezor Suite Lite Preview\",\"orientation\":\"portrait\",\"owner\":\"trezorcompany-develop\",\"platforms\":[\"android\",\"ios\"],\"plugins\":[\"./plugins/withGradleProperties.js\",\"./plugins/withRemoveXcodeLocalEnv.js\",\"./plugins/withRemoveiOSNotificationEntitlement.js\",\"@trezor/react-native-usb/plugins/withUSBDevice.js\",[\"./plugins/withAndroidMainActivityAttributes.js\",{\"android:allowBackup\":false}],[\"@config-plugins/detox\",{\"subdomains\":\"*\"}],[\"@sentry/react-native/expo\",{\"organization\":\"satoshilabs\",\"project\":\"suite-native\",\"url\":\"https://sentry.io/\"}],[\"expo-build-properties\",{\"android\":{\"kotlinVersion\":\"1.9.24\",\"minSdkVersion\":28},\"ios\":{\"deploymentTarget\":\"15.1\"}}],[\"expo-camera\",{\"cameraPermission\":\"Allow $(PRODUCT_NAME) to access camera for QR code scanning.\",\"microphonePermission\":false,\"recordAudioAndroid\":false}],[\"expo-font\",{\"fonts\":[\"../../packages/theme/fonts/TTSatoshi-DemiBold.otf\",\"../../packages/theme/fonts/TTSatoshi-Medium.otf\",\"../../suite-common/icons/iconFontsMobile/TrezorSuiteIcons.ttf\"]}],[\"expo-image-picker\",{\"microphonePermission\":false,\"photosPermission\":\"Allow $(PRODUCT_NAME) to access your photos to let you import QR code images.\"}],[\"expo-splash-screen\",{\"backgroundColor\":\"#25292E\",\"image\":\"./assets/splash_icon.png\",\"imageWidth\":\"200\"}],[\"expo-video\"]],\"runtimeVersion\":\"17\",\"scheme\":\"trezorsuitelite\",\"sdkVersion\":\"52.0.0\",\"slug\":\"trezor-suite-preview\",\"updates\":{\"requestHeaders\":{\"expo-channel-name\":\"preview\"},\"url\":\"https://u.expo.dev/15998f8a-e75c-4b60-959d-6f68e5ff4936\"},\"userInterfaceStyle\":\"automatic\",\"version\":\"24.11.3\"}",
      "reasons": [
        "expoConfig"
      ],
      "hash": "a6d66dc8e19e612ed555ff888e5d8a69f6aab5e5"
    }
  }
]

Learn more about 𝝠 Expo Github Action

@Nodonisko Nodonisko force-pushed the feat/firmware-upgrade branch from 61b3b75 to f0cdf36 Compare December 2, 2024 17:43
@Nodonisko Nodonisko force-pushed the feat/firmware-upgrade branch from f0cdf36 to 2544975 Compare December 3, 2024 15:46
@Nodonisko Nodonisko merged commit b870aa9 into develop Dec 3, 2024
68 of 69 checks passed
@Nodonisko Nodonisko deleted the feat/firmware-upgrade branch December 3, 2024 17:49
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.

Mobile manage device - firmware update
7 participants