Skip to content

An open-source remote desktop application designed for self-hosting, as an alternative to TeamViewer.

prepare no-register-device

rustdesk01146574f247
diff --git a/libs/hbb_common b/libs/hbb_common
index 53709d8f8..fa160b286 160000
--- a/libs/hbb_common
+++ b/libs/hbb_common
@@ -1 +1 @@
-Subproject commit 53709d8f8dd09a1491f4d8866e9643804caa380b
+Subproject commit fa160b286449d4feee26c03dfa721d9997b4748b
diff --git a/src/core_main.rs b/src/core_main.rs
index 4ce4be7b5..eab989181 100644
--- a/src/core_main.rs
+++ b/src/core_main.rs
@@ -454,7 +454,9 @@ pub fn core_main() -> Option<Vec<String>> {
}
return None;
} else if args[0] == "--assign" {
- if crate::platform::is_installed() && is_root() {
+ if config::Config::no_register_device() {
+ println!("Cannot assign an unregistrable device!");
+ } else if crate::platform::is_installed() && is_root() {
let max = args.len() - 1;
let pos = args.iter().position(|x| x == "--token").unwrap_or(max);
if pos < max {
diff --git a/src/hbbs_http/sync.rs b/src/hbbs_http/sync.rs
index b82464b24..a94ff7aa2 100644
--- a/src/hbbs_http/sync.rs
+++ b/src/hbbs_http/sync.rs
@@ -127,7 +127,8 @@ async fn start_hbbs_sync_async() {
// Though the username comparison is only necessary on Windows,
// we still keep the comparison on other platforms for consistency.
let need_upload = (!info_uploaded.uploaded || info_uploaded.username.as_ref() != Some(&sys_username)) &&
- info_uploaded.last_uploaded.map(|x| x.elapsed() >= UPLOAD_SYSINFO_TIMEOUT).unwrap_or(true);
+ info_uploaded.last_uploaded.map(|x| x.elapsed() >= UPLOAD_SYSINFO_TIMEOUT).unwrap_or(true)
+ && !Config::no_register_device();
if need_upload {
v["version"] = json!(crate::VERSION);
v["id"] = json!(id);
diff --git a/src/rendezvous_mediator.rs b/src/rendezvous_mediator.rs
index aa31ec323..99e6c3b8f 100644
--- a/src/rendezvous_mediator.rs
+++ b/src/rendezvous_mediator.rs
@@ -568,6 +568,7 @@ impl RendezvousMediator {
id,
uuid: uuid.into(),
pk: pk.into(),
+ no_register_device: Config::no_register_device(),
..Default::default()
});
socket.send(&msg_out).await?;