From e1ef6c9dedce29d9ebd4651dcf27f0a29417851e Mon Sep 17 00:00:00 2001 From: ricky Date: Fri, 26 Dec 2025 16:06:26 +0800 Subject: [PATCH 1/3] chore: update dependencies in pubspec.yaml and Cargo files to latest versions --- flutter/wind_send/pubspec.yaml | 18 ++++++++++++------ windSend-rs/Cargo.lock | 6 +++--- windSend-rs/Cargo.toml | 2 +- 3 files changed, 16 insertions(+), 10 deletions(-) diff --git a/flutter/wind_send/pubspec.yaml b/flutter/wind_send/pubspec.yaml index 1c0b52bbf..8b0a29d1d 100644 --- a/flutter/wind_send/pubspec.yaml +++ b/flutter/wind_send/pubspec.yaml @@ -35,12 +35,17 @@ dependencies: # Use with the CupertinoIcons class for iOS style icons. cupertino_icons: ^1.0.8 - shared_preferences: ^2.2.2 + shared_preferences: ^2.5.4 flutter_localization: ^0.3.3 device_info_plus: ^11.5.0 path_provider: ^2.1.1 - file_picker: ^10.3.7 - share_handler: ^0.0.23 + file_picker: ^10.3.8 + # share_handler: ^0.0.23 + share_handler: + git: + url: https://github.com/doraemonkeys/share_handler + path: share_handler + ref: main # https://github.com/ShoutSocial/share_handler/tree/main/share_handler #listen_sharing_intent: ^1.9.2 # receive_sharing_intent: @@ -62,10 +67,10 @@ dependencies: # https://github.com/superlistapp/super_native_extensions/tree/main/super_clipboard # https://github.com/superlistapp/super_native_extensions/issues/325 super_clipboard: ^0.9.1 - network_info_plus: ^6.1.1 + network_info_plus: ^7.0.0 collection: ^1.18.0 - share_plus: ^11.1.0 - fluttertoast: ^8.2.14 + share_plus: ^12.0.1 + fluttertoast: ^9.0.0 # open_filex: ^4.6.0 open_filex: git: @@ -85,6 +90,7 @@ dependencies: saf_util: ^0.11.0 fast_file_picker: ^0.4.8 + dev_dependencies: flutter_test: sdk: flutter diff --git a/windSend-rs/Cargo.lock b/windSend-rs/Cargo.lock index 46a97938e..84e239329 100644 --- a/windSend-rs/Cargo.lock +++ b/windSend-rs/Cargo.lock @@ -4013,9 +4013,9 @@ dependencies = [ [[package]] name = "rfd" -version = "0.15.4" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef2bee61e6cffa4635c72d7d81a84294e28f0930db0ddcb0f66d10244674ebed" +checksum = "a15ad77d9e70a92437d8f74c35d99b4e4691128df018833e99f90bcd36152672" dependencies = [ "ashpd", "block2 0.6.2", @@ -4032,7 +4032,7 @@ dependencies = [ "wasm-bindgen", "wasm-bindgen-futures", "web-sys", - "windows-sys 0.59.0", + "windows-sys 0.60.2", ] [[package]] diff --git a/windSend-rs/Cargo.toml b/windSend-rs/Cargo.toml index 61414f466..5560e18b6 100644 --- a/windSend-rs/Cargo.toml +++ b/windSend-rs/Cargo.toml @@ -96,7 +96,7 @@ tao = "0.34" tray-icon = "0.21" reqwest = { version = "0.12", features = ["multipart", "cookies"] } # rfd 0.14.0 在ubuntu上编译失败 -rfd = "0.15" +rfd = "0.16" # windows dependencies [target.'cfg(target_os = "windows")'.dependencies] From 8d1de382febf840a1fd3bcd58bc7c25ff1c25c89 Mon Sep 17 00:00:00 2001 From: ricky Date: Fri, 26 Dec 2025 16:15:36 +0800 Subject: [PATCH 2/3] refactor: streamline OS-specific auto-start logic and reintroduce winreg dependency for Windows support --- windSend-rs/Cargo.toml | 2 +- windSend-rs/src/utils/auto_start.rs | 56 +++++++++++++++++++---------- 2 files changed, 38 insertions(+), 20 deletions(-) diff --git a/windSend-rs/Cargo.toml b/windSend-rs/Cargo.toml index 5560e18b6..454496b37 100644 --- a/windSend-rs/Cargo.toml +++ b/windSend-rs/Cargo.toml @@ -49,7 +49,6 @@ cipher = "0.4" chrono = "0.4.42" subslice = "0.2.3" regex = "1.12" -winreg = "0.55" arboard = { version = "3.6", features = [ "core-graphics", "image", @@ -100,6 +99,7 @@ rfd = "0.16" # windows dependencies [target.'cfg(target_os = "windows")'.dependencies] +winreg = "0.55" win-toast-notify = "0.1.6" [target.'cfg(not(target_os = "windows"))'.dependencies] diff --git a/windSend-rs/src/utils/auto_start.rs b/windSend-rs/src/utils/auto_start.rs index 2320b6974..b3e05a419 100644 --- a/windSend-rs/src/utils/auto_start.rs +++ b/windSend-rs/src/utils/auto_start.rs @@ -2,7 +2,9 @@ use std::borrow::Cow; use tracing::error; +#[cfg(target_os = "windows")] use winreg::RegKey; +#[cfg(target_os = "windows")] use winreg::enums::*; pub struct StartHelper { exe_name: String, @@ -22,32 +24,44 @@ impl StartHelper { } pub fn set_auto_start(&self) -> Result<(), Box> { - // #[cfg(target_os = "windows")] - // { - // self.set_win_auto_start() - // } - // #[cfg(not(any(target_os = "linux", target_os = "windows", target_os = "macos")))] - match std::env::consts::OS { - "windows" => self.set_win_auto_start(), - "macos" => self.set_mac_auto_start(), - "linux" => self.set_linux_auto_start(), - _ => Err(format!("unsupported os: {}", std::env::consts::OS).into()), + #[cfg(target_os = "windows")] + { + self.set_win_auto_start() + } + #[cfg(target_os = "macos")] + { + self.set_mac_auto_start() + } + #[cfg(target_os = "linux")] + { + self.set_linux_auto_start() + } + #[cfg(not(any(target_os = "windows", target_os = "macos", target_os = "linux")))] + { + Err(format!("unsupported os: {}", std::env::consts::OS).into()) } } pub fn unset_auto_start(&self) -> Result<(), Box> { - // #[cfg(target_os = "windows")] - // { - // self.unset_win_auto_start() - // } - match std::env::consts::OS { - "windows" => self.unset_win_auto_start(), - "macos" => self.unset_mac_auto_start(), - "linux" => self.unset_linux_auto_start(), - _ => Err(format!("unsupported os: {}", std::env::consts::OS).into()), + #[cfg(target_os = "windows")] + { + self.unset_win_auto_start() + } + #[cfg(target_os = "macos")] + { + self.unset_mac_auto_start() + } + #[cfg(target_os = "linux")] + { + self.unset_linux_auto_start() + } + #[cfg(not(any(target_os = "windows", target_os = "macos", target_os = "linux")))] + { + Err(format!("unsupported os: {}", std::env::consts::OS).into()) } } + #[cfg(target_os = "windows")] fn set_win_auto_start(&self) -> Result<(), Box> { match self.set_win_auto_start_with_reg() { Ok(_) => { @@ -61,6 +75,7 @@ impl StartHelper { } } + #[cfg(target_os = "windows")] fn cleanup_vbs_start_file(&self) -> Result<(), Box> { let win_user_home_dir = home::home_dir().ok_or("failed to get current windows user home dir")?; @@ -77,6 +92,7 @@ impl StartHelper { Ok(()) } + #[cfg(target_os = "windows")] fn set_win_auto_start_with_vbs(&self) -> Result<(), Box> { // C:\Users\*\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup // 获取当前Windows用户的home directory. @@ -118,6 +134,7 @@ impl StartHelper { Ok(()) } + #[cfg(target_os = "windows")] fn set_win_auto_start_with_reg(&self) -> Result<(), Box> { let exe_path = std::env::current_exe()?; let exe_path_str = exe_path.to_str().ok_or("exe path contains invalid UTF-8")?; @@ -199,6 +216,7 @@ impl StartHelper { Ok(()) } + #[cfg(target_os = "windows")] fn unset_win_auto_start(&self) -> Result<(), Box> { // 删除注册表项 let hkcu = RegKey::predef(HKEY_CURRENT_USER); From dd46160ce71a8d93639d54e06cc1f2feda3c6722 Mon Sep 17 00:00:00 2001 From: ricky Date: Fri, 26 Dec 2025 16:26:39 +0800 Subject: [PATCH 3/3] fix: correct conditional return logic in SaltCache implementation --- windSend-rs/src/relay/main.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/windSend-rs/src/relay/main.rs b/windSend-rs/src/relay/main.rs index cf3d3f95d..aa15c8be7 100644 --- a/windSend-rs/src/relay/main.rs +++ b/windSend-rs/src/relay/main.rs @@ -398,8 +398,8 @@ impl SaltCache { if let (Some(p), Some(_)) = (&self.cur_pwd, &self.salt_b64) && *p == *pwd { - return (self.kdf_key, self.salt_b64.clone()); - } + return (self.kdf_key, self.salt_b64.clone()); + } (None, None) }