From b3f6c79f25fc89d204d7217e2244011fafffea98 Mon Sep 17 00:00:00 2001 From: Martin Kleinschrodt Date: Sun, 15 May 2016 18:39:50 -0500 Subject: [PATCH] Set filterTouchesWhenObscured on view object to mitigate 'Tapjacking'. Fixes #22 --- src/android/PrivacyScreenPlugin.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/android/PrivacyScreenPlugin.java b/src/android/PrivacyScreenPlugin.java index 691f5a6..0c36403 100644 --- a/src/android/PrivacyScreenPlugin.java +++ b/src/android/PrivacyScreenPlugin.java @@ -24,12 +24,14 @@ /** * This class sets the FLAG_SECURE flag on the window to make the app - * private when shown in the task switcher + * private when shown in the task switcher and sets filterTouchesWhenObscured + * on the view object to mitgate 'Tapjacking' */ public class PrivacyScreenPlugin extends CordovaPlugin { @Override public void initialize(CordovaInterface cordova, CordovaWebView webView) { + webView.getView().setFilterTouchesWhenObscured(true); super.initialize(cordova, webView); Activity activity = this.cordova.getActivity(); activity.getWindow().addFlags(WindowManager.LayoutParams.FLAG_SECURE);