Skip to content

Commit 6de6ae4

Browse files
committed
feat(suite-native): disable FW rev check by message system
1 parent bc47eef commit 6de6ae4

File tree

5 files changed

+21
-3
lines changed

5 files changed

+21
-3
lines changed

Diff for: suite-common/message-system/src/messageSystemTypes.ts

+1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ export const Feature = {
2424
ethUnstake: 'eth.staking.unstake',
2525
ethClaim: 'eth.staking.claim',
2626
firmwareRevisionCheck: 'security.firmware.revisionCheck',
27+
firmwareRevisionCheckMobile: 'security.firmware.revisionCheck.mobile',
2728
firmwareHashCheck: 'security.firmware.hashCheck',
2829
entropyCheck: 'security.entropyCheck',
2930
// FW update feature flag implemented only for mobile app

Diff for: suite-native/device/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
"@react-navigation/native": "6.1.18",
1515
"@reduxjs/toolkit": "1.9.5",
1616
"@sentry/react-native": "6.5.0",
17+
"@suite-common/message-system": "workspace:*",
1718
"@suite-common/redux-utils": "workspace:*",
1819
"@suite-common/suite-utils": "workspace:*",
1920
"@suite-common/wallet-core": "workspace:*",

Diff for: suite-native/device/src/selectors.ts

+15-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
import { A, pipe } from '@mobily/ts-belt';
22

3+
import {
4+
Feature,
5+
MessageSystemRootState,
6+
selectIsFeatureEnabled,
7+
} from '@suite-common/message-system';
38
import { createWeakMapSelector, returnStableArrayIfEmpty } from '@suite-common/redux-utils';
49
import { FiatCurrencyCode } from '@suite-common/suite-config';
510
import { isDeviceAcquired } from '@suite-common/suite-utils';
@@ -156,7 +161,9 @@ export const selectFirmwareRevisionCheckError = (state: DeviceRootState) => {
156161
return checkResult.error;
157162
};
158163

159-
type FwAuthenticityCheckState = NativeDeviceRootState & FeatureFlagsRootState;
164+
type FwAuthenticityCheckState = NativeDeviceRootState &
165+
FeatureFlagsRootState &
166+
MessageSystemRootState;
160167
/**
161168
* Get firmware revision check error, or null if check was successful / skipped, if the check is enabled in settings and through message system.
162169
*/
@@ -167,8 +174,13 @@ export const selectFirmwareRevisionCheckErrorIfEnabled = (state: FwAuthenticityC
167174
state,
168175
FeatureFlag.IsFwRevisionCheckEnabled,
169176
);
170-
const isCheckEnabled = isFirmwareRevisionCheckEnabled && isFeatureFlagEnabled;
171-
// TODO #16456 disable also by message-system feature flag
177+
const isMessageSystemFeatureEnabled = selectIsFeatureEnabled(
178+
state,
179+
Feature.firmwareRevisionCheckMobile,
180+
true,
181+
);
182+
const isCheckEnabled =
183+
isFirmwareRevisionCheckEnabled && isFeatureFlagEnabled && isMessageSystemFeatureEnabled;
172184

173185
return isCheckEnabled ? revisionCheckError : null;
174186
};

Diff for: suite-native/device/tsconfig.json

+3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
"extends": "../../tsconfig.base.json",
33
"compilerOptions": { "outDir": "libDev" },
44
"references": [
5+
{
6+
"path": "../../suite-common/message-system"
7+
},
58
{
69
"path": "../../suite-common/redux-utils"
710
},

Diff for: yarn.lock

+1
Original file line numberDiff line numberDiff line change
@@ -10757,6 +10757,7 @@ __metadata:
1075710757
"@react-navigation/native": "npm:6.1.18"
1075810758
"@reduxjs/toolkit": "npm:1.9.5"
1075910759
"@sentry/react-native": "npm:6.5.0"
10760+
"@suite-common/message-system": "workspace:*"
1076010761
"@suite-common/redux-utils": "workspace:*"
1076110762
"@suite-common/suite-utils": "workspace:*"
1076210763
"@suite-common/wallet-core": "workspace:*"

0 commit comments

Comments
 (0)