内置「发给 WorkBuddy」入口因 bundle id 写错而显示"未安装"
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Newbie friendliness
- 88/100
Research direction
The wrong bundle identifier is hard-coded in two places: the workBuddy case of AgentID in macos/Sources/WeChatBridgeCore/AgentID.swift, and the targetBundleIdentifier switch in macos/Sources/WeChatBridgeCore/ShareAction.swift. Confirm the installed app's real id with defaults read on its Info.plist, then update both cases to that value. Done means both lookups return the corrected id and the entry no longer reports 'not installed' when WorkBuddy is present.
Written by the indexing model from the issue text.
Description
现象 / Symptom
在 macOS 上安装官方 WorkBuddy(/Applications/WorkBuddy.app)后,微信流的转发入口「发给 WorkBuddy」仍显示为橙色「未安装」,开启后转发也无法定位到 App,最终回退到剪贴板并提示「这台 Mac 上没有找到 WorkBuddy」。
复现 / Reproduction
从腾讯官方下载并安装 WorkBuddy for Mac(bundle id:com.workbuddy.workbuddy)。
打开微信流的「设置 → 入口」,查看「发给 WorkBuddy」一行 —— 显示为「未安装」。
在微信多选聊天记录 → 合并转发 → 选「发给 WorkBuddy」→ 实际只把文件放到剪贴板,并提示未找到 App。
根因 / Root Cause
AgentID.workBuddy 与 ShareAction.workBuddy.targetBundleIdentifier 把 WorkBuddy 的 bundle id 写死成了 com.tencent.workbuddy.mac:
macos/Sources/WeChatBridgeCore/AgentID.swift
case .workBuddy: return "com.tencent.workbuddy.mac"
macos/Sources/WeChatBridgeCore/ShareAction.swift 的 targetBundleIdentifier
case .workBuddy: return "com.tencent.workbuddy.mac"
而实际安装的 WorkBuddy for Mac 的 CFBundleIdentifier 是 com.workbuddy.workbuddy(已在本机 defaults read /Applications/WorkBuddy.app/Contents/Info.plist CFBundleIdentifier 验证)。
转发时 AutoPaste.applicationURL(forBundleIdentifier:) 走的是 NSWorkspace.urlForApplication(withBundleIdentifier:),该方法是精确匹配、无按名称回退,于是返回 nil → ActionRunner.forward 走 fallBack 分支 → 入口判定为未安装。
修复建议 / Suggested Fix
把上述两处都改为真实的 bundle id com.workbuddy.workbuddy:
// macos/Sources/WeChatBridgeCore/AgentID.swift
case .workBuddy:
- return "com.tencent.workbuddy.mac"
- return "com.workbuddy.workbuddy"
// macos/Sources/WeChatBridgeCore/ShareAction.swift (targetBundleIdentifier)
case .workBuddy:
- return "com.tencent.workbuddy.mac"
- return "com.workbuddy.workbuddy"
(如后续 WorkBuddy 存在多个分发渠道、bundle id 不统一,也可改为同时尝试多个候选 id 的容错逻辑,但当前单值修正即可解决绝大多数用户问题。)
临时绕过 / Workaround(无需等发版)
用户可暂用「自定义目标」:微信流 → 设置 → 入口 → 添加应用 → 选中 /Applications/WorkBuddy.app,其会读取真实 id com.workbuddy.workbuddy,转发时选「发送到自定义」即可正常工作。
环境 / Environment
macOS 15 (Sequoia)
WeChatBridge 0.1.15
WorkBuddy for Mac: bundle id com.workbuddy.workbuddy
- Dominant language
- Swift
- Stars
- 1.4k
- Forks
- 430
- Avg merge
- 18h 9m
- Merged PRs (30d)
- 10
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from freestylefly/WeChatBridge
-
Windows 兼容层404Open
Difficulty 2/5 1-3 hours Newbie friendliness 48/100
freestylefly/WeChatBridge#42 ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
freestylefly/WeChatBridge#41 ·
Maintainers usually reply within 1 day
-
[Windows] v1.1.12 安装失败 0x80070643:Add-AppxPackage 无法删除 AppContainer 配置文件 (0x800701C0)Possibly taken @dqtx760 claimed this 3 days ago. Open
Difficulty 4/5 1-2 days Newbie friendliness 38/100
freestylefly/WeChatBridge#39 · 1 comment ·
Maintainers usually reply within 1 day
-
win版本安装最后一步报错MSI解压失败Possibly taken @dqtx760 claimed this 3 days ago. Open
Difficulty 1/5 Under an hour Newbie friendliness 15/100
freestylefly/WeChatBridge#38 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 38/100
freestylefly/WeChatBridge#32 ·
Maintainers usually reply within 1 day
All issues in freestylefly/WeChatBridge
Similar issues
-
fyi-ecosystem platform-ios team-ios
Difficulty 1/5 Under an hour Newbie friendliness 70/100
flutter/flutter#194348 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 Half a day Newbie friendliness 62/100
swiftwasm/JavaScriptKit#818 ·
-
Difficulty 2/5 Half a day Newbie friendliness 62/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
capawesome-team/capacitor-plugins#1134 ·
Maintainers usually reply within 1 day
-
OpenAILanguageModel replays tool-call arguments as GeneratedContent's Codable form, not JSONPossibly taken @gtokman claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
huggingface/AnyLanguageModel#324 ·
Maintainers usually reply within 1 day