fix: debug variant cannot use plugin files from server.
This commit is contained in:
@ -2001,10 +2001,13 @@ object VHelper {
|
||||
|
||||
@SuppressLint("CheckResult")
|
||||
fun preparePluginUpdate() {
|
||||
if(com.gh.gamecenter.BuildConfig.DEBUG) {
|
||||
Utils.log(LOG_TAG, "开发者需要插件更新功能,请push文件到手机,或者【修改插件打包的配置为debug版本,然后上传,推送】")
|
||||
return
|
||||
}
|
||||
Config.vNewSettingSubject.debounce(2, TimeUnit.SECONDS).doOnNext {
|
||||
it?.vaPlugin?.let { vaPlugin ->
|
||||
if (!vaPlugin.id.isNullOrEmpty()) {
|
||||
Utils.log(LOG_TAG, "开发者需要插件更新功能,请push文件到手机,或者【修改插件打包的配置为debug版本,然后上传,推送】")
|
||||
if (!vaPlugin.url64.isNullOrEmpty()) {
|
||||
val installedPluginVersion = HostUtils.getPluginVersion()
|
||||
if (installedPluginVersion?.isNotEmpty() == true
|
||||
@ -2036,6 +2039,7 @@ object VHelper {
|
||||
val currentPluginFile = File(HaloApp.getInstance().cacheDir, pluginFileName)
|
||||
if (currentPluginFile.exists() && PluginFileUtils.isZipFile(currentPluginFile)) {
|
||||
// 已经下载好了
|
||||
Utils.log(LOG_TAG, "id:${id} file exists.")
|
||||
fn(currentPluginFile)
|
||||
} else {
|
||||
val currentDownloadEntity = DownloadMessageHandler.findEntity(id)
|
||||
@ -2066,6 +2070,7 @@ object VHelper {
|
||||
|
||||
override fun onStatusChanged(status: DownloadStatus) {
|
||||
if (status == DownloadStatus.COMPLETED) {
|
||||
Utils.log(LOG_TAG, "id:${id} file download complete.")
|
||||
fn(currentPluginFile)
|
||||
DownloadMessageHandler.unregisterListener(id, this)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user