From 0a7a12fa2f2671a81b89a93724875d3e451b9d26 Mon Sep 17 00:00:00 2001 From: Song <168455@qq.com> Date: Thu, 9 Jul 2026 14:59:04 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20silence=20Milink=20(=E8=AE=BE=E5=A4=87?= =?UTF-8?q?=E4=BA=92=E8=81=94)=20UniversalClipboardService=20notices?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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) --- CLAUDE.md | 2 +- .../main/java/com/a2i/forwarder/core/NotificationProcessor.kt | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CLAUDE.md b/CLAUDE.md index 4fbf75a..197575c 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -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`。 | | `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/AdFilter.kt` | 内置营销关键词 + 用户自定义关键词(`settings.adKeywords`)。 | | `core/AppParsers.kt` | 微信/QQ/Telegram 的 `clickUrl` 映射 + 重要消息关键词(@我、验证码、通话等)。 | diff --git a/app/src/main/java/com/a2i/forwarder/core/NotificationProcessor.kt b/app/src/main/java/com/a2i/forwarder/core/NotificationProcessor.kt index 0be2c73..bca4732 100644 --- a/app/src/main/java/com/a2i/forwarder/core/NotificationProcessor.kt +++ b/app/src/main/java/com/a2i/forwarder/core/NotificationProcessor.kt @@ -55,6 +55,7 @@ class NotificationProcessor(private val context: Context) { "com.github.metacubex.clash.meta", // Clash Meta for Android "com.github.kr328.clash", // Clash for Android "com.v2ray.ang", // v2rayNG + "com.milink.service", // 小米设备互联(UniversalClipboardService 跨设备剪贴板等常驻通知) ) fun process(sbn: StatusBarNotification): Decision {