mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-03-13 08:11:01 +03:00
unlock with PIN (#8977)
* add custom password to unlock settings * If not set, use admin password; if set, use custom settings password. * At least 4 characters. * Set with gui or command line. Signed-off-by: 21pages <sunboeasy@gmail.com> * Update cn.rs --------- Signed-off-by: 21pages <sunboeasy@gmail.com> Co-authored-by: RustDesk <71636191+rustdesk@users.noreply.github.com>
This commit is contained in:
@@ -1444,3 +1444,22 @@ pub fn check_hwcodec() {
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "flutter")]
|
||||
pub fn get_unlock_pin() -> String {
|
||||
#[cfg(any(target_os = "android", target_os = "ios"))]
|
||||
return String::default();
|
||||
#[cfg(not(any(target_os = "android", target_os = "ios")))]
|
||||
return ipc::get_unlock_pin();
|
||||
}
|
||||
|
||||
#[cfg(feature = "flutter")]
|
||||
pub fn set_unlock_pin(pin: String) -> String {
|
||||
#[cfg(any(target_os = "android", target_os = "ios"))]
|
||||
return String::default();
|
||||
#[cfg(not(any(target_os = "android", target_os = "ios")))]
|
||||
match ipc::set_unlock_pin(pin, true) {
|
||||
Ok(_) => String::default(),
|
||||
Err(err) => err.to_string(),
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user