From 9e293c12508bbe02e942c502beb3ee3264bf97d1 Mon Sep 17 00:00:00 2001 From: klockky Date: Thu, 14 May 2026 18:01:36 +0300 Subject: [PATCH] =?UTF-8?q?fix:=20Zstd=20=D1=87=D0=B5=D1=80=D0=B5=D0=B7=20?= =?UTF-8?q?pure-Dart=20libcompress?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/core/protocol/packet.dart | 5 ++--- pubspec.lock | 24 ++++++++---------------- pubspec.yaml | 2 +- 3 files changed, 11 insertions(+), 20 deletions(-) diff --git a/lib/core/protocol/packet.dart b/lib/core/protocol/packet.dart index e8b3e27..d8527a1 100644 --- a/lib/core/protocol/packet.dart +++ b/lib/core/protocol/packet.dart @@ -1,7 +1,7 @@ import 'dart:typed_data'; import 'dart:isolate'; import 'package:dart_lz4/dart_lz4.dart'; -import 'package:es_compression/zstd.dart'; +import 'package:libcompress/libcompress.dart'; import 'package:msgpack_dart/msgpack_dart.dart' as msgpack; /// ver(1) + cmd(1) + seq(2) + opcode(2) + packedLen(4) = 10 @@ -162,8 +162,7 @@ Uint8List _decompressPayload(Uint8List src) { src[2] == 0x2F && src[3] == 0xFD) { try { - final out = zstd.decode(src); - return out is Uint8List ? out : Uint8List.fromList(out); + return ZstdCodec().decompress(src); } catch (e) { throw Exception('Zstd decompression error: $e'); } diff --git a/pubspec.lock b/pubspec.lock index d510664..00c6969 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -1,14 +1,6 @@ # Generated by pub # See https://dart.dev/tools/pub/glossary#lockfile packages: - args: - dependency: transitive - description: - name: args - sha256: d0481093c50b1da8910eb0bb301626d4d8eb7284aa739614d2b394ee09e3ea04 - url: "https://pub.dev" - source: hosted - version: "2.7.0" async: dependency: transitive description: @@ -145,14 +137,6 @@ packages: url: "https://pub.dev" source: hosted version: "2.0.8" - es_compression: - dependency: "direct main" - description: - name: es_compression - sha256: c1ff7af54802631cf5c3942cb67bb99daadcc087f573ca99a9de91002d1a7ece - url: "https://pub.dev" - source: hosted - version: "2.0.15" fake_async: dependency: transitive description: @@ -365,6 +349,14 @@ packages: url: "https://pub.dev" source: hosted version: "3.0.2" + libcompress: + dependency: "direct main" + description: + name: libcompress + sha256: "1f55be8dc9e622efa1584ad899e05880d71469b7107f35be1858e91d0fadf1d4" + url: "https://pub.dev" + source: hosted + version: "1.0.0" lints: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index cf9fd81..784ef10 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -38,7 +38,7 @@ dependencies: # Use with the CupertinoIcons class for iOS style icons. cupertino_icons: ^1.0.8 dart_lz4: ^1.0.0 - es_compression: ^2.0.15 + libcompress: ^1.0.0 msgpack_dart: ^1.0.1 logger: ^2.6.2 device_info_plus: 12.3.0