react-native-security-suite 0.9.14 β 0.9.16
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.
- package/README.md +310 -72
- package/android/src/main/java/com/securitysuite/SecureViewManager.java +6 -6
- package/ios/SecureViewManager.h +1 -1
- package/ios/SecureViewManager.m +1 -1
- package/ios/SecureViewManager.swift +2 -2
- package/lib/commonjs/SecureView.js +2 -2
- package/lib/commonjs/SecureView.js.map +1 -1
- package/lib/module/SecureView.js +2 -2
- package/lib/module/SecureView.js.map +1 -1
- package/package.json +20 -3
- package/src/SecureView.tsx +2 -2
package/README.md
CHANGED
|
@@ -1,125 +1,363 @@
|
|
|
1
|
-
#
|
|
1
|
+
# React Native Security Suite π
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
[](https://www.npmjs.com/package/react-native-security-suite)
|
|
4
|
+
[](https://opensource.org/licenses/MIT)
|
|
5
|
+
[](https://www.npmjs.com/package/react-native-security-suite)
|
|
5
6
|
|
|
6
|
-
|
|
7
|
+
**Comprehensive security solutions for React Native applications** - Protect your mobile apps with advanced security features including root/jailbreak detection, SSL certificate pinning, encryption, secure storage, screenshot protection, and network monitoring.
|
|
7
8
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
## π Features
|
|
10
|
+
|
|
11
|
+
### Security Detection & Protection
|
|
12
|
+
|
|
13
|
+
- **Root Detection**: Detect rooted Android devices
|
|
14
|
+
- **Jailbreak Detection**: Detect jailbroken iOS devices
|
|
15
|
+
- **Screenshot Protection**: Prevent screenshots and screen recordings
|
|
16
|
+
- **SSL Certificate Pinning**: Secure network communications
|
|
17
|
+
- **Public Key Pinning**: Advanced certificate validation
|
|
18
|
+
|
|
19
|
+
### Data Security & Encryption
|
|
20
|
+
|
|
21
|
+
- **Text Encryption/Decryption**: Secure data encryption with multiple algorithms
|
|
22
|
+
- **Secure Storage**: Encrypted local storage with AsyncStorage integration
|
|
23
|
+
- **Diffie-Hellman Key Exchange**: Secure key generation and sharing
|
|
24
|
+
- **Hard & Soft Encryption**: Multiple encryption levels for different security needs
|
|
25
|
+
|
|
26
|
+
### Network Security & Monitoring
|
|
27
|
+
|
|
28
|
+
- **Network Logger**: Built-in request/response logging
|
|
29
|
+
- **Android Chucker Integration**: Advanced network debugging
|
|
30
|
+
- **iOS Pulse Integration**: Network monitoring for iOS
|
|
31
|
+
- **SSL Pinning with Custom Certificates**: Enhanced security for API calls
|
|
32
|
+
|
|
33
|
+
## π± Supported Platforms
|
|
12
34
|
|
|
13
|
-
|
|
35
|
+
- β
**Android** (API 21+)
|
|
36
|
+
- β
**iOS** (iOS 11.0+)
|
|
37
|
+
- β
**React Native** (0.60+)
|
|
14
38
|
|
|
15
|
-
|
|
39
|
+
## π Installation
|
|
40
|
+
|
|
41
|
+
### Using Yarn
|
|
42
|
+
|
|
43
|
+
```bash
|
|
16
44
|
yarn add react-native-security-suite @react-native-async-storage/async-storage
|
|
17
45
|
```
|
|
18
46
|
|
|
19
|
-
|
|
47
|
+
### Using NPM
|
|
48
|
+
|
|
49
|
+
```bash
|
|
20
50
|
npm install react-native-security-suite @react-native-async-storage/async-storage
|
|
21
51
|
```
|
|
22
52
|
|
|
23
|
-
|
|
53
|
+
### iOS Setup
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
cd ios && pod install
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## π Usage Examples
|
|
24
60
|
|
|
25
|
-
1.
|
|
61
|
+
### 1. Root/Jailbreak Detection
|
|
26
62
|
|
|
27
|
-
|
|
63
|
+
Detect compromised devices to protect your app from security risks:
|
|
64
|
+
|
|
65
|
+
```javascript
|
|
28
66
|
import { deviceHasSecurityRisk } from 'react-native-security-suite';
|
|
29
67
|
|
|
30
|
-
const
|
|
31
|
-
|
|
68
|
+
const checkDeviceSecurity = async () => {
|
|
69
|
+
const isRiskyDevice = await deviceHasSecurityRisk();
|
|
70
|
+
|
|
71
|
+
if (isRiskyDevice) {
|
|
72
|
+
console.log('β οΈ Device is rooted/jailbroken - Security risk detected');
|
|
73
|
+
// Handle security risk - show warning or restrict features
|
|
74
|
+
} else {
|
|
75
|
+
console.log('β
Device security check passed');
|
|
76
|
+
}
|
|
77
|
+
};
|
|
32
78
|
```
|
|
33
79
|
|
|
34
|
-
2
|
|
80
|
+
### 2. Screenshot Protection
|
|
35
81
|
|
|
36
|
-
|
|
82
|
+
Protect sensitive content from screenshots and screen recordings:
|
|
83
|
+
|
|
84
|
+
```javascript
|
|
37
85
|
import { SecureView } from 'react-native-security-suite';
|
|
38
86
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
<
|
|
42
|
-
|
|
43
|
-
|
|
87
|
+
const SensitiveScreen = () => {
|
|
88
|
+
return (
|
|
89
|
+
<View style={styles.container}>
|
|
90
|
+
<SecureView style={styles.secureContainer}>
|
|
91
|
+
<Text style={styles.sensitiveText}>
|
|
92
|
+
π This content is protected from screenshots
|
|
93
|
+
</Text>
|
|
94
|
+
<TextInput
|
|
95
|
+
placeholder="Enter sensitive information"
|
|
96
|
+
secureTextEntry={true}
|
|
97
|
+
/>
|
|
98
|
+
</SecureView>
|
|
99
|
+
</View>
|
|
100
|
+
);
|
|
101
|
+
};
|
|
44
102
|
```
|
|
45
103
|
|
|
46
|
-
3
|
|
104
|
+
### 3. Text Encryption & Decryption
|
|
105
|
+
|
|
106
|
+
Secure your data with multiple encryption methods:
|
|
107
|
+
|
|
108
|
+
```javascript
|
|
109
|
+
import { encrypt, decrypt } from 'react-native-security-suite';
|
|
110
|
+
|
|
111
|
+
const handleEncryption = async () => {
|
|
112
|
+
// Soft encryption (faster, less secure)
|
|
113
|
+
const softEncrypted = await encrypt('Sensitive data', false);
|
|
114
|
+
console.log('Soft encrypted:', softEncrypted);
|
|
47
115
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
116
|
+
const softDecrypted = await decrypt(softEncrypted, false);
|
|
117
|
+
console.log('Soft decrypted:', softDecrypted);
|
|
118
|
+
|
|
119
|
+
// Hard encryption (slower, more secure)
|
|
120
|
+
const hardEncrypted = await encrypt('Highly sensitive data', true);
|
|
121
|
+
console.log('Hard encrypted:', hardEncrypted);
|
|
122
|
+
|
|
123
|
+
const hardDecrypted = await decrypt(hardEncrypted, true);
|
|
124
|
+
console.log('Hard decrypted:', hardDecrypted);
|
|
125
|
+
};
|
|
53
126
|
```
|
|
54
127
|
|
|
55
|
-
4
|
|
128
|
+
### 4. Secure Storage
|
|
56
129
|
|
|
57
|
-
|
|
130
|
+
Store sensitive data securely with automatic encryption:
|
|
131
|
+
|
|
132
|
+
```javascript
|
|
58
133
|
import { SecureStorage } from 'react-native-security-suite';
|
|
59
134
|
|
|
60
|
-
|
|
61
|
-
|
|
135
|
+
const handleSecureStorage = async () => {
|
|
136
|
+
try {
|
|
137
|
+
// Store encrypted data
|
|
138
|
+
await SecureStorage.setItem(
|
|
139
|
+
'userToken',
|
|
140
|
+
'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...'
|
|
141
|
+
);
|
|
142
|
+
await SecureStorage.setItem(
|
|
143
|
+
'userCredentials',
|
|
144
|
+
JSON.stringify({
|
|
145
|
+
username: 'user@example.com',
|
|
146
|
+
password: 'encrypted_password',
|
|
147
|
+
})
|
|
148
|
+
);
|
|
149
|
+
|
|
150
|
+
// Retrieve and decrypt data
|
|
151
|
+
const token = await SecureStorage.getItem('userToken');
|
|
152
|
+
const credentials = await SecureStorage.getItem('userCredentials');
|
|
153
|
+
|
|
154
|
+
console.log('Retrieved token:', token);
|
|
155
|
+
console.log('Retrieved credentials:', JSON.parse(credentials));
|
|
156
|
+
|
|
157
|
+
// Remove sensitive data
|
|
158
|
+
await SecureStorage.removeItem('userToken');
|
|
159
|
+
} catch (error) {
|
|
160
|
+
console.error('Secure storage error:', error);
|
|
161
|
+
}
|
|
162
|
+
};
|
|
62
163
|
```
|
|
63
164
|
|
|
64
|
-
5
|
|
165
|
+
### 5. Diffie-Hellman Key Exchange
|
|
166
|
+
|
|
167
|
+
Implement secure key exchange for encrypted communications:
|
|
65
168
|
|
|
66
|
-
```
|
|
169
|
+
```javascript
|
|
67
170
|
import {
|
|
68
171
|
getPublicKey,
|
|
69
172
|
getSharedKey,
|
|
70
173
|
encryptBySharedKey,
|
|
71
174
|
decryptBySharedKey,
|
|
72
|
-
encrypt,
|
|
73
|
-
decrypt,
|
|
74
175
|
} from 'react-native-security-suite';
|
|
75
176
|
|
|
76
|
-
const
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
177
|
+
const handleKeyExchange = async () => {
|
|
178
|
+
try {
|
|
179
|
+
// Generate client public key
|
|
180
|
+
const clientPublicKey = await getPublicKey();
|
|
181
|
+
console.log('Client public key:', clientPublicKey);
|
|
182
|
+
|
|
183
|
+
// Send to server and receive server's public key
|
|
184
|
+
const serverPublicKey = 'SERVER_PUBLIC_KEY_FROM_API';
|
|
185
|
+
|
|
186
|
+
// Generate shared secret key
|
|
187
|
+
const sharedKey = await getSharedKey(serverPublicKey);
|
|
188
|
+
console.log('Shared key generated:', sharedKey);
|
|
189
|
+
|
|
190
|
+
// Encrypt data with shared key
|
|
191
|
+
const encryptedMessage = await encryptBySharedKey('Secret message');
|
|
192
|
+
console.log('Encrypted message:', encryptedMessage);
|
|
193
|
+
|
|
194
|
+
// Decrypt data with shared key
|
|
195
|
+
const decryptedMessage = await decryptBySharedKey(encryptedMessage);
|
|
196
|
+
console.log('Decrypted message:', decryptedMessage);
|
|
197
|
+
} catch (error) {
|
|
198
|
+
console.error('Key exchange error:', error);
|
|
199
|
+
}
|
|
200
|
+
};
|
|
89
201
|
```
|
|
90
202
|
|
|
91
|
-
6
|
|
203
|
+
### 6. SSL Certificate Pinning
|
|
92
204
|
|
|
93
|
-
|
|
205
|
+
Secure your API communications with certificate pinning:
|
|
206
|
+
|
|
207
|
+
```javascript
|
|
94
208
|
import { fetch } from 'react-native-security-suite';
|
|
95
209
|
|
|
96
|
-
const
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
})
|
|
108
|
-
|
|
210
|
+
const secureApiCall = async () => {
|
|
211
|
+
try {
|
|
212
|
+
const response = await fetch('https://api.yourapp.com/secure-endpoint', {
|
|
213
|
+
method: 'POST',
|
|
214
|
+
headers: {
|
|
215
|
+
'Content-Type': 'application/json',
|
|
216
|
+
'Authorization': 'Bearer your-token',
|
|
217
|
+
},
|
|
218
|
+
body: JSON.stringify({
|
|
219
|
+
userId: 123,
|
|
220
|
+
action: 'sensitive_operation',
|
|
221
|
+
}),
|
|
222
|
+
certificates: [
|
|
223
|
+
'sha256/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=',
|
|
224
|
+
'sha256/BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB=',
|
|
225
|
+
],
|
|
226
|
+
validDomains: ['api.yourapp.com', 'secure.yourapp.com'],
|
|
227
|
+
timeout: 10000,
|
|
228
|
+
});
|
|
229
|
+
|
|
230
|
+
const data = await response.json();
|
|
231
|
+
console.log('Secure API response:', data);
|
|
232
|
+
} catch (error) {
|
|
233
|
+
console.error('SSL pinning failed:', error);
|
|
234
|
+
// Handle certificate validation failure
|
|
235
|
+
}
|
|
236
|
+
};
|
|
109
237
|
```
|
|
110
238
|
|
|
111
|
-
7
|
|
239
|
+
### 7. Network Monitoring & Debugging
|
|
240
|
+
|
|
241
|
+
Monitor network requests in development:
|
|
112
242
|
|
|
113
|
-
```
|
|
243
|
+
```javascript
|
|
114
244
|
import { fetch } from 'react-native-security-suite';
|
|
115
245
|
|
|
116
|
-
|
|
246
|
+
const monitoredRequest = async () => {
|
|
247
|
+
try {
|
|
248
|
+
const response = await fetch(
|
|
249
|
+
'https://api.example.com/data',
|
|
250
|
+
{
|
|
251
|
+
method: 'GET',
|
|
252
|
+
headers: {
|
|
253
|
+
Accept: 'application/json',
|
|
254
|
+
},
|
|
255
|
+
},
|
|
256
|
+
__DEV__
|
|
257
|
+
); // Enable logging in development
|
|
258
|
+
|
|
259
|
+
return await response.json();
|
|
260
|
+
} catch (error) {
|
|
261
|
+
console.error('Network request failed:', error);
|
|
262
|
+
}
|
|
263
|
+
};
|
|
117
264
|
```
|
|
118
265
|
|
|
119
|
-
##
|
|
266
|
+
## π§ API Reference
|
|
267
|
+
|
|
268
|
+
### Security Detection
|
|
269
|
+
|
|
270
|
+
- `deviceHasSecurityRisk()` - Detect rooted/jailbroken devices
|
|
271
|
+
|
|
272
|
+
### Encryption & Storage
|
|
273
|
+
|
|
274
|
+
- `encrypt(text, hardEncryption?, secretKey?)` - Encrypt text
|
|
275
|
+
- `decrypt(encryptedText, hardEncryption?, secretKey?)` - Decrypt text
|
|
276
|
+
- `SecureStorage` - Encrypted storage methods
|
|
277
|
+
|
|
278
|
+
### Key Exchange
|
|
120
279
|
|
|
121
|
-
|
|
280
|
+
- `getPublicKey()` - Generate public key
|
|
281
|
+
- `getSharedKey(serverPublicKey)` - Generate shared key
|
|
282
|
+
- `encryptBySharedKey(text)` - Encrypt with shared key
|
|
283
|
+
- `decryptBySharedKey(encryptedText)` - Decrypt with shared key
|
|
122
284
|
|
|
123
|
-
|
|
285
|
+
### Network Security
|
|
286
|
+
|
|
287
|
+
- `fetch(url, options, loggerEnabled?)` - Secure fetch with SSL pinning
|
|
288
|
+
|
|
289
|
+
### UI Components
|
|
290
|
+
|
|
291
|
+
- `SecureView` - Screenshot-protected view component
|
|
292
|
+
|
|
293
|
+
## π‘οΈ Security Best Practices
|
|
294
|
+
|
|
295
|
+
1. **Always validate certificates** - Use SSL pinning for production APIs
|
|
296
|
+
2. **Detect compromised devices** - Check for root/jailbreak before sensitive operations
|
|
297
|
+
3. **Use appropriate encryption levels** - Hard encryption for highly sensitive data
|
|
298
|
+
4. **Protect sensitive UI** - Wrap sensitive content in SecureView
|
|
299
|
+
5. **Monitor network traffic** - Use built-in logging for debugging
|
|
300
|
+
6. **Secure key management** - Implement proper key exchange protocols
|
|
301
|
+
|
|
302
|
+
## π Troubleshooting
|
|
303
|
+
|
|
304
|
+
### Common Issues
|
|
305
|
+
|
|
306
|
+
**iOS Build Errors:**
|
|
307
|
+
|
|
308
|
+
```bash
|
|
309
|
+
cd ios && pod install && cd ..
|
|
310
|
+
npx react-native run-ios
|
|
311
|
+
```
|
|
312
|
+
|
|
313
|
+
**Android Build Errors:**
|
|
314
|
+
|
|
315
|
+
```bash
|
|
316
|
+
cd android && ./gradlew clean && cd ..
|
|
317
|
+
npx react-native run-android
|
|
318
|
+
```
|
|
319
|
+
|
|
320
|
+
**Metro Cache Issues:**
|
|
321
|
+
|
|
322
|
+
```bash
|
|
323
|
+
npx react-native start --reset-cache
|
|
324
|
+
```
|
|
325
|
+
|
|
326
|
+
## π€ Contributing
|
|
327
|
+
|
|
328
|
+
We welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md) for details.
|
|
329
|
+
|
|
330
|
+
### Development Setup
|
|
331
|
+
|
|
332
|
+
```bash
|
|
333
|
+
git clone https://github.com/mohamadnavabi/react-native-security-suite.git
|
|
334
|
+
cd react-native-security-suite
|
|
335
|
+
yarn install
|
|
336
|
+
cd example && yarn install && cd ..
|
|
337
|
+
yarn example android # or ios
|
|
338
|
+
```
|
|
339
|
+
|
|
340
|
+
## π License
|
|
341
|
+
|
|
342
|
+
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
|
|
343
|
+
|
|
344
|
+
## π Acknowledgments
|
|
345
|
+
|
|
346
|
+
- [Chucker](https://github.com/ChuckerTeam/chucker) for Android network monitoring
|
|
347
|
+
- [Pulse](https://github.com/kean/Pulse) for iOS network monitoring
|
|
348
|
+
- React Native community for continuous support
|
|
349
|
+
|
|
350
|
+
## π Support
|
|
351
|
+
|
|
352
|
+
- π§ Email: 7navabi@gmail.com
|
|
353
|
+
- π Issues: [GitHub Issues](https://github.com/mohamadnavabi/react-native-security-suite/issues)
|
|
354
|
+
- π Documentation: [GitHub Wiki](https://github.com/mohamadnavabi/react-native-security-suite/wiki)
|
|
355
|
+
|
|
356
|
+
---
|
|
357
|
+
|
|
358
|
+
<div style="display: flex; flex-direction: row; justify-content: center; align-items: center; gap: 20px;">
|
|
359
|
+
<img src="https://raw.githubusercontent.com/mohamadnavabi/react-native-security-suite/master/pulse.png" alt="iOS Pulse Network Monitor" width="200" />
|
|
360
|
+
<img src="https://raw.githubusercontent.com/mohamadnavabi/react-native-security-suite/master/chucker.gif" alt="Android Chucker Network Monitor" width="200" />
|
|
361
|
+
</div>
|
|
124
362
|
|
|
125
|
-
|
|
363
|
+
**Made with β€οΈ for the React Native community**
|
|
@@ -21,7 +21,7 @@ import java.util.Map;
|
|
|
21
21
|
|
|
22
22
|
public class SecureViewManager extends ViewGroupManager<SecureView> {
|
|
23
23
|
|
|
24
|
-
public static final String REACT_CLASS = "
|
|
24
|
+
public static final String REACT_CLASS = "RNSSecureView";
|
|
25
25
|
public final int COMMAND_CREATE = 1;
|
|
26
26
|
private int propWidth = ViewGroup.LayoutParams.MATCH_PARENT;
|
|
27
27
|
private int propHeight = ViewGroup.LayoutParams.MATCH_PARENT;
|
|
@@ -73,7 +73,7 @@ public class SecureViewManager extends ViewGroupManager<SecureView> {
|
|
|
73
73
|
public void createFragment(FrameLayout root, int reactNativeViewId) {
|
|
74
74
|
ViewGroup parentView = (ViewGroup) root.findViewById(reactNativeViewId);
|
|
75
75
|
if (parentView == null) {
|
|
76
|
-
Log.e("
|
|
76
|
+
Log.e("RNSSecureViewManager", "Parent view not found");
|
|
77
77
|
return;
|
|
78
78
|
}
|
|
79
79
|
setupLayout(parentView);
|
|
@@ -81,13 +81,13 @@ public class SecureViewManager extends ViewGroupManager<SecureView> {
|
|
|
81
81
|
final SecureViewFragment secureViewFragment = new SecureViewFragment(reactContext);
|
|
82
82
|
FragmentActivity activity = (FragmentActivity) reactContext.getCurrentActivity();
|
|
83
83
|
if (activity == null) {
|
|
84
|
-
Log.e("
|
|
84
|
+
Log.e("RNSSecureViewManager", "Activity is null");
|
|
85
85
|
return;
|
|
86
86
|
}
|
|
87
87
|
activity.getSupportFragmentManager()
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
88
|
+
.beginTransaction()
|
|
89
|
+
.replace(reactNativeViewId, secureViewFragment, String.valueOf(reactNativeViewId))
|
|
90
|
+
.commit();
|
|
91
91
|
}
|
|
92
92
|
|
|
93
93
|
@ReactPropGroup(names = { "width", "height" }, customType = "Style")
|
package/ios/SecureViewManager.h
CHANGED
package/ios/SecureViewManager.m
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#import <React/RCTViewManager.h>
|
|
2
2
|
|
|
3
|
-
@interface RCT_EXTERN_MODULE(
|
|
3
|
+
@interface RCT_EXTERN_MODULE(RNSSecureViewManager, RCTViewManager)
|
|
4
4
|
|
|
5
5
|
RCT_EXPORT_VIEW_PROPERTY(backgroundColor, NSString)
|
|
6
6
|
RCT_EXPORT_VIEW_PROPERTY(style, NSDictionary)
|
|
@@ -7,10 +7,10 @@ exports.SecureView = void 0;
|
|
|
7
7
|
var _react = require("react");
|
|
8
8
|
var _reactNative = require("react-native");
|
|
9
9
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
10
|
-
const NativeComponent = (0, _reactNative.requireNativeComponent)('
|
|
10
|
+
const NativeComponent = (0, _reactNative.requireNativeComponent)('RNSSecureView');
|
|
11
11
|
const createFragment = viewId => {
|
|
12
12
|
if (!_reactNative.UIManager.getViewManagerConfig) return;
|
|
13
|
-
const viewManagerConfig = _reactNative.UIManager.getViewManagerConfig('
|
|
13
|
+
const viewManagerConfig = _reactNative.UIManager.getViewManagerConfig('RNSSecureView');
|
|
14
14
|
if (viewManagerConfig.Commands.create) {
|
|
15
15
|
_reactNative.UIManager.dispatchViewManagerCommand(viewId, viewManagerConfig.Commands.create, [viewId]);
|
|
16
16
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","require","_reactNative","_jsxRuntime","NativeComponent","requireNativeComponent","createFragment","viewId","UIManager","getViewManagerConfig","viewManagerConfig","Commands","create","dispatchViewManagerCommand","SecureView","props","ref","useRef","useEffect","findNodeHandle","current","Platform","OS","jsx","exports"],"sourceRoot":"../../src","sources":["SecureView.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAKsB,IAAAE,WAAA,GAAAF,OAAA;AAEtB,MAAMG,eAAe,GAAG,IAAAC,mCAAsB,EAAC,
|
|
1
|
+
{"version":3,"names":["_react","require","_reactNative","_jsxRuntime","NativeComponent","requireNativeComponent","createFragment","viewId","UIManager","getViewManagerConfig","viewManagerConfig","Commands","create","dispatchViewManagerCommand","SecureView","props","ref","useRef","useEffect","findNodeHandle","current","Platform","OS","jsx","exports"],"sourceRoot":"../../src","sources":["SecureView.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAKsB,IAAAE,WAAA,GAAAF,OAAA;AAEtB,MAAMG,eAAe,GAAG,IAAAC,mCAAsB,EAAC,eAAe,CAAC;AAE/D,MAAMC,cAAc,GAAIC,MAAqB,IAAK;EAChD,IAAI,CAACC,sBAAS,CAACC,oBAAoB,EAAE;EAErC,MAAMC,iBAAiB,GAAGF,sBAAS,CAACC,oBAAoB,CAAC,eAAe,CAAC;EAEzE,IAAIC,iBAAiB,CAACC,QAAQ,CAACC,MAAM,EAAE;IACrCJ,sBAAS,CAACK,0BAA0B,CAClCN,MAAM,EACNG,iBAAiB,CAACC,QAAQ,CAACC,MAAM,EACjC,CAACL,MAAM,CACT,CAAC;EACH;AACF,CAAC;AAEM,MAAMO,UAAU,GAAIC,KAAU,IAAK;EACxC,MAAMC,GAAG,GAAG,IAAAC,aAAM,EAAC,IAAI,CAAC;EAExB,IAAAC,gBAAS,EAAC,MAAM;IACd,MAAMX,MAAM,GAAG,IAAAY,2BAAc,EAACH,GAAG,CAACI,OAAO,CAAC;IAC1C,IAAIC,qBAAQ,CAACC,EAAE,KAAK,SAAS,EAAEhB,cAAc,CAACC,MAAM,CAAC;EACvD,CAAC,EAAE,EAAE,CAAC;EAEN,oBAAO,IAAAJ,WAAA,CAAAoB,GAAA,EAACnB,eAAe;IAAA,GAAKW,KAAK;IAAEC,GAAG,EAAEA;EAAI,CAAE,CAAC;AACjD,CAAC;AAACQ,OAAA,CAAAV,UAAA,GAAAA,UAAA","ignoreList":[]}
|
package/lib/module/SecureView.js
CHANGED
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
import { useEffect, useRef } from 'react';
|
|
4
4
|
import { Platform, UIManager, findNodeHandle, requireNativeComponent } from 'react-native';
|
|
5
5
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
|
-
const NativeComponent = requireNativeComponent('
|
|
6
|
+
const NativeComponent = requireNativeComponent('RNSSecureView');
|
|
7
7
|
const createFragment = viewId => {
|
|
8
8
|
if (!UIManager.getViewManagerConfig) return;
|
|
9
|
-
const viewManagerConfig = UIManager.getViewManagerConfig('
|
|
9
|
+
const viewManagerConfig = UIManager.getViewManagerConfig('RNSSecureView');
|
|
10
10
|
if (viewManagerConfig.Commands.create) {
|
|
11
11
|
UIManager.dispatchViewManagerCommand(viewId, viewManagerConfig.Commands.create, [viewId]);
|
|
12
12
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useEffect","useRef","Platform","UIManager","findNodeHandle","requireNativeComponent","jsx","_jsx","NativeComponent","createFragment","viewId","getViewManagerConfig","viewManagerConfig","Commands","create","dispatchViewManagerCommand","SecureView","props","ref","current","OS"],"sourceRoot":"../../src","sources":["SecureView.tsx"],"mappings":";;AAAA,SAASA,SAAS,EAAEC,MAAM,QAAQ,OAAO;AACzC,SACEC,QAAQ,EACRC,SAAS,EACTC,cAAc,EACdC,sBAAsB,QACjB,cAAc;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAEtB,MAAMC,eAAe,GAAGH,sBAAsB,CAAC,
|
|
1
|
+
{"version":3,"names":["useEffect","useRef","Platform","UIManager","findNodeHandle","requireNativeComponent","jsx","_jsx","NativeComponent","createFragment","viewId","getViewManagerConfig","viewManagerConfig","Commands","create","dispatchViewManagerCommand","SecureView","props","ref","current","OS"],"sourceRoot":"../../src","sources":["SecureView.tsx"],"mappings":";;AAAA,SAASA,SAAS,EAAEC,MAAM,QAAQ,OAAO;AACzC,SACEC,QAAQ,EACRC,SAAS,EACTC,cAAc,EACdC,sBAAsB,QACjB,cAAc;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAEtB,MAAMC,eAAe,GAAGH,sBAAsB,CAAC,eAAe,CAAC;AAE/D,MAAMI,cAAc,GAAIC,MAAqB,IAAK;EAChD,IAAI,CAACP,SAAS,CAACQ,oBAAoB,EAAE;EAErC,MAAMC,iBAAiB,GAAGT,SAAS,CAACQ,oBAAoB,CAAC,eAAe,CAAC;EAEzE,IAAIC,iBAAiB,CAACC,QAAQ,CAACC,MAAM,EAAE;IACrCX,SAAS,CAACY,0BAA0B,CAClCL,MAAM,EACNE,iBAAiB,CAACC,QAAQ,CAACC,MAAM,EACjC,CAACJ,MAAM,CACT,CAAC;EACH;AACF,CAAC;AAED,OAAO,MAAMM,UAAU,GAAIC,KAAU,IAAK;EACxC,MAAMC,GAAG,GAAGjB,MAAM,CAAC,IAAI,CAAC;EAExBD,SAAS,CAAC,MAAM;IACd,MAAMU,MAAM,GAAGN,cAAc,CAACc,GAAG,CAACC,OAAO,CAAC;IAC1C,IAAIjB,QAAQ,CAACkB,EAAE,KAAK,SAAS,EAAEX,cAAc,CAACC,MAAM,CAAC;EACvD,CAAC,EAAE,EAAE,CAAC;EAEN,oBAAOH,IAAA,CAACC,eAAe;IAAA,GAAKS,KAAK;IAAEC,GAAG,EAAEA;EAAI,CAAE,CAAC;AACjD,CAAC","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-security-suite",
|
|
3
|
-
"version": "0.9.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.9.16",
|
|
4
|
+
"description": "Comprehensive security suite for React Native apps - Root/Jailbreak detection, SSL pinning, encryption, secure storage, screenshot protection, and network monitoring",
|
|
5
5
|
"source": "./src/index.tsx",
|
|
6
6
|
"main": "./lib/commonjs/index.js",
|
|
7
7
|
"module": "./lib/module/index.js",
|
|
@@ -47,8 +47,25 @@
|
|
|
47
47
|
},
|
|
48
48
|
"keywords": [
|
|
49
49
|
"react-native",
|
|
50
|
+
"security",
|
|
51
|
+
"encryption",
|
|
52
|
+
"ssl-pinning",
|
|
53
|
+
"root-detection",
|
|
54
|
+
"jailbreak-detection",
|
|
55
|
+
"secure-storage",
|
|
56
|
+
"screenshot-protection",
|
|
57
|
+
"network-monitoring",
|
|
58
|
+
"android",
|
|
50
59
|
"ios",
|
|
51
|
-
"
|
|
60
|
+
"mobile-security",
|
|
61
|
+
"cryptography",
|
|
62
|
+
"diffie-hellman",
|
|
63
|
+
"certificate-pinning",
|
|
64
|
+
"chucker",
|
|
65
|
+
"pulse",
|
|
66
|
+
"react-native-security",
|
|
67
|
+
"mobile-app-security",
|
|
68
|
+
"data-protection"
|
|
52
69
|
],
|
|
53
70
|
"repository": {
|
|
54
71
|
"type": "git",
|
package/src/SecureView.tsx
CHANGED
|
@@ -6,12 +6,12 @@ import {
|
|
|
6
6
|
requireNativeComponent,
|
|
7
7
|
} from 'react-native';
|
|
8
8
|
|
|
9
|
-
const NativeComponent = requireNativeComponent('
|
|
9
|
+
const NativeComponent = requireNativeComponent('RNSSecureView');
|
|
10
10
|
|
|
11
11
|
const createFragment = (viewId: number | null) => {
|
|
12
12
|
if (!UIManager.getViewManagerConfig) return;
|
|
13
13
|
|
|
14
|
-
const viewManagerConfig = UIManager.getViewManagerConfig('
|
|
14
|
+
const viewManagerConfig = UIManager.getViewManagerConfig('RNSSecureView');
|
|
15
15
|
|
|
16
16
|
if (viewManagerConfig.Commands.create) {
|
|
17
17
|
UIManager.dispatchViewManagerCommand(
|