mirror of
https://github.com/weyne85/rustdesk.git
synced 2025-10-29 17:00:05 +00:00
@@ -200,7 +200,7 @@ impl Client {
|
||||
token: &str,
|
||||
conn_type: ConnType,
|
||||
interface: impl Interface,
|
||||
) -> ResultType<(Stream, bool)> {
|
||||
) -> ResultType<(Stream, bool, Option<Vec<u8>>)> {
|
||||
match Self::_start(peer, key, token, conn_type, interface).await {
|
||||
Err(err) => {
|
||||
let err_str = err.to_string();
|
||||
@@ -221,7 +221,7 @@ impl Client {
|
||||
token: &str,
|
||||
conn_type: ConnType,
|
||||
interface: impl Interface,
|
||||
) -> ResultType<(Stream, bool)> {
|
||||
) -> ResultType<(Stream, bool, Option<Vec<u8>>)> {
|
||||
// to-do: remember the port for each peer, so that we can retry easier
|
||||
if hbb_common::is_ip_str(peer) {
|
||||
return Ok((
|
||||
@@ -231,6 +231,7 @@ impl Client {
|
||||
)
|
||||
.await?,
|
||||
true,
|
||||
None,
|
||||
));
|
||||
}
|
||||
// Allow connect to {domain}:{port}
|
||||
@@ -238,6 +239,7 @@ impl Client {
|
||||
return Ok((
|
||||
socket_client::connect_tcp(peer, RENDEZVOUS_TIMEOUT).await?,
|
||||
true,
|
||||
None,
|
||||
));
|
||||
}
|
||||
let (mut rendezvous_server, servers, contained) = crate::get_rendezvous_server(1_000).await;
|
||||
@@ -333,7 +335,7 @@ impl Client {
|
||||
my_addr.is_ipv4(),
|
||||
)
|
||||
.await?;
|
||||
Self::secure_connection(
|
||||
let pk = Self::secure_connection(
|
||||
peer,
|
||||
signed_id_pk,
|
||||
key,
|
||||
@@ -342,7 +344,7 @@ impl Client {
|
||||
interface,
|
||||
)
|
||||
.await?;
|
||||
return Ok((conn, false));
|
||||
return Ok((conn, false, pk));
|
||||
}
|
||||
_ => {
|
||||
log::error!("Unexpected protobuf msg received: {:?}", msg_in);
|
||||
@@ -403,7 +405,7 @@ impl Client {
|
||||
token: &str,
|
||||
conn_type: ConnType,
|
||||
interface: impl Interface,
|
||||
) -> ResultType<(Stream, bool)> {
|
||||
) -> ResultType<(Stream, bool, Option<Vec<u8>>)> {
|
||||
let direct_failures = PeerConfig::load(peer_id).direct_failures;
|
||||
let mut connect_timeout = 0;
|
||||
const MIN: u64 = 1000;
|
||||
@@ -473,8 +475,9 @@ impl Client {
|
||||
}
|
||||
let mut conn = conn?;
|
||||
log::info!("{:?} used to establish connection", start.elapsed());
|
||||
Self::secure_connection(peer_id, signed_id_pk, key, &mut conn, direct, interface).await?;
|
||||
Ok((conn, direct))
|
||||
let pk = Self::secure_connection(peer_id, signed_id_pk, key, &mut conn, direct, interface)
|
||||
.await?;
|
||||
Ok((conn, direct, pk))
|
||||
}
|
||||
|
||||
/// Establish secure connection with the server.
|
||||
@@ -485,17 +488,19 @@ impl Client {
|
||||
conn: &mut Stream,
|
||||
direct: bool,
|
||||
interface: impl Interface,
|
||||
) -> ResultType<()> {
|
||||
) -> ResultType<Option<Vec<u8>>> {
|
||||
let rs_pk = get_rs_pk(if key.is_empty() {
|
||||
hbb_common::config::RS_PUB_KEY
|
||||
} else {
|
||||
key
|
||||
});
|
||||
let mut sign_pk = None;
|
||||
let mut option_pk = None;
|
||||
if !signed_id_pk.is_empty() && rs_pk.is_some() {
|
||||
if let Ok((id, pk)) = decode_id_pk(&signed_id_pk, &rs_pk.unwrap()) {
|
||||
if id == peer_id {
|
||||
sign_pk = Some(sign::PublicKey(pk));
|
||||
option_pk = Some(pk.to_vec());
|
||||
}
|
||||
}
|
||||
if sign_pk.is_none() {
|
||||
@@ -507,7 +512,7 @@ impl Client {
|
||||
None => {
|
||||
// send an empty message out in case server is setting up secure and waiting for first message
|
||||
conn.send(&Message::new()).await?;
|
||||
return Ok(());
|
||||
return Ok(option_pk);
|
||||
}
|
||||
};
|
||||
match timeout(READ_TIMEOUT, conn.next()).await? {
|
||||
@@ -560,7 +565,7 @@ impl Client {
|
||||
bail!("Reset by the peer");
|
||||
}
|
||||
}
|
||||
Ok(())
|
||||
Ok(option_pk)
|
||||
}
|
||||
|
||||
/// Request a relay connection to the server.
|
||||
|
||||
@@ -121,9 +121,11 @@ impl<T: InvokeUiSession> Remote<T> {
|
||||
)
|
||||
.await
|
||||
{
|
||||
Ok((mut peer, direct)) => {
|
||||
Ok((mut peer, direct, pk)) => {
|
||||
self.handler.set_connection_type(peer.is_secured(), direct); // flutter -> connection_ready
|
||||
self.handler.set_connection_info(direct, false);
|
||||
self.handler
|
||||
.set_fingerprint(crate::common::pk_to_fingerprint(pk.unwrap_or_default()));
|
||||
|
||||
// just build for now
|
||||
#[cfg(not(windows))]
|
||||
|
||||
@@ -840,3 +840,17 @@ pub fn is_peer_version_ge(v: &str) -> bool {
|
||||
|
||||
false
|
||||
}
|
||||
|
||||
pub fn pk_to_fingerprint(pk: Vec<u8>) -> String {
|
||||
let s: String = pk.iter().map(|u| format!("{:02x}", u)).collect();
|
||||
s.chars()
|
||||
.enumerate()
|
||||
.map(|(i, c)| {
|
||||
if i > 0 && i % 4 == 0 {
|
||||
format!(" {}", c)
|
||||
} else {
|
||||
format!("{}", c)
|
||||
}
|
||||
})
|
||||
.collect()
|
||||
}
|
||||
|
||||
@@ -395,6 +395,10 @@ impl InvokeUiSession for FlutterHandler {
|
||||
);
|
||||
}
|
||||
|
||||
fn set_fingerprint(&self, fingerprint: String) {
|
||||
self.push_event("fingerprint", vec![("fingerprint", &fingerprint)]);
|
||||
}
|
||||
|
||||
fn job_error(&self, id: i32, err: String, file_num: i32) {
|
||||
self.push_event(
|
||||
"job_error",
|
||||
|
||||
@@ -921,6 +921,10 @@ pub fn main_get_permanent_password() -> String {
|
||||
ui_interface::permanent_password()
|
||||
}
|
||||
|
||||
pub fn main_get_fingerprint() -> String {
|
||||
get_fingerprint()
|
||||
}
|
||||
|
||||
pub fn main_get_online_statue() -> i64 {
|
||||
ONLINE.lock().unwrap().values().max().unwrap_or(&0).clone()
|
||||
}
|
||||
|
||||
12
src/ipc.rs
12
src/ipc.rs
@@ -383,6 +383,12 @@ async fn handle(data: Data, stream: &mut Connection) {
|
||||
));
|
||||
} else if name == "rendezvous_servers" {
|
||||
value = Some(Config::get_rendezvous_servers().join(","));
|
||||
} else if name == "fingerprint" {
|
||||
value = if Config::get_key_confirmed() {
|
||||
Some(crate::common::pk_to_fingerprint(Config::get_key_pair().1))
|
||||
} else {
|
||||
None
|
||||
};
|
||||
} else {
|
||||
value = None;
|
||||
}
|
||||
@@ -690,6 +696,12 @@ pub fn get_permanent_password() -> String {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn get_fingerprint() -> String {
|
||||
get_config("fingerprint")
|
||||
.unwrap_or_default()
|
||||
.unwrap_or_default()
|
||||
}
|
||||
|
||||
pub fn set_permanent_password(v: String) -> ResultType<()> {
|
||||
Config::set_permanent_password(&v);
|
||||
set_config("permanent-password", v)
|
||||
|
||||
@@ -492,6 +492,11 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("no_desktop_title_tip", ""),
|
||||
("no_desktop_text_tip", ""),
|
||||
("No need to elevate", ""),
|
||||
("System Sound", ""),
|
||||
("Default", ""),
|
||||
("New RDP", ""),
|
||||
("Fingerprint", ""),
|
||||
("Copy Fingerprint", ""),
|
||||
("no fingerprints", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -492,6 +492,11 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("no_desktop_title_tip", "desktop 未安装"),
|
||||
("no_desktop_text_tip", "请安装 desktop"),
|
||||
("No need to elevate", ""),
|
||||
("System Sound", ""),
|
||||
("Default", ""),
|
||||
("New RDP", ""),
|
||||
("Fingerprint", "指纹"),
|
||||
("Copy Fingerprint", "复制指纹"),
|
||||
("no fingerprints", "没有指纹"),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -492,6 +492,11 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("no_desktop_title_tip", ""),
|
||||
("no_desktop_text_tip", ""),
|
||||
("No need to elevate", ""),
|
||||
("System Sound", ""),
|
||||
("Default", ""),
|
||||
("New RDP", ""),
|
||||
("Fingerprint", ""),
|
||||
("Copy Fingerprint", ""),
|
||||
("no fingerprints", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -492,6 +492,11 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("no_desktop_title_tip", ""),
|
||||
("no_desktop_text_tip", ""),
|
||||
("No need to elevate", ""),
|
||||
("System Sound", ""),
|
||||
("Default", ""),
|
||||
("New RDP", ""),
|
||||
("Fingerprint", ""),
|
||||
("Copy Fingerprint", ""),
|
||||
("no fingerprints", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -492,7 +492,11 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("no_desktop_title_tip", "Es ist kein Desktop verfügbar."),
|
||||
("no_desktop_text_tip", "Bitte installieren Sie den GNOME-Desktop."),
|
||||
("No need to elevate", "Erhöhung der Rechte nicht erforderlich"),
|
||||
("System Sound", ""),
|
||||
("Default", ""),
|
||||
("New RDP", "Neue RDP-Verbindung"),
|
||||
("Failed to listen on {}: {}", "Lauschen fehlgeschlagen auf Port {}: {}"),
|
||||
("Fingerprint", ""),
|
||||
("Copy Fingerprint", ""),
|
||||
("no fingerprints", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -492,6 +492,11 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("no_desktop_title_tip", ""),
|
||||
("no_desktop_text_tip", ""),
|
||||
("No need to elevate", ""),
|
||||
("System Sound", ""),
|
||||
("Default", ""),
|
||||
("New RDP", ""),
|
||||
("Fingerprint", ""),
|
||||
("Copy Fingerprint", ""),
|
||||
("no fingerprints", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -492,6 +492,11 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("no_desktop_title_tip", ""),
|
||||
("no_desktop_text_tip", ""),
|
||||
("No need to elevate", ""),
|
||||
("System Sound", ""),
|
||||
("Default", ""),
|
||||
("New RDP", ""),
|
||||
("Fingerprint", ""),
|
||||
("Copy Fingerprint", ""),
|
||||
("no fingerprints", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -492,6 +492,11 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("no_desktop_title_tip", "No hay escritorio disponible"),
|
||||
("no_desktop_text_tip", "Por favor, instala GNOME Desktop"),
|
||||
("No need to elevate", "No es necesario elevar privilegios"),
|
||||
("System Sound", ""),
|
||||
("Default", ""),
|
||||
("New RDP", "Nuevo RDP"),
|
||||
("Fingerprint", ""),
|
||||
("Copy Fingerprint", ""),
|
||||
("no fingerprints", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -492,6 +492,11 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("no_desktop_title_tip", "هیچ دسکتاپی در دسترس نیست"),
|
||||
("no_desktop_text_tip", "لطفا دسکتاپ گنوم را نصب کنید"),
|
||||
("No need to elevate", "نیازی به ارتقاء نیست"),
|
||||
("System Sound", ""),
|
||||
("Default", ""),
|
||||
("New RDP", "ریموت جدید"),
|
||||
("Fingerprint", ""),
|
||||
("Copy Fingerprint", ""),
|
||||
("no fingerprints", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -492,6 +492,11 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("no_desktop_title_tip", ""),
|
||||
("no_desktop_text_tip", ""),
|
||||
("No need to elevate", ""),
|
||||
("System Sound", ""),
|
||||
("Default", ""),
|
||||
("New RDP", ""),
|
||||
("Fingerprint", ""),
|
||||
("Copy Fingerprint", ""),
|
||||
("no fingerprints", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -492,6 +492,11 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("no_desktop_title_tip", ""),
|
||||
("no_desktop_text_tip", ""),
|
||||
("No need to elevate", ""),
|
||||
("System Sound", ""),
|
||||
("Default", ""),
|
||||
("New RDP", ""),
|
||||
("Fingerprint", ""),
|
||||
("Copy Fingerprint", ""),
|
||||
("no fingerprints", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -492,6 +492,11 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("no_desktop_title_tip", ""),
|
||||
("no_desktop_text_tip", ""),
|
||||
("No need to elevate", ""),
|
||||
("System Sound", ""),
|
||||
("Default", ""),
|
||||
("New RDP", ""),
|
||||
("Fingerprint", ""),
|
||||
("Copy Fingerprint", ""),
|
||||
("no fingerprints", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -495,5 +495,8 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("System Sound", "Dispositivo audio sistema"),
|
||||
("Default", "Predefinita"),
|
||||
("New RDP", "Nuovo RDP"),
|
||||
("Fingerprint", ""),
|
||||
("Copy Fingerprint", ""),
|
||||
("no fingerprints", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -492,6 +492,11 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("no_desktop_title_tip", ""),
|
||||
("no_desktop_text_tip", ""),
|
||||
("No need to elevate", ""),
|
||||
("System Sound", ""),
|
||||
("Default", ""),
|
||||
("New RDP", ""),
|
||||
("Fingerprint", ""),
|
||||
("Copy Fingerprint", ""),
|
||||
("no fingerprints", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -492,6 +492,11 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("no_desktop_title_tip", ""),
|
||||
("no_desktop_text_tip", ""),
|
||||
("No need to elevate", ""),
|
||||
("System Sound", ""),
|
||||
("Default", ""),
|
||||
("New RDP", ""),
|
||||
("Fingerprint", ""),
|
||||
("Copy Fingerprint", ""),
|
||||
("no fingerprints", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -492,6 +492,11 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("no_desktop_title_tip", ""),
|
||||
("no_desktop_text_tip", ""),
|
||||
("No need to elevate", ""),
|
||||
("System Sound", ""),
|
||||
("Default", ""),
|
||||
("New RDP", ""),
|
||||
("Fingerprint", ""),
|
||||
("Copy Fingerprint", ""),
|
||||
("no fingerprints", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -492,6 +492,11 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("no_desktop_title_tip", "Nėra pasiekiamų nuotolinių darbalaukių"),
|
||||
("no_desktop_text_tip", "Prašom įdiegti GNOME Desktop"),
|
||||
("No need to elevate", ""),
|
||||
("System Sound", ""),
|
||||
("Default", ""),
|
||||
("New RDP", ""),
|
||||
("Fingerprint", ""),
|
||||
("Copy Fingerprint", ""),
|
||||
("no fingerprints", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -492,6 +492,11 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("no_desktop_title_tip", ""),
|
||||
("no_desktop_text_tip", ""),
|
||||
("No need to elevate", ""),
|
||||
("System Sound", ""),
|
||||
("Default", ""),
|
||||
("New RDP", ""),
|
||||
("Fingerprint", ""),
|
||||
("Copy Fingerprint", ""),
|
||||
("no fingerprints", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -495,5 +495,8 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("System Sound", "Dźwięk Systemowy"),
|
||||
("Default", "Domyślne"),
|
||||
("New RDP", "Nowe RDP"),
|
||||
("Fingerprint", ""),
|
||||
("Copy Fingerprint", ""),
|
||||
("no fingerprints", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -492,6 +492,11 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("no_desktop_title_tip", ""),
|
||||
("no_desktop_text_tip", ""),
|
||||
("No need to elevate", ""),
|
||||
("System Sound", ""),
|
||||
("Default", ""),
|
||||
("New RDP", ""),
|
||||
("Fingerprint", ""),
|
||||
("Copy Fingerprint", ""),
|
||||
("no fingerprints", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -492,6 +492,11 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("no_desktop_title_tip", ""),
|
||||
("no_desktop_text_tip", ""),
|
||||
("No need to elevate", ""),
|
||||
("System Sound", ""),
|
||||
("Default", ""),
|
||||
("New RDP", ""),
|
||||
("Fingerprint", ""),
|
||||
("Copy Fingerprint", ""),
|
||||
("no fingerprints", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -492,6 +492,11 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("no_desktop_title_tip", ""),
|
||||
("no_desktop_text_tip", ""),
|
||||
("No need to elevate", ""),
|
||||
("System Sound", ""),
|
||||
("Default", ""),
|
||||
("New RDP", ""),
|
||||
("Fingerprint", ""),
|
||||
("Copy Fingerprint", ""),
|
||||
("no fingerprints", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -492,6 +492,11 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("no_desktop_title_tip", "Нет доступных рабочих столов"),
|
||||
("no_desktop_text_tip", "Установите GNOME Desktop"),
|
||||
("No need to elevate", "Повышение прав не требуется"),
|
||||
("System Sound", ""),
|
||||
("Default", ""),
|
||||
("New RDP", ""),
|
||||
("Fingerprint", ""),
|
||||
("Copy Fingerprint", ""),
|
||||
("no fingerprints", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -492,6 +492,11 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("no_desktop_title_tip", ""),
|
||||
("no_desktop_text_tip", ""),
|
||||
("No need to elevate", ""),
|
||||
("System Sound", ""),
|
||||
("Default", ""),
|
||||
("New RDP", ""),
|
||||
("Fingerprint", ""),
|
||||
("Copy Fingerprint", ""),
|
||||
("no fingerprints", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -492,6 +492,11 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("no_desktop_title_tip", ""),
|
||||
("no_desktop_text_tip", ""),
|
||||
("No need to elevate", ""),
|
||||
("System Sound", ""),
|
||||
("Default", ""),
|
||||
("New RDP", ""),
|
||||
("Fingerprint", ""),
|
||||
("Copy Fingerprint", ""),
|
||||
("no fingerprints", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -492,6 +492,11 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("no_desktop_title_tip", ""),
|
||||
("no_desktop_text_tip", ""),
|
||||
("No need to elevate", ""),
|
||||
("System Sound", ""),
|
||||
("Default", ""),
|
||||
("New RDP", ""),
|
||||
("Fingerprint", ""),
|
||||
("Copy Fingerprint", ""),
|
||||
("no fingerprints", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -492,6 +492,11 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("no_desktop_title_tip", ""),
|
||||
("no_desktop_text_tip", ""),
|
||||
("No need to elevate", ""),
|
||||
("System Sound", ""),
|
||||
("Default", ""),
|
||||
("New RDP", ""),
|
||||
("Fingerprint", ""),
|
||||
("Copy Fingerprint", ""),
|
||||
("no fingerprints", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -492,6 +492,11 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("no_desktop_title_tip", ""),
|
||||
("no_desktop_text_tip", ""),
|
||||
("No need to elevate", ""),
|
||||
("System Sound", ""),
|
||||
("Default", ""),
|
||||
("New RDP", ""),
|
||||
("Fingerprint", ""),
|
||||
("Copy Fingerprint", ""),
|
||||
("no fingerprints", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -495,5 +495,8 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("System Sound", ""),
|
||||
("Default", ""),
|
||||
("New RDP", ""),
|
||||
("Fingerprint", ""),
|
||||
("Copy Fingerprint", ""),
|
||||
("no fingerprints", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -492,6 +492,11 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("no_desktop_title_tip", ""),
|
||||
("no_desktop_text_tip", ""),
|
||||
("No need to elevate", ""),
|
||||
("System Sound", ""),
|
||||
("Default", ""),
|
||||
("New RDP", ""),
|
||||
("Fingerprint", ""),
|
||||
("Copy Fingerprint", ""),
|
||||
("no fingerprints", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -492,6 +492,11 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("no_desktop_title_tip", ""),
|
||||
("no_desktop_text_tip", ""),
|
||||
("No need to elevate", ""),
|
||||
("System Sound", ""),
|
||||
("Default", ""),
|
||||
("New RDP", ""),
|
||||
("Fingerprint", ""),
|
||||
("Copy Fingerprint", ""),
|
||||
("no fingerprints", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -492,6 +492,11 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("no_desktop_title_tip", "沒有可用的桌面"),
|
||||
("no_desktop_text_tip", "請安裝 GNOME 桌面"),
|
||||
("No need to elevate", "不需要提升權限"),
|
||||
("System Sound", ""),
|
||||
("Default", ""),
|
||||
("New RDP", "新的 RDP"),
|
||||
("Fingerprint", "指紋"),
|
||||
("Copy Fingerprint", "複製指紋"),
|
||||
("no fingerprints", "沒有指紋"),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -492,6 +492,11 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("no_desktop_title_tip", ""),
|
||||
("no_desktop_text_tip", ""),
|
||||
("No need to elevate", ""),
|
||||
("System Sound", ""),
|
||||
("Default", ""),
|
||||
("New RDP", ""),
|
||||
("Fingerprint", ""),
|
||||
("Copy Fingerprint", ""),
|
||||
("no fingerprints", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -492,6 +492,11 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("no_desktop_title_tip", ""),
|
||||
("no_desktop_text_tip", ""),
|
||||
("No need to elevate", ""),
|
||||
("System Sound", ""),
|
||||
("Default", ""),
|
||||
("New RDP", ""),
|
||||
("Fingerprint", ""),
|
||||
("Copy Fingerprint", ""),
|
||||
("no fingerprints", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -154,7 +154,8 @@ async fn connect_and_login_2(
|
||||
} else {
|
||||
ConnType::PORT_FORWARD
|
||||
};
|
||||
let (mut stream, direct) = Client::start(id, key, token, conn_type, interface.clone()).await?;
|
||||
let (mut stream, direct, _pk) =
|
||||
Client::start(id, key, token, conn_type, interface.clone()).await?;
|
||||
let mut interface = interface;
|
||||
let mut buffer = Vec::new();
|
||||
let mut received = false;
|
||||
|
||||
@@ -470,6 +470,10 @@ impl UI {
|
||||
get_version()
|
||||
}
|
||||
|
||||
fn get_fingerprint(&self) -> String {
|
||||
get_fingerprint()
|
||||
}
|
||||
|
||||
fn get_app_name(&self) -> String {
|
||||
get_app_name()
|
||||
}
|
||||
@@ -649,6 +653,7 @@ impl sciter::EventHandler for UI {
|
||||
fn get_software_update_url();
|
||||
fn get_new_version();
|
||||
fn get_version();
|
||||
fn get_fingerprint();
|
||||
fn update_me(String);
|
||||
fn show_run_without_install();
|
||||
fn run_without_install();
|
||||
|
||||
@@ -364,6 +364,7 @@ class MyIdMenu: Reactor.Component {
|
||||
var name = handler.get_app_name();
|
||||
msgbox("custom-nocancel-nook-hasclose", translate("About") + " " + name, "<div style='line-height: 2em'> \
|
||||
<div>Version: " + handler.get_version() + " \
|
||||
<div>Fingerprint: " + handler.get_fingerprint() + " \
|
||||
<div .link .custom-event url='https://rustdesk.com/privacy'>Privacy Statement</div> \
|
||||
<div .link .custom-event url='https://rustdesk.com'>Website</div> \
|
||||
<div style='background: #2c8cff; color: white; padding: 1em; margin-top: 1em;'>Copyright © 2022 Purslane Ltd.\
|
||||
|
||||
@@ -144,6 +144,8 @@ impl InvokeUiSession for SciterHandler {
|
||||
self.call("setConnectionType", &make_args!(is_secured, direct));
|
||||
}
|
||||
|
||||
fn set_fingerprint(&self, _fingerprint: String) {}
|
||||
|
||||
fn job_error(&self, id: i32, err: String, file_num: i32) {
|
||||
self.call("jobError", &make_args!(id, err, file_num));
|
||||
}
|
||||
|
||||
@@ -24,13 +24,12 @@ use hbb_common::{
|
||||
rendezvous_proto::*,
|
||||
};
|
||||
|
||||
use crate::common::SOFTWARE_UPDATE_URL;
|
||||
#[cfg(feature = "flutter")]
|
||||
use crate::hbbs_http::account;
|
||||
use crate::{common::SOFTWARE_UPDATE_URL};
|
||||
#[cfg(not(any(target_os = "ios")))]
|
||||
use crate::ipc;
|
||||
|
||||
|
||||
type Message = RendezvousMessage;
|
||||
|
||||
pub type Children = Arc<Mutex<(bool, HashMap<(String, String), Child>)>>;
|
||||
@@ -515,8 +514,7 @@ pub fn get_error() -> String {
|
||||
#[cfg(target_os = "linux")]
|
||||
{
|
||||
let dtype = crate::platform::linux::get_display_server();
|
||||
if crate::platform::linux::DISPLAY_SERVER_WAYLAND == dtype
|
||||
{
|
||||
if crate::platform::linux::DISPLAY_SERVER_WAYLAND == dtype {
|
||||
return crate::server::wayland::common_get_error();
|
||||
}
|
||||
if dtype != crate::platform::linux::DISPLAY_SERVER_X11 {
|
||||
@@ -852,6 +850,17 @@ pub fn get_user_default_option(key: String) -> String {
|
||||
UserDefaultConfig::load().get(&key)
|
||||
}
|
||||
|
||||
pub fn get_fingerprint() -> String {
|
||||
#[cfg(any(target_os = "android", target_os = "ios"))]
|
||||
if Config::get_key_confirmed() {
|
||||
return crate::common::pk_to_fingerprint(Config::get_key_pair().1);
|
||||
} else {
|
||||
return "".to_owned();
|
||||
}
|
||||
#[cfg(not(any(target_os = "android", target_os = "ios")))]
|
||||
return ipc::get_fingerprint();
|
||||
}
|
||||
|
||||
// notice: avoiding create ipc connection repeatedly,
|
||||
// because windows named pipe has serious memory leak issue.
|
||||
#[cfg(not(any(target_os = "android", target_os = "ios")))]
|
||||
|
||||
@@ -889,6 +889,7 @@ pub trait InvokeUiSession: Send + Sync + Clone + 'static + Sized + Default {
|
||||
fn close_success(&self);
|
||||
fn update_quality_status(&self, qs: QualityStatus);
|
||||
fn set_connection_type(&self, is_secured: bool, direct: bool);
|
||||
fn set_fingerprint(&self, fingerprint: String);
|
||||
fn job_error(&self, id: i32, err: String, file_num: i32);
|
||||
fn job_done(&self, id: i32, file_num: i32);
|
||||
fn clear_all_jobs(&self);
|
||||
|
||||
Reference in New Issue
Block a user