From 20abe3aef2c7b2021b8dfc3617e1e3243e839534 Mon Sep 17 00:00:00 2001 From: lijunjie Date: Wed, 25 Nov 2026 11:17:46 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=AF=E5=8A=A8=E9=A1=B9=E8=A7=92=E8=89=B2?= =?UTF-8?q?=E5=90=8D=E4=B8=8D=E5=86=8D=E8=87=AA=E6=88=90=E4=B8=80=E7=BB=84?= =?UTF-8?q?=EF=BC=9AWindows=20File=20System=20Proxy=20=E5=BD=92=E5=85=A5?= =?UTF-8?q?=E5=85=B6=E4=BB=96=E8=BD=AF=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - WinFsp 的 launcher-x64.exe 把 FileDescription 写成 "Windows File System Proxy"(看着像系统组件,实则 Navimatics 第三方库),命名优先级取了这句 角色描述,导致启动列表冒出一个独立软件组 - 新规则 is_component_role_label:以 Windows/Microsoft 开头、以 proxy/host/agent/service/helper/driver/launcher/broker 等角色词结尾的 名字视为管道组件而非产品 → named=false,落入其他软件;真实产品名 (微信、Windows Defender Firewall、WinFsp Launcher 等)不受影响 - 单测×2:角色词表边界断言 + 本机真机断言(WinFsp 行必须未归因;机器无 WinFsp 自动跳过) --- crates/squid-platform/src/permissions.rs | 81 ++++++++++++++++++++++-- release/0.1.13/RELEASE_NOTES.md | 4 ++ 2 files changed, 81 insertions(+), 4 deletions(-) diff --git a/crates/squid-platform/src/permissions.rs b/crates/squid-platform/src/permissions.rs index 8874f02..2c39cf4 100644 --- a/crates/squid-platform/src/permissions.rs +++ b/crates/squid-platform/src/permissions.rs @@ -606,6 +606,30 @@ mod windows { (!product.is_empty()).then(|| product.to_string()) } + /// Windows-style *component role* descriptions shipped inside PEs — + /// "Windows File System Proxy" (WinFsp), "Microsoft Edge Elevation + /// Service" — label a role, not a product the user recognises. Rows + /// named only by such a label are not attributed to a software group; + /// they fall into 其他软件 like any anonymous helper. Microsoft-signed + /// ones are usually hidden in 系统组件 anyway. + fn is_component_role_label(text: &str) -> bool { + let lower = text.trim().to_lowercase(); + let vendor_led = lower.starts_with("windows ") || lower.starts_with("microsoft "); + const ROLES: [&str; 10] = [ + "proxy", + "host", + "agent", + "service", + "support", + "helper", + "driver", + "component", + "launcher", + "broker", + ]; + vendor_led && ROLES.iter().any(|role| lower.ends_with(role)) + } + /// Resolve `display_name` (and the software icon) for every scanned /// entry, once per binary. Also settles `target` / `target_exists`: the /// binary the row really runs, and whether it is still on disk (a missing @@ -643,8 +667,12 @@ mod windows { friendly_program_name(&entry.name, description.as_deref(), product.as_deref()); // 电脑管家's grouping rule: an entry is only attributed to a // software product when the binary carries real human strings; - // everything else falls into the 其他软件 bucket. - entry.named = description.is_some() || product.is_some(); + // everything else falls into the 其他软件 bucket. A "Windows + // File System Proxy"-style role label names a plumbing part, + // not a product the user recognises — WinFsp's launcher used to + // open its own fake software group through its FileDescription. + entry.named = (description.is_some() || product.is_some()) + && !is_component_role_label(&entry.display_name); if !entry.named { if let Some(product) = windows_store_product(&probed) { entry.display_name = product; @@ -2492,12 +2520,57 @@ mod windows { mod tests { use super::{ approved_enabled, attribute_vendor_suites, clean_module_path, exe_from_command, - friendly_program_name, has_cjk, is_placeholder_label, module_folder_name, - parse_csv_line, split_run_path, suite_path, task_settings_enabled, + friendly_program_name, has_cjk, is_component_role_label, is_placeholder_label, + module_folder_name, parse_csv_line, split_run_path, suite_path, task_settings_enabled, windows_store_product, write_approved, StartupEntry, CURRENT_VERSION, }; use winreg::RegKey; + #[test] + fn role_labels_are_not_products() { + // WinFsp's launcher names itself "Windows File System Proxy"; + // that is plumbing, so the row must not open its own group. + assert!(is_component_role_label("Windows File System Proxy")); + assert!(is_component_role_label("Microsoft Edge Elevation Service")); + assert!(is_component_role_label( + "Windows Push Notifications User Service" + )); + // Real products keep their groups, Chinese or English. + assert!(!is_component_role_label("微信")); + assert!(!is_component_role_label("Windows Defender Firewall")); + assert!(!is_component_role_label("Everything")); + assert!(!is_component_role_label("WinFsp Launcher")); + } + + #[test] + fn the_live_scan_leaves_winfsp_unattributed() { + // The user's exact complaint: the WinFsp launcher service opened + // a "Windows File System Proxy" software group of its own. + if !std::path::Path::new(r"C:\Program Files (x86)\WinFsp").exists() { + eprintln!("skipping: no WinFsp on this machine"); + return; + } + let entries = super::scan_startup(); + let launcher: Vec<_> = entries + .iter() + .filter(|entry| { + entry + .target + .to_lowercase() + .starts_with(r"c:\program files (x86)\winfsp") + }) + .collect(); + assert!(!launcher.is_empty(), "WinFsp rows vanished"); + assert!( + launcher.iter().all(|entry| !entry.named), + "WinFsp still attributed: {:?}", + launcher + .iter() + .map(|entry| (&entry.name, &entry.display_name, entry.named)) + .collect::>() + ); + } + #[test] fn suite_paths_need_a_vendor_and_a_child_folder() { assert_eq!( diff --git a/release/0.1.13/RELEASE_NOTES.md b/release/0.1.13/RELEASE_NOTES.md index d33f918..2d7fd09 100644 --- a/release/0.1.13/RELEASE_NOTES.md +++ b/release/0.1.13/RELEASE_NOTES.md @@ -28,6 +28,10 @@ Squid 0.1.13 更新说明 H3C Workspace 的 SpaceAgent、摄像头/打印机/USB/串并口重定向等一组服务, 每个程序都不带产品名信息)自动合并为一组「H3C Workspace」,不再散成 单行组和「其他软件」;带真实产品名的软件不受影响。 +- 角色名不再自成一组:WinFsp 的启动服务自称「Windows File System Proxy」, + 看着像系统组件实为第三方库,此前在启动列表里开了一个独立的假软件组; + 现在这类「Windows/Microsoft + Proxy/Host/Service…)」的角色名一律归入 + 「其他软件」,真实产品名不受影响。 - 商店应用归组修复:ChatGPT 等微软商店安装的应用此前因为读不到程序信息 而全部堆在「其他软件」,现在按安装包名自动归组(ChatGPT 独立成组,带 自己的图标);「其他软件」组头改用中性九宫格图标,不再借用组内某个