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/lib/network/http/http.dart b/lib/network/http/http.dart index 5009543..e880289 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 1c18499..339e19a 100644 --- a/lib/network/util/compress.dart +++ b/lib/network/util/compress.dart @@ -40,3 +40,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 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 1ab579e..aed531b 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/desktop/setting/script.dart b/lib/ui/desktop/setting/script.dart index cdf9647..5b81b1f 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/mobile.dart b/lib/ui/mobile/mobile.dart index 9453a91..b65f8ee 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/lib/ui/mobile/setting/script.dart b/lib/ui/mobile/setting/script.dart index a74d388..691f70c 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); 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/macos/Flutter/GeneratedPluginRegistrant.swift b/macos/Flutter/GeneratedPluginRegistrant.swift index 1808fce..ca6c8bf 100644 --- a/macos/Flutter/GeneratedPluginRegistrant.swift +++ b/macos/Flutter/GeneratedPluginRegistrant.swift @@ -9,7 +9,6 @@ import desktop_multi_window import device_info_plus import flutter_desktop_context_menu import flutter_js -import path_provider_foundation import proxy_manager import screen_retriever_macos import share_plus @@ -22,7 +21,6 @@ func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { DeviceInfoPlusMacosPlugin.register(with: registry.registrar(forPlugin: "DeviceInfoPlusMacosPlugin")) 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/pubspec.yaml b/pubspec.yaml index 2758828..4310d05 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' diff --git a/windows/packaging/msix/make_config.yaml b/windows/packaging/msix/make_config.yaml index c5478b6..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.2.0 +msix_version: 1.2.5.0 logo_path: D:\IdeaProjects\proxypin\assets\icon.png capabilities: internetClient store: "true"