diff --git a/app/src/main/java/com/nutomic/syncthingandroid/activities/FirstStartActivity.java b/app/src/main/java/com/nutomic/syncthingandroid/activities/FirstStartActivity.java
index b001fc6c4..f7388405d 100644
--- a/app/src/main/java/com/nutomic/syncthingandroid/activities/FirstStartActivity.java
+++ b/app/src/main/java/com/nutomic/syncthingandroid/activities/FirstStartActivity.java
@@ -97,21 +97,6 @@ protected void onCreate(Bundle savedInstanceState) {
mRunningOnTV = Util.isRunningOnTV(this);
Log.d(TAG, mRunningOnTV ? "Running on a TV Device" : "Running on a non-TV Device");
- /**
- * Check if a valid config exists that can be read and parsed.
- */
- Boolean configParseable = false;
- Boolean configExists = Constants.getConfigFile(this).exists();
- if (configExists) {
- ConfigXml configParseTest = new ConfigXml(this);
- try {
- configParseTest.loadConfig();
- configParseable = true;
- } catch (ConfigXml.OpenConfigException e) {
- Log.d(TAG, "Failed to parse existing config. Will show key generation slide ...");
- }
- }
-
/**
* Check if prerequisites to run the app are still in place.
* If anything mandatory is missing, the according welcome slide(s) will be shown.
@@ -119,7 +104,7 @@ protected void onCreate(Bundle savedInstanceState) {
Boolean showSlideStoragePermission = !haveStoragePermission();
Boolean showSlideIgnoreDozePermission = !haveIgnoreDozePermission();
Boolean showSlideLocationPermission = !haveLocationPermission();
- Boolean showSlideKeyGeneration = !configExists || !configParseable;
+ Boolean showSlideKeyGeneration = !checkForParseableConfig();
/**
* If we don't have to show slides for mandatory prerequisites,
@@ -583,10 +568,33 @@ protected void onPostExecute(Void aVoid) {
return;
}
TextView keygenStatus = (TextView) firstStartActivity.findViewById(R.id.key_generation_status);
+ if (!firstStartActivity.checkForParseableConfig()) {
+ keygenStatus.setText(firstStartActivity.getString(R.string.config_read_failed));
+ return;
+ }
keygenStatus.setText(firstStartActivity.getString(R.string.key_generation_success));
Button nextButton = (Button) firstStartActivity.findViewById(R.id.btn_next);
nextButton.setVisibility(View.VISIBLE);
nextButton.requestFocus();
}
}
+
+ private Boolean checkForParseableConfig() {
+ /**
+ * Check if a valid config exists that can be read and parsed.
+ */
+ Boolean configExists = Constants.getConfigFile(this).exists();
+ if (!configExists) {
+ return false;
+ }
+ Boolean configParseable = false;
+ ConfigXml configParseTest = new ConfigXml(this);
+ try {
+ configParseTest.loadConfig();
+ configParseable = true;
+ } catch (ConfigXml.OpenConfigException e) {
+ Log.d(TAG, "Failed to parse existing config. Will show key generation slide ...");
+ }
+ return configParseable;
+ }
}
diff --git a/app/src/main/java/com/nutomic/syncthingandroid/service/NotificationHandler.java b/app/src/main/java/com/nutomic/syncthingandroid/service/NotificationHandler.java
index 29b75e439..834faf719 100644
--- a/app/src/main/java/com/nutomic/syncthingandroid/service/NotificationHandler.java
+++ b/app/src/main/java/com/nutomic/syncthingandroid/service/NotificationHandler.java
@@ -192,7 +192,7 @@ public void showCrashedNotification(@StringRes int title, String extraInfo) {
Intent intent = new Intent(mContext, LogActivity.class);
Notification n = getNotificationBuilder(mInfoChannel)
.setContentTitle(mContext.getString(title, extraInfo))
- .setContentText(mContext.getString(R.string.notification_crash_text))
+ .setContentText(mContext.getString(R.string.notification_crash_text, extraInfo))
.setSmallIcon(R.drawable.ic_stat_notify)
.setContentIntent(PendingIntent.getActivity(mContext, 0, intent, 0))
.setAutoCancel(true)
diff --git a/app/src/main/java/com/nutomic/syncthingandroid/service/SyncthingService.java b/app/src/main/java/com/nutomic/syncthingandroid/service/SyncthingService.java
index f483189bd..0dd44c350 100644
--- a/app/src/main/java/com/nutomic/syncthingandroid/service/SyncthingService.java
+++ b/app/src/main/java/com/nutomic/syncthingandroid/service/SyncthingService.java
@@ -428,10 +428,11 @@ private void applyCustomRunConditions(RunConditionMonitor runConditionMonitor) {
try {
configXml.loadConfig();
} catch (ConfigXml.OpenConfigException e) {
- mNotificationHandler.showCrashedNotification(R.string.config_read_failed, "applyCustomRunConditions:ConfigXml.OpenConfigException");
+ mNotificationHandler.showCrashedNotification(R.string.config_read_failed, "applyCustomRunConditions:OpenConfigException");
synchronized (mStateLock) {
onServiceStateChange(State.ERROR);
}
+ stopSelf();
return;
}
@@ -508,10 +509,11 @@ private void launchStartupTask(SyncthingRunnable.Command srCommand) {
try {
mConfig.loadConfig();
} catch (ConfigXml.OpenConfigException e) {
- mNotificationHandler.showCrashedNotification(R.string.config_read_failed, "ConfigXml.OpenConfigException");
+ mNotificationHandler.showCrashedNotification(R.string.config_read_failed, "launchStartupTask:OpenConfigException");
synchronized (mStateLock) {
onServiceStateChange(State.ERROR);
}
+ stopSelf();
return;
}
diff --git a/app/src/main/java/com/nutomic/syncthingandroid/util/ConfigXml.java b/app/src/main/java/com/nutomic/syncthingandroid/util/ConfigXml.java
index ac9c86c38..e122752b2 100644
--- a/app/src/main/java/com/nutomic/syncthingandroid/util/ConfigXml.java
+++ b/app/src/main/java/com/nutomic/syncthingandroid/util/ConfigXml.java
@@ -255,6 +255,9 @@ private void updateIfNeeded() {
/* Section - GUI */
Element gui = getGuiElement();
+ if (gui == null) {
+ throw new OpenConfigException();
+ }
// Platform-specific: Force REST API and Web UI access to use TLS 1.2 or not.
Boolean forceHttps = Constants.osSupportsTLS12();
@@ -293,6 +296,9 @@ private void updateIfNeeded() {
// https://github.com/syncthing/syncthing/issues/4348
Element options = (Element) mConfig.getDocumentElement()
.getElementsByTagName("options").item(0);
+ if (options == null) {
+ throw new OpenConfigException();
+ }
changed = setConfigElement(options, "weakHashSelectionMethod", "never") || changed;
/* Dismiss "fsWatcherNotification" according to https://github.com/syncthing/syncthing-android/pull/1051 */
diff --git a/app/src/main/res/values-bg/strings.xml b/app/src/main/res/values-bg/strings.xml
index 900cdf4d7..cbc64c052 100644
--- a/app/src/main/res/values-bg/strings.xml
+++ b/app/src/main/res/values-bg/strings.xml
@@ -200,6 +200,7 @@
Изчакване на потребителския интерфейс
+
@@ -208,7 +209,6 @@
Условия на работа
Поведение
Настройки на Syncthing
- Дебъг
Експериментални
diff --git a/app/src/main/res/values-ca-rES/strings.xml b/app/src/main/res/values-ca-rES/strings.xml
index d329250d5..078cc9488 100644
--- a/app/src/main/res/values-ca-rES/strings.xml
+++ b/app/src/main/res/values-ca-rES/strings.xml
@@ -44,10 +44,6 @@
Ignora
-
-
-
-
S\'ha trobat un error conegut que encara no està resolt. Vegeu %1$s/%2$s per més informació. Siusplau doneu una descripció precisa del que ha passat amb antelació.
@@ -320,7 +316,6 @@
Comportament
Opcions del Syncthing
Importa i Exporta
- Depuració
Experimental
@@ -331,8 +326,6 @@
Executa quan el dispositiu es connecti a través de la xarxa de dades mòbils. Advertència: Si sincronitzeu gran quantitat de dades podríeu consumir un volum important del pla de dades del vostre operador mòbil.
Executa amb Wi-Fi
- Executa quan el dispositiu es connecti a una xarxa Wi-Fi.
-
Executa amb Wi-Fi mesurada
Executa quan el dispositiu estigui connectat a una xarxa Wi-Fi mesurada, com ara una zona amb cobertura o un ancoratge. Advertència: Si sincronitzeu gran quantitat de dades podríeu consumir un volum important del pla de dades del vostre operador mòbil.
@@ -610,7 +603,6 @@
El Syncthing no té permís per funcionar amb connexions de dades mòbils.
El Syncthing està funcionant perquè les dades mòbils estan actives.
El Syncthing pot funcionar amb connexions de dades mòbils però les dades mòbils no estan connectades.
- El Syncthing no té permís per funcionar amb WiFi.
@@ -640,8 +632,6 @@
El Syncthing s\'ha bloquejat %1$s
- Feu clic per veure els registres
-
El Syncthing està actiu
Vigilant les condicions d\'execució
Altres notificacions
diff --git a/app/src/main/res/values-cs/strings.xml b/app/src/main/res/values-cs/strings.xml
index aacfdfa12..bb29c448e 100644
--- a/app/src/main/res/values-cs/strings.xml
+++ b/app/src/main/res/values-cs/strings.xml
@@ -212,6 +212,7 @@
Čeká se na Syncthing GUI
+
@@ -220,7 +221,6 @@
Podmínky spuštění
Chování
Nastavení Syncthing
- Ladění
Experimentální
@@ -427,8 +427,6 @@
Syncthing spadl %1$s
- Pro prohlížení logů klikněte
-
Ostatní upozornění
diff --git a/app/src/main/res/values-da/strings.xml b/app/src/main/res/values-da/strings.xml
index 3c77cdc3e..88eb3ea6d 100644
--- a/app/src/main/res/values-da/strings.xml
+++ b/app/src/main/res/values-da/strings.xml
@@ -208,6 +208,7 @@
Venter på GUI
+
@@ -216,7 +217,6 @@
Kør betingelser
Adfærd
Syncthing Muligheder
- Debug
Eksperimentalt
@@ -407,8 +407,6 @@
Syncthing crashede %1$s
- Klik for at se logs
-
diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml
index 1cc6ff610..46f5c0a83 100644
--- a/app/src/main/res/values-de/strings.xml
+++ b/app/src/main/res/values-de/strings.xml
@@ -740,7 +740,7 @@ Bitte melden Sie auftretende Probleme via GitHub.
Syncthing ist abgestürzt (Exit-Code %1$s)
- Klicken um Logs anzuzeigen
+ Klicke für Logs (%1$s)
Syncthing läuft
Laufkonditionen werden überwacht
diff --git a/app/src/main/res/values-el/strings.xml b/app/src/main/res/values-el/strings.xml
index 7881d4be1..61ebf9a58 100644
--- a/app/src/main/res/values-el/strings.xml
+++ b/app/src/main/res/values-el/strings.xml
@@ -208,6 +208,7 @@
Αναμονή για το GUI
+
@@ -216,7 +217,6 @@
Συνθήκες εκτέλεσης
Συμπεριφορά
Επιλογές Syncthing
- Αποσφαλμάτωση
Πειραματικά
@@ -417,8 +417,6 @@
Το Syncthing κατέρρευσε %1$s
- Πατήστε για να δείτε την καταγραφή συμβάντων
-
Άλλες ειδοποιήσεις
diff --git a/app/src/main/res/values-es-rMX/strings.xml b/app/src/main/res/values-es-rMX/strings.xml
index d0c89f10f..d66523fce 100644
--- a/app/src/main/res/values-es-rMX/strings.xml
+++ b/app/src/main/res/values-es-rMX/strings.xml
@@ -190,6 +190,7 @@
Esperando por la Interfaz
+
diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml
index 9e9a4a1be..4caa991f6 100644
--- a/app/src/main/res/values-es/strings.xml
+++ b/app/src/main/res/values-es/strings.xml
@@ -208,7 +208,6 @@
Condiciones de ejecución
Comportamiento
Opciones de Syncthing
- Depuración
Experimental
@@ -383,8 +382,6 @@
Syncthing se ha estrellado %1$s
- Haga clic para ver los registros
-
diff --git a/app/src/main/res/values-fi/strings.xml b/app/src/main/res/values-fi/strings.xml
index d2418b33b..364dc7f4b 100644
--- a/app/src/main/res/values-fi/strings.xml
+++ b/app/src/main/res/values-fi/strings.xml
@@ -212,6 +212,7 @@
Käyttöliittymä käynnistyy
+
@@ -220,7 +221,6 @@
Käyntiehdot
Käyttäytyminen
Syncthing asetukset
- Vianhaku
Kokeellinen
diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml
index ac3996b0c..fe2ece957 100644
--- a/app/src/main/res/values-fr/strings.xml
+++ b/app/src/main/res/values-fr/strings.xml
@@ -237,7 +237,6 @@
Conditions d\'exécution
Comportement
Options Syncthing
- Debug
Expérimental
@@ -482,8 +481,6 @@
Syncthing s\'est planté %1$s
- Cliquer pour voir les journaux
-
Syncthing en marche
Surveillance des conditions de fonctionnement
Autres notifications
diff --git a/app/src/main/res/values-hu/strings.xml b/app/src/main/res/values-hu/strings.xml
index 0e255df0f..c2bda530d 100644
--- a/app/src/main/res/values-hu/strings.xml
+++ b/app/src/main/res/values-hu/strings.xml
@@ -225,6 +225,7 @@ Az összesített statisztika nyilvánosan elérhető a https://data.syncthing.ne
Várakozás a grafikus felületre
+
@@ -233,7 +234,6 @@ Az összesített statisztika nyilvánosan elérhető a https://data.syncthing.ne
Futás feltételei
Viselkedés
Syncthing opciók
- Hibakeresés
Kísérleti
@@ -471,8 +471,6 @@ VIGYÁZAT! Más alkalmazások kiolvashatják a backupból a titkos kulcsot, és
A Syncthing összeomlott %1$s
- Koppints a naplók megtekintéséhez
-
Syncthing aktív
Futási feltételek monitorozása
További értesítések
diff --git a/app/src/main/res/values-in/strings.xml b/app/src/main/res/values-in/strings.xml
index 27acbeb81..f0ea41be6 100644
--- a/app/src/main/res/values-in/strings.xml
+++ b/app/src/main/res/values-in/strings.xml
@@ -202,6 +202,7 @@
Memuat GUI
+
@@ -210,7 +211,6 @@
Syarat Operasi
Perilaku
Opsi Syncthing
- Debug
Ujicoba
diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml
index 9b188fcd7..6257793bd 100644
--- a/app/src/main/res/values-it/strings.xml
+++ b/app/src/main/res/values-it/strings.xml
@@ -234,7 +234,6 @@
Condizioni di funzionamento
Comportamento
Opzioni di Syncthing
- Debug
Sperimentale
@@ -479,8 +478,6 @@
Syncthing è andato in crash %1$s
- Clicca per visualizzare i log
-
Syncthing attivo
Monitoraggio delle condizioni di esecuzione
Altre notifiche
diff --git a/app/src/main/res/values-ja/strings.xml b/app/src/main/res/values-ja/strings.xml
index f45d6fdf4..9f741a882 100644
--- a/app/src/main/res/values-ja/strings.xml
+++ b/app/src/main/res/values-ja/strings.xml
@@ -218,7 +218,6 @@
実行条件
動作
同期オプション
- デバッグ
実験的
@@ -416,8 +415,6 @@
Syncthing がクラッシュしました %1$s
- クリックしてログを表示
-
他の通知
diff --git a/app/src/main/res/values-ko/strings.xml b/app/src/main/res/values-ko/strings.xml
index c1d195fa6..18d4b8285 100644
--- a/app/src/main/res/values-ko/strings.xml
+++ b/app/src/main/res/values-ko/strings.xml
@@ -207,6 +207,7 @@
GUI를 기다리는 중
+
@@ -215,7 +216,6 @@
작동 상태
동작
Syncthing 옵션
- 디버그
실험적인 기능
@@ -413,8 +413,6 @@
Syncthing이 충돌하였습니다. %1$s
- 클릭해서 로그 보기
-
기타 알림
diff --git a/app/src/main/res/values-nb/strings.xml b/app/src/main/res/values-nb/strings.xml
index 135af59b3..9e5073ae6 100644
--- a/app/src/main/res/values-nb/strings.xml
+++ b/app/src/main/res/values-nb/strings.xml
@@ -193,6 +193,7 @@
Venter på GUI
+
diff --git a/app/src/main/res/values-nl/strings.xml b/app/src/main/res/values-nl/strings.xml
index 43d59d1b1..ec34f9e65 100644
--- a/app/src/main/res/values-nl/strings.xml
+++ b/app/src/main/res/values-nl/strings.xml
@@ -256,7 +256,6 @@
Uitvoervoorwaarden
Gedrag
Syncthing-opties
- Debug
Experimenteel
@@ -501,8 +500,6 @@
Syncthing is gecrasht %1$s
- Tik om logboeken te bekijken
-
Syncthing is actief
Uitvoervoorwaarden controleren
Overige meldingen
diff --git a/app/src/main/res/values-nn/strings.xml b/app/src/main/res/values-nn/strings.xml
index b690262b8..17d8e30c2 100644
--- a/app/src/main/res/values-nn/strings.xml
+++ b/app/src/main/res/values-nn/strings.xml
@@ -193,6 +193,7 @@
Venter på grafisk grensesnitt
+
diff --git a/app/src/main/res/values-pl/strings.xml b/app/src/main/res/values-pl/strings.xml
index 1d8319254..51b23d0cf 100644
--- a/app/src/main/res/values-pl/strings.xml
+++ b/app/src/main/res/values-pl/strings.xml
@@ -212,6 +212,7 @@
Oczekiwanie na interfejs użytkownika
+
@@ -220,7 +221,6 @@
Warunki działania
Zachowanie
Ustawienia Syncthing
- Diagnozowanie błędów
Eksperymentalne
@@ -427,8 +427,6 @@
Syncthing spadło z rowerka %1$s
- Dotknij, by zobaczyć logi
-
Inne powiadomienia
diff --git a/app/src/main/res/values-pt-rBR/strings.xml b/app/src/main/res/values-pt-rBR/strings.xml
index aa04751c1..e2d6d4703 100644
--- a/app/src/main/res/values-pt-rBR/strings.xml
+++ b/app/src/main/res/values-pt-rBR/strings.xml
@@ -225,6 +225,7 @@
Aguardando a interface web
+
@@ -233,7 +234,6 @@
Condições de execução
Comportamento
Opções do Syncthing
- Depuração
Configurações experimentais
@@ -458,8 +458,6 @@
O Syncthing fechou inesperadamente %1$s
- Clique para ver os logs
-
Syncthing ativado
Monitorando condições de execução
Outras notificações
diff --git a/app/src/main/res/values-pt/strings.xml b/app/src/main/res/values-pt/strings.xml
index 3fc5b0c76..5af74a436 100644
--- a/app/src/main/res/values-pt/strings.xml
+++ b/app/src/main/res/values-pt/strings.xml
@@ -202,6 +202,7 @@
Aguardando a interface web
+
@@ -210,7 +211,6 @@
Condições de execução
Comportamento
Opções do Syncthing
- Depuração
Experimental
diff --git a/app/src/main/res/values-ro/strings.xml b/app/src/main/res/values-ro/strings.xml
index 862fcae26..67a17ad13 100644
--- a/app/src/main/res/values-ro/strings.xml
+++ b/app/src/main/res/values-ro/strings.xml
@@ -252,7 +252,6 @@
Condiții de rulare
Comportament
Opțiuni Syncthing
- Depanare
Experimental
@@ -517,8 +516,6 @@
Syncthing s-a oprit neașteptat %1$s
- Atingeți pentru a vedea jurnalele de erori
-
Syncthing este activ
Monitorizare condiții rulare
Alte notificări
diff --git a/app/src/main/res/values-ru/strings.xml b/app/src/main/res/values-ru/strings.xml
index 7e0ada6e4..915894067 100644
--- a/app/src/main/res/values-ru/strings.xml
+++ b/app/src/main/res/values-ru/strings.xml
@@ -43,10 +43,6 @@
Игнорировать
-
-
-
-
Была встречена найденная ошибка, которая ещё не была решена. Больше информации в %1$s/%2$s. Пожалуйста, оставьте нам точное описание произошедшего перед этим.
@@ -539,7 +535,7 @@
Syncthing завершился из-за сбоя %1$s
- Нажмите для просмотра логов
+ Нажмите для просмотра логов (%1$s)
Syncthing работает
Отслеживание условий работы
diff --git a/app/src/main/res/values-sk/strings.xml b/app/src/main/res/values-sk/strings.xml
index b0176a778..6136610a6 100644
--- a/app/src/main/res/values-sk/strings.xml
+++ b/app/src/main/res/values-sk/strings.xml
@@ -177,6 +177,7 @@
Čakám na GUI
+
diff --git a/app/src/main/res/values-sv/strings.xml b/app/src/main/res/values-sv/strings.xml
index 7de06a268..d04890c91 100644
--- a/app/src/main/res/values-sv/strings.xml
+++ b/app/src/main/res/values-sv/strings.xml
@@ -615,7 +615,7 @@
Syncthing har kraschat %1$s
- Klicka för att visa loggar
+ Klicka för att visa loggar (%1$s)
Syncthing är aktiv
Övervakar körvillkor
diff --git a/app/src/main/res/values-tr/strings.xml b/app/src/main/res/values-tr/strings.xml
index d23e352fe..bef230f47 100644
--- a/app/src/main/res/values-tr/strings.xml
+++ b/app/src/main/res/values-tr/strings.xml
@@ -198,6 +198,7 @@
Arayüz Bekleniyor
+
@@ -206,7 +207,6 @@
Çalışma Koşulları
Davranış
Syncthing Seçenekleri
- Hata ayıklama
Deneysel
diff --git a/app/src/main/res/values-uk/strings.xml b/app/src/main/res/values-uk/strings.xml
index 1910dca6c..24dee9989 100644
--- a/app/src/main/res/values-uk/strings.xml
+++ b/app/src/main/res/values-uk/strings.xml
@@ -164,6 +164,7 @@
Очікую на веб-інтерфейс
+
@@ -171,7 +172,6 @@
Умови запуску
Опції Syncthing
- Відладка
Експериментальне
diff --git a/app/src/main/res/values-vi/strings.xml b/app/src/main/res/values-vi/strings.xml
index 94c61520e..6089fba56 100644
--- a/app/src/main/res/values-vi/strings.xml
+++ b/app/src/main/res/values-vi/strings.xml
@@ -190,6 +190,7 @@
Đang chờ GUI
+
diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml
index 439c44dad..09fd9d37a 100644
--- a/app/src/main/res/values-zh-rCN/strings.xml
+++ b/app/src/main/res/values-zh-rCN/strings.xml
@@ -582,7 +582,7 @@
Syncthing 已崩溃 %1$s
- 点击查看日志
+ 点击查看日志 (%1$s)
Syncthing 運行。
监控正在运行的规则中
diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml
index ef027e68d..fdfca43ce 100644
--- a/app/src/main/res/values-zh-rTW/strings.xml
+++ b/app/src/main/res/values-zh-rTW/strings.xml
@@ -414,7 +414,7 @@
Syncthing 已經當機 %1$s
- 觸碰檢視日誌
+ 觸碰檢視日誌 (%1$s)
其他通知
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index af53ab927..7e1ae8d5a 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -756,7 +756,7 @@ Please report any problems you encounter via Github.
Syncthing has crashed (exit code %1$s)
- Click to view logs
+ Click for logs (%1$s)
Syncthing active
Monitoring run conditions