fix: silence Milink (设备互联) UniversalClipboardService notices

com.milink.service posts empty/high-frequency cross-device clipboard
notices. Add to silentPackages so they're dropped silently (no forward,
no log entry). CLAUDE.md synced.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-07-09 14:59:04 +08:00
parent dcdfb7e9f9
commit 0a7a12fa2f
2 changed files with 2 additions and 1 deletions
+1 -1
View File
@@ -71,7 +71,7 @@ NotifyListenerService (系统通知入口)
|---|---| |---|---|
| `A2iApp.kt` | `Application` 单例;持有全局 `appScope``SupervisorJob+Dispatchers.Default`)与全局组件:三个 Store`settings`/`appRules`/`logStore`+ 监听类(`phoneCallMonitor`/`connectivityMonitor`/`carrierBalanceQuery`/`smsForwarder`/`updateChecker`)。全部经 `A2iApp.instance.xxx` 访问,`onCreate` 构造并 `start()`。UI 通过 `collectAsState()` 订阅 Store 的 `StateFlow`。 | | `A2iApp.kt` | `Application` 单例;持有全局 `appScope``SupervisorJob+Dispatchers.Default`)与全局组件:三个 Store`settings`/`appRules`/`logStore`+ 监听类(`phoneCallMonitor`/`connectivityMonitor`/`carrierBalanceQuery`/`smsForwarder`/`updateChecker`)。全部经 `A2iApp.instance.xxx` 访问,`onCreate` 构造并 `start()`。UI 通过 `collectAsState()` 订阅 Store 的 `StateFlow`。 |
| `service/NotifyListenerService.kt` | `NotificationListenerService` 实现;每条通知调 `processor.process()`,过滤后推送。 | | `service/NotifyListenerService.kt` | `NotificationListenerService` 实现;每条通知调 `processor.process()`,过滤后推送。 |
| `core/NotificationProcessor.kt` | **核心决策点**。包含 LRU 去重缓存(5s)、脱敏检测(`*****` → 回退到 `tickerText`)、持续性通知 + VPN/代理客户端常驻通知(`silentPackages`)静默过滤、米家「设备状态」泛化通知静默(保留门锁告警)、系统状态消息过滤、广告过滤、验证码提取、特殊 App 解析。返回 `Decision(message?, reason, appLabel, code, silent)`。 | | `core/NotificationProcessor.kt` | **核心决策点**。包含 LRU 去重缓存(5s)、脱敏检测(`*****` → 回退到 `tickerText`)、持续性通知 + VPN/代理客户端/设备互联等常驻通知(`silentPackages`)静默过滤、米家「设备状态」泛化通知静默(保留门锁告警)、系统状态消息过滤、广告过滤、验证码提取、特殊 App 解析。返回 `Decision(message?, reason, appLabel, code, silent)`。 |
| `core/CodeExtractor.kt` | 三段正则:关键词+数字、数字+关键词、纯数字 4-8 位。检测到全 `*****` 时直接返回 null。 | | `core/CodeExtractor.kt` | 三段正则:关键词+数字、数字+关键词、纯数字 4-8 位。检测到全 `*****` 时直接返回 null。 |
| `core/AdFilter.kt` | 内置营销关键词 + 用户自定义关键词(`settings.adKeywords`)。 | | `core/AdFilter.kt` | 内置营销关键词 + 用户自定义关键词(`settings.adKeywords`)。 |
| `core/AppParsers.kt` | 微信/QQ/Telegram 的 `clickUrl` 映射 + 重要消息关键词(@我、验证码、通话等)。 | | `core/AppParsers.kt` | 微信/QQ/Telegram 的 `clickUrl` 映射 + 重要消息关键词(@我、验证码、通话等)。 |
@@ -55,6 +55,7 @@ class NotificationProcessor(private val context: Context) {
"com.github.metacubex.clash.meta", // Clash Meta for Android "com.github.metacubex.clash.meta", // Clash Meta for Android
"com.github.kr328.clash", // Clash for Android "com.github.kr328.clash", // Clash for Android
"com.v2ray.ang", // v2rayNG "com.v2ray.ang", // v2rayNG
"com.milink.service", // 小米设备互联(UniversalClipboardService 跨设备剪贴板等常驻通知)
) )
fun process(sbn: StatusBarNotification): Decision { fun process(sbn: StatusBarNotification): Decision {