Skip to content

Commit 084175d

Browse files
committed
feat(example): add vpn and dev mode detection
1 parent 1814b8a commit 084175d

File tree

2 files changed

+28
-6
lines changed

2 files changed

+28
-6
lines changed

example/src/App.tsx

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,14 @@ const App = () => {
101101
);
102102
},
103103
// Android & iOS
104+
systemVPN: () => {
105+
setAppChecks((currentState) =>
106+
currentState.map((threat) =>
107+
threat.name === 'System VPN' ? { ...threat, status: 'nok' } : threat
108+
)
109+
);
110+
},
111+
// Android & iOS
104112
passcode: () => {
105113
setAppChecks((currentState) =>
106114
currentState.map((threat) =>
@@ -126,6 +134,16 @@ const App = () => {
126134
)
127135
);
128136
},
137+
// Android only
138+
devMode: () => {
139+
setAppChecks((currentState) =>
140+
currentState.map((threat) =>
141+
threat.name === 'Developer Mode'
142+
? { ...threat, status: 'nok' }
143+
: threat
144+
)
145+
);
146+
},
129147
};
130148

131149
useFreeRasp(config, actions);

example/src/checks.ts

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,19 @@
11
export const commonChecks = [
2+
{ name: 'App Integrity', status: 'ok' },
23
{ name: 'Privileged Access', status: 'ok' },
34
{ name: 'Debug', status: 'ok' },
4-
{ name: 'Simulator', status: 'ok' },
5-
{ name: 'App Integrity', status: 'ok' },
6-
{ name: 'Unofficial Store', status: 'ok' },
75
{ name: 'Hooks', status: 'ok' },
8-
{ name: 'Device Binding', status: 'ok' },
9-
{ name: 'Secure Hardware Not Available', status: 'ok' },
106
{ name: 'Passcode', status: 'ok' },
7+
{ name: 'Simulator', status: 'ok' },
8+
{ name: 'Secure Hardware Not Available', status: 'ok' },
9+
{ name: 'System VPN', status: 'ok' },
10+
{ name: 'Device Binding', status: 'ok' },
11+
{ name: 'Unofficial Store', status: 'ok' },
1112
];
1213

1314
export const iosChecks = [{ name: 'Device ID', status: 'ok' }];
1415

15-
export const androidChecks = [{ name: 'Obfuscation Issues', status: 'ok' }];
16+
export const androidChecks = [
17+
{ name: 'Obfuscation Issues', status: 'ok' },
18+
{ name: 'Developer Mode', status: 'ok' },
19+
];

0 commit comments

Comments
 (0)