1
0
mirror of git://f0xx.org/android_cast synced 2026-07-29 03:38:52 +03:00

Add gzip-aware crash upload and OTA staging build/deploy tooling.

This restores the interrupted stash work on a dedicated feature branch, including backend decoding support, Dockerized build scripts, and staging channel artifacts for end-to-end OTA validation.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Anton Afanasyeu
2026-06-02 16:08:46 +02:00
parent 9f9d617730
commit 097c0790b8
18 changed files with 258 additions and 11 deletions

View File

@@ -4,7 +4,7 @@
- **Main process:** `CrashReporter.install()` — any uncaught Java exception (cast or idle UI) → `files/crash_reports/pending/crash_yyyyMMdd_HHmmss.json` (same stamp as `session_*.json`). Active cast session stats are flushed with `globals.reason: "crash"` when applicable.
- **Runtime context:** every report includes `runtime_context` (foreground activity, `CastActiveState`, last `session_*.json` name) and `scenario` (`cast_session` vs `app_runtime`).
- **Watcher process:** `CrashWatcherService` in `:crashwatcher` — reads `settings.json``crash`, uploads pending reports, ingests native stub files.
- **Watcher process:** `CrashWatcherService` in `:crashwatcher` — reads `settings.json``crash`, uploads pending reports (JSON body gzip-compressed), ingests native stub files.
- **Native:** `crash_hook.c` (unwind + `dladdr`) writes stubs to `crash_reports/native/`; watcher converts to schema v1 JSON.
- **User toggle:** Settings drawer → **Send anonymous crash logs** (`AppPreferences.send_anonymous_crash_logs`, default on).

View File

@@ -27,6 +27,8 @@ Store in DB:
## Upload API (`POST …/api/upload.php`)
Clients may send **`Content-Encoding: gzip`** with a gzip-compressed JSON body (same schema). The BE nginx upload `location` should use `gunzip on` + `gunzip_types application/json`; PHP accepts plain or gzip.
Phases:
1. **Phase A (now):** Accept extra JSON fields; persist inside `payload_json`; console search includes `ingest.source` in blob.

View File

@@ -111,10 +111,20 @@ When `ota.trusted=true` and build is debug, strict checksum/sign enforcement is
```bash
chmod +x scripts/generate-ota-v0.sh
./scripts/generate-ota-v0.sh app/build/outputs/apk/release/app-release.apk https://your-host:port ./ota-publish
./scripts/generate-ota-v0.sh app/build/outputs/apk/release/app-release.apk https://your-host:port ./ota-publish staging
```
Upload the contents of `ota-publish/` to your web root so `https://your-host/v0/ota/...` resolves.
Fourth argument is the **channel** file name (`stable`, `staging`, `next`, …). Upload `ota-publish/v0/` to your web root so `https://your-host/v0/ota/...` resolves.
### Docker build + staging channel
See [BUILD_DEPLOY.md](BUILD_DEPLOY.md):
```bash
export OTA_BASE_URL=https://apps.f0xx.org
./scripts/docker-build-ota.sh
./scripts/deploy-ota-staging.sh # after setting OTA_DEPLOY_TARGET
```
## App configuration

View File

@@ -168,4 +168,5 @@ See [ndk/README.md](../ndk/README.md).
- [PRO_AAR.md](PRO_AAR.md) — cast-core / cast-pro entitlements
- [OPEN_API.md](OPEN_API.md) — crash ingest triage API
- [OTA.md](OTA.md) — backend layout v0
- [BUILD_DEPLOY.md](BUILD_DEPLOY.md) — Docker build, staging OTA, deploy flow
- [CRASH_REPORTER.md](CRASH_REPORTER.md) — crash upload