Show PGP signature status

pull/156/head
M66B 6 years ago
parent 8b4f9246c7
commit 822515623c

@ -74,6 +74,7 @@ import com.google.android.material.snackbar.Snackbar;
import org.json.JSONArray;
import org.json.JSONObject;
import org.openintents.openpgp.OpenPgpError;
import org.openintents.openpgp.OpenPgpSignatureResult;
import org.openintents.openpgp.util.OpenPgpApi;
import org.openintents.openpgp.util.OpenPgpServiceConnection;
@ -100,6 +101,9 @@ import javax.mail.Session;
import javax.mail.internet.MimeMessage;
import javax.net.ssl.HttpsURLConnection;
import static org.openintents.openpgp.OpenPgpSignatureResult.RESULT_NO_SIGNATURE;
import static org.openintents.openpgp.OpenPgpSignatureResult.RESULT_VALID_KEY_CONFIRMED;
public class ActivityView extends ActivityBilling implements FragmentManager.OnBackStackChangedListener {
private String startup;
@ -1445,6 +1449,18 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB
}
}
// Check signature status
OpenPgpSignatureResult sigResult = result.getParcelableExtra(OpenPgpApi.RESULT_SIGNATURE);
int sresult = (sigResult == null ? RESULT_NO_SIGNATURE : sigResult.getResult());
int resid;
if (sresult == RESULT_NO_SIGNATURE)
resid = R.string.title_signature_none;
else if (sresult == RESULT_VALID_KEY_CONFIRMED)
resid = R.string.title_signature_valid;
else
resid = R.string.title_signature_invalid;
Snackbar.make(getVisibleView(), resid, Snackbar.LENGTH_LONG).show();
break;
case OpenPgpApi.RESULT_CODE_USER_INTERACTION_REQUIRED:

@ -500,6 +500,10 @@
<string name="title_no_openpgp">OpenKeychain not found</string>
<string name="title_not_encrypted">Message is not encrypted</string>
<string name="title_signature_none">Message not signed</string>
<string name="title_signature_valid">Message signature valid</string>
<string name="title_signature_invalid">Message signature invalid</string>
<string name="title_search">Search</string>
<string name="title_search_in">Search in</string>
<string name="title_searching">Searching \'%1$s\'</string>

Loading…
Cancel
Save