react-native-device-defense 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +236 -0
  3. package/android/build.gradle +90 -0
  4. package/android/proguard-rules.pro +28 -0
  5. package/android/src/main/AndroidManifest.xml +4 -0
  6. package/android/src/main/cpp/CMakeLists.txt +45 -0
  7. package/android/src/main/cpp/device-security.cpp +314 -0
  8. package/android/src/main/java/vn/osp/security/DebugDetection.kt +131 -0
  9. package/android/src/main/java/vn/osp/security/DeviceSecurityModule.kt +277 -0
  10. package/android/src/main/java/vn/osp/security/DeviceSecurityPackage.kt +58 -0
  11. package/android/src/main/java/vn/osp/security/EmulatorDetection.kt +204 -0
  12. package/android/src/main/java/vn/osp/security/HookDetection.kt +270 -0
  13. package/android/src/main/java/vn/osp/security/NativeSecurityCheck.kt +66 -0
  14. package/android/src/main/java/vn/osp/security/RootDetection.kt +349 -0
  15. package/lib/commonjs/NativeDeviceSecurity.js +9 -0
  16. package/lib/commonjs/NativeDeviceSecurity.js.map +1 -0
  17. package/lib/commonjs/api.js +213 -0
  18. package/lib/commonjs/api.js.map +1 -0
  19. package/lib/commonjs/components/SecurityBlockedScreen.js +177 -0
  20. package/lib/commonjs/components/SecurityBlockedScreen.js.map +1 -0
  21. package/lib/commonjs/components/index.js +13 -0
  22. package/lib/commonjs/components/index.js.map +1 -0
  23. package/lib/commonjs/hooks/index.js +13 -0
  24. package/lib/commonjs/hooks/index.js.map +1 -0
  25. package/lib/commonjs/hooks/useDeviceSecurity.js +81 -0
  26. package/lib/commonjs/hooks/useDeviceSecurity.js.map +1 -0
  27. package/lib/commonjs/index.js +48 -0
  28. package/lib/commonjs/index.js.map +1 -0
  29. package/lib/commonjs/types.js +2 -0
  30. package/lib/commonjs/types.js.map +1 -0
  31. package/lib/module/NativeDeviceSecurity.js +3 -0
  32. package/lib/module/NativeDeviceSecurity.js.map +1 -0
  33. package/lib/module/api.js +206 -0
  34. package/lib/module/api.js.map +1 -0
  35. package/lib/module/components/SecurityBlockedScreen.js +169 -0
  36. package/lib/module/components/SecurityBlockedScreen.js.map +1 -0
  37. package/lib/module/components/index.js +2 -0
  38. package/lib/module/components/index.js.map +1 -0
  39. package/lib/module/hooks/index.js +2 -0
  40. package/lib/module/hooks/index.js.map +1 -0
  41. package/lib/module/hooks/useDeviceSecurity.js +73 -0
  42. package/lib/module/hooks/useDeviceSecurity.js.map +1 -0
  43. package/lib/module/index.js +21 -0
  44. package/lib/module/index.js.map +1 -0
  45. package/lib/module/types.js +2 -0
  46. package/lib/module/types.js.map +1 -0
  47. package/lib/typescript/NativeDeviceSecurity.d.ts +16 -0
  48. package/lib/typescript/NativeDeviceSecurity.d.ts.map +1 -0
  49. package/lib/typescript/api.d.ts +55 -0
  50. package/lib/typescript/api.d.ts.map +1 -0
  51. package/lib/typescript/components/SecurityBlockedScreen.d.ts +23 -0
  52. package/lib/typescript/components/SecurityBlockedScreen.d.ts.map +1 -0
  53. package/lib/typescript/components/index.d.ts +2 -0
  54. package/lib/typescript/components/index.d.ts.map +1 -0
  55. package/lib/typescript/hooks/index.d.ts +3 -0
  56. package/lib/typescript/hooks/index.d.ts.map +1 -0
  57. package/lib/typescript/hooks/useDeviceSecurity.d.ts +7 -0
  58. package/lib/typescript/hooks/useDeviceSecurity.d.ts.map +1 -0
  59. package/lib/typescript/index.d.ts +12 -0
  60. package/lib/typescript/index.d.ts.map +1 -0
  61. package/lib/typescript/types.d.ts +81 -0
  62. package/lib/typescript/types.d.ts.map +1 -0
  63. package/package.json +72 -0
  64. package/react-native-device-security.podspec +18 -0
  65. package/src/NativeDeviceSecurity.ts +33 -0
  66. package/src/api.ts +225 -0
  67. package/src/components/SecurityBlockedScreen.tsx +204 -0
  68. package/src/components/index.ts +1 -0
  69. package/src/hooks/index.ts +5 -0
  70. package/src/hooks/useDeviceSecurity.ts +91 -0
  71. package/src/index.ts +27 -0
  72. package/src/types.ts +95 -0
@@ -0,0 +1,206 @@
1
+ /**
2
+ * DeviceSecurity API
3
+ * Main singleton class for device security checks
4
+ */
5
+
6
+ import { Platform } from 'react-native';
7
+ import NativeDeviceSecurity from './NativeDeviceSecurity';
8
+ /**
9
+ * Main DeviceSecurity API class
10
+ */
11
+ class DeviceSecurity {
12
+ /**
13
+ * Check if device is secure (no security threats)
14
+ */
15
+ async isDeviceSecure() {
16
+ if (Platform.OS !== 'android') {
17
+ // iOS: no-op for now, return true
18
+ return true;
19
+ }
20
+ try {
21
+ return await NativeDeviceSecurity.isDeviceSecure();
22
+ } catch (error) {
23
+ console.error('DeviceSecurity: Error checking device security', error);
24
+ return false;
25
+ }
26
+ }
27
+
28
+ /**
29
+ * Get detailed security status
30
+ */
31
+ async getSecurityStatus() {
32
+ if (Platform.OS !== 'android') {
33
+ // iOS: no-op for now, return secure status
34
+ return {
35
+ isSecure: true,
36
+ threats: [],
37
+ isRooted: false,
38
+ hasRootBeerDetected: false,
39
+ hasNativeRootDetected: false,
40
+ hasDangerousBins: false,
41
+ hasRootApps: false,
42
+ hasSystemPropsModified: false,
43
+ hasFrida: false,
44
+ hasXposed: false,
45
+ hasMagisk: false,
46
+ isDebuggable: false,
47
+ isEmulator: false
48
+ };
49
+ }
50
+ try {
51
+ const statusJson = await NativeDeviceSecurity.getSecurityStatus();
52
+ return JSON.parse(statusJson);
53
+ } catch (error) {
54
+ console.error('DeviceSecurity: Error getting security status', error);
55
+ return this.getDefaultSecurityStatus();
56
+ }
57
+ }
58
+
59
+ /**
60
+ * Check if device is rooted (synchronous, Android only)
61
+ */
62
+ isRooted() {
63
+ if (Platform.OS !== 'android') {
64
+ return false;
65
+ }
66
+ try {
67
+ return NativeDeviceSecurity.isRooted();
68
+ } catch (error) {
69
+ console.error('DeviceSecurity: Error checking root status', error);
70
+ return false;
71
+ }
72
+ }
73
+
74
+ /**
75
+ * Check if Frida is present
76
+ */
77
+ hasFrida() {
78
+ if (Platform.OS !== 'android') {
79
+ return false;
80
+ }
81
+ try {
82
+ return NativeDeviceSecurity.hasFrida();
83
+ } catch (error) {
84
+ console.error('DeviceSecurity: Error checking Frida', error);
85
+ return false;
86
+ }
87
+ }
88
+
89
+ /**
90
+ * Check if Xposed framework is present
91
+ */
92
+ hasXposed() {
93
+ if (Platform.OS !== 'android') {
94
+ return false;
95
+ }
96
+ try {
97
+ return NativeDeviceSecurity.hasXposed();
98
+ } catch (error) {
99
+ console.error('DeviceSecurity: Error checking Xposed', error);
100
+ return false;
101
+ }
102
+ }
103
+
104
+ /**
105
+ * Check if Magisk is present
106
+ */
107
+ hasMagisk() {
108
+ if (Platform.OS !== 'android') {
109
+ return false;
110
+ }
111
+ try {
112
+ return NativeDeviceSecurity.hasMagisk();
113
+ } catch (error) {
114
+ console.error('DeviceSecurity: Error checking Magisk', error);
115
+ return false;
116
+ }
117
+ }
118
+
119
+ /**
120
+ * Check if app is debuggable
121
+ */
122
+ isDebuggable() {
123
+ if (Platform.OS !== 'android') {
124
+ return false;
125
+ }
126
+ try {
127
+ return NativeDeviceSecurity.isDebuggable();
128
+ } catch (error) {
129
+ console.error('DeviceSecurity: Error checking debuggable', error);
130
+ return false;
131
+ }
132
+ }
133
+
134
+ /**
135
+ * Check if running on emulator
136
+ */
137
+ isEmulator() {
138
+ if (Platform.OS !== 'android') {
139
+ return false;
140
+ }
141
+ try {
142
+ return NativeDeviceSecurity.isEmulator();
143
+ } catch (error) {
144
+ console.error('DeviceSecurity: Error checking emulator', error);
145
+ return false;
146
+ }
147
+ }
148
+
149
+ /**
150
+ * Block app when security threat detected
151
+ * This will show an alert and potentially exit the app
152
+ */
153
+ blockOnSecurityThreat(options = {}) {
154
+ if (Platform.OS !== 'android') {
155
+ return;
156
+ }
157
+ const {
158
+ showAlert = true,
159
+ alertTitle = 'Security Warning',
160
+ alertMessage = 'This device is not secure. The app cannot run on rooted or modified devices.',
161
+ alertButtonText = 'OK',
162
+ onBlocked
163
+ } = options;
164
+ try {
165
+ NativeDeviceSecurity.blockOnSecurityThreat(showAlert, alertTitle, alertMessage, alertButtonText);
166
+
167
+ // Call callback if provided
168
+ if (onBlocked) {
169
+ // Get status for callback
170
+ this.getSecurityStatus().then(status => {
171
+ onBlocked(status);
172
+ });
173
+ }
174
+ } catch (error) {
175
+ console.error('DeviceSecurity: Error blocking on security threat', error);
176
+ }
177
+ }
178
+
179
+ /**
180
+ * Get default security status (error case)
181
+ */
182
+ getDefaultSecurityStatus() {
183
+ return {
184
+ isSecure: false,
185
+ threats: ['emulator_detected'],
186
+ // Mark as threat on error to be safe
187
+ isRooted: false,
188
+ hasRootBeerDetected: false,
189
+ hasNativeRootDetected: false,
190
+ hasDangerousBins: false,
191
+ hasRootApps: false,
192
+ hasSystemPropsModified: false,
193
+ hasFrida: false,
194
+ hasXposed: false,
195
+ hasMagisk: false,
196
+ isDebuggable: false,
197
+ isEmulator: false
198
+ };
199
+ }
200
+ }
201
+
202
+ // Export singleton instance
203
+ const deviceSecurityInstance = new DeviceSecurity();
204
+ export default deviceSecurityInstance;
205
+ export { DeviceSecurity };
206
+ //# sourceMappingURL=api.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["Platform","NativeDeviceSecurity","DeviceSecurity","isDeviceSecure","OS","error","console","getSecurityStatus","isSecure","threats","isRooted","hasRootBeerDetected","hasNativeRootDetected","hasDangerousBins","hasRootApps","hasSystemPropsModified","hasFrida","hasXposed","hasMagisk","isDebuggable","isEmulator","statusJson","JSON","parse","getDefaultSecurityStatus","blockOnSecurityThreat","options","showAlert","alertTitle","alertMessage","alertButtonText","onBlocked","then","status","deviceSecurityInstance"],"sourceRoot":"../../src","sources":["api.ts"],"mappings":"AAAA;AACA;AACA;AACA;;AAEA,SAASA,QAAQ,QAAQ,cAAc;AACvC,OAAOC,oBAAoB,MAAM,wBAAwB;AAOzD;AACA;AACA;AACA,MAAMC,cAAc,CAAC;EACnB;AACF;AACA;EACE,MAAMC,cAAcA,CAAA,EAAqB;IACvC,IAAIH,QAAQ,CAACI,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AE,KAAK;MAClBC,sBAAsB,EAAE,KAAK;MAC7BC,QAAQ,EAAE,KAAK;MACfC,SAAS,EAAE,KAAK;MAChBC,SAAS,EAAE,KAAK;MAChBC,YAAY,EAAE,KAAK;MACnBC,UAAU,EAAE;IACd,CAAC;EACH;AACF;;AAEA;AACA,MAAMc,sBAAsB,GAAG,IAAIhC,cAAc,CAAC,CAAC;AACnD,eAAegC,sBAAsB;AACrC,SAAShC,cAAc","ignoreList":[]}
@@ -0,0 +1,169 @@
1
+ /**
2
+ * SecurityBlockedScreen.tsx
3
+ *
4
+ * Screen to display when app is blocked due to security threats
5
+ */
6
+
7
+ import React from 'react';
8
+ import { View, Text, StyleSheet, ScrollView, SafeAreaView } from 'react-native';
9
+ const THREAT_TITLES = {
10
+ root_detected: 'Thiết bị đã root',
11
+ root_beer_detected: 'Phát hiện root (RootBeer)',
12
+ native_root_detected: 'Phát hiện root (Native)',
13
+ dangerous_bins_detected: 'Phát hiện binary nguy hiểm',
14
+ root_apps_detected: 'Phát hiện ứng dụng root',
15
+ system_props_modified: 'Thuộc tính hệ thống đã sửa đổi',
16
+ frida_detected: 'Phát hiện Frida (Hooking)',
17
+ xposed_detected: 'Phát hiện Xposed Framework',
18
+ magisk_detected: 'Phát hiện Magisk',
19
+ debugger_detected: 'Phát hiện Debugger',
20
+ emulator_detected: 'Phát hiện Bộ giả lập'
21
+ };
22
+ const THREAT_DESCRIPTIONS = {
23
+ root_detected: 'Thiết bị của bạn đã được root, làm giảm tính bảo mật của ứng dụng.',
24
+ root_beer_detected: 'Công cụ phát hiện root đã phát hiện thiết bị đã bị can thiệp.',
25
+ native_root_detected: 'Phát hiện native root - thiết bị có thể đã bị sửa đổi.',
26
+ dangerous_bins_detected: 'Phát hiện các file thực thi nguy hiểm trên thiết bị.',
27
+ root_apps_detected: 'Phát hiện ứng dụng quản lý root trên thiết bị.',
28
+ system_props_modified: 'Các thuộc tính hệ thống quan trọng đã bị sửa đổi.',
29
+ frida_detected: 'Phát hiện công cụ Frida - thường dùng để can thiệp vào ứng dụng.',
30
+ xposed_detected: 'Phát hiện Xposed Framework - có thể can thiệp vào ứng dụng.',
31
+ magisk_detected: 'Phát hiện Magisk - công cụ root ẩn danh.',
32
+ debugger_detected: 'Phát hiện debugger đang gắn vào ứng dụng.',
33
+ emulator_detected: 'Ứng dụng đang chạy trên bộ giả lập, không an toàn cho môi trường production.'
34
+ };
35
+
36
+ /**
37
+ * Default security blocked screen component
38
+ */
39
+ export const SecurityBlockedScreen = ({
40
+ threats = [],
41
+ title = 'Cảnh báo bảo mật',
42
+ message = 'Thiết bị của bạn không đáp ứng yêu cầu bảo mật. Ứng dụng không thể tiếp tục chạy.',
43
+ icon
44
+ }) => {
45
+ return /*#__PURE__*/React.createElement(SafeAreaView, {
46
+ style: styles.container
47
+ }, /*#__PURE__*/React.createElement(ScrollView, {
48
+ contentContainerStyle: styles.scrollContent,
49
+ bounces: false
50
+ }, icon || /*#__PURE__*/React.createElement(View, {
51
+ style: styles.iconContainer
52
+ }, /*#__PURE__*/React.createElement(Text, {
53
+ style: styles.icon
54
+ }, "\uD83D\uDD12")), /*#__PURE__*/React.createElement(Text, {
55
+ style: styles.title
56
+ }, title), /*#__PURE__*/React.createElement(Text, {
57
+ style: styles.message
58
+ }, message), threats.length > 0 && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Text, {
59
+ style: styles.threatsTitle
60
+ }, "V\u1EA5n \u0111\u1EC1 ph\xE1t hi\u1EC7n:"), /*#__PURE__*/React.createElement(View, {
61
+ style: styles.threatsList
62
+ }, threats.map(threat => /*#__PURE__*/React.createElement(View, {
63
+ key: threat,
64
+ style: styles.threatItem
65
+ }, /*#__PURE__*/React.createElement(View, {
66
+ style: styles.bullet
67
+ }), /*#__PURE__*/React.createElement(View, {
68
+ style: styles.threatContent
69
+ }, /*#__PURE__*/React.createElement(Text, {
70
+ style: styles.threatTitle
71
+ }, THREAT_TITLES[threat] || threat), /*#__PURE__*/React.createElement(Text, {
72
+ style: styles.threatDescription
73
+ }, THREAT_DESCRIPTIONS[threat] || 'Vấn đề bảo mật không xác định.')))))), /*#__PURE__*/React.createElement(View, {
74
+ style: styles.footer
75
+ }, /*#__PURE__*/React.createElement(Text, {
76
+ style: styles.footerText
77
+ }, "N\u1EBFu b\u1EA1n cho r\u1EB1ng \u0111\xE2y l\xE0 s\u1EF1 nh\u1EA7m l\u1EABn, vui l\xF2ng li\xEAn h\u1EC7 v\u1EDBi b\u1ED9 ph\u1EADn h\u1ED7 tr\u1EE3."))));
78
+ };
79
+ const styles = StyleSheet.create({
80
+ container: {
81
+ flex: 1,
82
+ backgroundColor: '#f5f5f5'
83
+ },
84
+ scrollContent: {
85
+ padding: 24,
86
+ alignItems: 'center'
87
+ },
88
+ iconContainer: {
89
+ width: 100,
90
+ height: 100,
91
+ borderRadius: 50,
92
+ backgroundColor: '#ffebee',
93
+ justifyContent: 'center',
94
+ alignItems: 'center',
95
+ marginBottom: 24
96
+ },
97
+ icon: {
98
+ fontSize: 48
99
+ },
100
+ title: {
101
+ fontSize: 24,
102
+ fontWeight: '700',
103
+ color: '#d32f2f',
104
+ textAlign: 'center',
105
+ marginBottom: 12
106
+ },
107
+ message: {
108
+ fontSize: 16,
109
+ color: '#424242',
110
+ textAlign: 'center',
111
+ marginBottom: 24,
112
+ lineHeight: 24
113
+ },
114
+ threatsTitle: {
115
+ fontSize: 18,
116
+ fontWeight: '600',
117
+ color: '#212121',
118
+ alignSelf: 'flex-start',
119
+ marginBottom: 16
120
+ },
121
+ threatsList: {
122
+ width: '100%',
123
+ marginBottom: 24
124
+ },
125
+ threatItem: {
126
+ flexDirection: 'row',
127
+ backgroundColor: '#ffffff',
128
+ borderRadius: 8,
129
+ padding: 16,
130
+ marginBottom: 12,
131
+ borderLeftWidth: 4,
132
+ borderLeftColor: '#d32f2f'
133
+ },
134
+ bullet: {
135
+ width: 8,
136
+ height: 8,
137
+ borderRadius: 4,
138
+ backgroundColor: '#d32f2f',
139
+ marginTop: 6,
140
+ marginRight: 12
141
+ },
142
+ threatContent: {
143
+ flex: 1
144
+ },
145
+ threatTitle: {
146
+ fontSize: 16,
147
+ fontWeight: '600',
148
+ color: '#212121',
149
+ marginBottom: 4
150
+ },
151
+ threatDescription: {
152
+ fontSize: 14,
153
+ color: '#757575',
154
+ lineHeight: 20
155
+ },
156
+ footer: {
157
+ marginTop: 24,
158
+ paddingTop: 24,
159
+ borderTopWidth: 1,
160
+ borderTopColor: '#e0e0e0'
161
+ },
162
+ footerText: {
163
+ fontSize: 14,
164
+ color: '#9e9e9e',
165
+ textAlign: 'center'
166
+ }
167
+ });
168
+ export default SecurityBlockedScreen;
169
+ //# sourceMappingURL=SecurityBlockedScreen.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","View","Text","StyleSheet","ScrollView","SafeAreaView","THREAT_TITLES","root_detected","root_beer_detected","native_root_detected","dangerous_bins_detected","root_apps_detected","system_props_modified","frida_detected","xposed_detected","magisk_detected","debugger_detected","emulator_detected","THREAT_DESCRIPTIONS","SecurityBlockedScreen","threats","title","message","icon","createElement","style","styles","container","contentContainerStyle","scrollContent","bounces","iconContainer","length","Fragment","threatsTitle","threatsList","map","threat","key","threatItem","bullet","threatContent","threatTitle","threatDescription","footer","footerText","create","flex","backgroundColor","padding","alignItems","width","height","borderRadius","justifyContent","marginBottom","fontSize","fontWeight","color","textAlign","lineHeight","alignSelf","flexDirection","borderLeftWidth","borderLeftColor","marginTop","marginRight","paddingTop","borderTopWidth","borderTopColor"],"sourceRoot":"../../../src","sources":["components/SecurityBlockedScreen.tsx"],"mappings":"AAAA;AACA;AACA;AACA;AACA;;AAEA,OAAOA,KAAK,MAAM,OAAO;AACzB,SACEC,IAAI,EACJC,IAAI,EACJC,UAAU,EACVC,UAAU,EACVC,YAAY,QAEP,cAAc;AAcrB,MAAMC,aAA6C,GAAG;EACpDC,aAAa,EAAE,kBAAkB;EACjCC,kBAAkB,EAAE,2BAA2B;EAC/CC,oBAAoB,EAAE,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AM,EAAE;IACNW,KAAK,EAAE,CAAC;IACRC,MAAM,EAAE,CAAC;IACTC,YAAY,EAAE,CAAC;IACfL,eAAe,EAAE,SAAS;IAC1BiB,SAAS,EAAE,CAAC;IACZC,WAAW,EAAE;EACf,CAAC;EACDzB,aAAa,EAAE;IACbM,IAAI,EAAE;EACR,CAAC;EACDL,WAAW,EAAE;IACXc,QAAQ,EAAE,EAAE;IACZC,UAAU,EAAE,KAAK;IACjBC,KAAK,EAAE,SAAS;IAChBH,YAAY,EAAE;EAChB,CAAC;EACDZ,iBAAiB,EAAE;IACjBa,QAAQ,EAAE,EAAE;IACZE,KAAK,EAAE,SAAS;IAChBE,UAAU,EAAE;EACd,CAAC;EACDhB,MAAM,EAAE;IACNqB,SAAS,EAAE,EAAE;IACbE,UAAU,EAAE,EAAE;IACdC,cAAc,EAAE,CAAC;IACjBC,cAAc,EAAE;EAClB,CAAC;EACDxB,UAAU,EAAE;IACVW,QAAQ,EAAE,EAAE;IACZE,KAAK,EAAE,SAAS;IAChBC,SAAS,EAAE;EACb;AACF,CAAC,CAAC;AAEF,eAAexC,qBAAqB","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ export { SecurityBlockedScreen } from './SecurityBlockedScreen';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["SecurityBlockedScreen"],"sourceRoot":"../../../src","sources":["components/index.ts"],"mappings":"AAAA,SAASA,qBAAqB,QAAQ,yBAAyB","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ export { useDeviceSecurity } from './useDeviceSecurity';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["useDeviceSecurity"],"sourceRoot":"../../../src","sources":["hooks/index.ts"],"mappings":"AAAA,SAASA,iBAAiB,QAAQ,qBAAqB","ignoreList":[]}
@@ -0,0 +1,73 @@
1
+ /**
2
+ * React hook for device security
3
+ */
4
+
5
+ import { useCallback, useEffect, useState } from 'react';
6
+ import { Platform } from 'react-native';
7
+ import deviceSecurity from '../api';
8
+ export function useDeviceSecurity(options = {}) {
9
+ const {
10
+ onSecurityThreat,
11
+ blockOnThreat = false,
12
+ blockOptions,
13
+ checkInterval = 0
14
+ } = options;
15
+ const [isSecure, setIsSecure] = useState(null);
16
+ const [isLoading, setIsLoading] = useState(true);
17
+ const [securityStatus, setSecurityStatus] = useState(null);
18
+ const [error, setError] = useState(null);
19
+ const checkSecurity = useCallback(async () => {
20
+ if (Platform.OS !== 'android') {
21
+ setIsSecure(true);
22
+ setIsLoading(false);
23
+ return;
24
+ }
25
+ try {
26
+ setIsLoading(true);
27
+ setError(null);
28
+ const status = await deviceSecurity.getSecurityStatus();
29
+ setSecurityStatus(status);
30
+ setIsSecure(status.isSecure);
31
+
32
+ // Handle security threats
33
+ if (!status.isSecure) {
34
+ // Call callback for each threat
35
+ for (const threat of status.threats) {
36
+ onSecurityThreat === null || onSecurityThreat === void 0 || onSecurityThreat(threat, status);
37
+ }
38
+
39
+ // Block if requested
40
+ if (blockOnThreat) {
41
+ deviceSecurity.blockOnSecurityThreat(blockOptions);
42
+ }
43
+ }
44
+ } catch (err) {
45
+ const errorObj = err instanceof Error ? err : new Error('Security check failed');
46
+ setError(errorObj);
47
+ setIsSecure(false);
48
+ } finally {
49
+ setIsLoading(false);
50
+ }
51
+ }, [onSecurityThreat, blockOnThreat, blockOptions]);
52
+ const recheck = useCallback(async () => {
53
+ await checkSecurity();
54
+ }, [checkSecurity]);
55
+ useEffect(() => {
56
+ checkSecurity();
57
+
58
+ // Set up interval if specified
59
+ if (checkInterval > 0) {
60
+ const intervalId = setInterval(checkSecurity, checkInterval);
61
+ return () => clearInterval(intervalId);
62
+ }
63
+ }, [checkSecurity, checkInterval]);
64
+ return {
65
+ isSecure,
66
+ isLoading,
67
+ securityStatus,
68
+ error,
69
+ recheck
70
+ };
71
+ }
72
+ export default useDeviceSecurity;
73
+ //# sourceMappingURL=useDeviceSecurity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["useCallback","useEffect","useState","Platform","deviceSecurity","useDeviceSecurity","options","onSecurityThreat","blockOnThreat","blockOptions","checkInterval","isSecure","setIsSecure","isLoading","setIsLoading","securityStatus","setSecurityStatus","error","setError","checkSecurity","OS","status","getSecurityStatus","threat","threats","blockOnSecurityThreat","err","errorObj","Error","recheck","intervalId","setInterval","clearInterval"],"sourceRoot":"../../../src","sources":["hooks/useDeviceSecurity.ts"],"mappings":"AAAA;AACA;AACA;;AAEA,SAASA,WAAW,EAAEC,SAAS,EAAEC,QAAQ,QAAQ,OAAO;AACxD,SAASC,QAAQ,QAAQ,cAAc;AACvC,OAAOC,cAAc,MAAM,QAAQ;AAOnC,OAAO,SAASC,iBAAiBA,CAC/BC,OAAiC,GAAG,CAAC,CAAC,EACb;EACzB,MAAM;IACJC,gBAAgB;IAChBC,aAAa,GAAG,KAAK;IACrBC,YAAY;IACZC,aAAa,GAAG;EAClB,CAAC,GAAGJ,OAAO;EAEX,MAAM,CAACK,QAAQ,EAAEC,WAAW,CAAC,GAAGV,QAAQ,CAAiB,IAAI,CAAC;EAC9D,MAAM,CAACW,SAAS,EAAEC,YAAY,CAAC,GAAGZ,QAAQ,CAAC,IAAI,CAAC;EAChD,MAAM,CAACa,cAAc,EAAEC,iBAAiB,CAAC,GAAGd,QAAQ,CAClD,IACF,CAAC;EACD,MAAM,CAACe,KAAK,EAAEC,QAAQ,CAAC,GAAGhB,QAAQ,CAAe,IAAI,CAAC;EAEtD,MAAMiB,aAAa,GAAGnB,WAAW,CAAC,YAAY;IAC5C,IAAIG,QAAQ,CAACiB,EAAE,KAAK,SAAS,EAAE;MAC7BR,WAAW,CAAC,IAAI,CAAC;MACjBE,YAAY,CAAC,KAAK,CAAC;MACnB;IACF;IAEA,IAAI;MACFA,YAAY,CAAC,IAAI,CAAC;MAClBI,QAAQ,CAAC,IAAI,CAAC;MAEd,MAAMG,MAAM,GAAG,MAAMjB,cAAc,CAACkB,iBAAiB,CAAC,CAAC;MACvDN,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-device-security
3
+ *
4
+ * Main exports for the library
5
+ */
6
+
7
+ // Main API
8
+ export { default as DeviceSecurity, DeviceSecurity as DeviceSecurityClass } from './api';
9
+ export { default } from './api';
10
+
11
+ // Native module spec
12
+ export { default as NativeDeviceSecurity } from './NativeDeviceSecurity';
13
+
14
+ // Hooks
15
+ export { useDeviceSecurity } from './hooks';
16
+
17
+ // Components
18
+ export { SecurityBlockedScreen } from './components';
19
+
20
+ // Types
21
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["default","DeviceSecurity","DeviceSecurityClass","NativeDeviceSecurity","useDeviceSecurity","SecurityBlockedScreen"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":"AAAA;AACA;AACA;AACA;AACA;;AAEA;AACA,SAASA,OAAO,IAAIC,cAAc,EAAEA,cAAc,IAAIC,mBAAmB,QAAQ,OAAO;AACxF,SAASF,OAAO,QAAQ,OAAO;;AAE/B;AACA,SAASA,OAAO,IAAIG,oBAAoB,QAAQ,wBAAwB;;AAExE;AACA,SAASC,iBAAiB,QAAQ,SAAS;;AAE3C;AACA,SAASC,qBAAqB,QAAQ,cAAc;;AAEpD","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sourceRoot":"../../src","sources":["types.ts"],"mappings":"","ignoreList":[]}
@@ -0,0 +1,16 @@
1
+ import type { TurboModule } from 'react-native';
2
+ export interface Spec extends TurboModule {
3
+ isRooted(): boolean;
4
+ isRootedWithDetails(): Promise<string>;
5
+ hasFrida(): boolean;
6
+ hasXposed(): boolean;
7
+ hasMagisk(): boolean;
8
+ isDebuggable(): boolean;
9
+ isEmulator(): boolean;
10
+ getSecurityStatus(): Promise<string>;
11
+ isDeviceSecure(): Promise<boolean>;
12
+ blockOnSecurityThreat(showAlert: boolean, alertTitle: string, alertMessage: string, alertButtonText: string): void;
13
+ }
14
+ declare const _default: Spec;
15
+ export default _default;
16
+ //# sourceMappingURL=NativeDeviceSecurity.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NativeDeviceSecurity.d.ts","sourceRoot":"","sources":["../../src/NativeDeviceSecurity.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAGhD,MAAM,WAAW,IAAK,SAAQ,WAAW;IAEvC,QAAQ,IAAI,OAAO,CAAC;IACpB,mBAAmB,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;IAGvC,QAAQ,IAAI,OAAO,CAAC;IACpB,SAAS,IAAI,OAAO,CAAC;IACrB,SAAS,IAAI,OAAO,CAAC;IAGrB,YAAY,IAAI,OAAO,CAAC;IAGxB,UAAU,IAAI,OAAO,CAAC;IAGtB,iBAAiB,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;IACrC,cAAc,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC;IAGnC,qBAAqB,CACnB,SAAS,EAAE,OAAO,EAClB,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,MAAM,EACpB,eAAe,EAAE,MAAM,GACtB,IAAI,CAAC;CACT;;AAED,wBAAwE"}
@@ -0,0 +1,55 @@
1
+ /**
2
+ * DeviceSecurity API
3
+ * Main singleton class for device security checks
4
+ */
5
+ import type { BlockOnSecurityThreatOptions, SecurityStatus } from './types';
6
+ /**
7
+ * Main DeviceSecurity API class
8
+ */
9
+ declare class DeviceSecurity {
10
+ /**
11
+ * Check if device is secure (no security threats)
12
+ */
13
+ isDeviceSecure(): Promise<boolean>;
14
+ /**
15
+ * Get detailed security status
16
+ */
17
+ getSecurityStatus(): Promise<SecurityStatus>;
18
+ /**
19
+ * Check if device is rooted (synchronous, Android only)
20
+ */
21
+ isRooted(): boolean;
22
+ /**
23
+ * Check if Frida is present
24
+ */
25
+ hasFrida(): boolean;
26
+ /**
27
+ * Check if Xposed framework is present
28
+ */
29
+ hasXposed(): boolean;
30
+ /**
31
+ * Check if Magisk is present
32
+ */
33
+ hasMagisk(): boolean;
34
+ /**
35
+ * Check if app is debuggable
36
+ */
37
+ isDebuggable(): boolean;
38
+ /**
39
+ * Check if running on emulator
40
+ */
41
+ isEmulator(): boolean;
42
+ /**
43
+ * Block app when security threat detected
44
+ * This will show an alert and potentially exit the app
45
+ */
46
+ blockOnSecurityThreat(options?: BlockOnSecurityThreatOptions): void;
47
+ /**
48
+ * Get default security status (error case)
49
+ */
50
+ private getDefaultSecurityStatus;
51
+ }
52
+ declare const deviceSecurityInstance: DeviceSecurity;
53
+ export default deviceSecurityInstance;
54
+ export { DeviceSecurity };
55
+ //# sourceMappingURL=api.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../src/api.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,KAAK,EACV,4BAA4B,EAC5B,cAAc,EAEf,MAAM,SAAS,CAAC;AAEjB;;GAEG;AACH,cAAM,cAAc;IAClB;;OAEG;IACG,cAAc,IAAI,OAAO,CAAC,OAAO,CAAC;IAcxC;;OAEG;IACG,iBAAiB,IAAI,OAAO,CAAC,cAAc,CAAC;IA6BlD;;OAEG;IACH,QAAQ,IAAI,OAAO;IAanB;;OAEG;IACH,QAAQ,IAAI,OAAO;IAanB;;OAEG;IACH,SAAS,IAAI,OAAO;IAapB;;OAEG;IACH,SAAS,IAAI,OAAO;IAapB;;OAEG;IACH,YAAY,IAAI,OAAO;IAavB;;OAEG;IACH,UAAU,IAAI,OAAO;IAarB;;;OAGG;IACH,qBAAqB,CAAC,OAAO,GAAE,4BAAiC,GAAG,IAAI;IAiCvE;;OAEG;IACH,OAAO,CAAC,wBAAwB;CAiBjC;AAGD,QAAA,MAAM,sBAAsB,gBAAuB,CAAC;AACpD,eAAe,sBAAsB,CAAC;AACtC,OAAO,EAAE,cAAc,EAAE,CAAC"}
@@ -0,0 +1,23 @@
1
+ /**
2
+ * SecurityBlockedScreen.tsx
3
+ *
4
+ * Screen to display when app is blocked due to security threats
5
+ */
6
+ import React from 'react';
7
+ import type { SecurityThreat } from '../types';
8
+ interface SecurityBlockedScreenProps {
9
+ /** Security status details */
10
+ threats?: SecurityThreat[];
11
+ /** Custom title */
12
+ title?: string;
13
+ /** Custom message */
14
+ message?: string;
15
+ /** Custom icon component */
16
+ icon?: React.ReactNode;
17
+ }
18
+ /**
19
+ * Default security blocked screen component
20
+ */
21
+ export declare const SecurityBlockedScreen: React.FC<SecurityBlockedScreenProps>;
22
+ export default SecurityBlockedScreen;
23
+ //# sourceMappingURL=SecurityBlockedScreen.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SecurityBlockedScreen.d.ts","sourceRoot":"","sources":["../../../src/components/SecurityBlockedScreen.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAS1B,OAAO,KAAK,EAAkB,cAAc,EAAE,MAAM,UAAU,CAAC;AAE/D,UAAU,0BAA0B;IAClC,8BAA8B;IAC9B,OAAO,CAAC,EAAE,cAAc,EAAE,CAAC;IAC3B,mBAAmB;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,qBAAqB;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,4BAA4B;IAC5B,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CACxB;AA8BD;;GAEG;AACH,eAAO,MAAM,qBAAqB,EAAE,KAAK,CAAC,EAAE,CAAC,0BAA0B,CAoDtE,CAAC;AA4FF,eAAe,qBAAqB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { SecurityBlockedScreen } from './SecurityBlockedScreen';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { useDeviceSecurity } from './useDeviceSecurity';
2
+ export type { UseDeviceSecurityOptions, UseDeviceSecurityReturn, } from '../types';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,YAAY,EACV,wBAAwB,EACxB,uBAAuB,GACxB,MAAM,UAAU,CAAC"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * React hook for device security
3
+ */
4
+ import type { UseDeviceSecurityOptions, UseDeviceSecurityReturn } from '../types';
5
+ export declare function useDeviceSecurity(options?: UseDeviceSecurityOptions): UseDeviceSecurityReturn;
6
+ export default useDeviceSecurity;
7
+ //# sourceMappingURL=useDeviceSecurity.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useDeviceSecurity.d.ts","sourceRoot":"","sources":["../../../src/hooks/useDeviceSecurity.ts"],"names":[],"mappings":"AAAA;;GAEG;AAKH,OAAO,KAAK,EAEV,wBAAwB,EACxB,uBAAuB,EACxB,MAAM,UAAU,CAAC;AAElB,wBAAgB,iBAAiB,CAC/B,OAAO,GAAE,wBAA6B,GACrC,uBAAuB,CAyEzB;AAED,eAAe,iBAAiB,CAAC"}