I scanned /etc/vold.fstab to get a list of external repositories. It works fine until Android 4.3 deletes the Google file. I know that the unified file /fstab.* is now used, but which is not accessible 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(); }
source share