Skip to content

Commit 0ee0828

Browse files
committed
Fix archive API breakage
1 parent d4ac988 commit 0ee0828

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

lib/utils/adb.dart

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,18 +49,20 @@ abstract class Adb {
4949

5050
Trace.verbose("Downloading to ${downloadPath.absolute}");
5151
Trace.verbose("Downloading from $adbFinalURL");
52-
var rs = await Dio().get<List<int>>(adbFinalURL,
53-
options: Options(
54-
responseType: ResponseType.bytes), // set responseType to `stream`
55-
onReceiveProgress: c,
56-
cancelToken: cancelToken);
52+
var rs = await Dio().get<List<int>>(
53+
adbFinalURL,
54+
options: Options(
55+
responseType: ResponseType.bytes), // set responseType to `stream`
56+
onReceiveProgress: c,
57+
cancelToken: cancelToken,
58+
);
5759

5860
var stream = rs.data;
5961
if (stream == null) throw "Stream is null";
6062

6163
// Decode the zip from the InputFileStream. The archive will have the contents of the
6264
// zip, without having stored the data in memory.
63-
final archive = ZipDecoder().decodeBuffer(InputStream(stream));
65+
final archive = ZipDecoder().decodeStream(InputMemoryStream(stream));
6466

6567
extractArchiveToDisk(archive, downloadPath.path);
6668
_adbCurrentPath = (await _getADBInstalledExecPath()).path;

0 commit comments

Comments
 (0)