Use InputStream transfer

This commit is contained in:
vvb2060
2021-12-27 12:17:35 -08:00
committed by John Wu
parent f1a3ef9590
commit d3ade06421
3 changed files with 21 additions and 30 deletions
@@ -140,10 +140,7 @@ public class DownloadActivity extends Activity {
var is = new CipherInputStream(new ByteArrayInputStream(Bytes.res()), cipher);
var out = new FileOutputStream(apk);
try (is; out) {
byte[] buf = new byte[4096];
for (int read; (read = is.read(buf)) >= 0;) {
out.write(buf, 0, read);
}
APKInstall.transfer(is, out);
}
DynAPK.addAssetPath(getResources().getAssets(), apk.getPath());
} catch (Exception ignored) {