Fix incorrect path when extracting downloaded .zip

This commit is contained in:
NikolayHD
2018-07-30 22:40:00 +03:00
parent 3d85051f7f
commit 43a12342e9
3 changed files with 30 additions and 21 deletions

View File

@@ -46,11 +46,14 @@ public class AssetsDownloader {
}
if (SOptionPane.showConfirmDialog(message, "New Version Available", "Update Now", "Update Later")) {
String filename = "forge-android-" + version + "-signed-aligned.apk";
String apkFile = new GuiDownloadZipService("", "update",
GuiDownloadZipService downloadService = new GuiDownloadZipService("", "update",
"https://releases.cardforge.org/forge/forge-gui-android/" + version + "/" + filename,
Forge.getDeviceAdapter().getDownloadsDir(), null, splashScreen.getProgressBar()).download(filename);
Forge.getDeviceAdapter().getDownloadsDir(), null, splashScreen.getProgressBar());
File apkFile = downloadService.download(filename);
if (apkFile != null) {
Forge.getDeviceAdapter().openFile(apkFile);
Forge.getDeviceAdapter().openFile(apkFile.getPath());
Forge.exit(true);
return;
}