mirror of
https://github.com/kuhyx/testsAndMisc.git
synced 2026-11-20 20:12:18 +01:00
The geofence needs HOME_LAT/HOME_LON, but those say where I live, so the committed policy asset is generated with --redact-home and the real values are pushed to app-private storage instead. push_home_location.sh greps config_secrets.sh rather than sourcing it -- that file holds other secrets and this script has no business evaluating them -- and refuses the shipped REDACTED_* placeholder with a message naming the file to fill in, rather than writing whatever the parse happened to land on. Private storage was chosen for its lifetime as much as its permissions: it does not survive an uninstall, so reinstalling forces re-provisioning instead of silently inheriting a stale home. The default umask left the file 666, so the script chmods it 600; the shell user gets Permission denied, and the /data/local/tmp staging copy is removed after the transfer. Every read failure returns null rather than throwing. Null reaches the enforcement layer as location-unknown, which already fails closed into enforcing -- so a corrupt coordinates file cannot become an unlock, and cannot crash the service either. Workout detection replaces a root-only SQLite read of StrongLifts' private database. The manual source is time-boxed rather than a plain toggle, because a workout mode left on by accident is indistinguishable from having no exception at all. The guarded wrapper catches broadly and times out: nothing about a workout probe failing should be able to stop enforcement running. The combined source can name which signal opened the exception, so the UI can explain an unlock rather than presenting it as magic. Only the two sources verified to exist on this device will be wired -- com.kuhy.workout_app exposes nothing readable and org.runnerup is not installed. HideTestReceiver is deleted. It proved setApplicationHidden persistence, which is what it was for, but it applied policy from an exported receiver and that has no place in a build that will later hold device owner. Confirmed absent from the rebuilt and reinstalled APK. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AwepyL5Lxs5QKbKkMpxxxL
23 lines
2.0 KiB
JSON
23 lines
2.0 KiB
JSON
{
|
|
"title": "Home coordinates out of git, layered workout detection, and removal of the test hook",
|
|
"objective": "Give the geofence its anchor without recording where the user lives in the repository, and replace the root-only workout detector with sources an unrooted app can actually read. Success is coordinates living only in app-private storage, a workout signal that fails closed on every path, and the temporary test receiver gone before it can reach a provisioned build.",
|
|
"acceptance_criteria": [
|
|
"Home coordinates are pushed from the untracked config_secrets.sh to app-private storage; nothing coordinate-shaped enters git",
|
|
"The shipped REDACTED_* placeholder is rejected with a message naming the file to fill in, not written as a nonsense coordinate",
|
|
"The provisioned file is mode 600 and unreadable by the shell user",
|
|
"The staging copy under /data/local/tmp is removed after the transfer",
|
|
"A missing, malformed, or out-of-range coordinate file reads as null rather than throwing, so the enforcement layer treats it as location-unknown and fails closed",
|
|
"Every workout source fails closed: a throwing or hanging probe reports no workout",
|
|
"The manual signal is time-boxed rather than a plain toggle",
|
|
"The combined signal can name which source opened the exception",
|
|
"HideTestReceiver is absent from the source, the manifest, and the installed APK"
|
|
],
|
|
"out_of_scope": [
|
|
"Device Owner provisioning and the factory reset",
|
|
"The Health Connect query implementation - the guarded wrapper exists, the platform call does not yet",
|
|
"The foreground service, BOOT_COMPLETED receiver and alarm scheduling",
|
|
"com.kuhy.workout_app and org.runnerup as sources: verified unusable and absent respectively"
|
|
],
|
|
"verifier": "focus_owner/scripts/push_home_location.sh (both the placeholder-rejection and success paths) then --check; adb run-as ls -la to confirm mode 600; adb shell cat to confirm the shell cannot read it; cd focus_owner && flutter analyze && flutter test; rebuild, reinstall, and dumpsys package | grep -c HideTest"
|
|
}
|