This commit is contained in:
2025-07-23 12:06:39 +02:00
5 changed files with 24 additions and 24 deletions

View File

@@ -720,7 +720,6 @@ pub async fn has_net8() -> bool {
is_net8_installed().await
}
#[cfg(windows)]
#[tauri::command]
pub fn encrypt_string(string: String, entropy: String) -> String {
let encrypted = encrypt_password(&string, &entropy);
@@ -730,10 +729,3 @@ pub fn encrypt_string(string: String, entropy: String) -> String {
Err(_) => string,
}
}
// NOTE: should not be called by tauri on non windows systems, return the string nonthenless
#[cfg(not(windows))]
#[tauri::command]
pub fn encrypt_string(string: String, _entropy: String) -> String {
string
}

View File

@@ -308,6 +308,11 @@ pub async fn is_net8_installed() -> bool {
}
}
#[cfg(not(windows))]
pub fn encrypt_password(password: &str, _entropy: &str) -> Result<String, String> {
Ok(password.to_string())
}
#[cfg(windows)]
pub fn encrypt_password(password: &str, entropy: &str) -> Result<String, String> {
use base64::{Engine as _, engine::general_purpose};