From fc2b3f33a6433547baae434804dc9f939af04a9b Mon Sep 17 00:00:00 2001 From: imkiva Date: Mon, 10 Sep 2018 22:38:57 +0800 Subject: [PATCH] fix: setup progress bar indicates wrong progress --- app/src/main/java/io/neoterm/setup/SetupThread.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/io/neoterm/setup/SetupThread.java b/app/src/main/java/io/neoterm/setup/SetupThread.java index 8936712..71222b6 100644 --- a/app/src/main/java/io/neoterm/setup/SetupThread.java +++ b/app/src/main/java/io/neoterm/setup/SetupThread.java @@ -50,16 +50,16 @@ final class SetupThread extends Thread { deleteFolder(stagingPrefixFile); } - int totalBytes = 0; int totalReadBytes = 0; final byte[] buffer = new byte[8096]; final List> symlinks = new ArrayList<>(50); - totalBytes = sourceConnection.getSize(); try (ZipInputStream zipInput = new ZipInputStream(sourceConnection.getInputStream())) { ZipEntry zipEntry; + int totalBytes = sourceConnection.getSize(); + while ((zipEntry = zipInput.getNextEntry()) != null) { totalReadBytes += zipEntry.getCompressedSize();