Repository navigation
Ommega 2.4.2
2.4.2 — 2026-11-12
A 端自动续签、本地出证时序与 WebUI 暗色显示(仅 A 端;B、Server 无改动,无需单独更新 Server)。
自动续签的三个独立缺陷
- 会漏签。 续签线程原先用相对的
thread::sleep等待,在 Android 上该等待基于不计入深度
休眠的时钟。于是「7 个清醒小时后到期」的等待会跨过整夜休眠继续挂着:TEE 证书进入续签窗口、
甚至越过到期时间,也从未开始签发,页面与日志都显示健康——因为根本没有发起过尝试。现在改为在
绝对墙钟截止时间上等待(clock_nanosleep配CLOCK_REALTIME与TIMER_ABSTIME):
休眠经过的时间与系统校时都计入,信号中断后沿用同一截止时间而不是重新计时,其他内核错误记录后
回退两分钟、不会忙循环。等待仍限制在 2 分钟到 1 天之间。它不会唤醒休眠中的设备,到期的
截止时间会在设备恢复运行时立即处理。 - 自己把自己锁死。
auto-run先取签发锁,随后调用的issue()又对同一个文件加锁;flock
按打开的文件描述持有,同一进程内第二次必然失败。于是每一次无人值守续签都报「已有签发在进行中」
而从不真正签发,6 小时退避又把重试推到更后面。现在拆成调用方持锁的issue_locked()与自行
取锁的issue()。 - 失败不显示。 无人值守的失败原先只写进
feedback.json,而它在下一次状态读取时就被覆盖;
policy.json的last_error一直是空,页面因此长期显示健康的卡片。现在把原因和尝试时间一起
持久化,在status中暴露并渲染到 RKP 卡片上。
本地出证时序
- 本地出证(attested)的
generateKey与未校验的一次消耗相同的 secure-world 时间片,成对比较
两者的校验方因此测得接近零的增量:10 组配对里有 4~6 组差值为非正,dAtt/initSign停在 0.1
附近。普通 Operation 延迟补不上这个差,因为两条路径都要付。 - 新增
RetrieveCertSigningInfo钩子,在本地叶证书成功编码之后、密钥可被封存或被观察到之前,
计入一次采样自 24–40 ms 的证书开销。覆盖热 keybox 缓存、调用方指定的本地签发者、本地出证的
认证兼容密钥与允许的远程回退;自签名叶、生成失败与远程返回的链不计入。 - A 端实测:
dAtt2.0/−2.2/−2.9 ms 变为 32.9/39.2/35.0 ms,非正配对 4/6/5 变为 0/0/0。
WebUI 暗色
- 诊断页日志框在暗色下不可读。两个缺陷叠加:底色引用
--om-surface-alt,而这个变量从未被任何
主题定义,永远落到浅色字面兜底;唯一的暗色覆盖又挂在.om-modern[data-theme=dark]上,但主题
实际写在:root,那条规则不可能命中。实测暗色对比度仅约 1.04。现在浅色与两条暗色主题路径都
定义了该变量,日志框只引用 token,实测为rgb(27,30,39)底配rgb(240,239,247)字,满足
WCAG AA。
随包组件
- 模块内置的 AProbe 从 1.6(versionCode 7)更新到 1.8.8-paytm(versionCode 19),带聚焦的时序
诊断。签名身份不变(CN=Ommega AProbe),可直接覆盖升级。
升级说明:只更新 A 端模块 ZIP 即可,B 端与 Server 无需改动。
- 自动续签修复位于 keymint 守护进程内,必须通过模块部署流程重载,仅替换
ommega-rkp工具
不会生效。安装后原有用例、已导入的种子与已签发的 keybox 全部保留。 - 出证时序改动在 KeyMint 与 TA 两侧,同样需要重载守护进程生效。
- WebUI 修复需要模块重新打包后刷新页面;建议同时强制刷新一次以避开 WebView 缓存。
- 若你的 TEE 证书已经临近或越过到期时间,本次更新不会追溯补签:部署后请在「设置 → 自动化」
确认状态,必要时手动签发一次。手动签发会消耗一次注册身份,属于设备侧操作。
验证:CI 全绿(A、B、Server、APK、UI)。新增 7 项续签计时回归、3 项主题对比度回归与出证时序的
配对断言,均在本地通过;把实现改回相对等待、恢复字面兜底或去掉时序计入时对应回归会失败。暗色
日志框经桌面 Chromium 以同一份 CSS 实测计算颜色确认;出证时序在 A 端实测(见上)。尚未在真机
WebView 内验证,也未在设备上验证自动续签能按时触发,这两项仍需实机验收。
2.4.2 — 2026-11-12
A-side automatic renewal, local attestation timing and a dark-mode WebUI fix
(A only; B and Server are unchanged, no Server update is required).
Three independent defects in automatic renewal
- It could silently skip issuance. The renewal thread waited with a relative
thread::sleep, which on Android runs on a clock that excludes deep sleep. A
wait of "seven awake hours" therefore stayed pending across a full night of
suspension: a TEE chain could enter its renewal window, pass its due time, and
never be re-issued, while the page and logs still looked healthy — because no
attempt had started at all. That is the reported case: policy enabled, seed
decryptable, TEE alreadydue, and the thread still holding the wait it
scheduled that morning. The thread now waits on an absolute wall-clock
deadline (clock_nanosleepwithCLOCK_REALTIMEandTIMER_ABSTIME), so
suspended time and clock corrections both count. An interrupted wait reuses the
same deadline instead of restarting a delay, and an unexpected kernel error logs
and backs off two minutes rather than busy-looping. The wait stays clamped
between two minutes and one day. It does not wake a suspended device; an
elapsed deadline is handled as soon as the device resumes. - It deadlocked on its own lock.
auto-runtook the issuance lock and then
calledissue(), which took the same file lock again.flockis held per open
file description, so the second acquisition inside one process always failed:
every unattended renewal reported "an issuance is already in progress" and never
issued, while the six-hour backoff pushed the retry even further out. It is now
split into caller-lockedissue_locked()and self-lockingissue(). - It hid its failures. An unattended failure was only written to
feedback.json, which the next status read replaces, andpolicy.jsonkept an
emptylast_error, so the page showed a healthy card for days. The reason is
now persisted next to the attempt time, exposed instatusand rendered on the
RKP card.
Local attestation timing
- A local attested
generateKeyspent the same secure-world band as an
unchallenged one, so a validator pairing the two generations measured a
near-zero increment: 4–6 of 10 paired deltas were non-positive and
dAtt/initSignstayed near 0.1. Ordinary Operation latency cannot close that,
because both paths pay it. - A
RetrieveCertSigningInfohook now accounts one sampled 24–40 ms of
certificate work after a local leaf is encoded and before the key can be sealed
or observed. It covers a warm keybox cache, a caller-selected local issuer,
locally certified authentication-compatible keys and permitted remote fallback;
self-signed leaves, failed generation and remotely returned chains do not pay it. - Measured on the A device:
dAtt2.0/−2.2/−2.9 ms became 32.9/39.2/35.0 ms, and
non-positive pairs 4/6/5 became 0/0/0.
WebUI dark mode
- Diagnostics log boxes were unreadable in dark mode. Two mistakes compounded: the
background referenced--om-surface-alt, which no theme block ever defined, so
it always took a light literal fallback; and the only dark override was scoped to
.om-modern[data-theme=dark]while the theme is written to:root, so it could
never match. The measured dark contrast was about 1.04. The token is now defined
for light and both dark paths, the box references the token alone, and the
measured dark result isrgb(240,239,247)onrgb(27,30,39), meeting WCAG AA.
Bundled component
- The bundled AProbe moves from 1.6 (versionCode 7) to 1.8.8-paytm
(versionCode 19), carrying the focused timing diagnostics. The signing identity
is unchanged (CN=Ommega AProbe), so it upgrades in place.
Upgrade notes: update the A-side module ZIP only; B and Server need no change.
- The renewal fixes live inside the keymint daemon, so they require the module
deployment flow to reload the daemon — replacing theommega-rkptool alone has
no effect. Existing policy, the imported seed and every issued keybox are kept. - The attestation-timing change spans KeyMint and the TA and likewise needs the
daemon reloaded. - The WebUI fix needs the module to be repackaged and the page refreshed; a forced
refresh avoids a stale WebView cache. - If your TEE chain is already near or past expiry, this update does not
retroactively renew it: check Settings → Automation after deploying and issue
manually if needed. A manual issuance spends one registration identity and is a
device-side operation.
Validation: CI is green (A, B, Server, APKs, UI). Seven renewal-timing
regressions, three theme-contrast regressions and the paired timing assertions
pass locally; reverting to the relative wait, restoring the literal fallback or
dropping the timing charge makes the matching regression fail. The dark log box
was measured with computed colours in desktop Chromium using the same CSS, and the
attestation timing was measured on the A device. It has not been verified inside
a real-device WebView, and automatic renewal was not observed firing on a
device; both still need on-device acceptance.
Full Changelog: v2.4.1...v2.4.2