flesh out security warning dialog

This commit is contained in:
Vincent Breitmoser
2017-04-25 16:44:13 +02:00
parent c1ba764ce8
commit 1868aed53b
6 changed files with 563 additions and 0 deletions

View File

@@ -0,0 +1,51 @@
<?xml version="1.0" encoding="utf-8"?>
<merge xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
tools:showIn="@layout/remote_security_issue_dialog">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:textAppearanceLarge"
android:text="Security Warning"
android:id="@+id/dialog_title"
/>
<TextView
android:id="@+id/api_register_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:gravity="center_vertical"
android:textAppearance="?android:attr/textAppearanceSmall"
android:text="The key this message was sent by is using an outdated algorithm, and is no longer considered secure!"
/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:text="The algorithm in use is DSA 1024 bit, which has been considered insecure since 2010."
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:textAppearance="?android:textAppearanceMedium"
android:text="Recommended Action"
android:id="@+id/dialog_title_2"
/>
<TextView
android:id="@+id/api_register_text_2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:gravity="center_vertical"
android:textAppearance="?android:attr/textAppearanceSmall"
android:text="The key in use is insecure, and cannot be updated. To communicate securely, the sender must create a new key!"
/>
</merge>

View File

@@ -0,0 +1,52 @@
<?xml version="1.0" encoding="utf-8"?>
<merge xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
tools:showIn="@layout/remote_security_issue_dialog">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:textAppearanceLarge"
android:text="@string/dialog_insecure_title"
android:id="@+id/dialog_title"
/>
<TextView
android:id="@+id/dialog_insecure_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:gravity="center_vertical"
android:textAppearance="?android:attr/textAppearanceSmall"
tools:text="The key this message was sent by is using an outdated algorithm, and is no longer considered secure!\n\nThe algorithm in use is DSA 1024 bit, which has been considered insecure since 2010."
/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:id="@+id/dialog_insecure_recommend_layout">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:textAppearance="?android:textAppearanceMedium"
android:text="@string/dialog_insecure_recommend_title"
android:id="@+id/dialog_title_2"
/>
<TextView
android:id="@+id/dialog_insecure_recommend_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:gravity="center_vertical"
android:textAppearance="?android:attr/textAppearanceSmall"
tools:text="The key in use is insecure, and cannot be updated. To communicate securely, the sender must create a new key!"
/>
</LinearLayout>
</merge>

View File

@@ -0,0 +1,94 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:layout_marginTop="24dp"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="16dp"
android:elevation="4dp"
android:background="?attr/colorPrimary"
android:gravity="center_horizontal"
tools:targetApi="lollipop">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@mipmap/ic_launcher"
/>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="24dp"
android:layout_marginRight="24dp"
android:src="@drawable/link_24dp"
/>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/icon_client_app"
tools:src="@drawable/apps_k9"
/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:orientation="vertical">
<!-- The parent properly determines the height of this scroll view, it is *not* useless -->
<ScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:overScrollMode="ifContentScrolls"
tools:ignore="UselessParent">
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingLeft="24dp"
android:paddingRight="24dp"
android:paddingTop="24dp"
android:paddingBottom="16dp"
android:id="@+id/insecure_warning_layout"
>
<include layout="@layout/dialog_insecure_generic" />
</LinearLayout>
</ScrollView>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:gravity="end"
android:padding="8dp"
tools:layout_marginBottom="50dp"
style="?buttonBarStyle">
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Got it"
android:id="@+id/button_allow"
style="?buttonBarButtonStyle" />
</LinearLayout>
</LinearLayout>

View File

@@ -1853,4 +1853,12 @@
<string name="key_expiry_text">"This key expired on <b>%1$s</b>."</string>
<string name="dialog_insecure_title">Security Warning</string>
<string name="dialog_insecure_recommend_title">Recommended Action</string>
<string name="insecure_msg_bitstrength">"The key this message was sent from is using an outdated algorithm, that is no longer considered secure!\n\nThe algorithm in use is %1$s with %2$s bitstrength, which has been considered insecure since %3$s."</string>
<string name="insecure_recom_new_key">The key in use is insecure, and cannot be updated. To communicate securely, the sender must create a new key!</string>
<string name="insecure_msg_not_whitelisted_curve">"This "</string>
<string name="insecure_msg_unidentified_key">"The key used to "</string>
<string name="insecure_recom_mdc">The sender of this message should update their OpenPGP software.</string>
<string name="insecure_msg_mdc">This message was encrypted with an insecure encryption mechanism. The encrypted message did not include a Modification Detection Code (MDC), which is necessary to ensure message integrity.</string>
</resources>