Bump version and auto-generate sing-box HWIDs
This commit is contained in:
@@ -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}")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user