Skip to content

Commit 1992f09

Browse files
dependabot[bot]crossleboyan01
authored
build(deps): Bump archive from 3.6.1 to 4.0.4 (#1700)
* build(deps): Bump archive from 3.6.1 to 4.0.4 Bumps [archive](https://github.com/brendan-duncan/archive) from 3.6.1 to 4.0.4. - [Changelog](https://github.com/brendan-duncan/archive/blob/main/CHANGELOG.md) - [Commits](https://github.com/brendan-duncan/archive/commits) --- updated-dependencies: - dependency-name: archive dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]> * fix error --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Crossle Song <[email protected]> Co-authored-by: bin <[email protected]>
1 parent a69b1a3 commit 1992f09

File tree

5 files changed

+39
-17
lines changed

5 files changed

+39
-17
lines changed

lib/blaze/blaze.dart

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -284,8 +284,8 @@ class Blaze {
284284
}
285285

286286
Future<void> _sendGZip(BlazeMessage msg) async {
287-
channel?.sink.add(
288-
GZipEncoder().encode(Uint8List.fromList(jsonEncode(msg).codeUnits)));
287+
channel?.sink.add(const GZipEncoder()
288+
.encode(Uint8List.fromList(jsonEncode(msg).codeUnits)));
289289
}
290290

291291
void _disconnect([bool resetConnectedState = true]) {
@@ -311,7 +311,7 @@ class Blaze {
311311
transactions[blazeMessage.id] = transaction;
312312
d('sendMessage transactions size: ${transactions.length}');
313313
return transaction.run(
314-
() => channel?.sink.add(GZipEncoder()
314+
() => channel?.sink.add(const GZipEncoder()
315315
.encode(Uint8List.fromList(jsonEncode(blazeMessage).codeUnits))),
316316
() => null);
317317
}
@@ -367,7 +367,8 @@ BlazeMessage parseBlazeMessage(List<int> list) =>
367367
_parseBlazeMessageInternal(list);
368368

369369
BlazeMessage _parseBlazeMessageInternal(List<int> message) {
370-
final content = String.fromCharCodes(GZipDecoder().decodeBytes(message));
370+
final content =
371+
String.fromCharCodes(const GZipDecoder().decodeBytes(message));
371372
return BlazeMessage.fromJson(jsonDecode(content) as Map<String, dynamic>);
372373
}
373374

lib/utils/device_transfer/transfer_protocol.dart

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import 'dart:async';
22
import 'dart:convert';
33
import 'dart:io';
44

5-
import 'package:archive/archive.dart';
65
import 'package:flutter/foundation.dart';
76
import 'package:path/path.dart' as p;
87
import 'package:uuid/uuid.dart';
@@ -441,7 +440,7 @@ class TransferProtocolSink implements EventSink<Uint8List> {
441440
// check hMAC
442441
final hMac = Uint8List.sublistView(data, offset, offset + 32);
443442
final calculatedHMac = builder.hMac;
444-
if (!Uint8ListEquality.equals(hMac, calculatedHMac)) {
443+
if (!hMac.equals(calculatedHMac)) {
445444
e('hMac not match. expected ${base64Encode(hMac)}, actually ${base64Encode(calculatedHMac)}');
446445
_sink.addError('hMac check error', StackTrace.current);
447446
return;
@@ -465,3 +464,16 @@ class TransferProtocolSink implements EventSink<Uint8List> {
465464
_sink.close();
466465
}
467466
}
467+
468+
extension on Uint8List {
469+
bool equals(Uint8List other) {
470+
if (length != other.length) {
471+
return false;
472+
}
473+
var v = 0;
474+
for (var i = 0; i < length; i++) {
475+
v |= this[i] ^ other[i];
476+
}
477+
return v == 0;
478+
}
479+
}

lib/utils/extension/src/db.dart

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,19 +55,20 @@ extension SelectedableThrottle<T> on Selectable<T> {
5555

5656
@immutable
5757
class LikeEscapeOperator extends Expression<bool> {
58-
LikeEscapeOperator(
58+
const LikeEscapeOperator(
5959
this.target,
6060
this.regex,
6161
this.escape, {
6262
this.operator = 'LIKE',
6363
});
64+
6465
final Expression<String> target;
6566
final Expression<String> regex;
6667
final Expression<String> escape;
6768
final String operator;
6869

6970
@override
70-
final Precedence precedence = Precedence.comparisonEq;
71+
Precedence get precedence => Precedence.comparisonEq;
7172

7273
@override
7374
void writeInto(GenerationContext context) {

pubspec.lock

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,10 @@ packages:
5050
dependency: "direct main"
5151
description:
5252
name: archive
53-
sha256: cb6a278ef2dbb298455e1a713bda08524a175630ec643a242c399c932a0a1f7d
53+
sha256: "0c64e928dcbefddecd234205422bcfc2b5e6d31be0b86fef0d0dd48d7b4c9742"
5454
url: "https://pub.dev"
5555
source: hosted
56-
version: "3.6.1"
56+
version: "4.0.4"
5757
args:
5858
dependency: transitive
5959
description:
@@ -948,10 +948,10 @@ packages:
948948
dependency: "direct main"
949949
description:
950950
name: image
951-
sha256: f31d52537dc417fdcde36088fdf11d191026fd5e4fae742491ebd40e5a8bea7d
951+
sha256: "13d3349ace88f12f4a0d175eb5c12dcdd39d35c4c109a8a13dfeb6d0bd9e31c3"
952952
url: "https://pub.dev"
953953
source: hosted
954-
version: "4.3.0"
954+
version: "4.5.3"
955955
image_picker:
956956
dependency: "direct main"
957957
description:
@@ -1036,10 +1036,10 @@ packages:
10361036
dependency: "direct dev"
10371037
description:
10381038
name: intl_utils
1039-
sha256: c2b1f5c72c25512cbeef5ab015c008fc50fe7e04813ba5541c25272300484bf4
1039+
sha256: "35f9a55004871f241e24b07465cf402914992d8549a60205ee0816576a8ddee7"
10401040
url: "https://pub.dev"
10411041
source: hosted
1042-
version: "2.8.7"
1042+
version: "2.8.8"
10431043
io:
10441044
dependency: transitive
10451045
description:
@@ -1220,10 +1220,10 @@ packages:
12201220
dependency: "direct main"
12211221
description:
12221222
name: lottie
1223-
sha256: "377d87b8dcef640c04717e93afb86a510f0e1117a399ab94dc4b3f39c85eaa87"
1223+
sha256: c5fa04a80a620066c15cf19cc44773e19e9b38e989ff23ea32e5903ef1015950
12241224
url: "https://pub.dev"
12251225
source: hosted
1226-
version: "3.3.0"
1226+
version: "3.3.1"
12271227
macros:
12281228
dependency: transitive
12291229
description:
@@ -1601,6 +1601,14 @@ packages:
16011601
url: "https://pub.dev"
16021602
source: hosted
16031603
version: "1.5.1"
1604+
posix:
1605+
dependency: transitive
1606+
description:
1607+
name: posix
1608+
sha256: a0117dc2167805aa9125b82eee515cc891819bac2f538c83646d355b16f58b9a
1609+
url: "https://pub.dev"
1610+
source: hosted
1611+
version: "6.0.1"
16041612
pretty_qr_code:
16051613
dependency: "direct main"
16061614
description:

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ environment:
2020
dependencies:
2121
android_id: ^0.4.0
2222
ansicolor: ^2.0.3
23-
archive: ^3.4.10
23+
archive: ^4.0.4
2424
async: ^2.8.1
2525
audio_session: ^0.1.25
2626
auto_size_text: ^3.0.0

0 commit comments

Comments
 (0)