Modern Apps git
git clone https://git.maproj.org/Modern-Apps.git
main ▾

Modern-Apps.git / updater / AGENTS.md

AGENTS.md2.9 KiBRenderedCodeRaw
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- Gradle: :updater / dir: updater/
7- Package roots present: ui, domain, platform, service, notifications
8- Entry files: MainActivity.kt, Route.kt, Navigation.kt
9- Deps: :library:work, :library:aosp-stubs
10- Metadata: metadata_data/updater.md (present)
11- Rust: no / screenshotTest: no
12
13## Overview
14**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.
15**Key features:** `UpdateCheckWorker` polling → `UpdateChecker` → `OtaDownloader` (incremental plans) → `OtaInstaller`/`UpdateInstallService` → `IdleReboot`; `domain/` validates packages/metadata against the release key before anything is written.
16**Entry points:** `Route` → `MainActivity.kt` → `Navigation.kt` → `ui/UpdaterScreen.kt` → `platform/UpdateChecker.kt` → `domain/OtaPackageValidation.kt`.
17**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.
18
19## Key files
20### Root — entry + navigation
21- com/vayunmathur/updater/MainActivity.kt
22- com/vayunmathur/updater/Navigation.kt
23- com/vayunmathur/updater/Route.kt
24### domain/ — pure OTA validation (no Android)
25- com/vayunmathur/updater/domain/OtaPackageValidation.kt
26- com/vayunmathur/updater/domain/OtaPackageMetadata.kt
27- com/vayunmathur/updater/domain/OtaArtifacts.kt
28- com/vayunmathur/updater/domain/OtaDownloadPlan.kt
29- com/vayunmathur/updater/domain/PayloadProperties.kt
30- com/vayunmathur/updater/domain/UpdateMetadata.kt
31- com/vayunmathur/updater/domain/UpdateComparison.kt
32- com/vayunmathur/updater/domain/UpdateEngineOutcome.kt
33- com/vayunmathur/updater/domain/AutoInstallPolicy.kt
34### platform/ — check, download, install, reboot
35- com/vayunmathur/updater/platform/UpdateChecker.kt
36- com/vayunmathur/updater/platform/UpdateCheckWorker.kt
37- com/vayunmathur/updater/platform/OtaDownloader.kt
38- com/vayunmathur/updater/platform/OtaInstaller.kt
39- com/vayunmathur/updater/platform/UpdaterViewModel.kt
40- com/vayunmathur/updater/platform/UpdaterPreferences.kt
41- com/vayunmathur/updater/platform/SystemBuild.kt
42- com/vayunmathur/updater/platform/IdleReboot.kt
43- com/vayunmathur/updater/platform/RebootReceiver.kt
44- com/vayunmathur/updater/platform/UpdateBootReceiver.kt
45### service/ + notifications/ — install service + status
46- com/vayunmathur/updater/service/UpdateInstallService.kt
47- com/vayunmathur/updater/notifications/UpdateNotifications.kt
48### ui/ — updater surface
49- com/vayunmathur/updater/ui/UpdaterScreen.kt
50
51## Verify (this module only)
52```
53./gradlew :updater:compileDevKotlin
54./gradlew :updater:lint
55./gradlew :updater:checkMetadata
56```