From 14a8586e8c132aa1c217225e1d78b7185af3b7c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Sch=C3=BCrmann?= Date: Tue, 15 Apr 2014 22:37:36 +0200 Subject: Improve verification result display, close #568 --- .../keychain/ui/DecryptFragment.java | 42 ++++++-- .../src/main/res/layout/decrypt_file_fragment.xml | 120 +++++++++++---------- .../main/res/layout/decrypt_message_fragment.xml | 97 +++++++++-------- .../src/main/res/layout/decrypt_result_include.xml | 85 +++++++++++++++ .../main/res/layout/decrypt_signature_include.xml | 77 ------------- OpenKeychain/src/main/res/values/colors.xml | 8 +- OpenKeychain/src/main/res/values/strings.xml | 24 +++-- 7 files changed, 257 insertions(+), 196 deletions(-) create mode 100644 OpenKeychain/src/main/res/layout/decrypt_result_include.xml delete mode 100644 OpenKeychain/src/main/res/layout/decrypt_signature_include.xml (limited to 'OpenKeychain') diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/DecryptFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/DecryptFragment.java index 2254029df..71a5f3ad5 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/DecryptFragment.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/DecryptFragment.java @@ -31,7 +31,6 @@ import android.widget.RelativeLayout; import android.widget.TextView; import com.beardedhen.androidbootstrap.BootstrapButton; -import com.devspark.appmsg.AppMsg; import org.openintents.openpgp.OpenPgpSignatureResult; import org.sufficientlysecure.keychain.R; @@ -73,11 +72,6 @@ public class DecryptFragment extends Fragment { } }); mResultLayout.setVisibility(View.GONE); - mResultLayout.setOnClickListener(new OnClickListener() { - public void onClick(View v) { - lookupUnknownKey(mSignatureKeyId); - } - }); } private void lookupUnknownKey(long unknownKeyId) { @@ -119,7 +113,7 @@ public class DecryptFragment extends Fragment { String userId = signatureResult.getUserId(); String[] userIdSplit = PgpKeyHelper.splitUserId(userId); if (userIdSplit[0] != null) { - mUserId.setText(userId); + mUserId.setText(userIdSplit[0]); } else { mUserId.setText(R.string.user_id_no_name); } @@ -132,37 +126,63 @@ public class DecryptFragment extends Fragment { switch (signatureResult.getStatus()) { case OpenPgpSignatureResult.SIGNATURE_SUCCESS_CERTIFIED: { - mResultText.setText(R.string.decrypt_verified_successful); + if (signatureResult.isSignatureOnly()) { + mResultText.setText(R.string.decrypt_result_signature_certified); + } else { + mResultText.setText(R.string.decrypt_result_decrypted_and_signature_certified); + } mResultLayout.setBackgroundColor(getResources().getColor(R.color.result_green)); mSignatureStatusImage.setImageResource(R.drawable.overlay_ok); + mSignatureLayout.setVisibility(View.VISIBLE); mLookupKey.setVisibility(View.GONE); break; } case OpenPgpSignatureResult.SIGNATURE_SUCCESS_UNCERTIFIED: { - mResultText.setText(R.string.decrypt_verified_successful); + if (signatureResult.isSignatureOnly()) { + mResultText.setText(R.string.decrypt_result_signature_uncertified); + } else { + mResultText.setText(R.string.decrypt_result_decrypted_and_signature_uncertified); + } mResultLayout.setBackgroundColor(getResources().getColor(R.color.result_orange)); mSignatureStatusImage.setImageResource(R.drawable.overlay_ok); + mSignatureLayout.setVisibility(View.VISIBLE); mLookupKey.setVisibility(View.GONE); break; } case OpenPgpSignatureResult.SIGNATURE_UNKNOWN_PUB_KEY: { - mResultText.setText(R.string.unknown_signature); + if (signatureResult.isSignatureOnly()) { + mResultText.setText(R.string.decrypt_result_signature_unknown_pub_key); + } else { + mResultText.setText(R.string.decrypt_result_decrypted_unknown_pub_key); + } mResultLayout.setBackgroundColor(getResources().getColor(R.color.result_orange)); mSignatureStatusImage.setImageResource(R.drawable.overlay_error); + mSignatureLayout.setVisibility(View.VISIBLE); mLookupKey.setVisibility(View.VISIBLE); break; } + case OpenPgpSignatureResult.SIGNATURE_ERROR: { + mResultText.setText(R.string.decrypt_result_invalid_signature); + + mResultLayout.setBackgroundColor(getResources().getColor(R.color.result_red)); + mSignatureStatusImage.setImageResource(R.drawable.overlay_error); + mSignatureLayout.setVisibility(View.GONE); + mLookupKey.setVisibility(View.GONE); + break; + } + default: { mResultText.setText(R.string.error); mResultLayout.setBackgroundColor(getResources().getColor(R.color.result_red)); mSignatureStatusImage.setImageResource(R.drawable.overlay_error); + mSignatureLayout.setVisibility(View.GONE); mLookupKey.setVisibility(View.GONE); break; } @@ -172,7 +192,7 @@ public class DecryptFragment extends Fragment { // only successful decryption mResultLayout.setBackgroundColor(getResources().getColor(R.color.result_blue)); - mResultText.setText(R.string.decrypt_successful); + mResultText.setText(R.string.decrypt_result_decrypted); } } diff --git a/OpenKeychain/src/main/res/layout/decrypt_file_fragment.xml b/OpenKeychain/src/main/res/layout/decrypt_file_fragment.xml index 633c9c832..597652713 100644 --- a/OpenKeychain/src/main/res/layout/decrypt_file_fragment.xml +++ b/OpenKeychain/src/main/res/layout/decrypt_file_fragment.xml @@ -8,74 +8,86 @@ - + + + + android:layout_height="match_parent" + android:paddingTop="4dp" + android:paddingLeft="16dp" + android:paddingRight="16dp" + android:orientation="vertical"> - + android:orientation="horizontal"> - - + - + + - - - + android:text="@string/label_delete_after_decryption" /> - + android:layout_height="match_parent"> + + - + + + + \ No newline at end of file diff --git a/OpenKeychain/src/main/res/layout/decrypt_message_fragment.xml b/OpenKeychain/src/main/res/layout/decrypt_message_fragment.xml index dfe1bf64a..831d7e888 100644 --- a/OpenKeychain/src/main/res/layout/decrypt_message_fragment.xml +++ b/OpenKeychain/src/main/res/layout/decrypt_message_fragment.xml @@ -8,59 +8,72 @@ - + - - - + android:background="?android:attr/listDivider" /> + android:layout_height="match_parent" + android:paddingTop="4dp" + android:paddingLeft="16dp" + android:paddingRight="16dp" + android:orientation="vertical"> + - + android:layout_height="0dip" + android:gravity="top" + android:hint="@string/decrypt_content_edit_text_hint" + android:inputType="text|textCapSentences|textMultiLine|textLongMessage" + android:scrollHorizontally="true" + android:layout_weight="1" /> + + - + android:layout_height="wrap_content" + android:orientation="horizontal"> + + + + + diff --git a/OpenKeychain/src/main/res/layout/decrypt_result_include.xml b/OpenKeychain/src/main/res/layout/decrypt_result_include.xml new file mode 100644 index 000000000..6e599807d --- /dev/null +++ b/OpenKeychain/src/main/res/layout/decrypt_result_include.xml @@ -0,0 +1,85 @@ + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/OpenKeychain/src/main/res/layout/decrypt_signature_include.xml b/OpenKeychain/src/main/res/layout/decrypt_signature_include.xml deleted file mode 100644 index 70faa6e83..000000000 --- a/OpenKeychain/src/main/res/layout/decrypt_signature_include.xml +++ /dev/null @@ -1,77 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/OpenKeychain/src/main/res/values/colors.xml b/OpenKeychain/src/main/res/values/colors.xml index f03d316db..0f0b2a600 100644 --- a/OpenKeychain/src/main/res/values/colors.xml +++ b/OpenKeychain/src/main/res/values/colors.xml @@ -4,8 +4,8 @@ #31b6e7 #cecbce - #CC0000 - #FF8800 - #669900 - #336699 + #FF4444 + #FFBB33 + #99CC00 + #33B5E5 \ No newline at end of file diff --git a/OpenKeychain/src/main/res/values/strings.xml b/OpenKeychain/src/main/res/values/strings.xml index 3a73735cd..1cb4da986 100644 --- a/OpenKeychain/src/main/res/values/strings.xml +++ b/OpenKeychain/src/main/res/values/strings.xml @@ -209,8 +209,6 @@ Are you sure you want to delete\n%s? Successfully deleted. Select a file first. - Successfully decrypted. - Successfully decrypted and/or verified. Successfully signed and/or encrypted. Successfully signed and/or encrypted to clipboard. Enter the passphrase twice. @@ -258,7 +256,6 @@ Found %d keys. - Unknown signature, click button to lookup the missing key. %d bad secret key ignored. Perhaps you exported with the option\n --export-secret-subkeys\nMake sure you export with\n --export-secret-keys\ninstead. @@ -295,7 +292,6 @@ main user id must not be empty need at least a master key no encryption keys or passphrase given - signature failed no passphrase given no signature key given not valid encryption data @@ -305,14 +301,16 @@ wrong passphrase error saving some keys could not extract private key - Direct binary data without actual file in filesystem is not supported. This is only supported by ACTION_ENCRYPT_STREAM_AND_RETURN. - You need Android 4.1 alias Jelly Bean to use Androids NFC Beam feature! - NFC is not available on your device! - Nothing to import! expiry date must come after creation date please save the keyring first you can not delete this contact because it is your own. you can not delete the following contacts because they are your own:\n%s + + + Direct binary data without actual file in filesystem is not supported. This is only supported by ACTION_ENCRYPT_STREAM_AND_RETURN. + You need Android 4.1 alias Jelly Bean to use Androids NFC Beam feature! + NFC is not available on your device! + Nothing to import! Insufficient server query Querying keyserver failed Too many responses @@ -328,6 +326,16 @@ You must make changes to the keyring before you can save it + + Invalid signature! + Unknown public key + Valid signature (uncertified) + Valid signature (certified) + Successfully decrypted + Successfully decrypted but unknown public key + Successfully decrypted and valid signature (uncertified) + Successfully decrypted and valid signature (certified) + Done. Cancel -- cgit v1.2.3