Removed + control for Phone Numbers, Added Tests for TT, Added TARGET STOP/CANCEL command
This commit is contained in:
parent
f26e683dbe
commit
46270d87e2
2 changed files with 3 additions and 1 deletions
|
@ -37,8 +37,9 @@ public class AuthRequest {
|
||||||
log.debug("Already processed");
|
log.debug("Already processed");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
//if (false) { //F. Casellato - I test SMS with master phone that sends commands to itself. I found only this way to di this...
|
||||||
if (!confirmCode.equals(codeReceived)) {
|
if (!confirmCode.equals(codeReceived)) {
|
||||||
processed = true;
|
processed = true;
|
||||||
if (L.isEnabled(L.SMS))
|
if (L.isEnabled(L.SMS))
|
||||||
log.debug("Wrong code");
|
log.debug("Wrong code");
|
||||||
plugin.sendSMS(new Sms(requester.phoneNumber, R.string.sms_wrongcode));
|
plugin.sendSMS(new Sms(requester.phoneNumber, R.string.sms_wrongcode));
|
||||||
|
|
|
@ -887,6 +887,7 @@ object SmsCommunicatorPlugin : PluginBase(PluginDescription()
|
||||||
private fun generatePasscode(): String {
|
private fun generatePasscode(): String {
|
||||||
val startChar1 = 'A'.toInt() // on iphone 1st char is uppercase :)
|
val startChar1 = 'A'.toInt() // on iphone 1st char is uppercase :)
|
||||||
var passCode = Character.toString((startChar1 + Math.random() * ('z' - 'a' + 1)).toChar())
|
var passCode = Character.toString((startChar1 + Math.random() * ('z' - 'a' + 1)).toChar())
|
||||||
|
//For Milos: may we have only 'a'.toInt() for the 2nd and 3rd chars? Upper letters are uncomfortable here
|
||||||
val startChar2: Int = if (Math.random() > 0.5) 'a'.toInt() else 'A'.toInt()
|
val startChar2: Int = if (Math.random() > 0.5) 'a'.toInt() else 'A'.toInt()
|
||||||
passCode += Character.toString((startChar2 + Math.random() * ('z' - 'a' + 1)).toChar())
|
passCode += Character.toString((startChar2 + Math.random() * ('z' - 'a' + 1)).toChar())
|
||||||
val startChar3: Int = if (Math.random() > 0.5) 'a'.toInt() else 'A'.toInt()
|
val startChar3: Int = if (Math.random() > 0.5) 'a'.toInt() else 'A'.toInt()
|
||||||
|
|
Loading…
Reference in a new issue