Repository navigation
Baby Lock 1.2.2
Universal arm64 + x86_64, macOS 13+.
安全更新:更新包签名
- Ed25519 签名 — 从 1.2.2 起,每个 Release 的
BabyLock-macOS.zip都会附带.sig签名和.sha256。App 内置公钥,安装前先验证签名;签名缺失或不匹配时不会安装。 - 只信任 GitHub HTTPS — 下载地址会校验
https和 GitHub 域名,重定向后的最终地址也会校验。 - bundle 校验加强 — 除 bundle ID、版本号外,还会检查最低系统版本、解压目录边界和符号链接;复制到
/Applications后会再次验证签名和版本,失败自动恢复旧版本。 - 首次升级说明 — 1.2.1 自带的更新器还没有签名校验,所以 1.2.1 → 1.2.2 这一跳仍由旧版更新器完成。从 1.2.2 开始,之后的每次更新都必须通过 Ed25519 校验。想从第一次就使用签名校验,可以手动下载 1.2.2 并用下面的 SHA256/
.sig核对。
SHA256:
22eb9bb76ba6ece1fbf5abf46fdb05372e50a8af47c81e587d3fc655c273ab3a
签名公钥(Ed25519,base64):
6yX33wBdVhlOYROiJ8V+uonayrn2d3BN5Dm0EZhb714=
锁定修复
- 电源键短按 — 锁定期间不再放行电源键短按,避免“按一下电源键 → 睡眠 → 唤醒后已解锁”。
- 睡眠/合盖 — 系统睡眠或合盖后,唤醒时会自动重新进入锁定。
- 显示器变化 — 插拔显示器/扩展坞不再解除锁定;黑屏覆盖会按新的屏幕布局重建。
- 锁定期间的菜单 — 只显示“已锁定”和解除手势提示;Settings、Check for Updates、Quit 不再可点,避免关闭“屏蔽触控板”时孩子直接退出 App。
- 设置窗口 — 开始锁定时会自动关闭已经打开的设置窗口。
- 更新弹窗 — 锁定期间不再弹更新错误框;错误提示不会出现在黑屏后面。
- 解锁计时器 — 解锁进度计时器改为 common run-loop mode,菜单或 modal 打开时也能完成解锁。
稳定性修复
- 60 Hz 菜单重建 — 解锁进度不再每 1/60 秒重建整个菜单;菜单只在锁定/解锁状态真正变化时重建,并在菜单打开期间延迟重建。
- 更新器管道死锁 — 不再先
waitUntilExit()再读管道;输出写入临时文件并加超时,避免ditto/codesign输出过多时永久卡死。 - 主线程阻塞 — 更新解压和校验移到后台任务,不再冻结界面。
- 复制后校验/回滚 — 新 App 复制后再次验证签名和版本;失败会恢复旧版本。
- 权限修复 — 重启脚本写入或启动失败时不再直接退出 App;
tccutil非零退出会记录。 - PID 等待 — 安装/重启脚本的 PID 等待增加 60 秒超时,避免 PID 复用导致永久等待。
- 单实例 — 增加
LSMultipleInstancesProhibited和运行时检查,避免两个实例同时创建输入拦截。
限制
- 重启、强制关机或强退后不会恢复锁定;锁定状态只保存在内存中。
- 长按电源键 5–10 秒仍可强制关机,这是硬件逃生口。
- 解锁手势显示在 HUD 上;会阅读的孩子可以学会,因此它不是防大孩子的强安全锁。
- 外接键盘没有右 Command 时,解锁手势不可用;只能等待自动解锁或长按电源键强制关机。
- 同一用户下的其他程序、Voice Control、屏幕共享、MDM 远程管理等不受保护。
安装
下载 BabyLock-macOS.zip,用 Release 里的 BabyLock-macOS.zip.sha256 和 BabyLock-macOS.zip.sig 核对,然后解压并把 Baby Lock.app 放到 /Applications。版本为 ad-hoc 签名;如果首次打开被 Gatekeeper 拦截:
xattr -dr com.apple.quarantine "/Applications/Baby Lock.app"English
- Ed25519-signed updates — every release now ships
BabyLock-macOS.zip.sigand.sha256; the app pins the public key and refuses an update with a missing or invalid signature. - GitHub-only HTTPS — archive and signature URLs, including redirects, must be HTTPS on GitHub-controlled hosts.
- Stronger bundle checks — minimum macOS version, extraction boundary, symlink rejection, and a post-copy signature/version verification with rollback.
- First hop — the 1.2.1 updater does not verify signatures, so the 1.2.1 → 1.2.2 upgrade still uses the old path. From 1.2.2 onward, every update is signature-verified. Verify the SHA256/signature manually if you want the signed path from the start.
- Power key — the short press is blocked while locked; holding the hardware power button for 5–10 seconds still forces a shutdown.
- Sleep/display — the lock re-engages after sleep or lid close, and display changes rebuild the blackout instead of unlocking.
- Locked menu — Settings, Check for Updates, and Quit are unavailable until the lock is released; an open Settings window closes when the lock starts.
- Update alerts — no modal alerts over the lock overlay; the unlock progress timer now runs in common run-loop modes.
- Stability — no 60 Hz menu rebuild, no wait-before-read pipe deadlock, installer work moved off the main thread, post-copy verification with rollback, relaunch failure handling, PID-wait timeouts, and a single-instance guard.
- Limitations — reboot/force-quit does not restore the lock; the hardware power-button long press remains the escape hatch; the unlock gesture is visible on the HUD and is not a strong lock against older children; keyboards without a right Command key cannot use the gesture.