From 17534d5784f6267f795058b3e2ad9c76bc7db279 Mon Sep 17 00:00:00 2001 From: Seb3thehacker Date: Tue, 6 Oct 2026 00:06:06 -0700 Subject: [PATCH] update checker: finds new releases, downloads and installs them Checks GitHub's latest release once a day when the app opens and after a drive. A new version shows as a card on Home, a notification after the drive, and a card on the car screen at plug-in while parked. Downloads are checked against GitHub's SHA-256 and never install while the car is connected. Update notifications can be turned off in Settings. --- gearslip/build.gradle.kts | 3 +- gearslip/src/main/AndroidManifest.xml | 1 + .../gearslip/GearslipActivity.kt | 1 + .../seb3thehacker/gearslip/SessionReport.kt | 1 + .../app/seb3thehacker/gearslip/car/CarUi.kt | 2 + .../seb3thehacker/gearslip/ui/HomeScreen.kt | 1 + .../gearslip/ui/SettingsScreen.kt | 6 +- .../seb3thehacker/gearslip/ui/UpdateViews.kt | 146 +++++++ .../gearslip/update/UpdateChecker.kt | 374 ++++++++++++++++++ gearslip/src/main/res/xml/share_paths.xml | 3 +- 10 files changed, 535 insertions(+), 3 deletions(-) create mode 100644 gearslip/src/main/java/app/seb3thehacker/gearslip/ui/UpdateViews.kt create mode 100644 gearslip/src/main/java/app/seb3thehacker/gearslip/update/UpdateChecker.kt diff --git a/gearslip/build.gradle.kts b/gearslip/build.gradle.kts index 0f8635e..6eed1ad 100644 --- a/gearslip/build.gradle.kts +++ b/gearslip/build.gradle.kts @@ -33,7 +33,8 @@ android { minSdk = 31 targetSdk = 37 versionCode = 8 - versionName = "0.2.00-alpha" + // -PgearslipVersionName=0.1.99-test makes a build that thinks it's older, to try the updater. + versionName = project.findProperty("gearslipVersionName")?.toString() ?: "0.2.00-alpha" manifestPlaceholders["appLabel"] = "Gearslip" // Where opted-in phones send their daily usage note: the stats-worker/ Worker's address, // set as gearslipStatsUrl in gradle.properties. Left empty, nothing is ever sent. diff --git a/gearslip/src/main/AndroidManifest.xml b/gearslip/src/main/AndroidManifest.xml index 4dc1ede..fe7b03f 100644 --- a/gearslip/src/main/AndroidManifest.xml +++ b/gearslip/src/main/AndroidManifest.xml @@ -4,6 +4,7 @@ + + +