From c767259889f5a2448547d0cba09c6038e2850423 Mon Sep 17 00:00:00 2001 From: Felix Ableitner Date: Mon, 20 Apr 2015 21:32:34 +0200 Subject: [PATCH] Export config to `backups/syncthing` instead of sd card root (fixes #364). --- .../nutomic/syncthingandroid/syncthing/SyncthingService.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/nutomic/syncthingandroid/syncthing/SyncthingService.java b/src/main/java/com/nutomic/syncthingandroid/syncthing/SyncthingService.java index 09596e6b..74e58f4f 100644 --- a/src/main/java/com/nutomic/syncthingandroid/syncthing/SyncthingService.java +++ b/src/main/java/com/nutomic/syncthingandroid/syncthing/SyncthingService.java @@ -68,7 +68,8 @@ public class SyncthingService extends Service { /** * Directory where config is exported to and imported from. */ - public static final File EXPORT_PATH = Environment.getExternalStorageDirectory(); + public static final File EXPORT_PATH = + new File(Environment.getExternalStorageDirectory(), "backups/syncthing"); /** * Path to the native, integrated syncthing binary, relative to the data folder @@ -440,6 +441,7 @@ public class SyncthingService extends Service { * Exports the local config and keys to {@link #EXPORT_PATH}. */ public void exportConfig() { + EXPORT_PATH.mkdirs(); copyFile(new File(getFilesDir(), ConfigXml.CONFIG_FILE), new File(EXPORT_PATH, ConfigXml.CONFIG_FILE)); copyFile(new File(getFilesDir(), PRIVATE_KEY_FILE),