Show why signature was not valid, if possible

pull/172/head
M66B 5 years ago
parent 273c058f4c
commit 0bcc57f36d

@ -4850,6 +4850,7 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
}
} catch (CMSException ex) {
Log.w(ex);
args.putString("reason", ex.getMessage());
}
}
if (result != null)
@ -4984,9 +4985,15 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
boolean valid = args.getBoolean("valid");
final ArrayList<String> trace = args.getStringArrayList("trace");
if (cert == null)
Snackbar.make(view, R.string.title_signature_invalid, Snackbar.LENGTH_LONG).show();
else
if (cert == null) {
String message;
String reason = args.getString("reason");
if (TextUtils.isEmpty(reason))
message = getString(R.string.title_signature_invalid);
else
message = getString(R.string.title_signature_invalid_reason, reason);
Snackbar.make(view, message, Snackbar.LENGTH_LONG).show();
} else
try {
EntityCertificate record = EntityCertificate.from(cert, null);

@ -789,6 +789,7 @@
<string name="title_signature_valid">Message signature valid</string>
<string name="title_signature_unconfirmed">Message signature valid but not confirmed</string>
<string name="title_signature_invalid">Message signature invalid</string>
<string name="title_signature_invalid_reason">Message signature invalid: %1$s</string>
<string name="title_signature_certificate_invalid">Certificate chain invalid</string>
<string name="title_signature_sender">Sender\'s address</string>
<string name="title_signature_email">Signature\'s address</string>

Loading…
Cancel
Save