diff --git a/suite-common/message-system/src/messageSystemTypes.ts b/suite-common/message-system/src/messageSystemTypes.ts index 19e5360c8b5..cb03bb7c068 100644 --- a/suite-common/message-system/src/messageSystemTypes.ts +++ b/suite-common/message-system/src/messageSystemTypes.ts @@ -24,6 +24,7 @@ export const Feature = { ethUnstake: 'eth.staking.unstake', ethClaim: 'eth.staking.claim', firmwareRevisionCheck: 'security.firmware.revisionCheck', + firmwareRevisionCheckMobile: 'security.firmware.revisionCheck.mobile', firmwareHashCheck: 'security.firmware.hashCheck', entropyCheck: 'security.entropyCheck', // FW update feature flag implemented only for mobile app diff --git a/suite-native/device/package.json b/suite-native/device/package.json index b715bb49961..db6d01e43aa 100644 --- a/suite-native/device/package.json +++ b/suite-native/device/package.json @@ -14,6 +14,7 @@ "@react-navigation/native": "6.1.18", "@reduxjs/toolkit": "1.9.5", "@sentry/react-native": "6.5.0", + "@suite-common/message-system": "workspace:*", "@suite-common/redux-utils": "workspace:*", "@suite-common/suite-utils": "workspace:*", "@suite-common/wallet-core": "workspace:*", diff --git a/suite-native/device/src/selectors.ts b/suite-native/device/src/selectors.ts index 15f35153d51..3fdda972612 100644 --- a/suite-native/device/src/selectors.ts +++ b/suite-native/device/src/selectors.ts @@ -1,5 +1,10 @@ import { A, pipe } from '@mobily/ts-belt'; +import { + Feature, + MessageSystemRootState, + selectIsFeatureEnabled, +} from '@suite-common/message-system'; import { createWeakMapSelector, returnStableArrayIfEmpty } from '@suite-common/redux-utils'; import { FiatCurrencyCode } from '@suite-common/suite-config'; import { isDeviceAcquired } from '@suite-common/suite-utils'; @@ -156,7 +161,9 @@ export const selectFirmwareRevisionCheckError = (state: DeviceRootState) => { return checkResult.error; }; -type FwAuthenticityCheckState = NativeDeviceRootState & FeatureFlagsRootState; +type FwAuthenticityCheckState = NativeDeviceRootState & + FeatureFlagsRootState & + MessageSystemRootState; /** * Get firmware revision check error, or null if check was successful / skipped, if the check is enabled in settings and through message system. */ @@ -167,8 +174,13 @@ export const selectFirmwareRevisionCheckErrorIfEnabled = (state: FwAuthenticityC state, FeatureFlag.IsFwRevisionCheckEnabled, ); - const isCheckEnabled = isFirmwareRevisionCheckEnabled && isFeatureFlagEnabled; - // TODO #16456 disable also by message-system feature flag + const isMessageSystemFeatureEnabled = selectIsFeatureEnabled( + state, + Feature.firmwareRevisionCheckMobile, + true, + ); + const isCheckEnabled = + isFirmwareRevisionCheckEnabled && isFeatureFlagEnabled && isMessageSystemFeatureEnabled; return isCheckEnabled ? revisionCheckError : null; }; diff --git a/suite-native/device/tsconfig.json b/suite-native/device/tsconfig.json index 89c0ba07a9f..d341e2c0e35 100644 --- a/suite-native/device/tsconfig.json +++ b/suite-native/device/tsconfig.json @@ -2,6 +2,9 @@ "extends": "../../tsconfig.base.json", "compilerOptions": { "outDir": "libDev" }, "references": [ + { + "path": "../../suite-common/message-system" + }, { "path": "../../suite-common/redux-utils" }, diff --git a/yarn.lock b/yarn.lock index 98345b28f2f..a42ac4c55bf 100644 --- a/yarn.lock +++ b/yarn.lock @@ -10757,6 +10757,7 @@ __metadata: "@react-navigation/native": "npm:6.1.18" "@reduxjs/toolkit": "npm:1.9.5" "@sentry/react-native": "npm:6.5.0" + "@suite-common/message-system": "workspace:*" "@suite-common/redux-utils": "workspace:*" "@suite-common/suite-utils": "workspace:*" "@suite-common/wallet-core": "workspace:*"