From 88fa5cb14955b733ec341be3006de28e29a088f6 Mon Sep 17 00:00:00 2001 From: JianFeeeee Date: Tue, 15 Sep 2026 12:02:58 +0800 Subject: [PATCH] =?UTF-8?q?test(=E8=AE=BE=E5=A4=87=E9=97=B8):=20=E6=94=B6?= =?UTF-8?q?=E4=B8=80=E4=BB=BD**=E7=9C=9F=E5=AE=9E**=E7=9A=84=20`aa=20dump?= =?UTF-8?q?=20-l`=20=E4=BD=9C=E4=B8=BA=E6=A0=B7=E6=9C=AC=EF=BC=88=E6=9D=A5?= =?UTF-8?q?=E6=BA=90=E4=B8=8E=E6=97=B6=E9=97=B4=E5=86=99=E5=9C=A8=E4=B8=8B?= =?UTF-8?q?=E9=9D=A2=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 为什么要收它:`DeviceProbe.parseForeground` 原先是按**猜的**格式写的(`bundleName: xxx`), 而真机上的形状是 `bundle name [xxx]`,且**多个 mission 并存**、前台由各 mission 的 `state #FOREGROUND` 决定。两种错法都能发生: - 按 `bundleName:` 解析 ⇒ 全部匹配不到 ⇒ 闸永远返回 `unverified`(方向安全,但等于没法用); - 只取**第一个** `bundle name` ⇒ 取到的是**别的 app**(这份样本里 `#31 com.example.homeagent` 就排在我们 `#32 com.jianf.agentmail` 前面)⇒ **假绿**。 样本内容(采集于 2026-09-15,`hdc -t 127.0.0.1:5555 shell "aa dump -l"`)恰好是**争用发生后的那一刻**: 我们的 mission 在,但**前台是别的 app** —— 正是这道闸要挡的输入,而且是真实形状而非构造的。 采集背景(同一分钟内):`aa start` 报 success,随即 dump 显示我们 FOREGROUND(84231), 约一分钟后再次 dump(本样本)**前台已被对方拿回**(`#31` FOREGROUND)—— 所以"争用"不是理论风险,它在一分钟内就发生了。 --- .../electron/test/fixtures/aa-dump-l-real.txt | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 client/electron/test/fixtures/aa-dump-l-real.txt diff --git a/client/electron/test/fixtures/aa-dump-l-real.txt b/client/electron/test/fixtures/aa-dump-l-real.txt new file mode 100644 index 0000000..9c2978c --- /dev/null +++ b/client/electron/test/fixtures/aa-dump-l-real.txt @@ -0,0 +1,25 @@ +User ID #100 + current mission lists:{ + Mission ID #31 mission name #[#com.example.homeagent:entry:EntryAbility] lockedState #0 mission affinity #[] + AbilityRecord ID #31 + app name [com.example.homeagent] + main name [EntryAbility] + bundle name [com.example.homeagent] + ability type [PAGE] + state #FOREGROUND start time [82256] + app state #FOREGROUND + ready #1 window attached #0 launcher #0 + callee connections: + isKeepAlive: false + Mission ID #32 mission name #[#com.jianf.agentmail:entry:EntryAbility] lockedState #0 mission affinity #[] + AbilityRecord ID #34 + app name [com.jianf.agentmail] + main name [EntryAbility] + bundle name [com.jianf.agentmail] + ability type [PAGE] + state #BACKGROUND start time [84231] + app state #BACKGROUND + ready #1 window attached #0 launcher #0 + callee connections: + isKeepAlive: false + }