//react-native可调用的方法
@ReactMethod
public static void getSDCardPaths(Promise success){
success.resolve(getPaths());
}
androidyuan原生方法
public static String getPaths() {
List<String> sdcardPaths = new ArrayList<String>();
String path = "";
String cmd = "cat /proc/mounts";
Runtime run = Runtime.getRuntime();// 返回与当前 Java 应用程序相关的运行时对象
try {
Process p = run.exec(cmd);// 启动另一个进程来执行命令
BufferedInputStream in = new BufferedInputStream(p.getInputStream());
BufferedReader inBr = new BufferedReader(new InputStreamReader(in));
String lineStr;
while ((lineStr = inBr.readLine()) != null) {
// 获得命令执行后在控制台的输出信息
Log.i("getSDCardPath1", lineStr);
String[] temp = TextUtils.split(lineStr, " ");