mirror of
https://github.com/syncthing/syncthing-android.git
synced 2025-01-02 16:21:35 +00:00
WIP
This commit is contained in:
parent
20922055db
commit
5de7ad0500
1 changed files with 14 additions and 1 deletions
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue