Add tapjacking protection

* Set filterTouchesWhenObscured for all views
* Warn the user if Apps using the SYSTEM_ALERT_WINDOW permission are installed
* Warn the user if an App using the permission is installed while Briar is running

Signed-off-by: goapunk <noobie@goapunks.net>
This commit is contained in:
goapunk
2017-03-30 13:15:47 +02:00
parent a1b415330e
commit 04c4e70dd1
11 changed files with 423 additions and 2 deletions

View File

@@ -0,0 +1,40 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:filterTouchesWhenObscured="false"
android:orientation="vertical">
<ScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:fadeScrollbars="false"
android:paddingLeft="20dp"
android:paddingRight="20dp"
android:paddingStart="20dp"
android:paddingTop="20dp"
android:theme="@style/BriarTheme">
<TextView
android:id="@+id/alert_dialog_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="3dp"
android:paddingRight="6dp"
android:text="TextView"
android:textAppearance="@style/BriarTextBody"
android:theme="@+theme/BriarDialogTheme"/>
</ScrollView>
<CheckBox
android:id="@+id/checkBox_screen_filter_reminder"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="15dp"
android:layout_marginStart="15dp"
android:layout_weight="0"
android:filterTouchesWhenObscured="false"
android:text="@string/checkbox_dont_show_again"
android:textAppearance="@style/BriarTextBody"/>
</LinearLayout>

View File

@@ -380,4 +380,10 @@
<!-- Sign Out -->
<string name="progress_title_logout">Signing out of Briar…</string>
<!-- Screen Filters & Tapjacking -->
<string name="screen_filter_title">Screen filter detected</string>
<string name="screen_filter_body">The following apps have permission to draw over other apps:\n\n%1$s \n\nBriar will not respond to touches when another app is drawing over it.
If you experience any problems, try turning off these apps when using Briar.\n</string>
<string name="checkbox_dont_show_again">Don\'t warn me again for these apps</string>
</resources>

View File

@@ -14,6 +14,7 @@
<item name="android:textColorTertiaryInverse">@color/briar_text_tertiary_inverse</item>
<item name="android:textColorLink">@color/briar_text_link</item>
<item name="android:windowAnimationStyle">@style/ActivityAnimation</item>
<item name="android:filterTouchesWhenObscured">true</item>
<!-- These fix a long-standing UI bug in the support preference library -->
<item name="preferenceTheme">@style/PreferenceThemeOverlay.v14.Material</item>
@@ -47,6 +48,12 @@
<item name="android:textColorTertiaryInverse">@color/briar_text_tertiary_inverse</item>
<item name="android:textColorLink">@color/briar_text_link</item>
<item name="android:windowAnimationStyle">@style/DialogAnimation</item>
<item name="android:filterTouchesWhenObscured">true</item>
</style>
<!-- Use this with care. Only used for the screen filter warning dialog -->
<style name="BriarDialogThemeNoFilter" parent="BriarDialogTheme">
<item name="android:filterTouchesWhenObscured">false</item>
</style>
<style name="DialogAnimation" parent="@android:style/Animation.Dialog">