Adapt prettifyFingerprint() to axolotl FP sizes
This commit is contained in:
		
							parent
							
								
									4b0279a6ef
								
							
						
					
					
						commit
						30403a70f2
					
				| 
						 | 
				
			
			@ -387,7 +387,7 @@ public class ContactDetailsActivity extends XmppActivity implements OnAccountUpd
 | 
			
		|||
					.findViewById(R.id.button_remove);
 | 
			
		||||
			remove.setVisibility(View.VISIBLE);
 | 
			
		||||
			keyType.setText("Axolotl Fingerprint");
 | 
			
		||||
			key.setText(identityKey.getFingerprint());
 | 
			
		||||
			key.setText(CryptoHelper.prettifyFingerprint(identityKey.getFingerprint()));
 | 
			
		||||
			keys.addView(view);
 | 
			
		||||
			remove.setOnClickListener(new OnClickListener() {
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -94,11 +94,10 @@ public final class CryptoHelper {
 | 
			
		|||
		if (fingerprint.length() < 40) {
 | 
			
		||||
			return fingerprint;
 | 
			
		||||
		}
 | 
			
		||||
		StringBuilder builder = new StringBuilder(fingerprint);
 | 
			
		||||
		builder.insert(8, " ");
 | 
			
		||||
		builder.insert(17, " ");
 | 
			
		||||
		builder.insert(26, " ");
 | 
			
		||||
		builder.insert(35, " ");
 | 
			
		||||
		StringBuilder builder = new StringBuilder(fingerprint.replaceAll("\\s",""));
 | 
			
		||||
		for(int i=8;i<builder.length();i+=9) {
 | 
			
		||||
			builder.insert(i, ' ');
 | 
			
		||||
		}
 | 
			
		||||
		return builder.toString();
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue