refact: file copy&paste, cross platform (no macOS) (#10671)

* feat: unix, file copy&paste

Signed-off-by: fufesou <linlong1266@gmail.com>

* refact: unix file c&p, check peer version

Signed-off-by: fufesou <linlong1266@gmail.com>

* Update pubspec.yaml

---------

Signed-off-by: fufesou <linlong1266@gmail.com>
Co-authored-by: RustDesk <71636191+rustdesk@users.noreply.github.com>
This commit is contained in:
fufesou
2025-02-04 20:33:02 +08:00
committed by GitHub
parent a27fa43081
commit fbba8f0b34
42 changed files with 2026 additions and 1778 deletions

View File

@@ -23,7 +23,6 @@ use serde_derive::Serialize;
use std::process::Child;
use std::{
collections::HashMap,
sync::atomic::{AtomicUsize, Ordering},
sync::{Arc, Mutex},
};
@@ -213,6 +212,7 @@ pub fn get_local_option(key: String) -> String {
}
#[inline]
#[cfg(feature = "flutter")]
pub fn get_hard_option(key: String) -> String {
config::HARD_SETTINGS
.read()
@@ -491,6 +491,7 @@ pub fn set_socks(proxy: String, username: String, password: String) {
}
#[inline]
#[cfg(feature = "flutter")]
pub fn get_proxy_status() -> bool {
#[cfg(not(any(target_os = "android", target_os = "ios")))]
return ipc::get_proxy_status();
@@ -1150,13 +1151,7 @@ async fn check_connect_status_(reconnect: bool, rx: mpsc::UnboundedReceiver<ipc:
let mut video_conn_count = 0;
#[cfg(not(feature = "flutter"))]
let mut id = "".to_owned();
#[cfg(any(
target_os = "windows",
all(
any(target_os = "linux", target_os = "macos"),
feature = "unix-file-copy-paste"
)
))]
#[cfg(target_os = "windows")]
let mut enable_file_transfer = "".to_owned();
let is_cm = crate::common::is_cm();
@@ -1183,13 +1178,7 @@ async fn check_connect_status_(reconnect: bool, rx: mpsc::UnboundedReceiver<ipc:
*OPTIONS.lock().unwrap() = v;
*OPTION_SYNCED.lock().unwrap() = true;
#[cfg(any(
target_os = "windows",
all(
any(target_os="linux", target_os = "macos"),
feature = "unix-file-copy-paste"
)
))]
#[cfg(target_os = "windows")]
{
let b = OPTIONS.lock().unwrap().get(OPTION_ENABLE_FILE_TRANSFER).map(|x| x.to_string()).unwrap_or_default();
if b != enable_file_transfer {