mirror of
https://github.com/rustdesk/rustdesk.git
synced 2025-06-07 09:52:49 +08:00
upgrade some crates, fix scrap benchmark on mac, fix compile issue on
osx10.14
This commit is contained in:
parent
08f9b3760f
commit
61679a1072
1939
Cargo.lock
generated
1939
Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
17
Cargo.toml
17
Cargo.toml
@ -45,22 +45,22 @@ lazy_static = "1.4"
|
|||||||
sha2 = "0.10"
|
sha2 = "0.10"
|
||||||
repng = "0.2"
|
repng = "0.2"
|
||||||
parity-tokio-ipc = { git = "https://github.com/open-trade/parity-tokio-ipc" }
|
parity-tokio-ipc = { git = "https://github.com/open-trade/parity-tokio-ipc" }
|
||||||
runas = "0.2"
|
runas = "1.0"
|
||||||
magnum-opus = { git = "https://github.com/rustdesk/magnum-opus" }
|
magnum-opus = { git = "https://github.com/rustdesk/magnum-opus" }
|
||||||
dasp = { version = "0.11", features = ["signal", "interpolate-linear", "interpolate"], optional = true }
|
dasp = { version = "0.11", features = ["signal", "interpolate-linear", "interpolate"], optional = true }
|
||||||
rubato = { version = "0.12", optional = true }
|
rubato = { version = "0.12", optional = true }
|
||||||
samplerate = { version = "0.2", optional = true }
|
samplerate = { version = "0.2", optional = true }
|
||||||
async-trait = "0.1"
|
async-trait = "0.1"
|
||||||
uuid = { version = "1.0", features = ["v4"] }
|
uuid = { version = "1.0", features = ["v4"] }
|
||||||
clap = "3.0"
|
clap = "4.1"
|
||||||
rpassword = "7.0"
|
rpassword = "7.0"
|
||||||
base64 = "0.13"
|
base64 = "0.21"
|
||||||
num_cpus = "1.13"
|
num_cpus = "1.13"
|
||||||
bytes = { version = "1.2", features = ["serde"] }
|
bytes = { version = "1.2", features = ["serde"] }
|
||||||
default-net = "0.12.0"
|
default-net = "0.12.0"
|
||||||
wol-rs = "0.9.1"
|
wol-rs = "1.0"
|
||||||
flutter_rust_bridge = { version = "1.61.1", optional = true }
|
flutter_rust_bridge = { version = "1.61.1", optional = true }
|
||||||
errno = "0.2.8"
|
errno = "0.3"
|
||||||
rdev = { git = "https://github.com/fufesou/rdev" }
|
rdev = { git = "https://github.com/fufesou/rdev" }
|
||||||
url = { version = "2.1", features = ["serde"] }
|
url = { version = "2.1", features = ["serde"] }
|
||||||
dlopen = "0.1"
|
dlopen = "0.1"
|
||||||
@ -71,7 +71,7 @@ chrono = "0.4.23"
|
|||||||
cidr-utils = "0.5.9"
|
cidr-utils = "0.5.9"
|
||||||
|
|
||||||
[target.'cfg(not(any(target_os = "android", target_os = "linux")))'.dependencies]
|
[target.'cfg(not(any(target_os = "android", target_os = "linux")))'.dependencies]
|
||||||
cpal = "0.13.5"
|
cpal = "0.14"
|
||||||
|
|
||||||
[target.'cfg(not(any(target_os = "android", target_os = "ios")))'.dependencies]
|
[target.'cfg(not(any(target_os = "android", target_os = "ios")))'.dependencies]
|
||||||
machine-uid = "0.2"
|
machine-uid = "0.2"
|
||||||
@ -81,9 +81,9 @@ sys-locale = "0.2"
|
|||||||
enigo = { path = "libs/enigo", features = [ "with_serde" ] }
|
enigo = { path = "libs/enigo", features = [ "with_serde" ] }
|
||||||
clipboard = { path = "libs/clipboard" }
|
clipboard = { path = "libs/clipboard" }
|
||||||
ctrlc = "3.2"
|
ctrlc = "3.2"
|
||||||
arboard = "2.0"
|
arboard = "3.2"
|
||||||
#minreq = { version = "2.4", features = ["punycode", "https-native"] }
|
#minreq = { version = "2.4", features = ["punycode", "https-native"] }
|
||||||
system_shutdown = "3.0.0"
|
system_shutdown = "4.0"
|
||||||
|
|
||||||
[target.'cfg(target_os = "windows")'.dependencies]
|
[target.'cfg(target_os = "windows")'.dependencies]
|
||||||
trayicon = { git = "https://github.com/open-trade/trayicon-rs", features = ["winit"] }
|
trayicon = { git = "https://github.com/open-trade/trayicon-rs", features = ["winit"] }
|
||||||
@ -148,6 +148,7 @@ cc = "1.0"
|
|||||||
hbb_common = { path = "libs/hbb_common" }
|
hbb_common = { path = "libs/hbb_common" }
|
||||||
simple_rc = { path = "libs/simple_rc", optional = true }
|
simple_rc = { path = "libs/simple_rc", optional = true }
|
||||||
flutter_rust_bridge_codegen = "1.61.1"
|
flutter_rust_bridge_codegen = "1.61.1"
|
||||||
|
os-version = "0.2"
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
hound = "3.5"
|
hound = "3.5"
|
||||||
|
9
build.rs
9
build.rs
@ -9,7 +9,14 @@ fn build_windows() {
|
|||||||
#[cfg(target_os = "macos")]
|
#[cfg(target_os = "macos")]
|
||||||
fn build_mac() {
|
fn build_mac() {
|
||||||
let file = "src/platform/macos.mm";
|
let file = "src/platform/macos.mm";
|
||||||
cc::Build::new().file(file).compile("macos");
|
let mut b = cc::Build::new();
|
||||||
|
if let Ok(os_version::OsVersion::MacOS(v)) = os_version::detect() {
|
||||||
|
let v = v.version;
|
||||||
|
if v.contains("10.14") {
|
||||||
|
b.flag("-DNO_InputMonitoringAuthStatus=1");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
b.file(file).compile("macos");
|
||||||
println!("cargo:rerun-if-changed={}", file);
|
println!("cargo:rerun-if-changed={}", file);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -7,17 +7,17 @@ edition = "2018"
|
|||||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
flexi_logger = { version = "0.22", features = ["async", "use_chrono_for_offset"] }
|
flexi_logger = { version = "0.25", features = ["async"] }
|
||||||
protobuf = { version = "3.1", features = ["with-bytes"] }
|
protobuf = { version = "3.1", features = ["with-bytes"] }
|
||||||
tokio = { version = "1.20", features = ["full"] }
|
tokio = { version = "1.20", features = ["full"] }
|
||||||
tokio-util = { version = "0.7", features = ["full"] }
|
tokio-util = { version = "0.7", features = ["full"] }
|
||||||
futures = "0.3"
|
futures = "0.3"
|
||||||
bytes = { version = "1.2", features = ["serde"] }
|
bytes = { version = "1.2", features = ["serde"] }
|
||||||
log = "0.4"
|
log = "0.4"
|
||||||
env_logger = "0.9"
|
env_logger = "0.10"
|
||||||
socket2 = { version = "0.3", features = ["reuseport"] }
|
socket2 = { version = "0.3", features = ["reuseport"] }
|
||||||
zstd = "0.9"
|
zstd = "0.9"
|
||||||
quinn = {version = "0.8", optional = true }
|
quinn = {version = "0.9", optional = true }
|
||||||
anyhow = "1.0"
|
anyhow = "1.0"
|
||||||
futures-util = "0.3"
|
futures-util = "0.3"
|
||||||
directories-next = "2.0"
|
directories-next = "2.0"
|
||||||
@ -34,7 +34,7 @@ tokio-socks = { git = "https://github.com/open-trade/tokio-socks" }
|
|||||||
chrono = "0.4"
|
chrono = "0.4"
|
||||||
backtrace = "0.3"
|
backtrace = "0.3"
|
||||||
libc = "0.2"
|
libc = "0.2"
|
||||||
sysinfo = "0.24"
|
sysinfo = "0.26"
|
||||||
|
|
||||||
[target.'cfg(not(any(target_os = "android", target_os = "ios")))'.dependencies]
|
[target.'cfg(not(any(target_os = "android", target_os = "ios")))'.dependencies]
|
||||||
mac_address = "1.1"
|
mac_address = "1.1"
|
||||||
@ -54,5 +54,5 @@ winapi = { version = "0.3", features = ["winuser"] }
|
|||||||
osascript = "0.3.0"
|
osascript = "0.3.0"
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
toml = "0.5"
|
toml = "0.7"
|
||||||
serde_json = "1.0"
|
serde_json = "1.0"
|
@ -42,7 +42,7 @@ quest = "0.3"
|
|||||||
|
|
||||||
[build-dependencies]
|
[build-dependencies]
|
||||||
target_build_utils = "0.3"
|
target_build_utils = "0.3"
|
||||||
bindgen = "0.59"
|
bindgen = "0.64"
|
||||||
|
|
||||||
[target.'cfg(target_os = "linux")'.dependencies]
|
[target.'cfg(target_os = "linux")'.dependencies]
|
||||||
dbus = { version = "0.9", optional = true }
|
dbus = { version = "0.9", optional = true }
|
||||||
|
@ -83,7 +83,7 @@ impl crate::TraitCapturer for Capturer {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct Frame<'a>(quartz::Frame, PhantomData<&'a [u8]>);
|
pub struct Frame<'a>(pub quartz::Frame, PhantomData<&'a [u8]>);
|
||||||
|
|
||||||
impl<'a> ops::Deref for Frame<'a> {
|
impl<'a> ops::Deref for Frame<'a> {
|
||||||
type Target = [u8];
|
type Target = [u8];
|
||||||
|
@ -2233,7 +2233,7 @@ fn get_pk(pk: &[u8]) -> Option<[u8; 32]> {
|
|||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
fn get_rs_pk(str_base64: &str) -> Option<sign::PublicKey> {
|
fn get_rs_pk(str_base64: &str) -> Option<sign::PublicKey> {
|
||||||
if let Ok(pk) = base64::decode(str_base64) {
|
if let Ok(pk) = crate::decode64(str_base64) {
|
||||||
get_pk(&pk).map(|x| sign::PublicKey(x))
|
get_pk(&pk).map(|x| sign::PublicKey(x))
|
||||||
} else {
|
} else {
|
||||||
None
|
None
|
||||||
|
@ -787,3 +787,15 @@ pub fn handle_url_scheme(url: String) {
|
|||||||
let _ = crate::run_me(vec![url]);
|
let _ = crate::run_me(vec![url]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[inline]
|
||||||
|
pub fn encode64<T: AsRef<[u8]>>(input: T) -> String {
|
||||||
|
#[allow(deprecated)]
|
||||||
|
base64::encode(input)
|
||||||
|
}
|
||||||
|
|
||||||
|
#[inline]
|
||||||
|
pub fn decode64<T: AsRef<[u8]>>(input: T) -> Result<Vec<u8>, base64::DecodeError> {
|
||||||
|
#[allow(deprecated)]
|
||||||
|
base64::decode(input)
|
||||||
|
}
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
use base64::{engine::general_purpose::URL_SAFE_NO_PAD, Engine as _};
|
||||||
use hbb_common::{bail, sodiumoxide::crypto::sign, ResultType};
|
use hbb_common::{bail, sodiumoxide::crypto::sign, ResultType};
|
||||||
use serde_derive::{Deserialize, Serialize};
|
use serde_derive::{Deserialize, Serialize};
|
||||||
|
|
||||||
@ -18,7 +19,7 @@ fn get_license_from_string_(s: &str) -> ResultType<License> {
|
|||||||
12, 46, 129, 83, 17, 84, 193, 119, 197, 130, 103,
|
12, 46, 129, 83, 17, 84, 193, 119, 197, 130, 103,
|
||||||
];
|
];
|
||||||
let pk = sign::PublicKey(*PK);
|
let pk = sign::PublicKey(*PK);
|
||||||
let data = base64::decode_config(tmp, base64::URL_SAFE_NO_PAD)?;
|
let data = URL_SAFE_NO_PAD.decode(tmp)?;
|
||||||
if let Ok(lic) = serde_json::from_slice::<License>(&data) {
|
if let Ok(lic) = serde_json::from_slice::<License>(&data) {
|
||||||
return Ok(lic);
|
return Ok(lic);
|
||||||
}
|
}
|
||||||
|
@ -1,10 +1,11 @@
|
|||||||
mod license;
|
mod license;
|
||||||
|
use base64::{engine::general_purpose::URL_SAFE_NO_PAD, Engine as _};
|
||||||
use hbb_common::ResultType;
|
use hbb_common::ResultType;
|
||||||
use license::*;
|
use license::*;
|
||||||
|
|
||||||
fn gen_name(lic: &License) -> ResultType<String> {
|
fn gen_name(lic: &License) -> ResultType<String> {
|
||||||
let tmp = serde_json::to_vec::<License>(lic)?;
|
let tmp = serde_json::to_vec::<License>(lic)?;
|
||||||
let tmp = base64::encode_config(tmp, base64::URL_SAFE_NO_PAD);
|
let tmp = URL_SAFE_NO_PAD.encode(&tmp);
|
||||||
let tmp: String = tmp.chars().rev().collect();
|
let tmp: String = tmp.chars().rev().collect();
|
||||||
Ok(tmp)
|
Ok(tmp)
|
||||||
}
|
}
|
||||||
|
@ -8,6 +8,9 @@
|
|||||||
// https://github.com/codebytere/node-mac-permissions/blob/main/permissions.mm
|
// https://github.com/codebytere/node-mac-permissions/blob/main/permissions.mm
|
||||||
|
|
||||||
extern "C" bool InputMonitoringAuthStatus(bool prompt) {
|
extern "C" bool InputMonitoringAuthStatus(bool prompt) {
|
||||||
|
#ifdef NO_InputMonitoringAuthStatus
|
||||||
|
return true;
|
||||||
|
#else
|
||||||
if (floor(NSAppKitVersionNumber) >= NSAppKitVersionNumber10_15) {
|
if (floor(NSAppKitVersionNumber) >= NSAppKitVersionNumber10_15) {
|
||||||
IOHIDAccessType theType = IOHIDCheckAccess(kIOHIDRequestTypeListenEvent);
|
IOHIDAccessType theType = IOHIDCheckAccess(kIOHIDRequestTypeListenEvent);
|
||||||
NSLog(@"IOHIDCheckAccess = %d, kIOHIDAccessTypeGranted = %d", theType, kIOHIDAccessTypeGranted);
|
NSLog(@"IOHIDCheckAccess = %d, kIOHIDAccessTypeGranted = %d", theType, kIOHIDAccessTypeGranted);
|
||||||
@ -36,6 +39,7 @@ extern "C" bool InputMonitoringAuthStatus(bool prompt) {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
extern "C" bool MacCheckAdminAuthorization() {
|
extern "C" bool MacCheckAdminAuthorization() {
|
||||||
|
@ -735,7 +735,7 @@ impl Connection {
|
|||||||
let url = self.server_audit_conn.clone();
|
let url = self.server_audit_conn.clone();
|
||||||
let mut v = v;
|
let mut v = v;
|
||||||
v["id"] = json!(Config::get_id());
|
v["id"] = json!(Config::get_id());
|
||||||
v["uuid"] = json!(base64::encode(hbb_common::get_uuid()));
|
v["uuid"] = json!(crate::encode64(hbb_common::get_uuid()));
|
||||||
v["conn_id"] = json!(self.inner.id);
|
v["conn_id"] = json!(self.inner.id);
|
||||||
tokio::spawn(async move {
|
tokio::spawn(async move {
|
||||||
allow_err!(Self::post_audit_async(url, v).await);
|
allow_err!(Self::post_audit_async(url, v).await);
|
||||||
@ -765,7 +765,7 @@ impl Connection {
|
|||||||
info["files"] = json!(files);
|
info["files"] = json!(files);
|
||||||
let v = json!({
|
let v = json!({
|
||||||
"id":json!(Config::get_id()),
|
"id":json!(Config::get_id()),
|
||||||
"uuid":json!(base64::encode(hbb_common::get_uuid())),
|
"uuid":json!(crate::encode64(hbb_common::get_uuid())),
|
||||||
"peer_id":json!(self.lr.my_id),
|
"peer_id":json!(self.lr.my_id),
|
||||||
"type": r#type as i8,
|
"type": r#type as i8,
|
||||||
"path":path,
|
"path":path,
|
||||||
@ -788,7 +788,7 @@ impl Connection {
|
|||||||
}
|
}
|
||||||
let mut v = Value::default();
|
let mut v = Value::default();
|
||||||
v["id"] = json!(Config::get_id());
|
v["id"] = json!(Config::get_id());
|
||||||
v["uuid"] = json!(base64::encode(hbb_common::get_uuid()));
|
v["uuid"] = json!(crate::encode64(hbb_common::get_uuid()));
|
||||||
v["typ"] = json!(typ as i8);
|
v["typ"] = json!(typ as i8);
|
||||||
v["from_remote"] = json!(from_remote);
|
v["from_remote"] = json!(from_remote);
|
||||||
v["info"] = serde_json::Value::String(info.to_string());
|
v["info"] = serde_json::Value::String(info.to_string());
|
||||||
|
@ -605,7 +605,7 @@ pub fn remove_discovered(id: String) {
|
|||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn get_uuid() -> String {
|
pub fn get_uuid() -> String {
|
||||||
base64::encode(hbb_common::get_uuid())
|
crate::encode64(hbb_common::get_uuid())
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(any(target_os = "android", target_os = "ios", feature = "flutter"))]
|
#[cfg(any(target_os = "android", target_os = "ios", feature = "flutter"))]
|
||||||
@ -876,7 +876,7 @@ pub async fn change_id_shared(id: String, old_id: String) -> &'static str {
|
|||||||
#[cfg(not(any(target_os = "android", target_os = "ios")))]
|
#[cfg(not(any(target_os = "android", target_os = "ios")))]
|
||||||
let uuid = machine_uid::get().unwrap_or("".to_owned());
|
let uuid = machine_uid::get().unwrap_or("".to_owned());
|
||||||
#[cfg(any(target_os = "android", target_os = "ios"))]
|
#[cfg(any(target_os = "android", target_os = "ios"))]
|
||||||
let uuid = base64::encode(hbb_common::get_uuid());
|
let uuid = crate::encode64(hbb_common::get_uuid());
|
||||||
|
|
||||||
if uuid.is_empty() {
|
if uuid.is_empty() {
|
||||||
log::error!("Failed to change id, uuid is_empty");
|
log::error!("Failed to change id, uuid is_empty");
|
||||||
|
Loading…
Reference in New Issue
Block a user