From 0c2ed411b5393f2511ae07710529cda777e764eb Mon Sep 17 00:00:00 2001 From: wanghongenpin Date: Thu, 29 Jan 2026 07:27:51 +0800 Subject: [PATCH 1/4] android --- android/app/build.gradle | 21 +++++++++++++++++++ .../gradle/wrapper/gradle-wrapper.properties | 2 +- android/settings.gradle | 4 +++- macos/Flutter/GeneratedPluginRegistrant.swift | 2 -- windows/packaging/msix/make_config.yaml | 2 +- 5 files changed, 26 insertions(+), 5 deletions(-) diff --git a/android/app/build.gradle b/android/app/build.gradle index 2875577..c131243 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -1,3 +1,7 @@ +import java.util.Properties +import java.io.FileInputStream +import java.io.File + plugins { id "com.android.application" id "kotlin-android" @@ -96,5 +100,22 @@ flutter { source '../..' } +// Set a fixed APK name for release builds +// Use the older ApplicationVariants API which is compatible across AGP versions +android.applicationVariants.all { variant -> + if (variant.buildType.name == 'release') { + variant.outputs.all { output -> + def apkName = "proxypin-android.apk" + try { + // Newer output API + output.outputFileName = apkName + } catch (Exception e) { + // Fallback for older API + output.outputFile = new File(output.outputFile.parent, apkName) + } + } + } +} + dependencies { } diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties index 1e56f6a..c20122a 100644 --- a/android/gradle/wrapper/gradle-wrapper.properties +++ b/android/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ #Tue Nov 28 00:35:45 CST 2023 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/android/settings.gradle b/android/settings.gradle index 79b7e7e..1b9cabc 100644 --- a/android/settings.gradle +++ b/android/settings.gradle @@ -1,3 +1,5 @@ +import java.util.Properties + pluginManagement { def flutterSdkPath = { def properties = new Properties() @@ -19,7 +21,7 @@ pluginManagement { plugins { id "dev.flutter.flutter-plugin-loader" version "1.0.0" - id "com.android.application" version '8.6.0' apply false + id "com.android.application" version '8.9.1' apply false id "org.jetbrains.kotlin.android" version "2.1.0" apply false } diff --git a/macos/Flutter/GeneratedPluginRegistrant.swift b/macos/Flutter/GeneratedPluginRegistrant.swift index 76534dc..dbdc78c 100644 --- a/macos/Flutter/GeneratedPluginRegistrant.swift +++ b/macos/Flutter/GeneratedPluginRegistrant.swift @@ -10,7 +10,6 @@ import device_info_plus import file_picker import flutter_desktop_context_menu import flutter_js -import path_provider_foundation import proxy_manager import screen_retriever_macos import share_plus @@ -25,7 +24,6 @@ func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { FilePickerPlugin.register(with: registry.registrar(forPlugin: "FilePickerPlugin")) FlutterDesktopContextMenuPlugin.register(with: registry.registrar(forPlugin: "FlutterDesktopContextMenuPlugin")) FlutterJsPlugin.register(with: registry.registrar(forPlugin: "FlutterJsPlugin")) - PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin")) ProxyManagerPlugin.register(with: registry.registrar(forPlugin: "ProxyManagerPlugin")) ScreenRetrieverMacosPlugin.register(with: registry.registrar(forPlugin: "ScreenRetrieverMacosPlugin")) SharePlusMacosPlugin.register(with: registry.registrar(forPlugin: "SharePlusMacosPlugin")) diff --git a/windows/packaging/msix/make_config.yaml b/windows/packaging/msix/make_config.yaml index c5478b6..e6d2437 100644 --- a/windows/packaging/msix/make_config.yaml +++ b/windows/packaging/msix/make_config.yaml @@ -3,7 +3,7 @@ publisher_display_name: ProxyPin publisher: CN=8EC6F6C3-E66C-4189-8421-A6F2A451F552 identity_name: ProxyPin.ProxyPin publisher_url: https://github.com/wanghongenpin/proxypin -msix_version: 1.2.2.0 +msix_version: 1.2.4.0 logo_path: D:\IdeaProjects\proxypin\assets\icon.png capabilities: internetClient store: "true" From e9574e7abccd7d4dc0ab24aff5f0073515f82a9c Mon Sep 17 00:00:00 2001 From: wanghongenpin Date: Fri, 30 Jan 2026 12:14:19 +0800 Subject: [PATCH 2/4] Add zlib decoding support and fix encoding order in HTTP response handling --- lib/network/http/http.dart | 9 ++++++--- lib/network/util/compress.dart | 12 ++++++++++++ 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/lib/network/http/http.dart b/lib/network/http/http.dart index 26654fd..4489243 100644 --- a/lib/network/http/http.dart +++ b/lib/network/http/http.dart @@ -125,12 +125,15 @@ abstract class HttpMessage { charset ??= this.charset; try { List rawBody = body!; - if (headers.contentEncoding == 'br') { - rawBody = brDecode(body!); - } if (headers.isGzip) { rawBody = gzipDecode(body!); + }else + + if (headers.contentEncoding == 'br') { + rawBody = brDecode(body!); + } else if (headers.contentEncoding == 'deflate') { + rawBody = zlibDecode(body!); } if (charset == 'utf-8' || charset == 'utf8') { diff --git a/lib/network/util/compress.dart b/lib/network/util/compress.dart index 0c44c5a..528064a 100644 --- a/lib/network/util/compress.dart +++ b/lib/network/util/compress.dart @@ -41,3 +41,15 @@ Future?> zstdDecode(List byteBuffer) async { return byteBuffer; } } + + +///zlib +List zlibDecode(List byteBuffer) { + try { + final rawDeflateDecoder = ZLibDecoder(raw: true); + return rawDeflateDecoder.convert(byteBuffer); + } catch (e) { + logger.e("zlibDecode error: $e"); + return byteBuffer; + } +} \ No newline at end of file From 40be67290c28035c96ee7765d5cea5696bd75355 Mon Sep 17 00:00:00 2001 From: wanghongenpin Date: Fri, 30 Jan 2026 12:21:09 +0800 Subject: [PATCH 3/4] Fix remote URL check to handle null or empty values in script retrieval (#682) --- lib/ui/desktop/setting/script.dart | 2 +- lib/ui/mobile/setting/script.dart | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ui/desktop/setting/script.dart b/lib/ui/desktop/setting/script.dart index b90b098..84397a1 100644 --- a/lib/ui/desktop/setting/script.dart +++ b/lib/ui/desktop/setting/script.dart @@ -938,7 +938,7 @@ class _ScriptListState extends State { var map = item.toJson(); map.remove("scriptPath"); - if (item.remoteUrl != null && item.remoteUrl!.trim().isNotEmpty) { + if (item.remoteUrl == null || item.remoteUrl!.trim().isEmpty) { map['script'] = await scriptManager.getScript(item); } diff --git a/lib/ui/mobile/setting/script.dart b/lib/ui/mobile/setting/script.dart index f65fb79..8d4d2db 100644 --- a/lib/ui/mobile/setting/script.dart +++ b/lib/ui/mobile/setting/script.dart @@ -1015,7 +1015,7 @@ class _ScriptListState extends State { var item = widget.scripts[idx]; var map = item.toJson(); map.remove("scriptPath"); - if (item.remoteUrl != null && item.remoteUrl!.trim().isNotEmpty) { + if (item.remoteUrl == null || item.remoteUrl!.trim().isEmpty) { map['script'] = await scriptManager.getScript(item); } json.add(map); From 02bc02880c19473da7d725ab3b111b73b9939b63 Mon Sep 17 00:00:00 2001 From: wanghongenpin Date: Fri, 30 Jan 2026 18:11:16 +0800 Subject: [PATCH 4/4] v1.2.5 --- lib/ui/configuration.dart | 8 ++++---- lib/ui/desktop/desktop.dart | 14 ++++++++------ lib/ui/mobile/mobile.dart | 14 ++++++++------ linux/build.sh | 2 +- pubspec.yaml | 4 ++-- windows/packaging/msix/make_config.yaml | 2 +- 6 files changed, 24 insertions(+), 20 deletions(-) diff --git a/lib/ui/configuration.dart b/lib/ui/configuration.dart index f5be567..4668c22 100644 --- a/lib/ui/configuration.dart +++ b/lib/ui/configuration.dart @@ -63,7 +63,7 @@ class ThemeModel { } class AppConfiguration { - static const String version = "1.2.4"; + static const String version = "1.2.5"; ValueNotifier globalChange = ValueNotifier(false); @@ -71,7 +71,7 @@ class AppConfiguration { Locale? _language; //是否显示更新内容公告 - bool upgradeNoticeV24 = true; + bool upgradeNoticeV25 = true; /// 是否启用画中画 ValueNotifier pipEnabled = ValueNotifier(Platform.isAndroid); @@ -199,7 +199,7 @@ class AppConfiguration { _theme = ThemeModel(mode: mode, useMaterial3: config['useMaterial3'] ?? true); _theme.color = config['themeColor'] ?? "Blue"; - upgradeNoticeV24 = config['upgradeNoticeV24'] ?? true; + upgradeNoticeV25 = config['upgradeNoticeV25'] ?? true; _language = config['language'] == null ? null : Locale.fromSubtags( @@ -251,7 +251,7 @@ class AppConfiguration { 'mode': _theme.mode.name, 'themeColor': _theme.color, 'useMaterial3': _theme.useMaterial3, - 'upgradeNoticeV24': upgradeNoticeV24, + 'upgradeNoticeV25': upgradeNoticeV25, "language": _language?.languageCode, "languageScript": _language?.scriptCode, "headerExpanded": headerExpanded, diff --git a/lib/ui/desktop/desktop.dart b/lib/ui/desktop/desktop.dart index bfa4f40..2ad51af 100644 --- a/lib/ui/desktop/desktop.dart +++ b/lib/ui/desktop/desktop.dart @@ -93,7 +93,7 @@ class _DesktopHomePagePageState extends State implements EventL proxyServer.addListener(this); panel = NetworkTabController(tabStyle: const TextStyle(fontSize: 16), proxyServer: proxyServer); - if (widget.appConfiguration.upgradeNoticeV24) { + if (widget.appConfiguration.upgradeNoticeV25) { WidgetsBinding.instance.addPostFrameCallback((_) { showUpgradeNotice(); }); @@ -162,7 +162,7 @@ class _DesktopHomePagePageState extends State implements EventL actions: [ TextButton( onPressed: () { - widget.appConfiguration.upgradeNoticeV24 = false; + widget.appConfiguration.upgradeNoticeV25 = false; widget.appConfiguration.flushConfig(); Navigator.pop(context); }, @@ -181,8 +181,9 @@ class _DesktopHomePagePageState extends State implements EventL '3. 脚本支持远程URL获取执行;\n' '4. HTTP Header 展示增加文本和表格切换;\n' '5. 增加 Request Param 列表展示;\n' - '6. 应用过滤列表增加是否显示系统应用;\n' - '7. 更新JSON深色主题色,以提高可见度和美观度;\n' + '6. 添加zlib解码支持\n' + '7. 应用过滤列表增加是否显示系统应用;\n' + '8. 更新JSON深色主题色,以提高可见度和美观度;\n' : 'Note: HTTPS capture is disabled by default — please install the certificate before enabling HTTPS capture.\n' 'Click the HTTPS capture (lock) icon, choose "Install Root Certificate", and follow the prompts to complete installation.\n\n' '1. Added import/export for Favorites.\n' @@ -190,8 +191,9 @@ class _DesktopHomePagePageState extends State implements EventL '3. Scripts can now be fetched from remote URLs and executed.\n' '4. HTTP header view now supports switching between text and table modes.\n' '5. Added a Request Params list view.\n' - '6. App filter list now includes an option to show system apps.\n' - '7. Updated JSON dark-theme colors for better visibility and appearance.\n', + '6. Add zlib decoding support.\n' + '7. App filter list now includes an option to show system apps.\n' + '8. Updated JSON dark-theme colors for better visibility and appearance.\n', style: const TextStyle(fontSize: 14)))); }); } diff --git a/lib/ui/mobile/mobile.dart b/lib/ui/mobile/mobile.dart index 9eedf27..b1a5818 100644 --- a/lib/ui/mobile/mobile.dart +++ b/lib/ui/mobile/mobile.dart @@ -117,7 +117,7 @@ class MobileHomeState extends State implements EventListener, Li proxyServer.addListener(this); proxyServer.start(); - if (widget.appConfiguration.upgradeNoticeV24) { + if (widget.appConfiguration.upgradeNoticeV25) { WidgetsBinding.instance.addPostFrameCallback((_) { showUpgradeNotice(); }); @@ -292,19 +292,21 @@ class MobileHomeState extends State implements EventListener, Li '3. 脚本支持远程URL获取执行;\n' '4. HTTP Header 展示增加文本和表格切换;\n' '5. 增加 Request Param 列表展示;\n' - '6. 应用过滤列表增加是否显示系统应用;\n' - '7. 更新JSON深色主题色,以提高可见度和美观度;\n' + '6. 添加zlib解码支持\n' + '7. 应用过滤列表增加是否显示系统应用;\n' + '8. 更新JSON深色主题色,以提高可见度和美观度;\n' : 'Note: HTTPS capture is disabled by default — please install the certificate before enabling HTTPS capture.\n\n' '1. Added import/export for Favorites.\n' '2. Added request decryption with configurable AES automatic body decryption.\n' '3. Scripts can now be fetched from remote URLs and executed.\n' '4. HTTP header view now supports switching between text and table modes.\n' '5. Added a Request Params list view.\n' - '6. App filter list now includes an option to show system apps.\n' - '7. Updated JSON dark-theme colors for better visibility and appearance.\n'; + '6. Added zlib decoding support.\n' + '7. App filter list now includes an option to show system apps.\n' + '8. Updated JSON dark-theme colors for better visibility and appearance.\n'; showAlertDialog(isCN ? '更新内容V${AppConfiguration.version}' : "What's new in V${AppConfiguration.version}", content, () { - widget.appConfiguration.upgradeNoticeV24 = false; + widget.appConfiguration.upgradeNoticeV25 = false; widget.appConfiguration.flushConfig(); }); } diff --git a/linux/build.sh b/linux/build.sh index f29a670..d42b8d5 100644 --- a/linux/build.sh +++ b/linux/build.sh @@ -5,7 +5,7 @@ cd ../build/linux/x64/release rm -rf package mkdir -p package/DEBIAN echo "Package: ProxyPin" >> package/DEBIAN/control -echo "Version: 1.2.4" >> package/DEBIAN/control +echo "Version: 1.2.5" >> package/DEBIAN/control echo "Priority: optional" >> package/DEBIAN/control echo "Architecture: amd64" >> package/DEBIAN/control echo "Depends: ca-certificates" >> package/DEBIAN/control diff --git a/pubspec.yaml b/pubspec.yaml index 816ddc4..bf7c988 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -2,7 +2,7 @@ name: proxypin description: ProxyPin publish_to: 'none' # Remove this line if you wish to publish to pub.dev -version: 1.2.4+27 +version: 1.2.5+28 environment: sdk: '>=3.0.2 <4.0.0' @@ -23,7 +23,7 @@ dependencies: url: https://gitee.com/wanghongenpin/flutter-plugins.git path: packages/desktop_multi_window path_provider: ^2.1.5 - file_picker: ^10.3.8 + file_picker: ^10.3.10 proxy_manager: ^0.0.3 permission_handler: ^12.0.1 flutter_toastr: ^1.0.3 diff --git a/windows/packaging/msix/make_config.yaml b/windows/packaging/msix/make_config.yaml index e6d2437..bd57714 100644 --- a/windows/packaging/msix/make_config.yaml +++ b/windows/packaging/msix/make_config.yaml @@ -3,7 +3,7 @@ publisher_display_name: ProxyPin publisher: CN=8EC6F6C3-E66C-4189-8421-A6F2A451F552 identity_name: ProxyPin.ProxyPin publisher_url: https://github.com/wanghongenpin/proxypin -msix_version: 1.2.4.0 +msix_version: 1.2.5.0 logo_path: D:\IdeaProjects\proxypin\assets\icon.png capabilities: internetClient store: "true"