# Meditation Timer Jhana meditation timer for GrapheneOS. Start/end gong, scroll-wheel duration picker (presets 20/45/60/90), session history with depth rating + notes, and sync to the meditation dashboard at health.rehbock.xyz/meditation.html. ## Pipeline Push to `main` on [git.rehbock.xyz](https://git.rehbock.xyz/marcus/meditation-timer) → Gitea Actions builds a signed release APK → published as a Gitea release → Obtainium on the phone picks up the new version. ## Sync Sessions POST to `https://meditation.rehbock.xyz/v1/sessions` (health-api). The bearer token is **not** in this repo or the APK — set it once in-app (History → Token) or seed it via: ``` adb shell am start -n com.marcus.meditationtimer/.MainActivity --es sync_token "" ``` Sessions shorter than 30 seconds are not recorded (gong tests). ## Videos The Videos tab lists a library served by health-api (`GET /v1/videos`, files at `/v1/videos/` with range support, same bearer token as sync). Add videos on the VPS: ``` ~/personal/health-api/video-add.sh "https://www.youtube.com/watch?v=..." ``` (yt-dlp → 720p mp4 + thumbnail + info.json in `health-api/data/videos/`; delete the files to remove a video.) In-app: tap to stream, or "Download for offline" to keep a copy in app-private storage. Playback is Media3/ExoPlayer. ## Local build ``` ./gradlew assembleDebug # needs ANDROID_HOME or local.properties ``` Release signing (CI): secrets `KEYSTORE_B64` + `KEYSTORE_PASSWORD`; key alias `meditation`. Keystore master copy: `~/.android-keys/` on the desktop. ## Gong `app/src/main/res/raw/gong.wav` is synthesized (singing-bowl partials, detuned fundamental pair for beating). Regenerate with the script in the repo history / scratchpad if the tone needs tweaking.