Repository navigation
Add in-app updates with Stable (F-Droid) and Alpha (GitHub) channels - #141
Merged
Merged
Conversation
Settings gains an Updates screen (also linked from Settings > About) that checks the chosen channel: Stable reads the F-Droid package API and downloads from f-droid.org/repo; Alpha reads GitHub prereleases tagged vX.Y.Z-alpha.N and picks the APK for the device ABI. Same-channel updates download and install through PackageInstaller after checking the APK's package, version code, and signer. F-Droid and GitHub builds are signed with different keys, so a cross-channel release (or a signer mismatch) opens a guided switch instead: back up, get the other build, uninstall. An optional daily WorkManager check notifies about new same-channel releases; it defaults on for alpha builds and off for F-Droid builds. Update preferences describe the install, so they are excluded from backups.
|
- Keep downloads alive in the background with a dataSync foreground service; leaving the app mid-download let the system cache the process and abort its socket. - Cancel aborts the OkHttp call directly and no longer lets the dying job overwrite the status; it is only offered before a session is committed, since the system prompt owns that decision. - Open the install prompt directly only in the foreground; otherwise, including after process recreation, post a notification carrying the confirmation intent. - Offer debug builds a reinstall instead of an in-place update: their applicationId suffix means the published APK installs beside them. - Don't record a release as notified when the app's or the update channel's notifications are blocked.
cancel() launched the directory cleanup as the manager's job, so a check started right after it cancelled the job without stopping the blocking delete, and a retried download could lose its files to it. Cleanups now chain on a dedicated job that every download joins first, and a new download also waits for the previous download job to unwind.
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.
Adds an in-app update checker with two release channels.
What
Updates screen: a new row in the Settings root, also linked from Settings → About, the settings search, and the update notification (
ACTION_OPEN_UPDATES).Channels:
https://f-droid.org/api/v1/packages/<id>(suggestedVersionCode) and downloadsf-droid.org/repo/<id>_<code>.apk.vX.Y.Z-alpha.Nand picks thePixelPlayerOSS-<version>-<abi>.apkasset matchingBuild.SUPPORTED_ABIS. Versions are compared as semver, then by alpha number.Installed channel: taken from the running build's version name. Anything with a pre-release suffix (alpha and PR builds share the CI key) counts as Alpha; plain versions count as F-Droid.
Same-channel updates:
PackageInstallersession.UpdateInstallReceiverhandles the confirmation, cancel, and conflict results.Switching channels: F-Droid and GitHub builds are signed with different keys, so nothing is installed across channels. A "Reinstall required" dialog walks through:
ACTION_DELETE).The same dialog appears if a same-channel download turns out to have a different signer, e.g. a side-loaded build.
Daily check: an optional
WorkManagercheck notifies once per new same-channel release. It defaults on for alpha builds and off for F-Droid builds, where the F-Droid client already notifies.Backups: update preferences describe the install, not user taste, so they are excluded from backups.
Notes for review
REQUEST_INSTALL_PACKAGESandREQUEST_DELETE_PACKAGES. F-Droid builds only download fromf-droid.org/repoon the Stable channel and never install GitHub APKs. This is documented indocs/FDROID.mdandPRIVACY.md, but the F-Droid reviewers may still ask.alpha-release.yml's tag and asset naming is now a contract for alpha update discovery (noted indocs/RELEASE.md).MissingTranslationwarnings, like other recent strings.Testing
./gradlew :app:compileDebugKotlin :app:testDebugUnitTestpasses.AppReleaseSourceTestcovers:0.3.0-alpha.16. The switch dialog's Back up and Uninstall buttons open the right screens.cache/updatesare removed on the next start.Review follow-up (b299a98)
dataSyncforeground service (UpdateDownloadService) that mirrors progress. Without it, leaving the app mid-download got the socket aborted once the process was cached.highlightKeyquery matches the route, no crash.