Fix issue with wifi passwords >16 chars
Wasn't calculating their length in hex properly Bug:17369745 Change-Id: I7652c10a2e0704877ad113fcbc04007845a862e3
This commit is contained in:
@@ -125,7 +125,7 @@ class WriteWifiConfigToNfcDialog extends AlertDialog
|
|||||||
String passwordHex = byteArrayToHexString(password.getBytes());
|
String passwordHex = byteArrayToHexString(password.getBytes());
|
||||||
|
|
||||||
String passwordLength = password.length() >= HEX_RADIX
|
String passwordLength = password.length() >= HEX_RADIX
|
||||||
? "" + Character.forDigit(password.length(), HEX_RADIX)
|
? Integer.toString(password.length(), HEX_RADIX)
|
||||||
: "0" + Character.forDigit(password.length(), HEX_RADIX);
|
: "0" + Character.forDigit(password.length(), HEX_RADIX);
|
||||||
|
|
||||||
passwordHex = String.format(PASSWORD_FORMAT, passwordLength, passwordHex).toUpperCase();
|
passwordHex = String.format(PASSWORD_FORMAT, passwordLength, passwordHex).toUpperCase();
|
||||||
|
Reference in New Issue
Block a user