|
@@ -25,6 +25,7 @@ import com.owncloud.android.datastorage.StoragePoint;
|
|
|
|
|
|
import java.util.Locale;
|
|
import java.util.Locale;
|
|
import java.util.Vector;
|
|
import java.util.Vector;
|
|
|
|
+import java.util.regex.Pattern;
|
|
|
|
|
|
/**
|
|
/**
|
|
* @author Bartosz Przybylski
|
|
* @author Bartosz Przybylski
|
|
@@ -33,6 +34,8 @@ public class MountCommandStoragePointProvider extends AbstractCommandLineStorage
|
|
|
|
|
|
static private final String[] sCommand = new String[] { "mount" };
|
|
static private final String[] sCommand = new String[] { "mount" };
|
|
|
|
|
|
|
|
+ private static Pattern sPattern = Pattern.compile("(?i).*vold.*(vfat|ntfs|exfat|fat32|ext3|ext4).*rw.*");
|
|
|
|
+
|
|
@Override
|
|
@Override
|
|
protected String[] getCommand() {
|
|
protected String[] getCommand() {
|
|
return sCommand;
|
|
return sCommand;
|
|
@@ -51,10 +54,9 @@ public class MountCommandStoragePointProvider extends AbstractCommandLineStorage
|
|
|
|
|
|
private Vector<String> getPotentialPaths(String mounted) {
|
|
private Vector<String> getPotentialPaths(String mounted) {
|
|
final Vector<String> result = new Vector<>();
|
|
final Vector<String> result = new Vector<>();
|
|
- final String reg = "(?i).*vold.*(vfat|ntfs|exfat|fat32|ext3|ext4).*rw.*";
|
|
|
|
|
|
|
|
for (String line : mounted.split("\n"))
|
|
for (String line : mounted.split("\n"))
|
|
- if (!line.toLowerCase(Locale.US).contains("asec") && line.matches(reg)) {
|
|
|
|
|
|
+ if (!line.toLowerCase(Locale.US).contains("asec") && sPattern.matcher(line).matches()) {
|
|
String parts[] = line.split(" ");
|
|
String parts[] = line.split(" ");
|
|
for (String path : parts) {
|
|
for (String path : parts) {
|
|
if (path.startsWith("/") &&
|
|
if (path.startsWith("/") &&
|