pull/144/head
于俊 12 months ago
parent f27e9bd12a
commit e41599038d
  1. 9
      app/src/main/java/com/github/tvbox/osc/api/ApiConfig.java
  2. 2
      app/src/main/java/com/github/tvbox/osc/ui/activity/HomeActivity.java
  3. 2
      gradle.properties

@ -181,6 +181,7 @@ public class ApiConfig {
parseLiveJson(liveApiUrl,defaultLiveObjString);
}else {
File live_cache = new File(App.getInstance().getFilesDir().getAbsolutePath() + "/" + MD5.encode(liveApiUrl));
LOG.i("echo-加载独立直播");
if (useCache && live_cache.exists()) {
try {
parseLiveJson(liveApiUrl, live_cache);
@ -334,6 +335,7 @@ public class ApiConfig {
boolean isJarInImg = jarUrl.startsWith("img+");
jarUrl = jarUrl.replace("img+", "");
LOG.i("echo-load jar start:"+jarUrl);
OkGo.<File>get(jarUrl)
.headers("User-Agent", userAgent)
.headers("Accept", requestAccept)
@ -354,7 +356,7 @@ public class ApiConfig {
byte[] imgJar = getImgJar(respData);
if (imgJar == null || imgJar.length == 0) {
LOG.e("echo---Generated JAR data is empty");
callback.error("JAR data is empty");
callback.error("JAR 是空的");
}
fos.write(imgJar);
} else {
@ -387,7 +389,7 @@ public class ApiConfig {
}
} catch (Exception e) {
LOG.e("echo---jar Loader threw exception: " + e.getMessage());
callback.error("JAR加载异常: " + e.getMessage());
callback.error("JAR加载异常: ");
}
} else {
LOG.e("echo---jar File not found");
@ -401,7 +403,7 @@ public class ApiConfig {
if (ex != null) {
LOG.i("echo---jar Request failed: " + ex.getMessage());
}
callback.error(ex != null ? ex.getMessage() : "未知网络错误");
callback.error("网络错误");
}
});
}
@ -847,7 +849,6 @@ public class ApiConfig {
jarLoader.loadLiveJar(liveSpider);
}
}
LOG.i("echo-live-proxy-url:"+url);
}else {
liveChannelGroupList.clear();
return;

@ -345,7 +345,7 @@ public class HomeActivity extends BaseActivity {
mHandler.postDelayed(new Runnable() {
@Override
public void run() {
Toast.makeText(HomeActivity.this, "jar加载失败; 尝试加载最近一次的jar", Toast.LENGTH_SHORT).show();
Toast.makeText(HomeActivity.this, msg+"; 尝试加载最近一次的jar", Toast.LENGTH_SHORT).show();
refreshHome();
}
},50);

@ -17,4 +17,4 @@ android.useAndroidX=true
# Automatically convert third-party libraries to use AndroidX
android.enableJetifier=true
IsDebug=true
#org.gradle.jvmargs=-Xmx2048m --add-opens java.base/java.io=ALL-UNNAMED
org.gradle.jvmargs=-Xmx2048m --add-opens java.base/java.io=ALL-UNNAMED

Loading…
Cancel
Save