Support http so

pull/137/head
FongMi 3 years ago
parent cd8fbdec6a
commit beb65ad0ad
  1. 3
      catvod/src/main/java/com/github/catvod/utils/Github.java
  2. 2
      catvod/src/main/java/com/github/catvod/utils/Path.java

@ -68,7 +68,8 @@ public class Github {
public static String getSo(String name) {
try {
File file = Path.so(name);
if (file.length() < 300) Path.write(file, OkHttp.newCall(getUrl("so", file.getName())).execute().body().bytes());
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();
} catch (Exception e) {
return "";

@ -1,5 +1,6 @@
package com.github.catvod.utils;
import android.net.Uri;
import android.os.Environment;
import android.util.Log;
@ -93,6 +94,7 @@ public class Path {
}
public static File so(String name) {
if (name.startsWith("http")) return new File(so(), Uri.parse(name).getLastPathSegment());
return new File("mitv".equals(name) ? cache() : so(), "lib".concat(name).concat(".so"));
}

Loading…
Cancel
Save