From 5de7ad0500e3f9b99dcb7c9850fe2637cbbce01d Mon Sep 17 00:00:00 2001 From: Catfriend1 Date: Fri, 27 Jul 2018 00:54:58 +0200 Subject: [PATCH] WIP --- .../com/nutomic/syncthingandroid/util/Util.java | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/nutomic/syncthingandroid/util/Util.java b/app/src/main/java/com/nutomic/syncthingandroid/util/Util.java index 147cb8e4..316923dc 100644 --- a/app/src/main/java/com/nutomic/syncthingandroid/util/Util.java +++ b/app/src/main/java/com/nutomic/syncthingandroid/util/Util.java @@ -20,6 +20,9 @@ import java.io.IOException; import java.io.File; import java.text.DecimalFormat; +import java.io.StringReader; +import java.util.Properties; + import eu.chainfire.libsuperuser.Shell; public class Util { @@ -139,9 +142,19 @@ public class Util { useRoot = true; } + absoluteFolderPath = "/storage/emulated/0/Папка"; + + Properties p = new Properties(); + try { + p.load(new StringReader("key="+absoluteFolderPath)); + } catch(IOException e) { + Log.e(TAG, "Error", e); + } + absoluteFolderPath = p.getProperty("key"); + // Write permission test file. String touchFile = absoluteFolderPath + "/" + TOUCH_FILE_NAME; - int exitCode = runShellCommand("echo \"\" > \"" + touchFile + "\"\n", useRoot); + int exitCode = runShellCommand("mkdir -p \"" + absoluteFolderPath + "\"; echo \"\" > \"" + touchFile + "\"\n", useRoot); if (exitCode != 0) { String error; switch (exitCode) {