react-native-screen-blocker 1.0.6 → 1.0.7
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.
|
@@ -23,9 +23,14 @@ public class ScreenBlockerModule extends ReactContextBaseJavaModule {
|
|
|
23
23
|
public void enable() {
|
|
24
24
|
Activity activity = getCurrentActivity();
|
|
25
25
|
if (activity != null) {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
activity.runOnUiThread(new Runnable() {
|
|
27
|
+
@Override
|
|
28
|
+
public void run() {
|
|
29
|
+
Window window = activity.getWindow();
|
|
30
|
+
window.setFlags(WindowManager.LayoutParams.FLAG_SECURE,
|
|
31
|
+
WindowManager.LayoutParams.FLAG_SECURE);
|
|
32
|
+
}
|
|
33
|
+
});
|
|
29
34
|
}
|
|
30
35
|
}
|
|
31
36
|
|
|
@@ -33,8 +38,13 @@ public class ScreenBlockerModule extends ReactContextBaseJavaModule {
|
|
|
33
38
|
public void disable() {
|
|
34
39
|
Activity activity = getCurrentActivity();
|
|
35
40
|
if (activity != null) {
|
|
36
|
-
|
|
37
|
-
|
|
41
|
+
activity.runOnUiThread(new Runnable() {
|
|
42
|
+
@Override
|
|
43
|
+
public void run() {
|
|
44
|
+
Window window = activity.getWindow();
|
|
45
|
+
window.clearFlags(WindowManager.LayoutParams.FLAG_SECURE);
|
|
46
|
+
}
|
|
47
|
+
});
|
|
38
48
|
}
|
|
39
49
|
}
|
|
40
50
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-screen-blocker",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.7",
|
|
4
4
|
"description": "React Native module to block screenshots and screen recording on Android and iOS",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -35,9 +35,7 @@
|
|
|
35
35
|
"packageImportPath": "import com.screenblocker.ScreenBlockerPackage;",
|
|
36
36
|
"packageInstance": "new ScreenBlockerPackage()"
|
|
37
37
|
},
|
|
38
|
-
"ios": {
|
|
39
|
-
"podspecPath": "ios/react-native-screen-blocker.podspec"
|
|
40
|
-
}
|
|
38
|
+
"ios": {}
|
|
41
39
|
}
|
|
42
40
|
}
|
|
43
41
|
}
|
package/react-native.config.js
CHANGED