mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-21 15:19:53 +01:00
Accept any six-digit invitation/confirmation code.
Rejecting codes greater than 2^19 - 1 creates a confusing user experience.
This commit is contained in:
@@ -5,7 +5,6 @@ import static android.text.InputType.TYPE_CLASS_NUMBER;
|
|||||||
import static android.view.Gravity.CENTER;
|
import static android.view.Gravity.CENTER;
|
||||||
import static android.view.Gravity.CENTER_HORIZONTAL;
|
import static android.view.Gravity.CENTER_HORIZONTAL;
|
||||||
import static android.view.inputmethod.InputMethodManager.HIDE_IMPLICIT_ONLY;
|
import static android.view.inputmethod.InputMethodManager.HIDE_IMPLICIT_ONLY;
|
||||||
import static net.sf.briar.api.plugins.InvitationConstants.MAX_CODE;
|
|
||||||
import net.sf.briar.R;
|
import net.sf.briar.R;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.view.KeyEvent;
|
import android.view.KeyEvent;
|
||||||
@@ -83,7 +82,6 @@ OnEditorActionListener, OnClickListener {
|
|||||||
} catch(NumberFormatException e) {
|
} catch(NumberFormatException e) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if(remoteCode < 0 || remoteCode > MAX_CODE) return false;
|
|
||||||
// Hide the soft keyboard
|
// Hide the soft keyboard
|
||||||
Object o = getContext().getSystemService(INPUT_METHOD_SERVICE);
|
Object o = getContext().getSystemService(INPUT_METHOD_SERVICE);
|
||||||
((InputMethodManager) o).toggleSoftInput(HIDE_IMPLICIT_ONLY, 0);
|
((InputMethodManager) o).toggleSoftInput(HIDE_IMPLICIT_ONLY, 0);
|
||||||
|
|||||||
@@ -2,14 +2,12 @@ package net.sf.briar.api.plugins;
|
|||||||
|
|
||||||
public interface InvitationConstants {
|
public interface InvitationConstants {
|
||||||
|
|
||||||
long CONNECTION_TIMEOUT = 15 * 1000; // Milliseconds
|
long CONNECTION_TIMEOUT = 30 * 1000; // Milliseconds
|
||||||
|
|
||||||
long CONFIRMATION_TIMEOUT = 60 * 1000; // Milliseconds
|
long CONFIRMATION_TIMEOUT = 60 * 1000; // Milliseconds
|
||||||
|
|
||||||
int CODE_BITS = 19; // Codes must fit into six decimal digits
|
int CODE_BITS = 19; // Codes must fit into six decimal digits
|
||||||
|
|
||||||
int MAX_CODE = (1 << CODE_BITS) - 1; // 524287
|
|
||||||
|
|
||||||
int HASH_LENGTH = 48; // Bytes
|
int HASH_LENGTH = 48; // Bytes
|
||||||
|
|
||||||
int MAX_PUBLIC_KEY_LENGTH = 97; // Bytes
|
int MAX_PUBLIC_KEY_LENGTH = 97; // Bytes
|
||||||
|
|||||||
Reference in New Issue
Block a user