Skip to content

Commit 9f63cf7

Browse files
committed
feat(DemoApp): add new android checks
1 parent 8bbdadd commit 9f63cf7

File tree

4 files changed

+24
-26
lines changed

4 files changed

+24
-26
lines changed

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -239,21 +239,21 @@ const actions = {
239239
console.log('device binding');
240240
},
241241
// Android & iOS
242+
'hardwareBackedKeystoreNotAvailable': () => {
243+
console.log('hardwareBackedKeystoreNotAvailable');
244+
},
245+
// Android & iOS
242246
'passcode': () => {
243247
console.log('passcode');
244248
},
245-
// Android & iOS
246-
'hardwareBackedKeystoreNotAvailable': () => {
247-
console.log('hardwareBackedKeystoreNotAvailable');
248-
}
249+
// iOS only
250+
'deviceID': () => {
251+
console.log('deviceID');
252+
},
249253
// iOS only
250254
'passcodeChange': () => {
251255
console.log('passcodeChange');
252256
},
253-
// iOS only
254-
'deviceID': () => {
255-
console.log('deviceID');
256-
}
257257
};
258258
259259
useFreeRasp(config, actions);

example/src/App.tsx

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -89,39 +89,39 @@ const App = () => {
8989
)
9090
);
9191
},
92-
// iOS only
93-
'deviceID': () => {
92+
// Android & iOS
93+
'hardwareBackedKeystoreNotAvailable': () => {
9494
setAppChecks((currentState) =>
9595
currentState.map((threat) =>
96-
threat.name === 'Device ID' ? { ...threat, status: 'nok' } : threat
96+
threat.name === 'Hardware Backed Keystore'
97+
? { ...threat, status: 'nok' }
98+
: threat
9799
)
98100
);
99101
},
100-
// iOS only
101-
'missingSecureEnclave': () => {
102+
// Android & iOS
103+
'passcode': () => {
102104
setAppChecks((currentState) =>
103105
currentState.map((threat) =>
104-
threat.name === 'Missing Secure Enclave'
105-
? { ...threat, status: 'nok' }
106-
: threat
106+
threat.name === 'Passcode' ? { ...threat, status: 'nok' } : threat
107107
)
108108
);
109109
},
110110
// iOS only
111-
'passcodeChange': () => {
111+
'deviceID': () => {
112112
setAppChecks((currentState) =>
113113
currentState.map((threat) =>
114-
threat.name === 'Passcode Change'
115-
? { ...threat, status: 'nok' }
116-
: threat
114+
threat.name === 'Device ID' ? { ...threat, status: 'nok' } : threat
117115
)
118116
);
119117
},
120118
// iOS only
121-
'passcode': () => {
119+
'passcodeChange': () => {
122120
setAppChecks((currentState) =>
123121
currentState.map((threat) =>
124-
threat.name === 'Passcode' ? { ...threat, status: 'nok' } : threat
122+
threat.name === 'Passcode Change'
123+
? { ...threat, status: 'nok' }
124+
: threat
125125
)
126126
);
127127
},

example/src/checks.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ export const commonChecks = [
66
{ name: 'Unofficial Store', status: 'ok' },
77
{ name: 'Hooks', status: 'ok' },
88
{ name: 'Device Binding', status: 'ok' },
9+
{ name: 'Hardware Backed Keystore', status: 'ok' },
10+
{ name: 'Passcode', status: 'ok' },
911
];
1012

1113
export const iosChecks = [
1214
{ name: 'Device ID', status: 'ok' },
13-
{ name: 'Missing Secure Enclave', status: 'ok' },
1415
{ name: 'Passcode Change', status: 'ok' },
15-
{ name: 'Passcode', status: 'ok' },
1616
];

src/index.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,8 @@ type NativeEventEmitterActions = {
2727
'hooks'?: () => any;
2828
'device binding'?: () => any;
2929
'deviceID'?: () => any;
30-
'missingSecureEnclave'?: () => any;
3130
'passcodeChange'?: () => any;
3231
'passcode'?: () => any;
33-
'unlockedDevice'?: () => any;
3432
'hardwareBackedKeystoreNotAvailable'?: () => any;
3533
'started'?: () => any;
3634
'initializationError'?: (reason: { message: string }) => any;

0 commit comments

Comments
 (0)