Change so folder

pull/171/head
FongMi 2 years ago
parent 1192ac8d71
commit b34188bf94
  1. 3
      catvod/src/main/java/com/github/catvod/utils/Github.java
  2. 8
      catvod/src/main/java/com/github/catvod/utils/Path.java

@ -23,8 +23,7 @@ public class Github {
public static String getSo(String name) {
try {
File file = Path.so(name);
moveExist(Path.externalCache(), file);
moveExist(Path.externalFiles(), file);
moveExist(Path.download(), file);
String url = name.startsWith("http") ? name : getUrl("so", file.getName());
if (file.length() < 300) Path.write(file, OkHttp.newCall(url).execute().body().bytes());
return file.getAbsolutePath();

@ -45,12 +45,8 @@ public class Path {
return Init.context().getFilesDir();
}
public static File externalFiles() {
return Init.context().getExternalFilesDir("");
}
public static File externalCache() {
return Init.context().getExternalCacheDir();
public static File download() {
return Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS);
}
public static String rootPath() {

Loading…
Cancel
Save