Add support for SN verification

// FREEBIE
This commit is contained in:
Moxie Marlinspike
2017-06-06 18:03:09 -07:00
parent 58273997b9
commit 76c28cfa7a
49 changed files with 1532 additions and 250 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 294 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 217 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 354 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 492 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 628 B

View File

@@ -23,6 +23,12 @@
android:clipToPadding="false"
android:clipChildren="false">
<ViewStub android:id="@+id/unverified_banner_stub"
android:layout="@layout/conversation_activity_unverified_banner_stub"
android:inflatedId="@+id/unverified_banner"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
<ViewStub
android:id="@+id/reminder_stub"
android:layout="@layout/conversation_activity_reminderview_stub"

View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<org.thoughtcrime.securesms.components.identity.UnverifiedBannerView
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/unverified_banner"
android:layout_width="match_parent"
android:layout_height="wrap_content" />

View File

@@ -21,14 +21,31 @@
style="@style/TextSecure.TitleTextStyle"
tools:ignore="UnusedAttribute"/>
<TextView android:id="@+id/subtitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:singleLine="true"
android:ellipsize="end"
android:layout_gravity="center_vertical|start"
android:gravity="center_vertical"
android:textDirection="ltr"
style="@style/TextSecure.SubtitleTextStyle"/>
<LinearLayout android:orientation="horizontal"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_vertical">
<ImageView android:id="@+id/verified_indicator"
android:src="@drawable/ic_check_circle_white_18dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="3dp"
android:layout_gravity="bottom"
android:alpha="0.7"
android:visibility="gone"/>
<TextView android:id="@+id/subtitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:singleLine="true"
android:ellipsize="end"
android:layout_gravity="center_vertical|start"
android:gravity="center_vertical"
android:textDirection="ltr"
tools:text="(123) 123-1234"
style="@style/TextSecure.SubtitleTextStyle"/>
</LinearLayout>
</org.thoughtcrime.securesms.ConversationTitleView>

View File

@@ -0,0 +1,42 @@
<?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:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/reminder_background"
android:focusable="true"
android:nextFocusRight="@+id/cancel"
android:orientation="horizontal"
tools:visibility="visible">
<ImageView android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_gravity="center_vertical"
android:src="@drawable/ic_alert"/>
<TextView android:id="@+id/unverified_text"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:textColor="@color/white"
android:textSize="16sp"
android:layout_weight="1"
android:layout_margin="16dp"
tools:text="Your safety number with Jules Bonnot has changed and is no longer verified"/>
<ImageButton
android:id="@+id/cancel"
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_marginTop="2dp"
android:background="?selectableItemBackgroundBorderless"
android:focusable="true"
android:nextFocusLeft="@+id/container"
android:nextFocusRight="@+id/container"
android:src="@drawable/ic_close_white_24dp"
android:contentDescription="@string/InviteActivity_cancel"/>
</LinearLayout>

View File

@@ -12,17 +12,25 @@
android:background="?verification_background"
android:orientation="vertical">
<FrameLayout android:layout_width="wrap_content"
android:layout_height="wrap_content">
<FrameLayout android:layout_width="250dp"
android:layout_height="250dp">
<TextView android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:textSize="20sp"
android:text="@string/verify_display_fragment__loading"/>
<org.thoughtcrime.securesms.components.SquareImageView
android:id="@+id/qr_code"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="20dp"
android:padding="20dp"
android:background="@drawable/qr_code_background"
tools:src="@drawable/splash_logo"/>
android:visibility="invisible"
tools:src="@drawable/splash_logo"
tools:visibility="invisible"/>
<TextView android:id="@+id/tap_label"
android:layout_width="wrap_content"
@@ -31,6 +39,7 @@
android:layout_marginBottom="35dp"
android:textColor="@color/gray50"
android:textSize="11sp"
android:visibility="invisible"
android:text="@string/verify_display_fragment__tap_to_scan"/>
<org.thoughtcrime.securesms.components.SquareImageView
@@ -146,10 +155,30 @@
</TableRow>
</TableLayout>
<LinearLayout android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:paddingLeft="20dp">
<android.support.v7.widget.SwitchCompat
android:id="@+id/verified_switch"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<TextView
android:layout_marginLeft="5dp"
android:textSize="17dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/verify_display_fragment__verified"/>
</LinearLayout>
<TextView android:id="@+id/description"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="25dp"
android:layout_marginTop="15dp"
android:textSize="17sp"
android:lineSpacingExtra="3sp"
android:text="@string/verify_display_fragment__if_you_wish_to_verify_the_security_of_your_end_to_end_encryption_with_s"/>

View File

@@ -421,6 +421,10 @@
<string name="MessageRecord_you_set_disappearing_message_time_to_s">You set disappearing message time to %1$s.</string>
<string name="MessageRecord_s_set_disappearing_message_time_to_s">%1$s set disappearing message time to %2$s.</string>
<string name="MessageRecord_your_safety_number_with_s_has_changed">Your safety number with %s has changed.</string>
<string name="MessageRecord_you_marked_your_safety_number_with_s_verified">You marked your safety number with %s verified</string>
<string name="MessageRecord_you_marked_your_safety_number_with_s_verified_from_another_device">You marked your safety number with %s verified from another device</string>
<string name="MessageRecord_you_marked_your_safety_number_with_s_unverified">You marked your safety number with %s unverified</string>
<string name="MessageRecord_you_marked_your_safety_number_with_s_unverified_from_another_device">You marked your safety number with %s unverified from another device</string>
<!-- PassphraseChangeActivity -->
@@ -594,6 +598,8 @@
<string name="ThreadRecord_disappearing_message_time_updated_to_s">Disappearing message time set to %s</string>
<string name="ThreadRecord_safety_number_changed">Safety number changed</string>
<string name="ThreadRecord_your_safety_number_with_s_has_changed">Your safety number with %s has changed.</string>
<string name="ThreadRecord_you_marked_verified">You marked verified</string>
<string name="ThreadRecord_you_marked_unverified">You marked unverified</string>
<!-- UpdateApkReadyListener -->
<string name="UpdateApkReadyListener_Signal_update">Signal update</string>
@@ -851,6 +857,24 @@
</plurals>
<string name="expiration_weeks_abbreviated">%dw</string>
<!-- unverified safety numbers -->
<string name="IdentityUtil_unverified_banner_one">Your safety number with %s has changed and is no longer verified</string>
<string name="IdentityUtil_unverified_banner_two">Your safety numbers with %1$s and %2$s are no longer verified</string>
<string name="IdentityUtil_unverified_banner_many">Your safety numbers with %1$s, %2$s, and %3$s are no longer verified</string>
<string name="IdentityUtil_unverified_dialog_one">Your safety number with %1$s has changed and is no longer verified. This could either mean that someone is trying to intercept your communication, or that %1$s simply reinstalled Signal.</string>
<string name="IdentityUtil_unverified_dialog_two">Your safety numbers with %1$s and %2$s are no longer verified. This could either mean that someone is trying to intercept your communication, or that they simply reinstalled Signal.</string>
<string name="IdentityUtil_unverified_dialog_many">Your safety numbers with %1$s, %2$s, and %3$s are no longer verified. This could either mean that someone is trying to intercept your communication, or that they simply reinstalled Signal.</string>
<string name="IdentityUtil_untrusted_dialog_one">Your safety number with %s just changed.</string>
<string name="IdentityUtil_untrusted_dialog_two">Your safety number with %1$s and %2$s just changed.</string>
<string name="IdentityUtil_untrusted_dialog_many">Your safety number with %1$s, %2$s, and %3$s just changed.</string>
<plurals name="identity_others">
<item quantity="one">%d other</item>
<item quantity="other">%d others</item>
</plurals>
<!-- giphy_activity -->
<string name="giphy_activity_toolbar__search_gifs_and_stickers">Search GIFs and stickers</string>
@@ -1022,8 +1046,10 @@
<string name="recipients_panel__add_members">Add members</string>
<!-- verify_display_fragment -->
<string name="verify_display_fragment__if_you_wish_to_verify_the_security_of_your_end_to_end_encryption_with_s"><![CDATA[If you wish to verify the security of your end-to-end encryption with %s, compare the number above with the number on their device. Alternatively, you can scan the code on their phone, or ask them to scan your code. <a href="https://whispersystems.org/redirect/safety-numbers">Learn more about verifying safety numbers</a>]]></string>
<string name="verify_display_fragment__if_you_wish_to_verify_the_security_of_your_end_to_end_encryption_with_s"><![CDATA[If you wish to verify the security of your encryption with %s, compare the number above with the number on their device. Alternatively, you can scan the code on their phone, or ask them to scan your code. <a href="https://whispersystems.org/redirect/safety-numbers">Learn more.</a>]]></string>
<string name="verify_display_fragment__tap_to_scan">Tap to scan</string>
<string name="verify_display_fragment__loading">Loading...</string>
<string name="verify_display_fragment__verified">Verified</string>
<!-- verify_identity -->
<string name="verify_identity__share_safety_number">Share safety number</string>
@@ -1375,6 +1401,10 @@
<!-- transport_selection_list_item -->
<string name="transport_selection_list_item__transport_icon">Transport icon</string>
<string name="UntrustedSendDialog_send_message">Send message?</string>
<string name="UntrustedSendDialog_send">Send</string>
<string name="UnverifiedSendDialog_send_message">Send message?</string>
<string name="UnverifiedSendDialog_send">Send</string>
<!-- EOF -->