叶子维
2024-03-26 13:51:20 +08:00
parent 2e18460f22
commit b61fdd0a0e
27 changed files with 183 additions and 153 deletions

View File

@ -82,13 +82,11 @@ import com.gh.gamecenter.common.retrofit.Response;
import com.gh.gamecenter.common.utils.DialogHelper;
import com.gh.gamecenter.common.utils.ExtensionsKt;
import com.gh.gamecenter.common.utils.NewFlatLogUtils;
import com.gh.gamecenter.common.utils.PermissionHelper;
import com.gh.gamecenter.common.utils.SensorsBridge;
import com.gh.gamecenter.common.utils.ShareUtils;
import com.gh.gamecenter.core.AppExecutor;
import com.gh.gamecenter.core.utils.ClassUtils;
import com.gh.gamecenter.core.utils.DisplayUtils;
import com.gh.gamecenter.core.utils.EmptyCallback;
import com.gh.gamecenter.core.utils.GsonUtils;
import com.gh.gamecenter.core.utils.MtaHelper;
import com.gh.gamecenter.core.utils.SPUtils;
@ -698,15 +696,18 @@ public class MainActivity extends BaseActivity {
try {
GameEntity gameEntity = GsonUtils.getGson().fromJson(json, new TypeToken<GameEntity>() {
}.getType());
DownloadEntity downloadEntity = SimulatorGameManager.findDownloadEntityByUrl(gameEntity.getApk().get(0).getUrl());
if (downloadEntity != null) {
File file = new File(downloadEntity.getPath());
if (!file.exists()) {
ToastUtils.showToast("文件已被删除,无法启动");
return;
}
if (gameEntity != null) {
String apkUrl = gameEntity.getApk().isEmpty() ? "" : gameEntity.getApk().get(0).getUrl();
DownloadEntity downloadEntity = SimulatorGameManager.findDownloadEntityByUrl(apkUrl);
if (downloadEntity != null) {
File file = new File(downloadEntity.getPath());
if (!file.exists()) {
ToastUtils.showToast("文件已被删除,无法启动");
return;
}
SimulatorGameManager.launchSimulatorGame(downloadEntity, gameEntity);
SimulatorGameManager.launchSimulatorGame(downloadEntity, gameEntity);
}
}
} catch (JsonSyntaxException exception) {
exception.printStackTrace();