I've been scanning /etc/vold.fstab to get a list of external storage. It works fine until Android 4.3 that Google removed the file. I know that a unified /fstab.* file is now used but which is inaccessible without root.
So in Android 4.3, what should I do to get a list of external storage?
My code looks something like this. Now it includes both non-removable internal and removable external storage.
File voldFile = new File("/system/etc/vold.fstab");
fr = new FileReader(voldFile);
br = new BufferedReader(fr);
String line = br.readLine();
while (line != null) {
if (line.startsWith("dev_mount")) {
String[] tokens = line.split("\\s");
File mountPoint = new File(tokens[2]);
if (mountPoint.isDirectory() && mountPoint.canRead())
list.add(tokens[2]);
}
line = br.readLine();
}