diff --git a/android/app/src/main/kotlin/com/network/proxy/plugin/AppInfo.kt b/android/app/src/main/kotlin/com/network/proxy/plugin/AppInfo.kt index 3a6e79f..d8841e1 100644 --- a/android/app/src/main/kotlin/com/network/proxy/plugin/AppInfo.kt +++ b/android/app/src/main/kotlin/com/network/proxy/plugin/AppInfo.kt @@ -7,6 +7,7 @@ import android.graphics.Canvas import android.graphics.drawable.BitmapDrawable import android.graphics.drawable.Drawable import java.io.ByteArrayOutputStream +import androidx.core.graphics.createBitmap class ProcessInfo(name: CharSequence, packageName: String, icon: ByteArray?, versionName: String?) : HashMap() { @@ -55,11 +56,16 @@ class ProcessInfo(name: CharSequence, packageName: String, icon: ByteArray?, ver if (drawable is BitmapDrawable) { return drawable.bitmap } - val bitmap = Bitmap.createBitmap( - drawable.intrinsicWidth, - drawable.intrinsicHeight, - Bitmap.Config.ARGB_8888 - ) + + // 获取宽度和高度,如果无效则使用默认值 96dp + var width = drawable.intrinsicWidth + var height = drawable.intrinsicHeight + + // 如果宽度或高度无效(≤ 0),使用默认的 96 作为大小 + if (width <= 0) width = 96 + if (height <= 0) height = 96 + + val bitmap = createBitmap(width, height) val canvas = Canvas(bitmap) drawable.setBounds(0, 0, canvas.width, canvas.height) drawable.draw(canvas) diff --git a/ios/Flutter/AppFrameworkInfo.plist b/ios/Flutter/AppFrameworkInfo.plist index 391a902..1dc6cf7 100644 --- a/ios/Flutter/AppFrameworkInfo.plist +++ b/ios/Flutter/AppFrameworkInfo.plist @@ -20,5 +20,7 @@ ???? CFBundleVersion 1.0 + MinimumOSVersion + 13.0 diff --git a/ios/Runner/AudioManager.swift b/ios/Runner/AudioManager.swift index 8bb52cf..bc1df21 100644 --- a/ios/Runner/AudioManager.swift +++ b/ios/Runner/AudioManager.swift @@ -54,18 +54,16 @@ class AudioManager: NSObject { self.backgroundAudioPlayer?.delegate = self } -//主要修改了这里 private func setupListener() { NotificationCenter.default.addObserver(self, selector: #selector(didEnterBackground), name: UIApplication.didEnterBackgroundNotification, object: nil) NotificationCenter.default.addObserver(self, selector: #selector(didBecomeActive), name: UIApplication.didBecomeActiveNotification, object: nil) NotificationCenter.default.addObserver(self, selector: #selector(audioSessionInterruption(notification:)), name: AVAudioSession.interruptionNotification, object: nil) - - + } - } + // MARK: - 扩展 监听通知 extension AudioManager { /// 进入后台 播放无声音乐 @@ -126,6 +124,7 @@ extension AudioManager { } } } + // MARK: - 扩展 定时器任务 extension AudioManager { fileprivate func setupTimer() { diff --git a/lib/ui/configuration.dart b/lib/ui/configuration.dart index 4668c22..d8975cd 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.5"; + static const String version = "1.2.6"; ValueNotifier globalChange = ValueNotifier(false); @@ -71,7 +71,7 @@ class AppConfiguration { Locale? _language; //是否显示更新内容公告 - bool upgradeNoticeV25 = true; + bool upgradeNoticeV26 = 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"; - upgradeNoticeV25 = config['upgradeNoticeV25'] ?? true; + upgradeNoticeV26 = config['upgradeNoticeV26'] ?? true; _language = config['language'] == null ? null : Locale.fromSubtags( @@ -251,7 +251,7 @@ class AppConfiguration { 'mode': _theme.mode.name, 'themeColor': _theme.color, 'useMaterial3': _theme.useMaterial3, - 'upgradeNoticeV25': upgradeNoticeV25, + 'upgradeNoticeV26': upgradeNoticeV26, "language": _language?.languageCode, "languageScript": _language?.scriptCode, "headerExpanded": headerExpanded, diff --git a/lib/ui/desktop/desktop.dart b/lib/ui/desktop/desktop.dart index 2ad51af..ae014af 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.upgradeNoticeV25) { + if (widget.appConfiguration.upgradeNoticeV26) { WidgetsBinding.instance.addPostFrameCallback((_) { showUpgradeNotice(); }); @@ -162,7 +162,7 @@ class _DesktopHomePagePageState extends State implements EventL actions: [ TextButton( onPressed: () { - widget.appConfiguration.upgradeNoticeV25 = false; + widget.appConfiguration.upgradeNoticeV26 = false; widget.appConfiguration.flushConfig(); Navigator.pop(context); }, @@ -176,24 +176,21 @@ class _DesktopHomePagePageState extends State implements EventL isCN ? '提示:默认不会开启HTTPS抓包,请安装证书后再开启HTTPS抓包。\n' '点击HTTPS抓包(加锁图标),选择安装根证书,按照提示操作即可。\n\n' - '1. 增加收藏导出和导入;\n' - '2. 增加请求解密,可配置AES自动解密消息体;\n' - '3. 脚本支持远程URL获取执行;\n' - '4. HTTP Header 展示增加文本和表格切换;\n' - '5. 增加 Request Param 列表展示;\n' - '6. 添加zlib解码支持\n' - '7. 应用过滤列表增加是否显示系统应用;\n' - '8. 更新JSON深色主题色,以提高可见度和美观度;\n' + '1. 新增请求断点,可修改请求、响应后发送;\n' + '2. 在请求编辑器中为Header添加自动补全建议;\n' + '3. Android、iOS新增系统代理IP忽略设置;\n' + '4. Android新增系统代理是否启用设置;\n' + '5. Socks5代理新增 IPV6 支持;\n' + '6. 修复 MacOS 网线代理设置失败问题;\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' - '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. 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', + '1. Added request breakpoint feature, allowing modification of requests and responses before sending;\n' + '2. Added autocomplete suggestions for HTTP headers in request editor;\n' + '3. Added system proxy IP ignore settings for Android and iOS;\n' + '4. Added system proxy enable/disable settings for Android;\n' + '5. Added IPv6 support for Socks5 proxy;\n' + '6. Fixed an issue where proxy settings failed on macOS; \n' + , style: const TextStyle(fontSize: 14)))); }); } diff --git a/lib/ui/launch/launch.dart b/lib/ui/launch/launch.dart index 2648c8f..0d91740 100644 --- a/lib/ui/launch/launch.dart +++ b/lib/ui/launch/launch.dart @@ -193,6 +193,7 @@ class _SocketLaunchState extends State with WindowListener, Widget }); widget.onStart?.call(); }).catchError((e) { + logger.e("启动代理服务器失败", error: e); String message = localizations.proxyPortRepeat(widget.proxyServer.port); FlutterToastr.show(message, context, duration: 3); }); diff --git a/lib/ui/mobile/mobile.dart b/lib/ui/mobile/mobile.dart index 90b3084..48761d0 100644 --- a/lib/ui/mobile/mobile.dart +++ b/lib/ui/mobile/mobile.dart @@ -120,7 +120,7 @@ class MobileHomeState extends State implements EventListener, Li proxyServer.addListener(this); proxyServer.start(); - if (widget.appConfiguration.upgradeNoticeV25) { + if (widget.appConfiguration.upgradeNoticeV26) { WidgetsBinding.instance.addPostFrameCallback((_) { showUpgradeNotice(); }); @@ -138,9 +138,8 @@ class MobileHomeState extends State implements EventListener, Li builder: (context) => BreakpointExecutor( requestId: args['requestId'], request: HttpRequest.fromJson(jsonDecode(jsonEncode(args['request']))), - response: args['response'] == null - ? null - : HttpResponse.fromJson(jsonDecode(jsonEncode(args['response']))), + response: + args['response'] == null ? null : HttpResponse.fromJson(jsonDecode(jsonEncode(args['response']))), isResponse: args['type'] == 'response', ), ), @@ -310,26 +309,22 @@ class MobileHomeState extends State implements EventListener, Li String content = isCN ? '提示:默认不会开启HTTPS抓包,请安装证书后再开启HTTPS抓包。\n\n' - '1. 增加收藏导出和导入;\n' - '2. 增加请求解密,可配置AES自动解密消息体;\n' - '3. 脚本支持远程URL获取执行;\n' - '4. HTTP Header 展示增加文本和表格切换;\n' - '5. 增加 Request Param 列表展示;\n' - '6. 添加zlib解码支持\n' - '7. 应用过滤列表增加是否显示系统应用;\n' - '8. 更新JSON深色主题色,以提高可见度和美观度;\n' + '1. 新增请求断点,可修改请求、响应后发送;\n' + '2. 在请求编辑器中为Header添加自动补全建议;\n' + '3. Android、iOS新增系统代理IP忽略设置;\n' + '4. Android新增系统代理是否启用设置;\n' + '5. Socks5代理新增 IPV6 支持;\n' + '6. 修复 MacOS 网线代理设置失败问题;\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. 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'; + '1. Added request breakpoint feature, allowing modification of requests and responses before sending;\n' + '2. Added autocomplete suggestions for HTTP headers in request editor;\n' + '3. Added system proxy IP ignore settings for Android and iOS;\n' + '4. Added system proxy enable/disable settings for Android;\n' + '5. Added IPv6 support for Socks5 proxy;\n' + '6. Fixed an issue where proxy settings failed on macOS; \n'; showAlertDialog(isCN ? '更新内容V${AppConfiguration.version}' : "What's new in V${AppConfiguration.version}", content, () { - widget.appConfiguration.upgradeNoticeV25 = false; + widget.appConfiguration.upgradeNoticeV26 = false; widget.appConfiguration.flushConfig(); }); } diff --git a/linux/build.sh b/linux/build.sh index d42b8d5..7c5e6f8 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.5" >> package/DEBIAN/control +echo "Version: 1.2.6" >> 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 dbdc78c..76534dc 100644 --- a/macos/Flutter/GeneratedPluginRegistrant.swift +++ b/macos/Flutter/GeneratedPluginRegistrant.swift @@ -10,6 +10,7 @@ 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 @@ -24,6 +25,7 @@ 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/pubspec.yaml b/pubspec.yaml index 08ae3c6..79ed8fe 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.5+28 +version: 1.2.6+29 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 bd57714..36d5757 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.5.0 +msix_version: 1.2.6.0 logo_path: D:\IdeaProjects\proxypin\assets\icon.png capabilities: internetClient store: "true"