知了 Cicada · 任何会议和直播的实时字幕、同声传译、AI 会议纪要,Mac、Windows、Linux、Android 免费开源。Live subtitles, interpreting and meeting notes for any call or stream, on Mac, Windows, Linux and Android.
Swift androidlinuxlive-captionsmacosmeeting-notesmenubar-appsimultaneous-interpretationspeech-recognitionsubtitlesswiftswiftuitranslationwindows
feat: walk through the first-open warning in the installer window
wquguru2f23a45427f8
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 9973ba2..abe26f0 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -6,6 +6,7 @@ the release workflow publishes it as the release notes.## Unreleased- New: turning on 同声传译 switches the Mac's system microphone to BlackHole 2ch and switches it back when 同声传译 is turned off or Cicada quits, so a meeting page in Chrome (or any app left on the default microphone) hears the translation with no setup. Cicada itself keeps recording from your real microphone (Settings › 同声传译 › 系统麦克风 lets you pin one). If Cicada didn't get to switch back (it crashed), or AirPods or something else took over the system mic while you were speaking, the menu bar panel says so with a 还原 / 换回 button; the panel's ⋯ menu also has 同声传译设置…, 试一句 and 还原系统麦克风. The switch can be turned off in Settings.+- Changed: the installer window explains the first-open warning. While the developer certificate is pending, macOS says Apple can't verify Cicada; the window, now a little taller, says this is expected and shows the three screens to click through in miniature, each with the button ringed: 完成 (not 移到废纸篓), 隐私与安全性 in System Settings, then 仍要打开 under 安全性.## 2.2.0 — 2026-11-02diff --git a/Resources/dmg/DS_Store b/Resources/dmg/DS_Storeindex 92b787a..0555aff 100644Binary files a/Resources/dmg/DS_Store and b/Resources/dmg/DS_Store differdiff --git a/Sources/LiveSubs/DMGBackground.swift b/Sources/LiveSubs/DMGBackground.swiftindex b809708..50d9ac7 100644--- a/Sources/LiveSubs/DMGBackground.swift+++ b/Sources/LiveSubs/DMGBackground.swift@@ -4,13 +4,17 @@ import AppKit/// Finder places the icons on top of it at `appIcon` and `applicationsIcon`, so the art leaves/// those spots empty. Keep in step with `scripts/dmg-template.sh`.enum DMGBackground {- static let size = CGSize(width: 640, height: 400)- static let appIcon = CGPoint(x: 170, y: 205)- static let applicationsIcon = CGPoint(x: 470, y: 205)+ static let size = CGSize(width: 640, height: 520)+ static let appIcon = CGPoint(x: 170, y: 175)+ static let applicationsIcon = CGPoint(x: 470, y: 175)private static let ink = NSColor(srgbRed: 0.082, green: 0.09, blue: 0.11, alpha: 1) // #15171Cprivate static let secondary = NSColor(srgbRed: 0.353, green: 0.373, blue: 0.42, alpha: 1) // #5A5F6Bprivate static let orange = NSColor(srgbRed: 0.91, green: 0.33, blue: 0.17, alpha: 1) // #E8552B+ private static let grey = NSColor(srgbRed: 0.42, green: 0.44, blue: 0.5, alpha: 1) // #6B7080+ private static let well = CGColor(srgbRed: 0.945, green: 0.949, blue: 0.961, alpha: 1) // #F1F2F5+ private static let bar = CGColor(srgbRed: 0.86, green: 0.87, blue: 0.89, alpha: 1)+ private static let macBlue = CGColor(srgbRed: 0.04, green: 0.52, blue: 1, alpha: 1)static func render(to url: URL, scale: Int) throws {let rep = NSBitmapImageRep(@@ -34,8 +38,8 @@ enum DMGBackground {ctx.setFillColor(CGColor(srgbRed: 0.965, green: 0.969, blue: 0.976, alpha: 1)) // #F6F7F9ctx.fill(CGRect(origin: .zero, size: size))- text("把知了拖进「应用程序」", size: 22, weight: .semibold, color: ink, centerX: size.width / 2, top: 40)- text("然后在「应用程序」或启动台里打开它", size: 13, weight: .regular, color: secondary, centerX: size.width / 2, top: 76)+ text("把知了拖进应用程序", size: 22, weight: .semibold, color: ink, centerX: size.width / 2, top: 28)+ text("然后在应用程序或启动台里打开它", size: 13, weight: .regular, color: secondary, centerX: size.width / 2, top: 62)// Dotted arrow from the app to Applications.ctx.setStrokeColor(orange.cgColor)@@ -54,8 +58,125 @@ enum DMGBackground {ctx.addLine(to: CGPoint(x: tip.x - 11, y: y + 9))ctx.strokePath()- text("第一次打开被拦住:系统设置 › 隐私与安全性 › 仍要打开", size: 12, weight: .regular,- color: secondary, centerX: size.width / 2, top: 338)+ firstOpenSteps(ctx)+ }++ /// The app is ad-hoc signed, so the first open shows Gatekeeper's "Apple 无法验证…恶意软件" sheet.+ /// Say up front that this is expected, then show the three screens people will meet in miniature,+ /// with the thing to click ringed, so nobody stops at the scary sheet or picks 移到废纸篓.+ /// Button names match macOS's own Chinese strings (CoreServicesUIAgent, Privacy & Security).+ private static func firstOpenSteps(_ ctx: CGContext) {+ text("第一次打开会被拦一下,别担心", size: 15, weight: .semibold, color: ink, centerX: size.width / 2, top: 274)+ text("开发者证书还在申请中,照下面放行一次,以后就能直接打开", size: 12, weight: .regular,+ color: secondary, centerX: size.width / 2, top: 298)++ let steps: [(title: String, hint: String, art: (CGContext, CGRect) -> Void)] = [+ ("点完成", "别点移到废纸篓", drawAlert),+ ("打开系统设置", "左边选隐私与安全性", drawSettings),+ ("点仍要打开", "在安全性一栏,输一次密码", drawOpenAnyway),+ ]+ let w: CGFloat = 188, gap: CGFloat = 14+ var x = (size.width - w * 3 - gap * 2) / 2+ for (i, step) in steps.enumerated() {+ let card = CGRect(x: x, y: 330, width: w, height: 168)+ fill(ctx, card, radius: 12, color: .white, shadow: true)+ let art = card.insetBy(dx: 8, dy: 8).divided(atDistance: 100, from: .minYEdge).slice+ fill(ctx, art, radius: 8, color: well)+ ctx.saveGState()+ ctx.clip(to: art)+ step.art(ctx, art)+ ctx.restoreGState()++ // "① 点完成" centred under the picture, the hint below it.+ let titleAttrs: [NSAttributedString.Key: Any] = [.font: NSFont.systemFont(ofSize: 13, weight: .semibold)]+ let tw = (step.title as NSString).size(withAttributes: titleAttrs).width+ let left = card.midX - (tw + 24) / 2+ let badge = CGRect(x: left, y: card.minY + 120, width: 18, height: 18)+ ctx.setFillColor(orange.cgColor)+ ctx.fillEllipse(in: badge)+ text("\(i + 1)", size: 11, weight: .bold, color: .white, centerX: badge.midX, top: badge.minY + 2)+ text(step.title, size: 13, weight: .semibold, color: ink, x: badge.maxX + 6, top: badge.minY)+ text(step.hint, size: 11, weight: .regular, color: grey, centerX: card.midX, top: card.minY + 143)+ x += w + gap+ }+ }++ /// The "未打开 Cicada" sheet: 移到废纸篓 greyed, 完成 ringed.+ private static func drawAlert(_ ctx: CGContext, in r: CGRect) {+ let sheet = CGRect(x: r.midX - 66, y: r.minY + 8, width: 132, height: 86)+ fill(ctx, sheet, radius: 10, color: .white, shadow: true)+ if let icon = appIconImage {+ icon.draw(in: CGRect(x: sheet.midX - 10, y: sheet.minY + 7, width: 18, height: 18))+ }+ text("未打开 Cicada", size: 9, weight: .semibold, color: ink, centerX: sheet.midX, top: sheet.minY + 27)+ fill(ctx, CGRect(x: sheet.minX + 18, y: sheet.minY + 42, width: 96, height: 4), radius: 2, color: bar)+ fill(ctx, CGRect(x: sheet.minX + 30, y: sheet.minY + 50, width: 72, height: 4), radius: 2, color: bar)+ let trash = CGRect(x: sheet.minX + 10, y: sheet.minY + 60, width: 54, height: 16)+ let done = CGRect(x: sheet.maxX - 64, y: sheet.minY + 60, width: 54, height: 16)+ fill(ctx, trash, radius: 8, color: well)+ text("移到废纸篓", size: 7.5, weight: .regular, color: grey, centerX: trash.midX, top: trash.minY + 3)+ fill(ctx, done, radius: 8, color: macBlue)+ text("完成", size: 8, weight: .semibold, color: .white, centerX: done.midX, top: done.minY + 2.5)+ ring(ctx, done)+ }++ /// System Settings with 隐私与安全性 ringed in the sidebar.+ private static func drawSettings(_ ctx: CGContext, in r: CGRect) {+ let win = CGRect(x: r.minX + 14, y: r.minY + 12, width: r.width - 28, height: 100)+ fill(ctx, win, radius: 10, color: .white, shadow: true)+ let side = CGRect(x: win.minX, y: win.minY, width: 78, height: win.height)+ fill(ctx, side, radius: 10, color: CGColor(srgbRed: 0.97, green: 0.97, blue: 0.98, alpha: 1))+ for (i, w) in [CGFloat(40), 30, 46].enumerated() {+ let rowY = win.minY + 12 + CGFloat(i) * 13+ ctx.setFillColor(bar); ctx.fillEllipse(in: CGRect(x: side.minX + 9, y: rowY, width: 7, height: 7))+ fill(ctx, CGRect(x: side.minX + 20, y: rowY + 1.5, width: w, height: 4), radius: 2, color: bar)+ }+ let row = CGRect(x: side.minX + 4, y: win.minY + 52, width: side.width + 8, height: 17)+ fill(ctx, row, radius: 5, color: macBlue)+ text("隐私与安全性", size: 8, weight: .semibold, color: .white, x: row.minX + 7, top: row.minY + 3)+ ring(ctx, row)+ for (i, w) in [CGFloat(52), 36, 44, 30].enumerated() {+ fill(ctx, CGRect(x: side.maxX + 16, y: win.minY + 14 + CGFloat(i) * 12, width: w, height: 4), radius: 2, color: bar)+ }+ }++ /// The 安全性 section: "已阻止 Cicada 以保护 Mac" with 仍要打开 ringed.+ private static func drawOpenAnyway(_ ctx: CGContext, in r: CGRect) {+ let pane = CGRect(x: r.minX + 14, y: r.minY + 12, width: r.width - 28, height: 100)+ fill(ctx, pane, radius: 10, color: .white, shadow: true)+ text("安全性", size: 9, weight: .semibold, color: ink, x: pane.minX + 12, top: pane.minY + 9)+ fill(ctx, CGRect(x: pane.minX + 12, y: pane.minY + 27, width: pane.width - 24, height: 0.8), radius: 0, color: bar)+ text("已阻止 Cicada 以保护 Mac", size: 8, weight: .regular, color: secondary, x: pane.minX + 12, top: pane.minY + 36)+ let button = CGRect(x: pane.minX + 12, y: pane.minY + 55, width: 58, height: 17)+ fill(ctx, button, radius: 8.5, color: well)+ text("仍要打开", size: 8, weight: .semibold, color: ink, centerX: button.midX, top: button.minY + 3)+ ring(ctx, button)+ }++ /// The app's own icon, read from the running bundle.+ private static var appIconImage: NSImage? { NSWorkspace.shared.icon(forFile: Bundle.main.bundlePath) }++ private static func fill(_ ctx: CGContext, _ rect: CGRect, radius: CGFloat, color: CGColor, shadow: Bool = false) {+ ctx.saveGState()+ if shadow { ctx.setShadow(offset: CGSize(width: 0, height: 1), blur: 6, color: CGColor(gray: 0, alpha: 0.08)) }+ ctx.setFillColor(color)+ ctx.addPath(CGPath(roundedRect: rect, cornerWidth: radius, cornerHeight: radius, transform: nil))+ ctx.fillPath()+ ctx.restoreGState()+ }++ /// The orange "click here" ring around a control.+ private static func ring(_ ctx: CGContext, _ rect: CGRect) {+ let r = rect.insetBy(dx: -3.5, dy: -3.5)+ ctx.setStrokeColor(orange.cgColor)+ ctx.setLineWidth(2)+ ctx.addPath(CGPath(roundedRect: r, cornerWidth: r.height / 2, cornerHeight: r.height / 2, transform: nil))+ ctx.strokePath()+ }++ private static func text(_ s: String, size: CGFloat, weight: NSFont.Weight, color: NSColor, x: CGFloat, top: CGFloat) {+ let attrs: [NSAttributedString.Key: Any] = [.font: NSFont.systemFont(ofSize: size, weight: weight), .foregroundColor: color]+ (s as NSString).draw(at: CGPoint(x: x, y: top), withAttributes: attrs)}private static func text(_ s: String, size: CGFloat, weight: NSFont.Weight, color: NSColor, centerX: CGFloat, top: CGFloat) {diff --git a/scripts/dmg-template.sh b/scripts/dmg-template.shindex e0e336c..f5e05e1 100755--- a/scripts/dmg-template.sh+++ b/scripts/dmg-template.sh@@ -17,7 +17,7 @@ cp build/dmg/background.tiff "$WORK/stage/.background/background.tiff"hdiutil create -quiet -srcfolder "$WORK/stage" -volname "Cicada" -fs HFS+ -format UDRW -size 60m "$WORK/rw.dmg"hdiutil attach -quiet -readwrite -noverify -noautoopen "$WORK/rw.dmg"-# Window 640 × 400 of content (428 with the title bar); icons at the background's marks.+# Window 640 × 520 of content (548 with the title bar); icons at the background's marks.osascript <<'APPLESCRIPT'tell application "Finder"tell disk "Cicada"@@ -25,14 +25,14 @@ tell application "Finder"set current view of container window to icon viewset toolbar visible of container window to falseset statusbar visible of container window to false- set the bounds of container window to {200, 120, 840, 548}+ set the bounds of container window to {200, 120, 840, 668}set opts to the icon view options of container windowset arrangement of opts to not arrangedset icon size of opts to 112set text size of opts to 13set background picture of opts to file ".background:background.tiff"- set position of item "Cicada.app" of container window to {170, 205}- set position of item "Applications" of container window to {470, 205}+ set position of item "Cicada.app" of container window to {170, 175}+ set position of item "Applications" of container window to {470, 175}update without registering applicationsdelay 2closediff --git a/site/changelog.json b/site/changelog.jsonindex a4f5e2c..5c735cc 100644--- a/site/changelog.json+++ b/site/changelog.json@@ -10,6 +10,11 @@"kind": "new","title": "Chrome 里开会也不用设置麦克风了。","text": "打开同声传译时,知了把系统麦克风换成 BlackHole 2ch,关掉同声传译或退出知了时换回原来的麦克风,用“默认”麦克风的会议网页和软件直接就能听到译文。知了自己仍然用你的真实麦克风听你说话,也可以在设置里固定一个。上次没来得及换回(比如知了意外退出),或者说话时插上 AirPods 把系统麦克风换走了,菜单栏面板会提示,点一下还原或换回;面板上同声传译旁边的 ⋯ 里也能随时还原。不想自动切换的话,可以在设置的同声传译里关掉。"+ },+ {+ "kind": "changed",+ "title": "安装窗口讲清楚首次打开的提示。",+ "text": "开发者证书还在申请中,第一次打开会提示 Apple 无法验证。安装窗口里现在写明这是正常的,并用三张小图标出要点的按钮:点完成(别点移到废纸篓),在系统设置里选隐私与安全性,再在安全性一栏点仍要打开。"}]},