From 17c2e7f7950da7851ada793d2ae167e04b16bec0 Mon Sep 17 00:00:00 2001 From: zlzw <583819556@qq.com> Date: Wed, 28 Jun 2023 17:37:10 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E6=8F=92=E4=BB=B6=E5=8C=96=E5=88=A4?= =?UTF-8?q?=E6=96=AD=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/AndroidManifest.xml | 3 +++ .../src/main/java/com/yunbao/common/CommonAppConfig.java | 2 ++ .../main/java/com/yunbao/common/utils/PluginManager.java | 8 ++++++++ .../com/yunbao/main/dialog/MainStartDialogFragment.java | 2 +- 4 files changed, 14 insertions(+), 1 deletion(-) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 6c7ae6eb1..63f16650e 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -159,6 +159,9 @@ + diff --git a/common/src/main/java/com/yunbao/common/CommonAppConfig.java b/common/src/main/java/com/yunbao/common/CommonAppConfig.java index 8633489c6..ee5be1227 100644 --- a/common/src/main/java/com/yunbao/common/CommonAppConfig.java +++ b/common/src/main/java/com/yunbao/common/CommonAppConfig.java @@ -35,6 +35,8 @@ public class CommonAppConfig { public static final boolean IS_GOOGLE_PLAY = getMetaDataBoolean("IS_GOOGLE_PLAY"); //是否开启上报错误日志功能 public static final boolean IS_UPLOAD_ERROR_LOG = getMetaDataBoolean("IS_UPLOAD_ERROR_LOG"); + //是否为插件包模式 + public static final boolean IS_PLUGIN_MODEL = getMetaDataBoolean("IS_PLUGIN_MODEL"); //外部sd卡 public static final String DCMI_PATH = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DCIM).getAbsolutePath(); diff --git a/common/src/main/java/com/yunbao/common/utils/PluginManager.java b/common/src/main/java/com/yunbao/common/utils/PluginManager.java index b140203bb..13ba2274c 100644 --- a/common/src/main/java/com/yunbao/common/utils/PluginManager.java +++ b/common/src/main/java/com/yunbao/common/utils/PluginManager.java @@ -8,6 +8,7 @@ import android.os.Handler; import android.os.Looper; import android.util.Log; +import com.yunbao.common.CommonAppConfig; import com.yunbao.common.CommonAppContext; import java.io.BufferedInputStream; @@ -47,6 +48,9 @@ public class PluginManager { } public boolean isDownloadApk() { + if(!CommonAppConfig.IS_PLUGIN_MODEL){ + return true; + } return new File(CommonAppContext.sInstance.getFilesDir().getAbsolutePath() + File.separator + "plugin_download" + File.separator + "anchorPlugin.apk").exists(); } @@ -54,6 +58,10 @@ public class PluginManager { * 加载主播插件 */ public void loadAnchorPlugin(DialogInterface.OnDismissListener dismissListener) { + if(!CommonAppConfig.IS_PLUGIN_MODEL){ + dismissListener.onDismiss(null); + return; + } new Thread(() -> { try { if (Arrays.asList(CommonAppContext.sInstance.getAssets().list("")).contains("anchorPlugin.apk")) { diff --git a/main/src/main/java/com/yunbao/main/dialog/MainStartDialogFragment.java b/main/src/main/java/com/yunbao/main/dialog/MainStartDialogFragment.java index a774b3ba9..db687fb19 100644 --- a/main/src/main/java/com/yunbao/main/dialog/MainStartDialogFragment.java +++ b/main/src/main/java/com/yunbao/main/dialog/MainStartDialogFragment.java @@ -216,7 +216,7 @@ public class MainStartDialogFragment extends AbsDialogFragment implements View.O } }; } - if (PluginManager.getInstance().isDownloadApk()) { + if (!CommonAppConfig.IS_PLUGIN_MODEL || PluginManager.getInstance().isDownloadApk()) { PluginManager.getInstance().loadAnchorPlugin(it -> { LiveHttpUtil.getLiveSdk(mGetLiveSdkCallback); });