nandi/frqpublic Fork 0
0daacbb
Commits
Clone
git clone https://git.rickub.com/nandi/frq.git
git clone ssh://git@rickub.com/nandi/frq.git

Host key fingerprint (ed25519): SHA256:iycHnxEyq0Q7uyVpB7JlznP0G7JrTPXLYRcAU5CSLhc — verify it before your first connect.

Read the clock in the reader's zone on Android too

The zone chain had two branches and Android satisfies neither: it sets
no TZ, and it has no /etc/localtime to point at or read the bytes of.
Both came up empty, so the APK fell through to UTC and read every
channel seven hours ahead of the phone's own clock — the same fault as
the container case, reached by a different route.

Android keeps the zone in a system property instead. It is a plain zone
name, which bionic resolves against its own tzdata just as glibc does
against /usr/share/zoneinfo, so the offset stays DST-correct per instant
rather than fixed. The exec is reachable from inside the app sandbox;
SELinux does not stand in the way of getprop.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
nandi committed 2026-09-01T02:04:42-07:00 Browse files
0daacbb parent: bffe879
modified src/frq/clock.jolt +9 -0
@@ -31,6 +31,15 @@
3131 (str/trim (str (host/sh-out "readlink -f /etc/localtime")))))
3232 (catch Exception _ nil))
3333 (when (host/file-exists? "/etc/localtime") ":/etc/localtime")
34+ ;; Android has neither: no TZ in the environment and no /etc/localtime
35+ ;; to point at or read, so both branches above come up empty and the
36+ ;; APK read every channel in UTC. The zone is a system property there,
37+ ;; and bionic resolves the name against its own tzdata just as glibc
38+ ;; resolves it against /usr/share/zoneinfo — so the name is all we need.
39+ (try
40+ (let [tz (str/trim (str (host/sh-out "getprop persist.sys.timezone")))]
41+ (when (seq tz) tz))
42+ (catch Exception _ nil))
3443 "UTC")))
3544
3645 (defn now-ms [] (quot (host/wall-nanos) 1000000))
@@ -31,6 +31,15 @@
31 (str/trim (str (host/sh-out "readlink -f /etc/localtime")))))31 (str/trim (str (host/sh-out "readlink -f /etc/localtime")))))
32 (catch Exception _ nil))32 (catch Exception _ nil))
33 (when (host/file-exists? "/etc/localtime") ":/etc/localtime")33 (when (host/file-exists? "/etc/localtime") ":/etc/localtime")
34+ ;; Android has neither: no TZ in the environment and no /etc/localtime
35+ ;; to point at or read, so both branches above come up empty and the
36+ ;; APK read every channel in UTC. The zone is a system property there,
37+ ;; and bionic resolves the name against its own tzdata just as glibc
38+ ;; resolves it against /usr/share/zoneinfo — so the name is all we need.
39+ (try
40+ (let [tz (str/trim (str (host/sh-out "getprop persist.sys.timezone")))]
41+ (when (seq tz) tz))
42+ (catch Exception _ nil))
34 "UTC")))43 "UTC")))
35 44
36 (defn now-ms [] (quot (host/wall-nanos) 1000000))45 (defn now-ms [] (quot (host/wall-nanos) 1000000))