jimu-decompiled/sources/com/ubt/jimu/transport3/upgrade/VersionUpgrade.java
2025-05-13 19:24:51 +02:00

42 lines
1.5 KiB
Java
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package com.ubt.jimu.transport3.upgrade;
import com.ubt.jimu.JimuApplication;
import com.ubt.jimu.base.cache.Cache;
import com.ubtrobot.log.ALog;
/* loaded from: classes2.dex */
public class VersionUpgrade {
private final String TAG = "upgrade";
private final String SP_KEY_UPGRADE_TO_310 = "sp_key_upgrade_to_310";
private DiyModelActionUpgrade actionUpgrade = new DiyModelActionUpgrade();
private FileAndDirectoryUpgrade fileUpgrade = new FileAndDirectoryUpgrade(JimuApplication.l());
private TransportFileUpgrade transportFileUpgrade = new TransportFileUpgrade();
private BlocklyUpgrade blocklyUpgrade = new BlocklyUpgrade();
private DiyDBModelUpgrade modelUpgrade = new DiyDBModelUpgrade();
public static void doUpgrade() {
new VersionUpgrade().upgrade();
}
public void upgrade() {
boolean booleanValue = Cache.getInstance().getSettings().getBoolean("sp_key_upgrade_to_310", false).booleanValue();
ALog.a("upgrade").d("是否需要升级数据库upgraded=" + booleanValue);
if (booleanValue) {
return;
}
try {
try {
this.fileUpgrade.upgrade();
this.modelUpgrade.upgrade();
this.transportFileUpgrade.upgrade();
this.actionUpgrade.upgrade();
this.blocklyUpgrade.upgrade();
} catch (Exception e) {
e.printStackTrace();
}
} finally {
Cache.getInstance().getSettings().put("sp_key_upgrade_to_310", true);
}
}
}