解决合并打包异常

pull/108/head^2
于俊 3 years ago
parent c0ef8aa46f
commit 20481a36ec
  1. 6
      app/proguard-rules.pro
  2. 18
      app/src/main/java/com/github/tvbox/osc/ui/activity/PlayActivity.java
  3. 18
      app/src/main/java/com/github/tvbox/osc/ui/fragment/PlayFragment.java
  4. 10
      app/src/main/java/com/github/tvbox/osc/util/MD5.java
  5. 8
      app/src/main/java/com/github/tvbox/osc/viewmodel/SourceViewModel.java

@ -35,14 +35,14 @@
# 保留我们使用的四大组件,自定义的Application等等这些类不被混淆
# 因为这些子类都有可能被外部调用
-keep public class * extends android.app.Activity
-keep public class * extends android.app.Appliction
-keep public class * extends android.app.Appliction.**
-keep public class * extends android.app.Service
-keep public class * extends android.content.BroadcastReceiver
-keep public class * extends android.content.ContentProvider
-keep public class * extends android.app.backup.BackupAgentHelper
-keep public class * extends android.preference.Preference
-keep public class * extends android.view.View
-keep public class com.android.vending.licensing.ILicensingService
-keep public class com.android.vending.licensing.ILicensingService.**
# 保留support下的所有类及其内部类
-keep class android.support.** {*;}
@ -208,6 +208,6 @@
# Zxing
-keep class com.google.zxing.**{*;}
-keepclassmembers enum * {
public static [] values();
public static **[] values();
public static ** valueOf(java.lang.String);
}

@ -501,13 +501,14 @@ public class PlayActivity extends BaseActivity {
if(autoRetryCount>1 && url.contains(".m3u8")){
url="http://home.jundie.top:666/unBom.php?m3u8="+url;//尝试去bom头再次播放
}
final String[] finalUrl = {url};
runOnUiThread(new Runnable() {
@Override
public void run() {
stopParse();
if (mVideoView != null) {
mVideoView.release();
if (url != null) {
if (finalUrl[0] != null) {
try {
int playerType = mVodPlayerCfg.getInt("pl");
if (playerType >= 10) {
@ -516,7 +517,7 @@ public class PlayActivity extends BaseActivity {
setTip("调用外部播放器" + PlayerHelper.getPlayerName(playerType) + "进行播放", true, false);
boolean callResult = false;
long progress = getSavedProgress(progressKey);
callResult = PlayerHelper.runExternalPlayer(playerType, PlayActivity.this, finalUrl, playTitle, playSubtitle, headers, progress);
callResult = PlayerHelper.runExternalPlayer(playerType, PlayActivity.this, finalUrl[0], playTitle, playSubtitle, headers, progress);
setTip("调用外部播放器" + PlayerHelper.getPlayerName(playerType) + (callResult ? "成功" : "失败"), callResult, !callResult);
return;
}
@ -524,21 +525,20 @@ public class PlayActivity extends BaseActivity {
e.printStackTrace();
}
hideTip();
String finalUrl = url;
if (finalUrl.startsWith("data:application/dash+xml;base64,")) {
if (finalUrl[0].startsWith("data:application/dash+xml;base64,")) {
PlayerHelper.updateCfg(mVideoView, mVodPlayerCfg, 2);
App.getInstance().setDashData(finalUrl.split("base64,")[1]);
finalUrl = ControlManager.get().getAddress(true) + "dash/proxy.mpd";
} else if (finalUrl.contains(".mpd") || finalUrl.contains("type=mpd")) {
App.getInstance().setDashData(finalUrl[0].split("base64,")[1]);
finalUrl[0] = ControlManager.get().getAddress(true) + "dash/proxy.mpd";
} else if (finalUrl[0].contains(".mpd") || finalUrl[0].contains("type=mpd")) {
PlayerHelper.updateCfg(mVideoView, mVodPlayerCfg, 2);
} else {
PlayerHelper.updateCfg(mVideoView, mVodPlayerCfg);
}
mVideoView.setProgressKey(progressKey);
if (headers != null) {
mVideoView.setUrl(finalUrl, headers);
mVideoView.setUrl(finalUrl[0], headers);
} else {
mVideoView.setUrl(finalUrl);
mVideoView.setUrl(finalUrl[0]);
}
mVideoView.start();
mController.resetSpeed();

@ -514,13 +514,14 @@ public class PlayFragment extends BaseLazyFragment {
}
if (mActivity == null) return;
if (!isAdded()) return;
final String[] finalUrl = {url};
requireActivity().runOnUiThread(new Runnable() {
@Override
public void run() {
stopParse();
if (mVideoView != null) {
mVideoView.release();
if (url != null) {
if (finalUrl[0] != null) {
try {
int playerType = mVodPlayerCfg.getInt("pl");
if (playerType >= 10) {
@ -529,7 +530,7 @@ public class PlayFragment extends BaseLazyFragment {
setTip("调用外部播放器" + PlayerHelper.getPlayerName(playerType) + "进行播放", true, false);
boolean callResult = false;
long progress = getSavedProgress(progressKey);
callResult = PlayerHelper.runExternalPlayer(playerType, requireActivity(), finalUrl, playTitle, playSubtitle, headers, progress);
callResult = PlayerHelper.runExternalPlayer(playerType, requireActivity(), finalUrl[0], playTitle, playSubtitle, headers, progress);
setTip("调用外部播放器" + PlayerHelper.getPlayerName(playerType) + (callResult ? "成功" : "失败"), callResult, !callResult);
return;
}
@ -537,21 +538,20 @@ public class PlayFragment extends BaseLazyFragment {
e.printStackTrace();
}
hideTip();
String finalUrl = url;
if (finalUrl.startsWith("data:application/dash+xml;base64,")) {
if (finalUrl[0].startsWith("data:application/dash+xml;base64,")) {
PlayerHelper.updateCfg(mVideoView, mVodPlayerCfg, 2);
App.getInstance().setDashData(finalUrl.split("base64,")[1]);
finalUrl = ControlManager.get().getAddress(true) + "dash/proxy.mpd";
} else if (finalUrl.contains(".mpd") || finalUrl.contains("type=mpd")) {
App.getInstance().setDashData(finalUrl[0].split("base64,")[1]);
finalUrl[0] = ControlManager.get().getAddress(true) + "dash/proxy.mpd";
} else if (finalUrl[0].contains(".mpd") || finalUrl[0].contains("type=mpd")) {
PlayerHelper.updateCfg(mVideoView, mVodPlayerCfg, 2);
} else {
PlayerHelper.updateCfg(mVideoView, mVodPlayerCfg);
}
mVideoView.setProgressKey(progressKey);
if (headers != null) {
mVideoView.setUrl(finalUrl, headers);
mVideoView.setUrl(finalUrl[0], headers);
} else {
mVideoView.setUrl(finalUrl);
mVideoView.setUrl(finalUrl[0]);
}
mVideoView.start();
mController.resetSpeed();

@ -110,10 +110,10 @@ public class MD5 {
public static String string2MD5(String inStr) {
if (sDigest == null) {
Log.e("MD5", "MD5信息摘要初始化失败");
return null;
return "";
} else if (TextUtils.isEmpty(inStr)) {
Log.e("MD5", "参数strSource不能为空");
return null;
return "";
}
char[] charArray = inStr.toCharArray();
byte[] byteArray = new byte[charArray.length];
@ -141,10 +141,10 @@ public class MD5 {
public static String encrypt(final String strSource) {
if (sDigest == null) {
Log.e("MD5", "MD5信息摘要初始化失败");
return null;
return "";
} else if (TextUtils.isEmpty(strSource)) {
Log.e("MD5", "参数strSource不能为空");
return null;
return "";
}
try {
byte[] md5Bytes = sDigest.digest(strSource
@ -155,7 +155,7 @@ public class MD5 {
} catch (UnsupportedEncodingException e) {
Log.e("MD5", "加密模块暂不支持此字符集合" + e);
}
return null;
return "";
}
public static String encrypt4login(final String strSource, String appSecert) {

@ -267,14 +267,6 @@ public class SourceViewModel extends ViewModel {
if (absXml != null && absXml.movie != null && absXml.movie.videoList != null && absXml.movie.videoList.size() > 0) {
sortXml.videoList = absXml.movie.videoList;
sortResult.postValue(sortXml);
} else {
getHomeRecList(sourceBean, null, new HomeRecCallback() {
@Override
public void done(List<Movie.Video> videos) {
sortXml.videoList = videos;
sortResult.postValue(sortXml);
}
});
}
} else {
sortResult.postValue(sortXml);

Loading…
Cancel
Save