add apg's fix for Key id display

This commit is contained in:
uberspot 2014-03-19 18:28:34 +02:00
parent 52838a50c1
commit 977e76e7e4
5 changed files with 9 additions and 5 deletions

View File

@ -477,7 +477,11 @@ public class PgpKeyHelper {
* @return
*/
public static String convertKeyIdToHex(long keyId) {
return "0x" + ((keyId >> 32) > 0 ? convertKeyIdToHex32bit(keyId >> 32) : "") + convertKeyIdToHex32bit(keyId);
return "0x" + convertKeyIdToHex32bit(keyId >> 32) + convertKeyIdToHex32bit(keyId);
}
public static String convertKeyIdToHexShort(long keyId) {
return "0x" + convertKeyIdToHex32bit(keyId);
}
private static String convertKeyIdToHex32bit(long keyId) {

View File

@ -199,7 +199,7 @@ public class CertifyKeyActivity extends ActionBarActivity implements
// the first key here is our master key
if (data.moveToFirst()) {
long keyId = data.getLong(INDEX_MASTER_KEY_ID);
String keyIdStr = PgpKeyHelper.convertKeyIdToHex(keyId);
String keyIdStr = PgpKeyHelper.convertKeyIdToHexShort(keyId);
((TextView) findViewById(R.id.key_id)).setText(keyIdStr);
String mainUserId = data.getString(INDEX_USER_ID);

View File

@ -71,7 +71,7 @@ public class SelectSecretKeyLayoutFragment extends Fragment {
getActivity(), secretKeyId);
if (keyRing != null) {
PGPSecretKey key = PgpKeyHelper.getMasterKey(keyRing);
String masterkeyIdHex = PgpKeyHelper.convertKeyIdToHex(secretKeyId);
String masterkeyIdHex = PgpKeyHelper.convertKeyIdToHexShort(secretKeyId);
if (key != null) {
String userId = PgpKeyHelper.getMainUserIdSafe(getActivity(), key);

View File

@ -115,7 +115,7 @@ public class SelectKeyCursorAdapter extends HighlightQueryCursorAdapter {
// TODO: needed to key id to no?
keyId.setText(R.string.no_key);
long masterKeyId = cursor.getLong(mIndexMasterKeyId);
keyId.setText(PgpKeyHelper.convertKeyIdToHex(masterKeyId));
keyId.setText(PgpKeyHelper.convertKeyIdToHexShort(masterKeyId));
// TODO: needed to set unknown_status?
status.setText(R.string.unknown_status);

View File

@ -86,7 +86,7 @@ public class ViewKeyKeysAdapter extends CursorAdapter {
ImageView signIcon = (ImageView) view.findViewById(R.id.ic_signKey);
ImageView revokedKeyIcon = (ImageView) view.findViewById(R.id.ic_revokedKey);
String keyIdStr = PgpKeyHelper.convertKeyIdToHex(cursor.getLong(mIndexKeyId));
String keyIdStr = PgpKeyHelper.convertKeyIdToHexShort(cursor.getLong(mIndexKeyId));
String algorithmStr = PgpKeyHelper.getAlgorithmInfo(cursor.getInt(mIndexAlgorithm),
cursor.getInt(mIndexKeySize));