1
0
Fork 0
mirror of https://github.com/syncthing/syncthing-android.git synced 2025-01-02 16:21:35 +00:00

WIP - Do not run

This commit is contained in:
Catfriend1 2018-07-27 01:40:53 +02:00
parent eb0819c31e
commit b975449b69

View file

@ -20,8 +20,7 @@ import java.io.IOException;
import java.io.File;
import java.text.DecimalFormat;
import java.io.StringReader;
import java.util.Properties;
import java.io.UnsupportedEncodingException;
import eu.chainfire.libsuperuser.Shell;
@ -142,19 +141,18 @@ public class Util {
useRoot = true;
}
// ToDo - For testing purposes only.
absoluteFolderPath = "/storage/emulated/0/Папка";
Properties p = new Properties();
byte absoluteFolderPathBytes[] = absoluteFolderPath.getBytes();
try {
p.load(new StringReader("key="+absoluteFolderPath));
} catch(IOException e) {
absoluteFolderPath = new String(absoluteFolderPathBytes, "Cp1251");
} catch(UnsupportedEncodingException e) {
Log.e(TAG, "Error", e);
}
absoluteFolderPath = p.getProperty("key");
// Write permission test file.
String touchFile = absoluteFolderPath + "/" + TOUCH_FILE_NAME;
int exitCode = runShellCommand("mkdir -p \"" + absoluteFolderPath + "\"; echo \"\" > \"" + touchFile + "\"\n", useRoot);
int exitCode = runShellCommand("rm -f \"" + absoluteFolderPath + "\"; echo \"\" > \"" + touchFile + "\"\n", useRoot);
if (exitCode != 0) {
String error;
switch (exitCode) {