mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-14 03:39:05 +01:00
Use base32 for contact links.
This commit is contained in:
@@ -113,7 +113,8 @@ public class ContactLinkInputActivity extends BriarActivity
|
||||
}
|
||||
|
||||
private boolean isBriarLink(CharSequence s) {
|
||||
return s.length() == 72 && s.toString().startsWith("briar://");
|
||||
String regex = "^briar://[A-Z2-7]{64}$";
|
||||
return s.toString().trim().matches(regex);
|
||||
}
|
||||
|
||||
private void updateAddButtonState() {
|
||||
|
||||
@@ -19,7 +19,7 @@ import javax.annotation.Nullable;
|
||||
import static android.content.Intent.ACTION_SEND;
|
||||
import static android.content.Intent.EXTRA_TEXT;
|
||||
import static android.widget.Toast.LENGTH_SHORT;
|
||||
import static org.briarproject.bramble.util.StringUtils.getRandomString;
|
||||
import static org.briarproject.bramble.util.StringUtils.getRandomBase32String;
|
||||
|
||||
public class ContactLinkOutputActivity extends BriarActivity {
|
||||
|
||||
@@ -39,7 +39,7 @@ public class ContactLinkOutputActivity extends BriarActivity {
|
||||
ab.setDisplayHomeAsUpEnabled(true);
|
||||
}
|
||||
|
||||
String link = "briar://" + getRandomString(64);
|
||||
String link = "briar://" + getRandomBase32String(64);
|
||||
|
||||
TextView linkView = findViewById(R.id.linkView);
|
||||
linkView.setText(link);
|
||||
|
||||
Reference in New Issue
Block a user