From 46270d87e2052db695e3b6ffc56abfbf34ea5f1f Mon Sep 17 00:00:00 2001 From: fabriziocasellato Date: Fri, 22 Nov 2019 16:41:09 +0100 Subject: [PATCH] Removed + control for Phone Numbers, Added Tests for TT, Added TARGET STOP/CANCEL command --- .../plugins/general/smsCommunicator/AuthRequest.java | 3 ++- .../plugins/general/smsCommunicator/SmsCommunicatorPlugin.kt | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/smsCommunicator/AuthRequest.java b/app/src/main/java/info/nightscout/androidaps/plugins/general/smsCommunicator/AuthRequest.java index 45cd824743..40216dda30 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/smsCommunicator/AuthRequest.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/smsCommunicator/AuthRequest.java @@ -37,8 +37,9 @@ public class AuthRequest { log.debug("Already processed"); 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)) { - processed = true; + processed = true; if (L.isEnabled(L.SMS)) log.debug("Wrong code"); plugin.sendSMS(new Sms(requester.phoneNumber, R.string.sms_wrongcode)); diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/smsCommunicator/SmsCommunicatorPlugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/smsCommunicator/SmsCommunicatorPlugin.kt index 63848dd915..4094cc1c39 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/smsCommunicator/SmsCommunicatorPlugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/smsCommunicator/SmsCommunicatorPlugin.kt @@ -887,6 +887,7 @@ object SmsCommunicatorPlugin : PluginBase(PluginDescription() private fun generatePasscode(): String { val startChar1 = 'A'.toInt() // on iphone 1st char is uppercase :) 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() passCode += Character.toString((startChar2 + Math.random() * ('z' - 'a' + 1)).toChar()) val startChar3: Int = if (Math.random() > 0.5) 'a'.toInt() else 'A'.toInt()