mirror of
https://github.com/moparisthebest/Conversations
synced 2024-11-25 02:02:16 -05:00
Adapt prettifyFingerprint() to axolotl FP sizes
This commit is contained in:
parent
491f623708
commit
8fd46d40d6
@ -387,7 +387,7 @@ public class ContactDetailsActivity extends XmppActivity implements OnAccountUpd
|
|||||||
.findViewById(R.id.button_remove);
|
.findViewById(R.id.button_remove);
|
||||||
remove.setVisibility(View.VISIBLE);
|
remove.setVisibility(View.VISIBLE);
|
||||||
keyType.setText("Axolotl Fingerprint");
|
keyType.setText("Axolotl Fingerprint");
|
||||||
key.setText(identityKey.getFingerprint());
|
key.setText(CryptoHelper.prettifyFingerprint(identityKey.getFingerprint()));
|
||||||
keys.addView(view);
|
keys.addView(view);
|
||||||
remove.setOnClickListener(new OnClickListener() {
|
remove.setOnClickListener(new OnClickListener() {
|
||||||
|
|
||||||
|
@ -96,11 +96,10 @@ public final class CryptoHelper {
|
|||||||
} else if (fingerprint.length() < 40) {
|
} else if (fingerprint.length() < 40) {
|
||||||
return fingerprint;
|
return fingerprint;
|
||||||
}
|
}
|
||||||
StringBuilder builder = new StringBuilder(fingerprint);
|
StringBuilder builder = new StringBuilder(fingerprint.replaceAll("\\s",""));
|
||||||
builder.insert(8, " ");
|
for(int i=8;i<builder.length();i+=9) {
|
||||||
builder.insert(17, " ");
|
builder.insert(i, ' ');
|
||||||
builder.insert(26, " ");
|
}
|
||||||
builder.insert(35, " ");
|
|
||||||
return builder.toString();
|
return builder.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user