feat: surface update availability and add one-tap APK install#54
Merged
Conversation
…d A-parity) Mirrors the desktop update-notifier work. The launch-time GitHub check already worked but barely notified (a one-shot dialog). This makes a found update visible and actionable while the app is open, and adds an in-app install path. - Notify while open: a system notification (own "App updates" channel) plus a dismissible top banner. Both driven by a persisted pending-update record so they survive a restart and self-clear once the user is current. - Owner-only served-page banner: home + results show the notice to the loopback owner only (a network visitor never sees it / the version is not leaked). - One-tap install: re-fetch the latest release, download the APK, verify its SHA-256 against the release SHA256SUMS, then hand it to the system PackageInstaller (which shows its own confirmation; nothing installs silently). Linux-style fallback to the release page on no-asset/failure. - New REQUEST_INSTALL_PACKAGES permission + PackageInstallReceiver to launch the system install-confirmation UI. UpdateInfo gains assets parsing (apkAsset/checksumsAsset); UpdateInstaller (download+verify+install), UpdateFlow (orchestration), UpdateNotifier (channel + post). Coordinator persists pending state; PreferencesRepository gains the pending fields. SearchServer threads an owner-only updateBanner provider. Tests: assets parsing/selection, installer SHA-256 verify (match/mismatch/ missing/oversize), coordinator pending persistence, served-banner owner route. ktlintCheck + lintDebug + testDebugUnitTest + assembleDebug all green. Verified on the API 35 emulator: in-app banner, system notification, and served-page banner all appear for a build older than the published release. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Android parity for the desktop update-notifier (sibling PR FlintWave/SearchMob-Desktop#70).
Why
The launch-time GitHub check already worked but barely notified — a found update only showed as a one-shot dialog. This makes it visible and actionable while the app is open, and adds an in-app install path.
What
SHA256SUMS, then hand it to the systemPackageInstaller(which shows its own install confirmation — nothing installs silently). Falls back to the release page when there's no usable asset or on failure.REQUEST_INSTALL_PACKAGESpermission +PackageInstallReceiverto launch the system install-confirmation UI.Honest limitation
The system install UI always appears (the app isn't a device owner), and "install unknown apps" must be granted once — by design.
New / changed
update/UpdateChecker.kt—ReleaseAsset+ assets parsing +apkAsset/checksumsAsset.update/UpdateInstaller.kt,UpdateFlow.kt,UpdateNotifier.kt,PackageInstallReceiver.kt(new).update/UpdateCheckCoordinator.kt— persists pending state.ui/prefs/*— pending-update fields + flows.server/SearchServer.kt— owner-onlyupdateBannerprovider on home + results (+ CSS);service/SearchMobService.ktwiring.MainActivity.kt— banner replaces the dialog; one-tap flow + progress; notification on found update.AndroidManifest.xml,strings.xml.Tests / checks
Added: assets parsing/selection, installer SHA-256 verify (match / mismatch / missing-entry / oversize), coordinator pending persistence, served-banner owner route.
ktlintCheck+lintDebug+testDebugUnitTest+assembleDebugall green.On-device verification (API 35 emulator)
Built a throwaway 26.05.00 APK so the published
v26.06.00reads as newer. Confirmed: the in-app banner ("SearchMob 26.06.00 is available." + Update/Dismiss), the system notification (Update available), and the served-page banner (/and/search) all appear. Version reverted to 26.06.00; no version bump in this PR.🤖 Generated with Claude Code