Commit b477048e by pye52

现在在更新开始前会创建更新文件了

parent ed1d63e3
......@@ -118,7 +118,6 @@ public class MainActivity extends AppCompatActivity implements View.OnClickListe
SCWebSocketClient.getInstance().getConnectStateEvent().observe(this, event -> {
if (debugLayoutIsNotInflate()) return;
String msg;
LogUtils.d(TAG, "connect state: " + event.getState());
switch (event.getState()) {
case ConnectState.OFFLINE:
msg = String.format(getString(R.string.connect_offline), NetworkUtils.getTryingNetworkType(this));
......
......@@ -97,6 +97,15 @@ public class UpdateCommandHandler extends CommandHandler {
}
start = true;
FileUtils.delete(updateApk);
boolean createApk = false;
try {
createApk = updateApk.createNewFile();
} catch (IOException e) {
LogUtils.e(TAG, "更新包文件创建失败: " + e.getMessage(), e);
}
if (!createApk) {
return failedResult("更新包文件创建失败");
}
if (executor == null) {
executor = Executors.newScheduledThreadPool(1);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment