From c7e1338d660deaedfc729616b53d535edad9e3db Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Thu, 26 Dec 2019 18:52:09 +0100 Subject: [PATCH 1/6] Leaked certificate update --- app/src/main/assets/revoked_certs.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/assets/revoked_certs.txt b/app/src/main/assets/revoked_certs.txt index 59a55d9e42..41177d5667 100644 --- a/app/src/main/assets/revoked_certs.txt +++ b/app/src/main/assets/revoked_certs.txt @@ -1,2 +1,4 @@ #Demo certificate -51:6D:12:67:4C:27:F4:9B:9F:E5:42:9B:01:B3:98:E4:66:2B:85:B7:A8:DD:70:32:B7:6A:D7:97:9A:0D:97:10 \ No newline at end of file +51:6D:12:67:4C:27:F4:9B:9F:E5:42:9B:01:B3:98:E4:66:2B:85:B7:A8:DD:70:32:B7:6A:D7:97:9A:0D:97:10 +#Leaked +55:5D:70:C9:BE:10:41:7E:4B:01:A9:C4:C6:44:4A:F8:69:71:35:25:ED:95:23:16:C7:15:E8:EB:C6:08:FC:B1 From bff51df41de84cba955e3951caa97dc42ff81e1b Mon Sep 17 00:00:00 2001 From: osodebailar Date: Mon, 30 Dec 2019 11:02:26 +0100 Subject: [PATCH 2/6] issue #2318 Refactor header area destroys layout on Atom . Fixed small_layout to 'extra small' displays like atom --- .../layout/overview_fragment_smallheight.xml | 54 +++++++++---------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/app/src/main/res/layout/overview_fragment_smallheight.xml b/app/src/main/res/layout/overview_fragment_smallheight.xml index 55ca13a291..e892e565cd 100644 --- a/app/src/main/res/layout/overview_fragment_smallheight.xml +++ b/app/src/main/res/layout/overview_fragment_smallheight.xml @@ -105,7 +105,7 @@ android:orientation="horizontal"> @@ -120,9 +120,9 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_vertical" - android:layout_marginStart="6dp" + android:layout_marginStart="2dp" android:text="00.0" - android:textSize="42sp" + android:textSize="28sp" android:textStyle="bold" /> @@ -152,7 +152,7 @@ android:id="@+id/overview_timeago" android:layout_width="match_parent" android:layout_height="wrap_content" - android:layout_marginStart="8dp" + android:layout_marginStart="6dp" android:layout_marginTop="-2dp" android:paddingStart="2dp" android:layout_weight="0.5" @@ -166,7 +166,7 @@ android:layout_marginTop="-2dp" android:paddingStart="2dp" android:layout_weight="0.5" - android:textSize="14sp" /> + android:textSize="12sp" /> @@ -193,24 +193,24 @@ + android:textSize="14sp" /> + android:textSize="14sp" /> @@ -222,7 +222,7 @@ @@ -231,15 +231,15 @@ android:layout_width="5dp" android:layout_height="wrap_content" android:text=":" - android:textSize="16sp" /> + android:textSize="14sp" /> @@ -252,24 +252,24 @@ + android:textSize="14sp" /> + android:textSize="14sp" /> @@ -281,24 +281,24 @@ + android:textSize="14sp" /> + android:textSize="14sp" /> From 1b513cabbd42a0103e76778e3b6534821d4590af Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Wed, 1 Jan 2020 23:40:54 +0100 Subject: [PATCH 3/6] New Crowdin translations (#2316) * New translations strings.xml (Portuguese, Brazilian) * New translations strings.xml (Swedish) * New translations strings.xml (Portuguese) * New translations strings.xml (French) * New translations strings.xml (French) * New translations strings.xml (Russian) * New translations strings.xml (Italian) * New translations strings.xml (German) * New translations strings.xml (French) --- app/src/main/res/values-fr-rFR/strings.xml | 12 +-- wear/src/main/res/values-de-rDE/strings.xml | 1 + wear/src/main/res/values-it-rIT/strings.xml | 1 + wear/src/main/res/values-pt-rBR/strings.xml | 92 +++++++++++++++++++++ wear/src/main/res/values-pt-rPT/strings.xml | 1 + wear/src/main/res/values-ru-rRU/strings.xml | 1 + wear/src/main/res/values-sv-rSE/strings.xml | 1 + 7 files changed, 103 insertions(+), 6 deletions(-) diff --git a/app/src/main/res/values-fr-rFR/strings.xml b/app/src/main/res/values-fr-rFR/strings.xml index 138c0b9984..ce65634dd9 100644 --- a/app/src/main/res/values-fr-rFR/strings.xml +++ b/app/src/main/res/values-fr-rFR/strings.xml @@ -1002,7 +1002,7 @@ L\'ENSEMBLE DES RISQUES LIÉS À LA QUALITÉ ET À LA PERFORMANCE DU PROGRAMME S Pas de données d\'Autosens disponibles Paramètres journal Réinitialiser les valeurs par défaut - Dysfonctionnement du NSClient. Considérerez une réinitialisation de NS et de NSClient. + Dysfonctionnement NSClient. Faites une réinitialisation de NS et de NSClient. AS Version %1$s disponible Décalage horaire @@ -1197,13 +1197,13 @@ L\'ENSEMBLE DES RISQUES LIÉS À LA QUALITÉ ET À LA PERFORMANCE DU PROGRAMME S Début du profil %1$d%% existe n\'existe pas - Temp cible %1$s + Cible Temp. %1$s SSID WiFi %1$s %2$s Autosens %1$s %2$s %% Autosens % %3$s %1$s %2$s - Différence de glycémies - Différence Glycémie [%1$s] + Delta de glycémies + Delta Glyc. [%1$s] Localisation actuelle Localisation Lat : @@ -1364,8 +1364,8 @@ L\'ENSEMBLE DES RISQUES LIÉS À LA QUALITÉ ET À LA PERFORMANCE DU PROGRAMME S Remplacer le profil par Remplacer le profil par %1$s Dernière connexion à la pompe - Dernière connexion de pompe [minutes] - Dernière connexion à la pompe %1$s il y a %2$s min + Dernière connexion [min] + Dernière connexion pompe %1$s il y a %2$s min Envoyer SMS : %1$s Envoyer SMS à tous les numéros Envoyer SMS avec du texte diff --git a/wear/src/main/res/values-de-rDE/strings.xml b/wear/src/main/res/values-de-rDE/strings.xml index e2c73ab174..79f1d5a568 100644 --- a/wear/src/main/res/values-de-rDE/strings.xml +++ b/wear/src/main/res/values-de-rDE/strings.xml @@ -51,6 +51,7 @@ Niedrig Mittel Hoch + Auto Große Zahlen Ring BZ-Historie Ring BZ-Historie light diff --git a/wear/src/main/res/values-it-rIT/strings.xml b/wear/src/main/res/values-it-rIT/strings.xml index f06b29fcd5..5247ee0674 100644 --- a/wear/src/main/res/values-it-rIT/strings.xml +++ b/wear/src/main/res/values-it-rIT/strings.xml @@ -51,6 +51,7 @@ Basso Medio Alto + Auto Numeri grandi Storico Ring Storico Light Ring diff --git a/wear/src/main/res/values-pt-rBR/strings.xml b/wear/src/main/res/values-pt-rBR/strings.xml index 4659b21c65..29e4e9741b 100644 --- a/wear/src/main/res/values-pt-rBR/strings.xml +++ b/wear/src/main/res/values-pt-rBR/strings.xml @@ -8,10 +8,102 @@ AAPS(GrafGrande) AAPS(SemGraf) AAPS(Círculo) + AAPSv2 + AAPS(Cockpit) + AAPS(Steampunk) Sem dados! Dados antigos! Desde %1$s Sincronizar com AAPS! Nenhum dado recebido desde %1$s! Confira se o AAPS no telefone envia dados para o relógio Dados AAPS são %1$s antigos! Verifique sensor, xDrip+, NS, configuração AAPS ou outra! + Lig. + Desl. + Vibrar no Bólus + Unidades para Acções + Mostrar Data + Mostrar IOB + Mostrar COB + Mostrar Delta + Mostrar MedDelta + Mostrar Bateria Telefone + Mostrar Bateria Equipamento + Mostrar Taxa Basal + Mostrar Estado Loop + Mostrar Glic. + Mostrar Seta Direcção + Mostrar Atrás + Escuro + Destacar Basais + Divisor correspondente + Cronograma do Gráfico + 1 hora + 2 horas + 3 horas + 4 horas + 5 horas + Design de Entrada + Padrão + Rápido Direito + Rápido Esquerdo + Moderno Esparso + Delta Granularidade (Steampunk) + Baixo + Médio + Alto + Números Grandes + Anel Histórico + Anel Suave Histórico + Animações + Assistente no Menu + Purgar no Menu + Alvo Único + Assistente Percentagem + Complicação de Toque + Unicode em Complicações + Versão: + AlvoT + Assistente + Bólus + eCarb + Definições + Estado + Purgar/Preencher + Nenhum + Padrão + Menu + duração + alvo + hipo + hiper + hidratos + percentagem + iniciar [min] + duração [h] + insulina + Predefinição 1 + Predefinição 2 + Predefinição 3 + Valor livre + CONFIRMAR + ESTADO BOMBA + ESTADO LOOP + alteração turno + TDD ponderada + bólus + Bomba + Loop + CPP + TDD + Hidratos + IOB + sem estado + mg/dL + mmol/L + g + U + U/h + h + d + s diff --git a/wear/src/main/res/values-pt-rPT/strings.xml b/wear/src/main/res/values-pt-rPT/strings.xml index 29e4e9741b..32261260b4 100644 --- a/wear/src/main/res/values-pt-rPT/strings.xml +++ b/wear/src/main/res/values-pt-rPT/strings.xml @@ -51,6 +51,7 @@ Baixo Médio Alto + Auto Números Grandes Anel Histórico Anel Suave Histórico diff --git a/wear/src/main/res/values-ru-rRU/strings.xml b/wear/src/main/res/values-ru-rRU/strings.xml index 7bcb008d57..0cd5c49d54 100644 --- a/wear/src/main/res/values-ru-rRU/strings.xml +++ b/wear/src/main/res/values-ru-rRU/strings.xml @@ -51,6 +51,7 @@ Низкий Средний Высокий + Авто Цифры крупно Показывать историю в кольце Показывать историю в кольце менее подробно diff --git a/wear/src/main/res/values-sv-rSE/strings.xml b/wear/src/main/res/values-sv-rSE/strings.xml index 8324bbc64f..ff8d4c8c1a 100644 --- a/wear/src/main/res/values-sv-rSE/strings.xml +++ b/wear/src/main/res/values-sv-rSE/strings.xml @@ -51,6 +51,7 @@ Låg Mellan Hög + Auto Stora siffror Ringhistorik Ljus ringhistorik From d71f036dba7345f782e55844f29e1fb72b93364e Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Wed, 1 Jan 2020 23:44:13 +0100 Subject: [PATCH 4/6] Revert in range color --- app/src/main/res/values/colors.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml index 6e11ebcf80..2ebd12c7a5 100644 --- a/app/src/main/res/values/colors.xml +++ b/app/src/main/res/values/colors.xml @@ -14,7 +14,7 @@ #d3f166 #FFFFFF00 #FFFF00FF - #A4ECEA + #00FF00 #FF0000 #FFFF00 #FFFF00 From 9e9ae3cf914fd838a42e047f5fbb3a7b3084a4b0 Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Thu, 2 Jan 2020 00:40:03 +0100 Subject: [PATCH 5/6] Allow date in CarbsDialog --- .../nightscout/androidaps/dialogs/CarbsDialog.kt | 13 ++++++++----- app/src/main/res/layout/dialog_carbs.xml | 2 ++ 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/info/nightscout/androidaps/dialogs/CarbsDialog.kt b/app/src/main/java/info/nightscout/androidaps/dialogs/CarbsDialog.kt index 4e0e2980e8..de457068c5 100644 --- a/app/src/main/java/info/nightscout/androidaps/dialogs/CarbsDialog.kt +++ b/app/src/main/java/info/nightscout/androidaps/dialogs/CarbsDialog.kt @@ -155,7 +155,7 @@ class CarbsDialog : DialogFragmentWithDate() { actions.add(MainApp.gs(R.string.temptargetshort) + ": " + "" + DecimalFormatter.to1Decimal(hypoTT) + " " + unitLabel + " (" + hypoTTDuration + " " + MainApp.gs(R.string.unit_minute_short) + ")") val timeOffset = overview_carbs_time.value.toInt() - val time = DateUtil.now() + timeOffset * 1000 * 60 + val time = eventTime + timeOffset * 1000 * 60 if (timeOffset != 0) actions.add(MainApp.gs(R.string.time) + ": " + DateUtil.dateAndTimeString(time)) val duration = overview_carbs_duration.value.toInt() @@ -170,12 +170,15 @@ class CarbsDialog : DialogFragmentWithDate() { if (notes.isNotEmpty()) actions.add(MainApp.gs(R.string.careportal_newnstreatment_notes_label) + ": " + notes) + if (eventTimeChanged) + actions.add(MainApp.gs(R.string.time) + ": " + DateUtil.dateAndTimeString(eventTime)) + if (carbsAfterConstraints > 0 || activitySelected || eatingSoonSelected || hypoSelected) { activity?.let { activity -> OKDialog.showConfirmation(activity, MainApp.gs(R.string.carbs), HtmlHelper.fromHtml(Joiner.on("
").join(actions)), Runnable { if (activitySelected) { val tempTarget = TempTarget() - .date(System.currentTimeMillis()) + .date(eventTime) .duration(activityTTDuration) .reason(MainApp.gs(R.string.activity)) .source(Source.USER) @@ -184,7 +187,7 @@ class CarbsDialog : DialogFragmentWithDate() { TreatmentsPlugin.getPlugin().addToHistoryTempTarget(tempTarget) } else if (eatingSoonSelected) { val tempTarget = TempTarget() - .date(System.currentTimeMillis()) + .date(eventTime) .duration(eatingSoonTTDuration) .reason(MainApp.gs(R.string.eatingsoon)) .source(Source.USER) @@ -193,7 +196,7 @@ class CarbsDialog : DialogFragmentWithDate() { TreatmentsPlugin.getPlugin().addToHistoryTempTarget(tempTarget) } else if (hypoSelected) { val tempTarget = TempTarget() - .date(System.currentTimeMillis()) + .date(eventTime) .duration(hypoTTDuration) .reason(MainApp.gs(R.string.hypo)) .source(Source.USER) @@ -206,7 +209,7 @@ class CarbsDialog : DialogFragmentWithDate() { CarbsGenerator.createCarb(carbsAfterConstraints, time, CareportalEvent.CARBCORRECTION, notes) } else { CarbsGenerator.generateCarbs(carbsAfterConstraints, time, duration, notes) - NSUpload.uploadEvent(CareportalEvent.NOTE, DateUtil.now() - 2000, MainApp.gs(R.string.generated_ecarbs_note, carbsAfterConstraints, duration, timeOffset)) + NSUpload.uploadEvent(CareportalEvent.NOTE, time - 2000, MainApp.gs(R.string.generated_ecarbs_note, carbsAfterConstraints, duration, timeOffset)) } } }, null) diff --git a/app/src/main/res/layout/dialog_carbs.xml b/app/src/main/res/layout/dialog_carbs.xml index 9a95d19144..fdf83cff5b 100644 --- a/app/src/main/res/layout/dialog_carbs.xml +++ b/app/src/main/res/layout/dialog_carbs.xml @@ -204,6 +204,8 @@ + + From 1b4d06101df54a1c6642fc38edb16f6f4baac062 Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Thu, 2 Jan 2020 18:25:49 +0100 Subject: [PATCH 6/6] Fix creating careportal entries in Actions tab --- .../androidaps/dialogs/CareDialog.kt | 16 ++++++++- .../androidaps/dialogs/FillDialog.kt | 35 +++++++++++++++++-- 2 files changed, 48 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/info/nightscout/androidaps/dialogs/CareDialog.kt b/app/src/main/java/info/nightscout/androidaps/dialogs/CareDialog.kt index 946a3fec5b..1881e4fb77 100644 --- a/app/src/main/java/info/nightscout/androidaps/dialogs/CareDialog.kt +++ b/app/src/main/java/info/nightscout/androidaps/dialogs/CareDialog.kt @@ -13,6 +13,7 @@ import info.nightscout.androidaps.MainApp import info.nightscout.androidaps.R import info.nightscout.androidaps.data.Profile import info.nightscout.androidaps.db.CareportalEvent +import info.nightscout.androidaps.db.Source import info.nightscout.androidaps.plugins.configBuilder.ProfileFunctions import info.nightscout.androidaps.plugins.general.nsclient.NSUpload import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatus @@ -24,6 +25,7 @@ import info.nightscout.androidaps.utils.Translator import kotlinx.android.synthetic.main.dialog_care.* import kotlinx.android.synthetic.main.notes.* import kotlinx.android.synthetic.main.okcancel.* +import org.json.JSONException import org.json.JSONObject import java.text.DecimalFormat import java.util.* @@ -126,10 +128,13 @@ class CareDialog : DialogFragmentWithDate() { actions.add(MainApp.gs(R.string.careportal_newnstreatment_notes_label) + ": " + notes) json.put("notes", notes) } + eventTime -= eventTime % 1000 + if (eventTimeChanged) actions.add(MainApp.gs(R.string.time) + ": " + DateUtil.dateAndTimeString(eventTime)) json.put("created_at", DateUtil.toISOString(eventTime)) + json.put("mills", eventTime) json.put("eventType", when (options) { EventType.BGCHECK -> CareportalEvent.BGCHECK EventType.SENSOR_INSERT -> CareportalEvent.SENSORCHANGE @@ -141,7 +146,16 @@ class CareDialog : DialogFragmentWithDate() { activity?.let { activity -> OKDialog.showConfirmation(activity, MainApp.gs(event), HtmlHelper.fromHtml(Joiner.on("
").join(actions)), Runnable { - MainApp.getDbHelper().createCareportalEventFromJsonIfNotExists(json) + val careportalEvent = CareportalEvent() + careportalEvent.date = eventTime + careportalEvent.source = Source.USER + careportalEvent.eventType = when (options) { + EventType.BGCHECK -> CareportalEvent.BGCHECK + EventType.SENSOR_INSERT -> CareportalEvent.SENSORCHANGE + EventType.BATTERY_CHANGE -> CareportalEvent.PUMPBATTERYCHANGE + } + careportalEvent.json = json.toString() + MainApp.getDbHelper().createOrUpdate(careportalEvent) NSUpload.uploadCareportalEntryToNS(json) }, null) } diff --git a/app/src/main/java/info/nightscout/androidaps/dialogs/FillDialog.kt b/app/src/main/java/info/nightscout/androidaps/dialogs/FillDialog.kt index 8d55df9bc1..3eb4b0e379 100644 --- a/app/src/main/java/info/nightscout/androidaps/dialogs/FillDialog.kt +++ b/app/src/main/java/info/nightscout/androidaps/dialogs/FillDialog.kt @@ -20,6 +20,8 @@ import info.nightscout.androidaps.utils.* import kotlinx.android.synthetic.main.dialog_fill.* import kotlinx.android.synthetic.main.notes.* import kotlinx.android.synthetic.main.okcancel.* +import org.json.JSONException +import org.json.JSONObject import java.util.* import kotlin.math.abs @@ -91,6 +93,8 @@ class FillDialog : DialogFragmentWithDate() { val notes = notes.text.toString() if (notes.isNotEmpty()) actions.add(MainApp.gs(R.string.careportal_newnstreatment_notes_label) + ": " + notes) + eventTime -= eventTime % 1000 + if (eventTimeChanged) actions.add(MainApp.gs(R.string.time) + ": " + DateUtil.dateAndTimeString(eventTime)) @@ -117,8 +121,21 @@ class FillDialog : DialogFragmentWithDate() { } }) } - if (siteChange) NSUpload.uploadEvent(CareportalEvent.SITECHANGE, eventTime, notes) - if (insulinChange) NSUpload.uploadEvent(CareportalEvent.INSULINCHANGE, eventTime + 1000, notes) + val careportalEvent = CareportalEvent() + careportalEvent.date = eventTime + careportalEvent.source = Source.USER + if (siteChange) { + careportalEvent.json = generateJson(CareportalEvent.SITECHANGE, eventTime, notes).toString() + careportalEvent.eventType = CareportalEvent.SITECHANGE + NSUpload.uploadEvent(CareportalEvent.SITECHANGE, eventTime, notes) + } + if (insulinChange) { + // add a second for case of both checked + careportalEvent.json = generateJson(CareportalEvent.INSULINCHANGE, eventTime + 1000, notes).toString() + careportalEvent.eventType = CareportalEvent.INSULINCHANGE + NSUpload.uploadEvent(CareportalEvent.INSULINCHANGE, eventTime + 1000, notes) + } + MainApp.getDbHelper().createOrUpdate(careportalEvent) }, null) } } else { @@ -129,4 +146,18 @@ class FillDialog : DialogFragmentWithDate() { dismiss() return true } + + fun generateJson(careportalEvent: String, time: Long, notes: String): JSONObject { + val data = JSONObject() + try { + data.put("eventType", careportalEvent) + data.put("created_at", DateUtil.toISOString(time)) + data.put("mills", time) + data.put("enteredBy", SP.getString("careportal_enteredby", MainApp.gs(R.string.app_name))) + if (notes.isNotEmpty()) data.put("notes", notes) + } catch (ignored: JSONException) { + } + return data + } + } \ No newline at end of file