|
1 | 1 | # react-native-secure-view |
2 | 2 |
|
3 | | -A React Native component that protects specific content from screenshots and screen recordings on both iOS and Android. |
| 3 | +A React Native component that protects content from screenshots and screen recordings. On iOS, you can selectively protect specific components while keeping the rest of the screen visible. Android provides full-screen protection. |
| 4 | + |
| 5 | +## Demo |
| 6 | + |
| 7 | +| iOS | Android | |
| 8 | +| ----------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | |
| 9 | +|  |  | |
4 | 10 |
|
5 | 11 | ## Installation |
6 | 12 |
|
@@ -58,32 +64,35 @@ function App() { |
58 | 64 |
|
59 | 65 | ## How It Works |
60 | 66 |
|
61 | | -### Android |
| 67 | +### iOS |
62 | 68 |
|
63 | | -When `enable={true}`, the module applies `WindowManager.LayoutParams.FLAG_SECURE` to the activity window: |
| 69 | +Uses `UITextField` with `secureTextEntry` property to provide component-level protection: |
64 | 70 |
|
65 | | -- **Screenshots**: Completely blocked |
66 | | -- **Screen recording**: Entire screen appears black during recording |
67 | | -- Recent apps switcher shows a black screen |
| 71 | +- **Screenshots**: Only the `SecureView` component appears blank/hidden in the captured image |
| 72 | +- **Screen recording**: Only the `SecureView` component appears blank during recording (rest of the screen remains visible) |
| 73 | +- **Selective protection**: You can protect specific sensitive components while keeping other parts of your UI visible |
| 74 | +- Works by leveraging iOS's built-in secure text field behavior that hides content during capture |
68 | 75 |
|
69 | | -### iOS |
| 76 | +### Android |
70 | 77 |
|
71 | | -Uses `UITextField` with `secureTextEntry` property: |
| 78 | +Applies `WindowManager.LayoutParams.FLAG_SECURE` to the activity window: |
72 | 79 |
|
73 | | -- **Screenshots**: The `SecureView` component appears blank/hidden in the captured image |
74 | | -- **Screen recording**: Only the `SecureView` component appears blank during recording (rest of the screen is visible) |
75 | | -- Works by leveraging iOS's built-in secure text field behavior that hides content during capture |
| 80 | +- **Screenshots**: Completely blocked system-wide |
| 81 | +- **Screen recording**: Entire screen appears black during recording |
| 82 | +- **Recent apps switcher**: Shows a black screen instead of app content |
| 83 | +- **Full-screen protection**: When enabled, the entire app window becomes secure |
76 | 84 |
|
77 | 85 | ## Limitations |
78 | 86 |
|
79 | | -### Android |
| 87 | +### iOS |
80 | 88 |
|
81 | | -- **Entire screen protection**: When enabled, the entire app screen becomes secure, not just the `SecureView` component |
82 | | -- **Rooted devices**: May bypass protection on rooted/modified devices |
| 89 | +- **Component-level only**: Protection is limited to the specific `SecureView` component area, not the entire screen |
83 | 90 |
|
84 | | -### iOS |
| 91 | +### Android |
85 | 92 |
|
86 | | -- **Component-level protection**: Only hides the specific `SecureView` component, not the entire screen |
| 93 | +- **Full-screen only**: When enabled, the entire app screen becomes secure, not just the `SecureView` component |
| 94 | +- **Rooted devices**: Protection may be bypassed on rooted or modified devices |
| 95 | +- **System-level**: Applies to the entire activity window, affecting all content |
87 | 96 |
|
88 | 97 | ## Contributing |
89 | 98 |
|
|
0 commit comments