mirror of
https://github.com/weyne85/rustdesk.git
synced 2025-10-29 17:00:05 +00:00
fix #3328
This commit is contained in:
@@ -799,3 +799,22 @@ pub fn decode64<T: AsRef<[u8]>>(input: T) -> Result<Vec<u8>, base64::DecodeError
|
||||
#[allow(deprecated)]
|
||||
base64::decode(input)
|
||||
}
|
||||
|
||||
pub async fn get_key(sync: bool) -> String {
|
||||
let mut key = if sync {
|
||||
Config::get_option("key")
|
||||
} else {
|
||||
let mut options = crate::ipc::get_options_async().await;
|
||||
options.remove("key").unwrap_or_default()
|
||||
};
|
||||
if key.is_empty() {
|
||||
#[cfg(windows)]
|
||||
if let Some(lic) = windows::get_license() {
|
||||
return lic.key;
|
||||
}
|
||||
}
|
||||
if key.is_empty() && !option_env!("RENDEZVOUS_SERVER").unwrap_or("").is_empty() {
|
||||
key = config::RS_PUB_KEY.to_owned();
|
||||
}
|
||||
key
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user