You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
v1.0.2 finally landed working release assets, but the install-and-run
flow hung at "需要以下权限:定位服务" because the helper's `scan`
subcommand kept returning ssid/bssid as null even after the user
clicked Allow. Locally verified all three fixes against the
dev-rebuilt bundle: BSSID + SSID + Beacon IE fields all flow.
Three changes in helper/Sources/diting-tianer/main.swift + a small
launcher patch in src/diting/cli.py:
1. **Scan unredacts under install-script TCC grants.** Two parallel
issues kept BSSIDs/SSIDs null:
a. The `scan` subcommand inherited responsibility from its
terminal parent, so tccd attributed the Location request to
Terminal (no NSLocationUsageDescription), and CWNetwork
silently redacted ssid/bssid. The BLE path has done a
responsibility_spawnattrs_setdisclaim re-exec since v0.5.0;
`scan` now does the same hop.
b. macOS 14.4+ / 26 requires an active CLLocationManager in
the calling process at the moment of scanForNetworks — the
bundle's TCC grant on disk is necessary but not sufficient.
The `scan` subcommand now initialises a CLLocationManager
and calls startUpdatingLocation() before the CoreWLAN call,
mirroring what the GUI bundle has always done.
The earlier code comment claiming CoreLocation was "more lenient
than CoreBluetooth" was wrong; CoreWLAN on macOS 26 enforces
both conditions.
2. **Helper popup is localised.** When DITING_LANG=zh (passed via
`open --env` from Python's launcher) or when macOS's
Locale.preferredLanguages starts with "zh", the popup shows
Chinese instead of English. Title becomes "diting 天耳"; intro,
status lines, and the "All permissions granted" message all
translate. Resolution order (env var first, system preference
second) matches the Python CLI's i18n.
3. **Popup auto-close delay extended 1.5s → 4s.** Users reported
the "All permissions granted" confirmation flashed by too fast
to read.
4. **Python launcher passes DITING_LANG to `open`.** Without this,
the bundle inherits the user's login session env (which doesn't
know about `diting --lang zh`) and the popup would show English
even when diting is running in Chinese.
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
return"This helper exists so diting (the Python TUI) can read nearby Wi-Fi network names / BSSIDs and scan for nearby BLE devices without being blocked by macOS Location Services or Bluetooth permissions. Grant the prompts below — a one-time action — and you can close this window."
926
+
}
927
+
}
928
+
varrequestingStatus:String{ lang ==.zh ?"正在请求权限…":"Requesting permissions..."}
929
+
varallGranted:String{
930
+
switch lang {
931
+
case.zh:
932
+
return"全部权限已授予。本窗口将在几秒后自动关闭…"
933
+
case.en:
934
+
return"All permissions granted. This window will close automatically in a few seconds..."
935
+
}
936
+
}
937
+
// Location lines
938
+
func locationWaiting()->String{ lang ==.zh ?"定位服务:等待用户决定…":"Location: waiting for permission decision..."}
939
+
func locationRestricted()->String{ lang ==.zh ?"定位服务:被系统策略限制。":"Location: restricted by a system policy."}
0 commit comments