Support usb path

pull/69/head
FongMi 3 years ago
parent 98256dad90
commit 86fc2cd5fd
  1. 10
      app/src/main/java/com/github/catvod/spider/Local.java
  2. BIN
      jar/custom_spider.jar
  3. 2
      jar/custom_spider.jar.md5

@ -33,8 +33,14 @@ public class Local extends Spider {
@Override
public String homeContent(boolean filter) throws Exception {
List<Class> classes = new ArrayList<>();
String root = Environment.getExternalStorageDirectory().getAbsolutePath();
classes.add(new Class(root, "本地文件", "1"));
classes.add(new Class(Environment.getExternalStorageDirectory().getAbsolutePath(), "本地文件", "1"));
File[] files = new File("/storage").listFiles();
if (files == null) return Result.string(classes, new ArrayList<>());
List<String> exclude = Arrays.asList("emulated", "sdcard", "self");
for (File file : files) {
if (exclude.contains(file.getName())) continue;
classes.add(new Class(file.getAbsolutePath(), file.getName(), "1"));
}
return Result.string(classes, new ArrayList<>());
}

Binary file not shown.

@ -1 +1 @@
ca59a045079b3b0d57696149fa73864f
e276d142b10b9f2c2971664d0b9dc9a3

Loading…
Cancel
Save