integrated key server look-up into decrypt Activity, allowing to touch an unkown signature to import the key
Update issue 39 added: <string name="unknownSignatureKeyTouchToLookUp">Unknown signature, touch to look up key.</string>
This commit is contained in:
@@ -28,6 +28,7 @@ import java.util.regex.Matcher;
|
||||
|
||||
import org.bouncycastle2.jce.provider.BouncyCastleProvider;
|
||||
import org.bouncycastle2.openpgp.PGPException;
|
||||
import org.bouncycastle2.openpgp.PGPPublicKeyRing;
|
||||
import org.thialfihar.android.apg.provider.DataProvider;
|
||||
|
||||
import android.app.Dialog;
|
||||
@@ -276,6 +277,21 @@ public class DecryptActivity extends BaseActivity {
|
||||
}
|
||||
|
||||
mSignatureLayout.setVisibility(View.GONE);
|
||||
mSignatureLayout.setOnClickListener(new OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (mSignatureKeyId == 0) {
|
||||
return;
|
||||
}
|
||||
PGPPublicKeyRing key = Apg.getPublicKeyRing(mSignatureKeyId);
|
||||
if (key != null) {
|
||||
Intent intent = new Intent(DecryptActivity.this, KeyServerQueryActivity.class);
|
||||
intent.setAction(Apg.Intent.LOOK_UP_KEY_ID);
|
||||
intent.putExtra(Apg.EXTRA_KEY_ID, mSignatureKeyId);
|
||||
startActivity(intent);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
mDecryptButton.setOnClickListener(new OnClickListener() {
|
||||
@Override
|
||||
@@ -599,6 +615,7 @@ public class DecryptActivity extends BaseActivity {
|
||||
mSignatureStatusImage.setImageResource(R.drawable.overlay_ok);
|
||||
} else if (data.getBoolean(Apg.EXTRA_SIGNATURE_UNKNOWN)) {
|
||||
mSignatureStatusImage.setImageResource(R.drawable.overlay_error);
|
||||
Toast.makeText(this, R.string.unknownSignatureKeyTouchToLookUp, Toast.LENGTH_LONG).show();
|
||||
} else {
|
||||
mSignatureStatusImage.setImageResource(R.drawable.overlay_error);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user