588 lines
26 KiB
Java
588 lines
26 KiB
Java
package com.ubt.jimu.transport3.upgrade;
|
|
|
|
import android.content.Context;
|
|
import android.database.Cursor;
|
|
import android.database.sqlite.SQLiteDatabase;
|
|
import android.text.TextUtils;
|
|
import com.google.gson.reflect.TypeToken;
|
|
import com.tencent.open.SocialConstants;
|
|
import com.ubt.jimu.base.db.diy.DiyDBModel;
|
|
import com.ubt.jimu.base.db.proxy.data.DataBaseHelper;
|
|
import com.ubt.jimu.blockly.bean.BlocklyProject;
|
|
import com.ubt.jimu.blockly.bean.JimuMotion;
|
|
import com.ubt.jimu.blockly.dao.BlocklyProjectDbHandler;
|
|
import com.ubt.jimu.blockly.dao.JimuMotionDbHandler;
|
|
import com.ubt.jimu.controller.data.widget.ActionWidgetData;
|
|
import com.ubt.jimu.controller.data.widget.JockstickDataConverter;
|
|
import com.ubt.jimu.diy.DiyRobotDbHandler;
|
|
import com.ubt.jimu.transport.dao.ConfigItemDbHandler;
|
|
import com.ubt.jimu.transport.model.ConfigItem;
|
|
import com.ubt.jimu.transport.model.TransportFile;
|
|
import com.ubt.jimu.transport3.dao.DiyDBModelDBHandler;
|
|
import com.ubt.jimu.transport3.dao.TransportFileDbHandler2;
|
|
import com.ubt.jimu.unity.bluetooth.UnityActivity;
|
|
import com.ubt.jimu.utils.JsonHelper;
|
|
import com.unity3d.ads.metadata.MediationMetaData;
|
|
import java.io.File;
|
|
import java.util.ArrayList;
|
|
import java.util.HashMap;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
|
|
/* loaded from: classes2.dex */
|
|
public class Version2DbUpgrade {
|
|
private final String TAG = Version2DbUpgrade.class.getSimpleName();
|
|
private final String TABLE_DIY_MODEL = "CustomModelBean";
|
|
private final String TABLE_BLOCKLY_PROJECT = "BlocklyProject";
|
|
private final String TABLE_JIMU_MOTION = "JimuMotion";
|
|
private final String TABLE_MODEL_FILE = "syncFile";
|
|
private final String TABLE_CONFIG_ITEM = ConfigItem.TAG;
|
|
private final String TABLE_ROBOT = "local_model";
|
|
|
|
private void close(Cursor cursor) {
|
|
}
|
|
|
|
private void dropTable(SQLiteDatabase sQLiteDatabase, String str) {
|
|
if (TextUtils.isEmpty(str)) {
|
|
return;
|
|
}
|
|
try {
|
|
sQLiteDatabase.execSQL("drop table " + str);
|
|
} catch (Exception e) {
|
|
e.printStackTrace();
|
|
}
|
|
}
|
|
|
|
private Map<String, DiyDBModel> getSampleModel(SQLiteDatabase sQLiteDatabase) {
|
|
HashMap hashMap = new HashMap();
|
|
Cursor query = query(sQLiteDatabase, "local_model");
|
|
if (query == null) {
|
|
return hashMap;
|
|
}
|
|
int columnIndex = query.getColumnIndex(JockstickDataConverter.ID);
|
|
int columnIndex2 = query.getColumnIndex("model_id");
|
|
while (query.moveToNext()) {
|
|
try {
|
|
String string = query.getString(columnIndex);
|
|
int i = query.getInt(columnIndex2);
|
|
DiyDBModel diyDBModel = new DiyDBModel();
|
|
diyDBModel.setCustomModelId(string);
|
|
diyDBModel.setModelId(Integer.valueOf(i));
|
|
hashMap.put(string, diyDBModel);
|
|
} catch (Exception e) {
|
|
e.printStackTrace();
|
|
}
|
|
}
|
|
return hashMap;
|
|
}
|
|
|
|
private void migrateBlocklyProject(SQLiteDatabase sQLiteDatabase) {
|
|
Cursor query = query(sQLiteDatabase, "BlocklyProject");
|
|
if (query == null) {
|
|
return;
|
|
}
|
|
ArrayList arrayList = new ArrayList();
|
|
int columnIndex = query.getColumnIndex("xmlId");
|
|
int columnIndex2 = query.getColumnIndex("xmlName");
|
|
int columnIndex3 = query.getColumnIndex("xmlContent");
|
|
int columnIndex4 = query.getColumnIndex("isDefault");
|
|
int columnIndex5 = query.getColumnIndex("blocklyVersion");
|
|
int columnIndex6 = query.getColumnIndex("blocklyType");
|
|
int columnIndex7 = query.getColumnIndex("userId");
|
|
int columnIndex8 = query.getColumnIndex(UnityActivity.pModelType);
|
|
int columnIndex9 = query.getColumnIndex("customModelId");
|
|
int columnIndex10 = query.getColumnIndex("isDeleted");
|
|
while (query.moveToNext()) {
|
|
try {
|
|
try {
|
|
BlocklyProject blocklyProject = new BlocklyProject();
|
|
blocklyProject.setXmlId(query.getString(columnIndex));
|
|
blocklyProject.setXmlName(query.getString(columnIndex2));
|
|
blocklyProject.setXmlContent(query.getString(columnIndex3));
|
|
boolean z = true;
|
|
if (query.getInt(columnIndex4) != 1) {
|
|
z = false;
|
|
}
|
|
blocklyProject.setIsDefault(z);
|
|
blocklyProject.setBlocklyVersion(query.getString(columnIndex5));
|
|
blocklyProject.setBlocklyType(query.getString(columnIndex6));
|
|
blocklyProject.setUserId(query.getString(columnIndex7));
|
|
blocklyProject.setModelType(query.getString(columnIndex8));
|
|
blocklyProject.setCustomModelId(query.getString(columnIndex9));
|
|
blocklyProject.setIsDeleted(query.getString(columnIndex10));
|
|
arrayList.add(blocklyProject);
|
|
} catch (Exception e) {
|
|
e.printStackTrace();
|
|
}
|
|
} finally {
|
|
close(query);
|
|
}
|
|
}
|
|
if (arrayList.size() > 0) {
|
|
BlocklyProjectDbHandler.getInstance().insertOrUpdateInTx(arrayList);
|
|
}
|
|
}
|
|
|
|
private void migrateConfigItem(SQLiteDatabase sQLiteDatabase) {
|
|
int i;
|
|
int i2;
|
|
Version2DbUpgrade version2DbUpgrade;
|
|
int i3;
|
|
int i4;
|
|
ConfigItem configItem;
|
|
ArrayList arrayList;
|
|
int i5;
|
|
int i6;
|
|
Cursor query = query(sQLiteDatabase, ConfigItem.TAG);
|
|
if (query == null) {
|
|
return;
|
|
}
|
|
int columnIndex = query.getColumnIndex("type");
|
|
int columnIndex2 = query.getColumnIndex("fileName");
|
|
int columnIndex3 = query.getColumnIndex(SocialConstants.PARAM_COMMENT);
|
|
int columnIndex4 = query.getColumnIndex("fileCreateTime");
|
|
int columnIndex5 = query.getColumnIndex("fileModifyTime");
|
|
int columnIndex6 = query.getColumnIndex("serverID");
|
|
int columnIndex7 = query.getColumnIndex("isDeleted");
|
|
int columnIndex8 = query.getColumnIndex("icon");
|
|
int columnIndex9 = query.getColumnIndex("blocklyVersion");
|
|
int columnIndex10 = query.getColumnIndex(UnityActivity.pModelType);
|
|
int columnIndex11 = query.getColumnIndex("customModelId");
|
|
int columnIndex12 = query.getColumnIndex("isDefault");
|
|
int columnIndex13 = query.getColumnIndex("isModify");
|
|
int columnIndex14 = query.getColumnIndex("userId");
|
|
int columnIndex15 = query.getColumnIndex("content");
|
|
ArrayList arrayList2 = new ArrayList();
|
|
while (query.moveToNext()) {
|
|
try {
|
|
try {
|
|
configItem = new ConfigItem();
|
|
arrayList = arrayList2;
|
|
} catch (Exception e) {
|
|
e = e;
|
|
i = columnIndex2;
|
|
i2 = columnIndex15;
|
|
}
|
|
try {
|
|
configItem.setType(query.getString(columnIndex));
|
|
configItem.setFileName(query.getString(columnIndex2));
|
|
configItem.setDescription(query.getString(columnIndex3));
|
|
i5 = columnIndex;
|
|
i = columnIndex2;
|
|
} catch (Exception e2) {
|
|
e = e2;
|
|
i = columnIndex2;
|
|
i2 = columnIndex15;
|
|
arrayList2 = arrayList;
|
|
i3 = columnIndex14;
|
|
i4 = columnIndex;
|
|
version2DbUpgrade = this;
|
|
try {
|
|
e.printStackTrace();
|
|
version2DbUpgrade.close(query);
|
|
columnIndex = i4;
|
|
columnIndex14 = i3;
|
|
columnIndex15 = i2;
|
|
columnIndex2 = i;
|
|
} catch (Throwable th) {
|
|
th = th;
|
|
version2DbUpgrade.close(query);
|
|
throw th;
|
|
}
|
|
}
|
|
try {
|
|
configItem.setFileCreateTime(query.getLong(columnIndex4));
|
|
configItem.setFileModifyTime(query.getLong(columnIndex5));
|
|
configItem.setServerID(query.getString(columnIndex6));
|
|
configItem.setIsDeleted(query.getString(columnIndex7));
|
|
configItem.setIcon(query.getString(columnIndex8));
|
|
configItem.setBlocklyVersion(query.getString(columnIndex9));
|
|
configItem.setModelType(query.getString(columnIndex10));
|
|
configItem.setCustomModelId(query.getString(columnIndex11));
|
|
configItem.setIsDefault(query.getString(columnIndex12));
|
|
boolean z = true;
|
|
if (query.getInt(columnIndex13) != 1) {
|
|
z = false;
|
|
}
|
|
configItem.setIsModify(z);
|
|
i6 = columnIndex14;
|
|
try {
|
|
configItem.setUserId(query.getString(i6));
|
|
i4 = i5;
|
|
i2 = columnIndex15;
|
|
} catch (Exception e3) {
|
|
e = e3;
|
|
i4 = i5;
|
|
i2 = columnIndex15;
|
|
arrayList2 = arrayList;
|
|
}
|
|
} catch (Exception e4) {
|
|
e = e4;
|
|
version2DbUpgrade = this;
|
|
i2 = columnIndex15;
|
|
i3 = columnIndex14;
|
|
i4 = i5;
|
|
arrayList2 = arrayList;
|
|
e.printStackTrace();
|
|
version2DbUpgrade.close(query);
|
|
columnIndex = i4;
|
|
columnIndex14 = i3;
|
|
columnIndex15 = i2;
|
|
columnIndex2 = i;
|
|
}
|
|
try {
|
|
configItem.setContent(query.getString(i2));
|
|
arrayList2 = arrayList;
|
|
try {
|
|
arrayList2.add(configItem);
|
|
i3 = i6;
|
|
version2DbUpgrade = this;
|
|
} catch (Exception e5) {
|
|
e = e5;
|
|
i3 = i6;
|
|
version2DbUpgrade = this;
|
|
e.printStackTrace();
|
|
version2DbUpgrade.close(query);
|
|
columnIndex = i4;
|
|
columnIndex14 = i3;
|
|
columnIndex15 = i2;
|
|
columnIndex2 = i;
|
|
}
|
|
} catch (Exception e6) {
|
|
e = e6;
|
|
i3 = i6;
|
|
arrayList2 = arrayList;
|
|
version2DbUpgrade = this;
|
|
e.printStackTrace();
|
|
version2DbUpgrade.close(query);
|
|
columnIndex = i4;
|
|
columnIndex14 = i3;
|
|
columnIndex15 = i2;
|
|
columnIndex2 = i;
|
|
}
|
|
version2DbUpgrade.close(query);
|
|
columnIndex = i4;
|
|
columnIndex14 = i3;
|
|
columnIndex15 = i2;
|
|
columnIndex2 = i;
|
|
} catch (Throwable th2) {
|
|
th = th2;
|
|
version2DbUpgrade = this;
|
|
version2DbUpgrade.close(query);
|
|
throw th;
|
|
}
|
|
}
|
|
if (arrayList2.size() > 0) {
|
|
ConfigItemDbHandler.getInstance().insertOrUpdateInTx(arrayList2);
|
|
}
|
|
}
|
|
|
|
private void migrateDiyModel(SQLiteDatabase sQLiteDatabase) {
|
|
int i;
|
|
int i2;
|
|
DiyDBModel diyDBModel;
|
|
Version2DbUpgrade version2DbUpgrade = this;
|
|
Cursor query = version2DbUpgrade.query(sQLiteDatabase, "CustomModelBean");
|
|
if (query == null) {
|
|
return;
|
|
}
|
|
ArrayList arrayList = new ArrayList();
|
|
int columnIndex = query.getColumnIndex("customModelId");
|
|
int columnIndex2 = query.getColumnIndex(UnityActivity.pModelName);
|
|
int columnIndex3 = query.getColumnIndex("customModelCategory");
|
|
int columnIndex4 = query.getColumnIndex("modifyTime");
|
|
int columnIndex5 = query.getColumnIndex("isModify");
|
|
int columnIndex6 = query.getColumnIndex("modelId");
|
|
int columnIndex7 = query.getColumnIndex("useable");
|
|
int columnIndex8 = query.getColumnIndex(MediationMetaData.KEY_VERSION);
|
|
int columnIndex9 = query.getColumnIndex(SocialConstants.PARAM_COMMENT);
|
|
int columnIndex10 = query.getColumnIndex("modelCreatedId");
|
|
int columnIndex11 = query.getColumnIndex("compressImagePath");
|
|
int columnIndex12 = query.getColumnIndex("uploadState");
|
|
while (query.moveToNext()) {
|
|
try {
|
|
try {
|
|
diyDBModel = new DiyDBModel();
|
|
try {
|
|
try {
|
|
diyDBModel.setCustomModelId(query.getString(columnIndex));
|
|
diyDBModel.setModelName(query.getString(columnIndex2));
|
|
diyDBModel.setCustomModelCategory(query.getInt(columnIndex3));
|
|
i = columnIndex;
|
|
i2 = columnIndex2;
|
|
} catch (Exception e) {
|
|
e = e;
|
|
version2DbUpgrade = this;
|
|
i = columnIndex;
|
|
i2 = columnIndex2;
|
|
e.printStackTrace();
|
|
version2DbUpgrade.close(query);
|
|
columnIndex = i;
|
|
columnIndex2 = i2;
|
|
}
|
|
} catch (Throwable th) {
|
|
th = th;
|
|
version2DbUpgrade = this;
|
|
version2DbUpgrade.close(query);
|
|
throw th;
|
|
}
|
|
} catch (Exception e2) {
|
|
e = e2;
|
|
}
|
|
try {
|
|
diyDBModel.setModifyTime(query.getInt(columnIndex4));
|
|
diyDBModel.setModify(Boolean.valueOf(query.getInt(columnIndex5) == 1));
|
|
diyDBModel.setModelId(Integer.valueOf(query.getInt(columnIndex6)));
|
|
diyDBModel.setUseable(query.getInt(columnIndex7) == 1);
|
|
diyDBModel.setVersion(query.getString(columnIndex8));
|
|
diyDBModel.setDescription(query.getString(columnIndex9));
|
|
diyDBModel.setModelCreatedId(query.getString(columnIndex10));
|
|
diyDBModel.setCompressImagePath(query.getString(columnIndex11));
|
|
diyDBModel.setFilePath(DiyRobotDbHandler.getCustomModelPath(query.getString(columnIndex10)) + diyDBModel.getCustomModelId() + File.separator + diyDBModel.getCustomModelId() + ".jpg");
|
|
diyDBModel.setUploadState(Integer.valueOf(query.getInt(columnIndex12)));
|
|
arrayList.add(diyDBModel);
|
|
version2DbUpgrade = this;
|
|
} catch (Exception e3) {
|
|
e = e3;
|
|
version2DbUpgrade = this;
|
|
e.printStackTrace();
|
|
version2DbUpgrade.close(query);
|
|
columnIndex = i;
|
|
columnIndex2 = i2;
|
|
}
|
|
version2DbUpgrade.close(query);
|
|
columnIndex = i;
|
|
columnIndex2 = i2;
|
|
} catch (Throwable th2) {
|
|
th = th2;
|
|
}
|
|
}
|
|
if (arrayList.size() > 0) {
|
|
DiyDBModelDBHandler.getInstance().insertOrUpdateInTx(arrayList);
|
|
}
|
|
}
|
|
|
|
private void migrateJimuMotion(SQLiteDatabase sQLiteDatabase) {
|
|
DiyDBModel diyDBModel;
|
|
Cursor query = query(sQLiteDatabase, "JimuMotion");
|
|
if (query == null) {
|
|
return;
|
|
}
|
|
Map<String, DiyDBModel> sampleModel = getSampleModel(sQLiteDatabase);
|
|
ArrayList arrayList = new ArrayList();
|
|
int columnIndex = query.getColumnIndex("userId");
|
|
int columnIndex2 = query.getColumnIndex(UnityActivity.pModelType);
|
|
int columnIndex3 = query.getColumnIndex("customModelId");
|
|
int columnIndex4 = query.getColumnIndex("isDeleted");
|
|
int columnIndex5 = query.getColumnIndex("actionName");
|
|
int columnIndex6 = query.getColumnIndex(ActionWidgetData.ACTION_ID);
|
|
int columnIndex7 = query.getColumnIndex("actionData");
|
|
while (query.moveToNext()) {
|
|
try {
|
|
try {
|
|
JimuMotion jimuMotion = new JimuMotion();
|
|
jimuMotion.setUserId(query.getString(columnIndex));
|
|
jimuMotion.setModelType(query.getString(columnIndex2));
|
|
jimuMotion.setCustomModelId(query.getString(columnIndex3));
|
|
jimuMotion.setIsDeleted(query.getString(columnIndex4));
|
|
jimuMotion.setActionName(query.getString(columnIndex5));
|
|
jimuMotion.setActionID(query.getString(columnIndex6));
|
|
jimuMotion.setActionData((ArrayList) JsonHelper.a(query.getString(columnIndex7), new TypeToken<List<JimuMotion.JimuServo>>() { // from class: com.ubt.jimu.transport3.upgrade.Version2DbUpgrade.1
|
|
}.getType()));
|
|
if (sampleModel.size() > 0 && (diyDBModel = sampleModel.get(jimuMotion.getCustomModelId())) != null) {
|
|
jimuMotion.setModelId(diyDBModel.getModelId().intValue());
|
|
}
|
|
arrayList.add(jimuMotion);
|
|
} catch (Exception e) {
|
|
e.printStackTrace();
|
|
}
|
|
} finally {
|
|
close(query);
|
|
}
|
|
}
|
|
if (arrayList.size() > 0) {
|
|
JimuMotionDbHandler.getInstance().insertOrUpdateInTx(arrayList);
|
|
}
|
|
}
|
|
|
|
/* JADX WARN: Unreachable blocks removed: 1, instructions: 1 */
|
|
private void migrateTransportFile(SQLiteDatabase sQLiteDatabase) {
|
|
int i;
|
|
int i2;
|
|
int i3;
|
|
int i4;
|
|
int i5;
|
|
int i6;
|
|
Cursor query = query(sQLiteDatabase, "syncFile");
|
|
if (query == null) {
|
|
return;
|
|
}
|
|
ArrayList arrayList = new ArrayList();
|
|
int columnIndex = query.getColumnIndex("userId");
|
|
int columnIndex2 = query.getColumnIndex("customModelId");
|
|
int columnIndex3 = query.getColumnIndex("fileName");
|
|
int columnIndex4 = query.getColumnIndex("filePath");
|
|
int columnIndex5 = query.getColumnIndex("fileUrl");
|
|
int columnIndex6 = query.getColumnIndex("filenVersion");
|
|
int columnIndex7 = query.getColumnIndex("modelId");
|
|
int columnIndex8 = query.getColumnIndex(UnityActivity.pModelType);
|
|
int columnIndex9 = query.getColumnIndex("createTime");
|
|
query.getColumnIndex("modifyTime");
|
|
query.getColumnIndex("isDeleted");
|
|
query.getColumnIndex("isModify");
|
|
query.getColumnIndex("fileId");
|
|
query.getColumnIndex(JockstickDataConverter.ID);
|
|
query.getColumnIndex("customFileId");
|
|
while (query.moveToNext()) {
|
|
try {
|
|
try {
|
|
String string = query.getString(columnIndex2);
|
|
String string2 = query.getString(columnIndex);
|
|
String string3 = query.getString(columnIndex3);
|
|
String string4 = query.getString(columnIndex4);
|
|
String string5 = query.getString(columnIndex5);
|
|
String string6 = query.getString(columnIndex6);
|
|
int i7 = query.getInt(columnIndex7);
|
|
String string7 = query.getString(columnIndex8);
|
|
i = columnIndex;
|
|
i2 = columnIndex2;
|
|
try {
|
|
long j = query.getLong(columnIndex9);
|
|
i3 = columnIndex3;
|
|
try {
|
|
i4 = columnIndex4;
|
|
i5 = columnIndex5;
|
|
i6 = columnIndex6;
|
|
try {
|
|
TransportFile transportFile = new TransportFile(string2, i7, string, string7, "", string4, string3);
|
|
transportFile.setFileUrl(string5);
|
|
transportFile.setFileVersion(string6);
|
|
transportFile.setCreateTime(j);
|
|
arrayList.add(transportFile);
|
|
} catch (Exception e) {
|
|
e = e;
|
|
e.printStackTrace();
|
|
close(query);
|
|
columnIndex = i;
|
|
columnIndex2 = i2;
|
|
columnIndex3 = i3;
|
|
columnIndex4 = i4;
|
|
columnIndex5 = i5;
|
|
columnIndex6 = i6;
|
|
}
|
|
} catch (Exception e2) {
|
|
e = e2;
|
|
i4 = columnIndex4;
|
|
i5 = columnIndex5;
|
|
i6 = columnIndex6;
|
|
e.printStackTrace();
|
|
close(query);
|
|
columnIndex = i;
|
|
columnIndex2 = i2;
|
|
columnIndex3 = i3;
|
|
columnIndex4 = i4;
|
|
columnIndex5 = i5;
|
|
columnIndex6 = i6;
|
|
}
|
|
} catch (Exception e3) {
|
|
e = e3;
|
|
i3 = columnIndex3;
|
|
i4 = columnIndex4;
|
|
i5 = columnIndex5;
|
|
i6 = columnIndex6;
|
|
e.printStackTrace();
|
|
close(query);
|
|
columnIndex = i;
|
|
columnIndex2 = i2;
|
|
columnIndex3 = i3;
|
|
columnIndex4 = i4;
|
|
columnIndex5 = i5;
|
|
columnIndex6 = i6;
|
|
}
|
|
} catch (Throwable th) {
|
|
close(query);
|
|
throw th;
|
|
}
|
|
} catch (Exception e4) {
|
|
e = e4;
|
|
i = columnIndex;
|
|
i2 = columnIndex2;
|
|
}
|
|
close(query);
|
|
columnIndex = i;
|
|
columnIndex2 = i2;
|
|
columnIndex3 = i3;
|
|
columnIndex4 = i4;
|
|
columnIndex5 = i5;
|
|
columnIndex6 = i6;
|
|
}
|
|
if (arrayList.size() > 0) {
|
|
TransportFileDbHandler2.getInstance().insertOrUpdateInTx(arrayList);
|
|
}
|
|
}
|
|
|
|
private Cursor query(SQLiteDatabase sQLiteDatabase, String str) {
|
|
try {
|
|
return sQLiteDatabase.rawQuery(String.format("SELECT * FROM %s", str), null);
|
|
} catch (Exception e) {
|
|
e.printStackTrace();
|
|
return null;
|
|
}
|
|
}
|
|
|
|
/* JADX WARN: Unsupported multi-entry loop pattern (BACK_EDGE: B:17:0x005c -> B:6:0x005f). Please report as a decompilation issue!!! */
|
|
public void migrate(Context context) {
|
|
SQLiteDatabase sQLiteDatabase = null;
|
|
try {
|
|
try {
|
|
try {
|
|
sQLiteDatabase = new DataBaseHelper(context).getWritableDatabase();
|
|
migrateDiyModel(sQLiteDatabase);
|
|
migrateBlocklyProject(sQLiteDatabase);
|
|
migrateTransportFile(sQLiteDatabase);
|
|
migrateJimuMotion(sQLiteDatabase);
|
|
migrateConfigItem(sQLiteDatabase);
|
|
if (sQLiteDatabase != null) {
|
|
dropTable(sQLiteDatabase, "CustomModelBean");
|
|
dropTable(sQLiteDatabase, "BlocklyProject");
|
|
dropTable(sQLiteDatabase, "JimuMotion");
|
|
dropTable(sQLiteDatabase, "syncFile");
|
|
dropTable(sQLiteDatabase, ConfigItem.TAG);
|
|
dropTable(sQLiteDatabase, "local_model");
|
|
sQLiteDatabase.close();
|
|
}
|
|
} catch (Throwable th) {
|
|
if (sQLiteDatabase != null) {
|
|
try {
|
|
dropTable(sQLiteDatabase, "CustomModelBean");
|
|
dropTable(sQLiteDatabase, "BlocklyProject");
|
|
dropTable(sQLiteDatabase, "JimuMotion");
|
|
dropTable(sQLiteDatabase, "syncFile");
|
|
dropTable(sQLiteDatabase, ConfigItem.TAG);
|
|
dropTable(sQLiteDatabase, "local_model");
|
|
sQLiteDatabase.close();
|
|
} catch (Exception e) {
|
|
e.printStackTrace();
|
|
}
|
|
}
|
|
throw th;
|
|
}
|
|
} catch (Exception e2) {
|
|
e2.printStackTrace();
|
|
if (sQLiteDatabase == null) {
|
|
return;
|
|
}
|
|
dropTable(sQLiteDatabase, "CustomModelBean");
|
|
dropTable(sQLiteDatabase, "BlocklyProject");
|
|
dropTable(sQLiteDatabase, "JimuMotion");
|
|
dropTable(sQLiteDatabase, "syncFile");
|
|
dropTable(sQLiteDatabase, ConfigItem.TAG);
|
|
dropTable(sQLiteDatabase, "local_model");
|
|
sQLiteDatabase.close();
|
|
}
|
|
} catch (Exception e3) {
|
|
e3.printStackTrace();
|
|
}
|
|
}
|
|
}
|