mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-01-29 08:45:41 +08:00
feat: add signal handling for graceful shutdown on Windows and Unix (#5023)
* feat: add signal handling for graceful shutdown on Windows and Unix Co-authored-by: oomeow <oomeow@outlook.com> * chore: update Cargo.lock * fix(windows): restore shutdown hook build by enabling missing Win32 APIs and removing stray tracing call Includes the required windows-sys feature expansions and replaces a leftover tracing reference so the Windows shutdown hook builds successfully. * fix: add deprecation warnings for encrypt_data and decrypt_data functions --------- Co-authored-by: oomeow <oomeow@outlook.com> Co-authored-by: Slinetrac <realakayuki@gmail.com>
This commit is contained in:
@@ -9,6 +9,7 @@ use serde::{Deserialize, Deserializer, Serialize, Serializer};
|
||||
const NONCE_LENGTH: usize = 12;
|
||||
|
||||
/// Encrypt data
|
||||
#[allow(deprecated)]
|
||||
pub fn encrypt_data(data: &str) -> Result<String, Box<dyn std::error::Error>> {
|
||||
let encryption_key = get_encryption_key()?;
|
||||
let key = Key::<Aes256Gcm>::from_slice(&encryption_key);
|
||||
@@ -30,6 +31,7 @@ pub fn encrypt_data(data: &str) -> Result<String, Box<dyn std::error::Error>> {
|
||||
}
|
||||
|
||||
/// Decrypt data
|
||||
#[allow(deprecated)]
|
||||
pub fn decrypt_data(encrypted: &str) -> Result<String, Box<dyn std::error::Error>> {
|
||||
let encryption_key = get_encryption_key()?;
|
||||
let key = Key::<Aes256Gcm>::from_slice(&encryption_key);
|
||||
|
||||
Reference in New Issue
Block a user