Root adb shell has no CAP_SYS_TIME. Init's exec - root root also hits same issue.
Attempt 5: File-based time save/restore with shell scripts
Created shell scripts + init service to write/read /data/vendor/time/ats_2
Result: SELinux blocked init from transitioning to shell domain:
init: Could not start exec service: File /vendor/bin/timekeep_restore.sh
(labeled "u:object_r:shell_exec:s0") has incorrect label or no domain
transition from u:r:init:s0 to another SELinux domain defined.
Tried file_contexts (labeling as shell_exec), domain_auto_trans(init, shell_exec, shell) — all blocked.
What I Haven't Tried Yet (and need advice on)
How to properly add allow-set-time to DTBO overlay so it survives QCOM merge — which is the correct DTS file to patch?
How to give init's exec service CAP_SYS_TIME to bypass the RTC core capability check
Whether there's a simpler approach — perhaps using the kernel's rtc-hctosys + writing RTC via a different path (SPMI registers directly?)