mirror of
https://github.com/wanghongenpin/proxypin.git
synced 2026-05-09 00:34:17 +08:00
flutter-3.19.6
This commit is contained in:
@@ -147,16 +147,16 @@ abstract class HttpMessage {
|
||||
return _bodyString!;
|
||||
}
|
||||
|
||||
List<int> rawBody = body!;
|
||||
if (headers.contentEncoding == 'zstd') {
|
||||
rawBody = await zstdDecode(body!) ?? [];
|
||||
if (charset == 'utf-8' || charset == 'utf8') {
|
||||
_bodyString = utf8.decode(rawBody);
|
||||
} else {
|
||||
_bodyString = String.fromCharCodes(rawBody);
|
||||
}
|
||||
return _bodyString!;
|
||||
}
|
||||
// List<int> rawBody = body!;
|
||||
// if (headers.contentEncoding == 'zstd') {
|
||||
// rawBody = await zstdDecode(body!) ?? [];
|
||||
// if (charset == 'utf-8' || charset == 'utf8') {
|
||||
// _bodyString = utf8.decode(rawBody);
|
||||
// } else {
|
||||
// _bodyString = String.fromCharCodes(rawBody);
|
||||
// }
|
||||
// return _bodyString!;
|
||||
// }
|
||||
|
||||
return getBodyString();
|
||||
}
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
import 'dart:io';
|
||||
import 'dart:typed_data';
|
||||
|
||||
import 'package:brotli/brotli.dart';
|
||||
import 'package:proxypin/network/util/logger.dart';
|
||||
import 'package:zstandard/zstandard.dart';
|
||||
|
||||
///GZIP 解压缩
|
||||
List<int> gzipDecode(List<int> byteBuffer) {
|
||||
@@ -33,11 +31,12 @@ List<int> brDecode(List<int> byteBuffer) {
|
||||
|
||||
///zstd 解压缩
|
||||
Future<List<int>?> zstdDecode(List<int> byteBuffer) async {
|
||||
final zstandard = Zstandard();
|
||||
try {
|
||||
return zstandard.decompress(Uint8List.fromList(byteBuffer));
|
||||
} catch (e) {
|
||||
logger.e("zstdDecode error: $e");
|
||||
return byteBuffer;
|
||||
}
|
||||
// final zstandard = Zstandard();
|
||||
// try {
|
||||
// return zstandard.decompress(Uint8List.fromList(byteBuffer));
|
||||
// } catch (e) {
|
||||
// logger.e("zstdDecode error: $e");
|
||||
// return byteBuffer;
|
||||
// }
|
||||
return byteBuffer;
|
||||
}
|
||||
|
||||
@@ -182,14 +182,14 @@ class _AesWidgetState extends State<AesPage> {
|
||||
children: [
|
||||
FilledButton(
|
||||
style: ButtonStyle(
|
||||
shape: WidgetStateProperty.all<RoundedRectangleBorder>(
|
||||
shape: MaterialStateProperty.all<RoundedRectangleBorder>(
|
||||
RoundedRectangleBorder(borderRadius: BorderRadius.circular(8)))),
|
||||
onPressed: encryptText,
|
||||
child: Text(localizations.encrypt)),
|
||||
const SizedBox(width: 60),
|
||||
FilledButton(
|
||||
style: ButtonStyle(
|
||||
shape: WidgetStateProperty.all<RoundedRectangleBorder>(
|
||||
shape: MaterialStateProperty.all<RoundedRectangleBorder>(
|
||||
RoundedRectangleBorder(borderRadius: BorderRadius.circular(8)))),
|
||||
onPressed: decryptText,
|
||||
child: Text(localizations.decrypt)),
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
#include <screen_retriever_linux/screen_retriever_linux_plugin.h>
|
||||
#include <url_launcher_linux/url_launcher_plugin.h>
|
||||
#include <window_manager/window_manager_plugin.h>
|
||||
#include <zstandard_linux/zstandard_linux_plugin.h>
|
||||
|
||||
void fl_register_plugins(FlPluginRegistry* registry) {
|
||||
g_autoptr(FlPluginRegistrar) desktop_multi_window_registrar =
|
||||
@@ -37,7 +36,4 @@ void fl_register_plugins(FlPluginRegistry* registry) {
|
||||
g_autoptr(FlPluginRegistrar) window_manager_registrar =
|
||||
fl_plugin_registry_get_registrar_for_plugin(registry, "WindowManagerPlugin");
|
||||
window_manager_plugin_register_with_registrar(window_manager_registrar);
|
||||
g_autoptr(FlPluginRegistrar) zstandard_linux_registrar =
|
||||
fl_plugin_registry_get_registrar_for_plugin(registry, "ZstandardLinuxPlugin");
|
||||
zstandard_linux_plugin_register_with_registrar(zstandard_linux_registrar);
|
||||
}
|
||||
|
||||
@@ -10,7 +10,6 @@ list(APPEND FLUTTER_PLUGIN_LIST
|
||||
screen_retriever_linux
|
||||
url_launcher_linux
|
||||
window_manager
|
||||
zstandard_linux
|
||||
)
|
||||
|
||||
list(APPEND FLUTTER_FFI_PLUGIN_LIST
|
||||
|
||||
@@ -16,7 +16,6 @@ import share_plus
|
||||
import shared_preferences_foundation
|
||||
import url_launcher_macos
|
||||
import window_manager
|
||||
import zstandard_macos
|
||||
|
||||
func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
|
||||
FlutterMultiWindowPlugin.register(with: registry.registrar(forPlugin: "FlutterMultiWindowPlugin"))
|
||||
@@ -30,5 +29,4 @@ func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
|
||||
SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin"))
|
||||
UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin"))
|
||||
WindowManagerPlugin.register(with: registry.registrar(forPlugin: "WindowManagerPlugin"))
|
||||
ZstandardMacosPlugin.register(with: registry.registrar(forPlugin: "ZstandardMacosPlugin"))
|
||||
}
|
||||
|
||||
@@ -45,7 +45,6 @@ dependencies:
|
||||
flutter_qr_reader: ^1.0.5
|
||||
|
||||
brotli: ^0.6.0
|
||||
zstandard: ^1.3.27
|
||||
|
||||
win32audio: ^1.3.1
|
||||
vclibs: ^0.1.3
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
#include <win32audio/win32audio_plugin_c_api.h>
|
||||
#include <window_manager/window_manager_plugin.h>
|
||||
#include <windows_single_instance/windows_single_instance_plugin.h>
|
||||
#include <zstandard_windows/zstandard_windows_plugin_c_api.h>
|
||||
|
||||
void RegisterPlugins(flutter::PluginRegistry* registry) {
|
||||
DesktopMultiWindowPluginRegisterWithRegistrar(
|
||||
@@ -42,6 +41,4 @@ void RegisterPlugins(flutter::PluginRegistry* registry) {
|
||||
registry->GetRegistrarForPlugin("WindowManagerPlugin"));
|
||||
WindowsSingleInstancePluginRegisterWithRegistrar(
|
||||
registry->GetRegistrarForPlugin("WindowsSingleInstancePlugin"));
|
||||
ZstandardWindowsPluginCApiRegisterWithRegistrar(
|
||||
registry->GetRegistrarForPlugin("ZstandardWindowsPluginCApi"));
|
||||
}
|
||||
|
||||
@@ -14,7 +14,6 @@ list(APPEND FLUTTER_PLUGIN_LIST
|
||||
win32audio
|
||||
window_manager
|
||||
windows_single_instance
|
||||
zstandard_windows
|
||||
)
|
||||
|
||||
list(APPEND FLUTTER_FFI_PLUGIN_LIST
|
||||
|
||||
Reference in New Issue
Block a user