update 插件化判断代码
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -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")) {
|
||||
|
||||
Reference in New Issue
Block a user