Bump version and auto-generate sing-box HWIDs

This commit is contained in:
2026-07-08 21:03:14 +03:00
parent 42b85cc8fa
commit f6b722b22a
13 changed files with 101 additions and 281 deletions

View File

@@ -159,10 +159,6 @@ impl LocalSingBoxConfig {
.as_deref()
.map(redact_subscription_url)
}
pub fn device_hwid_display(&self) -> Option<String> {
self.device_hwid.as_deref().map(redact_device_hwid)
}
}
impl Default for LocalSingBoxConfig {
@@ -278,27 +274,3 @@ pub fn redact_subscription_url(raw_url: &str) -> String {
}
}
}
pub fn redact_device_hwid(raw_hwid: &str) -> String {
let trimmed = raw_hwid.trim();
if trimmed.is_empty() {
return String::new();
}
let length = trimmed.chars().count();
if length <= 8 {
return "***".to_string();
}
let prefix = trimmed.chars().take(4).collect::<String>();
let suffix = trimmed
.chars()
.rev()
.take(4)
.collect::<String>()
.chars()
.rev()
.collect::<String>();
format!("{prefix}...{suffix}")
}