Skip to content

Commit

Permalink
fix package.json. fix logic for android
Browse files Browse the repository at this point in the history
  • Loading branch information
killserver committed Jun 29, 2023
1 parent 872edcc commit abfb4ba
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,32 @@ public void run() {

@ReactMethod
public void enableSecureView() {

if (this.reactContext.hasCurrentActivity()) {
final Activity activity = this.reactContext.getCurrentActivity();
if (activity != null) {
activity.runOnUiThread(new Runnable() {
@Override
public void run() {
reactContext.getCurrentActivity().getWindow().setFlags(WindowManager.LayoutParams.FLAG_SECURE, WindowManager.LayoutParams.FLAG_SECURE);
}
});
}
}
}

@ReactMethod
public void disableSecureView() {

if (this.reactContext.hasCurrentActivity()) {
final Activity activity = this.reactContext.getCurrentActivity();
if (activity != null) {
activity.runOnUiThread(new Runnable() {
@Override
public void run() {
reactContext.getCurrentActivity().getWindow().clearFlags(WindowManager.LayoutParams.FLAG_SECURE);
}
});
}
}
}

// Required for rn built in EventEmitter Calls.
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"name": "react-native-screenshot-prevent",
"version": "1.1.6",
"version": "1.1.7",
"description": "This fork contains fully working blank screenshot on IOS13+ including screen recording",
"main": "lib/commonjs/index",
"main": "lib/module/index",
"module": "lib/module/index",
"types": "./src/index.d.ts",
"react-native": "index",
"react-native": "lib/module/index",
"source": "./src/index",
"files": [
"src",
Expand Down

0 comments on commit abfb4ba

Please sign in to comment.