doctor reports a devices.xml profile that a library profile hides
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 52/100
- Issue 类型
- 功能
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- android, typescript
调研方向
Read src/drivers/android/device-profile-source.ts and the driver wiring in src/drivers/android/index.ts; inspect the device profile source tests and AndroidDriver.advisories() seam in src/drivers/android/index.test.ts. Then run the focused Android driver tests and the CLI doctor tests in src/cli/index.test.ts. Done when hidden user profiles produce the specified advisories in order, existing physical advisories remain, no avdmanager process is started, and docs/CLI.md describes the advisory.
由索引模型根据 Issue 内容生成。
描述
Part of #485.
Scope
simlock doctor tells an operator when a profile they made in Android Studio is not used because a Simlock library profile has the same name. After this PR, a hidden custom profile is visible instead of silently ignored.
In short
A library name always wins. When devices.xml defines a profile whose name a library profile answers to, doctor reports it as an advisory. A name the library shares with the SDK is not reported: the two agree.
flowchart LR
X[devices.xml names] --> C{a library profile<br/>answers to it?}:::changed
C -- yes --> W[doctor: device-profile-hidden]:::changed
C -- no --> N[nothing]
classDef changed stroke-width:3px
$ simlock doctor
Warning [android] device-profile-hidden: "Pixel 9" in devices.xml is not used: Simlock's own Pixel 9 profile answers to that name
devices.xml defines |
Library has | Today | After |
|---|---|---|---|
| "Pixel 9" | Pixel 9 | nothing reported | one advisory, naming "Pixel 9" and Pixel 9 |
| "pixel_9" | Pixel 9 (other name pixel_9) |
nothing reported | one advisory, naming "pixel_9" and Pixel 9 |
| "PIXEL 9" | Pixel 9 | nothing reported | one advisory, naming "PIXEL 9" and Pixel 9 |
| "Pixel 9" and "Pixel 8" | both | nothing reported | two advisories, in devices.xml order |
| "My Tablet" | no such name | nothing reported | nothing reported |
| no file, or an unreadable one | — | nothing reported | nothing reported |
If this goes wrong, doctor misses a hidden profile or reports one that is in use.
Technical spec
Modules touched
flowchart LR
DOC[core Doctor] --> ADV[AndroidDriver.advisories]:::changed
ADV --> PH[PhysicalHandler.advisories]
ADV --> REG[DeviceProfileRegistry.hiddenUserProfiles]:::changed
REG --> L[library source]
REG --> U[UserDeviceProfileSource]
classDef changed stroke-width:3px
src/drivers/android/device-profile-source.ts: a new exported functionhiddenUserProfiles(library, user)takes the library source and theUserDeviceProfileSourceas two arguments. It reads only those two (static data and a file read), neverBuiltinDeviceProfileSource, so it starts no process, cannot hang onavdmanager, and counts eachdevices.xmlprofile once althoughavdmanagerlists it too. Neither source throws (the user source turns every read or parse failure into no profiles), so the function cannot reject. It returns, indevices.xmlorder, eachdevices.xmlprofile one of whose names a library profile answers to, ignoring case, paired with that library profile; the match ismatchProfileover the library's profiles.src/drivers/android/index.ts:defaultDeviceProfileSourcesreturns its three sources by name as well as in order, and the driver keeps the library and user ones.advisories()returns the physical handler's advisories followed by one{ code: "device-profile-hidden", message }per hidden profile. The message is"<devices.xml name>" in devices.xml is not used: Simlock's own <library name> profile answers to that name. A driver built with an injecteddeviceProfileSourceslist (tests only) reports no hidden profiles.
Contract and event changes
None. DriverAdvisory.code is a free string the core does not interpret; the CLI prints it as Warning [android] device-profile-hidden: <message>.
Other code on the same state
PhysicalHandler.advisories()(src/drivers/android/physical-handler.ts): its advisories are kept and come first.Doctor(src/core/doctor.ts) shows every driver advisory as adriver-advisoryfinding and never acts on one;--fixdoes nothing for it.advisories()also runs in the daemon's startup reconcile; with no process started, it adds only a file read there.UserDeviceProfileSource: an absent or unreadabledevices.xmlgives no profiles, so nothing is reported for it.BuiltinDeviceProfileSource: lists the samedevices.xmlprofiles withOEM : User; not read here.
Rules in play
safety.md:doctorreadsdevices.xmland changes nothing.architecture.md: the name match ismatchProfile, not a second one; the check is bounded because it starts no process.
Tests
Seam: AndroidDriver.advisories() through createDriver in src/drivers/android/index.test.ts, with writeDevicesXml (model on "device-profile sources").
- reports
device-profile-hiddenfor adevices.xmlprofile named like a library profile, with the message naming both - reports one matching a library profile's other name, in any letter case, naming the library profile's display name
- reports two hidden profiles as two advisories, in
devices.xmlorder - reports nothing for a
devices.xmlprofile no library profile answers to - reports nothing for a library name the SDK also lists
- reports one advisory per profile when
avdmanager list devicealso lists it withOEM : User, and runs noavdmanager - reports nothing when
devices.xmlis missing or unreadable - keeps the physical handler's advisories, before the new ones
- in the CLI tests (
src/cli/index.test.ts):simlock doctorprints a driver-advisory finding to stderr asWarning [<platform>] <code>: <message> - reports no hidden profiles for a driver built with injected
deviceProfileSources
Done when
- With a
devices.xmlprofile named "Pixel 9",advisories()returns onedevice-profile-hiddenadvisory naming it.simlock doctorshows driver advisories through the existingwriteDriverAdvisoryWarnings(src/cli/index.ts), and--fixnever acts on one, as the existing "--fix never acts on a driver-advisory finding" test insrc/core/doctor.test.tsproves. docs/CLI.md(simlock doctor) describes thedevice-profile-hiddenadvisory.
Out of scope
- Reporting SDK profiles the library hides.
- Reporting models with no fitting image.
Depends on
- #490
Approval
- Approved for delivery
Written by an agent.
- 主要语言
- TypeScript
- 星标
- 19
- 派生
- 1
- 平均合并
- 7 小时 49 分钟
- 30 天内合并 PR
- 228
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
callstackincubator/simlock 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 70/100
callstackincubator/simlock#639 ·
维护者通常 1 天内回复
-
Lint does not enforce index.ts boundaries for cleanup/, routing/, warm-pool/ and contract/ helpers可能已有人在做 @V3RON 今天认领。 未关闭bug:ready
难度 2/5 1-3 小时 新手友好度 70/100
callstackincubator/simlock#445 · 1 条评论 · 已指派 1 人 ·
维护者通常 1 天内回复
-
daemon-lifecycle e2e: the it.fails status test passes for the wrong reason可能已有人在做 @V3RON 于 8 天前认领。 未关闭bug:triage
难度 2/5 1-3 小时 新手友好度 84/100
callstackincubator/simlock#422 · 1 条评论 · 已指派 1 人 ·
维护者通常 1 天内回复
-
task:ready
难度 5/5 一周以上 新手友好度 8/100
callstackincubator/simlock#637 ·
维护者通常 1 天内回复
-
task:ready
难度 5/5 一周以上 新手友好度 12/100
callstackincubator/simlock#636 ·
维护者通常 1 天内回复
查看 callstackincubator/simlock 的全部 Issue
相似的 Issue
-
`cf complete zsh >> .zshrc` fails on vanilla zsh可能重新可做 关联的 PR 已关闭且未合并。 未关闭
难度 2/5 1-3 小时 新手友好度 75/100
cloudflare/cf#340 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
-
难度 2/5 1 小时以内 新手友好度 75/100
StoDevX/AAO-React-Native#8785 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 75/100
-
bnv-manager-v2: accept_invite creates the Mailcow domain admin before the commit可能已有人在做 @myOmikron 今天认领。 未关闭bug ready-for-agent
难度 2/5 1-3 小时 新手友好度 82/100