Modern-Apps.git
Publicgit clone https://git.maproj.org/Modern-Apps.gitModern-Apps.git / updater / AGENTS.md
| 1 | # AGENTS.md — updater/ (':updater') |
| 2 | |
| 3 | > Scoped supplement. Global rules in root `AGENTS.md` apply. Stay inside `updater/` + allowed shared modules. Do not root-scan. |
| 4 | |
| 5 | _Install: ./install updater (dev by default)._ |
| 6 | <!-- last-reviewed: 2026-10-16 --> |
| 7 | - Gradle: :updater / dir: updater/ |
| 8 | - Package roots present: ui, domain, platform, service, notifications |
| 9 | - Entry files: MainActivity.kt, Route.kt, Navigation.kt |
| 10 | - Deps: :library:work, :library:aosp-stubs |
| 11 | - Metadata: metadata_data/updater.md (present) |
| 12 | - Rust: no / screenshotTest: no |
| 13 | |
| 14 | ## Overview |
| 15 | **Purpose:** Verified A/B OTA system updates — background check/download/apply to the inactive slot, release-key signature verification, idle-only reboot. Internet only for update traffic; metered-gated. |
| 16 | **Key features:** `UpdateCheckWorker` polling → `UpdateChecker` → `OtaDownloader` (incremental plans) → `OtaInstaller`/`UpdateInstallService` → `IdleReboot`; `domain/` validates packages/metadata against the release key before anything is written. |
| 17 | **Entry points:** `Route` → `MainActivity.kt` → `Navigation.kt` → `ui/UpdaterScreen.kt` → `platform/UpdateChecker.kt` → `domain/OtaPackageValidation.kt`. |
| 18 | **Gotchas:** Signature verification is the product — never weaken it for UX; failed updates must leave the device bootable (A/B invariant); screenshot tests off, verify on device. |
| 19 | |
| 20 | ## Key files |
| 21 | ### Root — entry + navigation |
| 22 | - com/vayunmathur/updater/MainActivity.kt |
| 23 | - com/vayunmathur/updater/Navigation.kt |
| 24 | - com/vayunmathur/updater/Route.kt |
| 25 | ### domain/ — pure OTA validation (no Android) |
| 26 | - com/vayunmathur/updater/domain/OtaPackageValidation.kt |
| 27 | - com/vayunmathur/updater/domain/OtaPackageMetadata.kt |
| 28 | - com/vayunmathur/updater/domain/OtaArtifacts.kt |
| 29 | - com/vayunmathur/updater/domain/OtaDownloadPlan.kt |
| 30 | - com/vayunmathur/updater/domain/PayloadProperties.kt |
| 31 | - com/vayunmathur/updater/domain/UpdateMetadata.kt |
| 32 | - com/vayunmathur/updater/domain/UpdateComparison.kt |
| 33 | - com/vayunmathur/updater/domain/UpdateEngineOutcome.kt |
| 34 | - com/vayunmathur/updater/domain/AutoInstallPolicy.kt |
| 35 | ### platform/ — check, download, install, reboot |
| 36 | - com/vayunmathur/updater/platform/UpdateChecker.kt |
| 37 | - com/vayunmathur/updater/platform/UpdateCheckWorker.kt |
| 38 | - com/vayunmathur/updater/platform/OtaDownloader.kt |
| 39 | - com/vayunmathur/updater/platform/OtaInstaller.kt |
| 40 | - com/vayunmathur/updater/platform/UpdaterViewModel.kt |
| 41 | - com/vayunmathur/updater/platform/UpdaterPreferences.kt |
| 42 | - com/vayunmathur/updater/platform/SystemBuild.kt |
| 43 | - com/vayunmathur/updater/platform/IdleReboot.kt |
| 44 | - com/vayunmathur/updater/platform/RebootReceiver.kt |
| 45 | - com/vayunmathur/updater/platform/UpdateBootReceiver.kt |
| 46 | ### service/ + notifications/ — install service + status |
| 47 | - com/vayunmathur/updater/service/UpdateInstallService.kt |
| 48 | - com/vayunmathur/updater/notifications/UpdateNotifications.kt |
| 49 | ### ui/ — updater surface |
| 50 | - com/vayunmathur/updater/ui/UpdaterScreen.kt |
| 51 | |
| 52 | ## Verify (this module only) |
| 53 | ``` |
| 54 | ./gradlew :updater:compileDevKotlin |
| 55 | ./gradlew :updater:lint |
| 56 | ./gradlew :updater:checkMetadata |
| 57 | ``` |