Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 37 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,40 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

Nothing yet. Open an issue or PR to propose something.

## [1.1.1] - 2026-10-22

The app can now find and install its own updates, and its Settings screen has an About section that
shows what changed in the latest release.

### Added

- **Check for updates.** A new *Updates* card in Settings. It reports whether a newer version has
been published, and downloads and starts the installation of it without the user having to find
the release page first. Nothing is fetched until the button is pressed, and nothing is downloaded
until the download is asked for.
- **About / What's New.** A dialog showing the version installed on the device, the latest
published version, when it was published, and the release notes for it. The notes come from the
official GitHub release, so they are the same notes the release page shows. A copy is kept on the
device, so the dialog still says something useful when there is no network.
- **The update flow respects the platform's safeguards.** The downloaded package is handed to
Android's own installer, which asks the user to confirm. On Android 8 and above the "install
unknown apps" permission is granted separately, in system settings, and the app says so and
takes the user there.

### Fixed

- **A release signed with the wrong key installed once and then refused to update.** The release
workflow now restores the keystore from a repository secret, verifies the signature before
publishing, and refuses to publish at all if the secret is missing.

### Security

- The release check uses GitHub's public API **without a token**. A token embedded in an
application can be extracted from every user's device; the endpoint is public, and the result is
cached so it is not hammered.
- Release notes are rendered from a deliberately small Markdown subset. HTML is stripped, and a
link in somebody else's release notes is shown as text rather than made tappable.

## [1.1.0] - 2026-10-20

Deal alerts: the app now tells you when a game you saved goes on sale, and when a game becomes
Expand Down Expand Up @@ -189,8 +223,7 @@ failure mode behind every one.
- **Price history is local.** The chart shows prices *this device* recorded. External databases are
reachable through deep links rather than being scraped, because most of them block programmatic
access.

[1.0.0]: https://github.com/JuggyBob/DiscountHunterAndroid/releases/tag/v1.0.0

[Unreleased]: https://github.com/JuggyBob/DiscountHunterAndroid/compare/v1.1.0...HEAD
[Unreleased]: https://github.com/JuggyBob/DiscountHunterAndroid/compare/v1.1.1...HEAD
[1.1.1]: https://github.com/JuggyBob/DiscountHunterAndroid/releases/tag/v1.1.1
[1.1.0]: https://github.com/JuggyBob/DiscountHunterAndroid/releases/tag/v1.1.0
[1.0.0]: https://github.com/JuggyBob/DiscountHunterAndroid/releases/tag/v1.0.0
17 changes: 12 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ games to watch their prices.
| 🖼️ **Rich detail pages** | Hero art, screenshots, trailers, system requirements, genres, "Where to buy" comparing every store that has the game |
| 📈 **Price history** | A chart of prices **this device** recorded, with deep links to external databases |
| 🎨 **Material You** | Follows your system light/dark theme, edge-to-edge, with hand-tuned motion throughout |
| 🔄 **In-app updates** | Check the official releases from Settings, download a newer version and start Android's installer for it. Plus an About dialog with the release notes |
| 🔒 **Private by design** | No account, no tracking, no analytics, no API keys. Everything is cached on-device |

<p align="center">
Expand All @@ -35,12 +36,17 @@ games to watch their prices.
<img src="docs/screenshots/08-diagnostics.png" width="32%" alt="Settings, including log export" />
</p>

## What is new in 1.1.0
## What is new in 1.1.1

**The app can now update itself.** Settings has a *Check for updates* entry that finds a newer
release, downloads it, and starts Android's own installer for it — and an *About* dialog that shows
the version you are on, the version published most recently, and the release notes for it, fetched
from the official GitHub release.

Nothing is fetched until you ask, nothing is downloaded until you ask for that, and the
installation itself is still confirmed by Android, in the normal way. See
[CHANGELOG.md](CHANGELOG.md) for the full list.

**Deal alerts.** The app now tells you when a game you saved goes on sale, and when a game becomes
free to keep — with the name, the new price and the discount — and it does so **with the app
closed**. See [CHANGELOG.md](CHANGELOG.md) for the full list, including the five bugs this release
fixes along the way.
## Download

<p align="center">
Expand Down Expand Up @@ -135,6 +141,7 @@ app/src/main/java/com/discounthunter/android/
│ ├── cache/ # Region-scoped snapshots, payload cache
│ └── repo/ # Repositories merging the stores together
├── alerts/ # Background deal alerts: detection, scheduling, notification
├── update/ # In-app updater: release metadata, download, install
├── diagnostics/ # In-app log + crash capture used by the export button
├── di/ # AppContainer — the hand-rolled dependency graph
└── ui/ # Compose screens, one package per screen, plus shared components
Expand Down
4 changes: 2 additions & 2 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ android {
targetSdk = 36
// Must be higher than any build already installed on a user's device, or the install is
// refused as a downgrade. The device this was built against had 1.0.1-release at code 7.
versionCode = 8
versionName = "1.1.0-release"
versionCode = 9
versionName = "1.1.1-release"

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}
Expand Down
21 changes: 21 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,15 @@
-->
<uses-permission android:name="android.permission.SCHEDULE_EXACT_ALARM" />

<!--
Lets the updater hand a downloaded release to Android's own package installer. The
application cannot install anything silently: the user still sees and confirms the
installation, and on Android 8 and above the "install unknown apps" permission is granted
separately, in system settings. This permission is what allows the request to be made at
all; it is not what allows a silent install.
-->
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />

<application
android:name=".DiscountHunterApplication"
android:allowBackup="true"
Expand Down Expand Up @@ -113,6 +122,18 @@
<action android:name="android.intent.action.MY_PACKAGE_REPLACED" />
</intent-filter>
</receiver>

<!--
Receives the result of an installation started by the updater, so the app can tell
the user whether the update actually went through rather than leaving them to guess.
-->
<receiver
android:name=".update.InstallStatusReceiver"
android:exported="false">
<intent-filter>
<action android:name="com.discounthunter.android.action.INSTALL_STATUS" />
</intent-filter>
</receiver>
</application>

</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,9 @@ object CacheKeys {

// ---- Epic --------------------------------------------------------------------------
fun epicFreeGames(country: String) = CacheKey("epic", "freegames", country, "v3")

// ---- GitHub -------------------------------------------------------------------------
// The application's own release metadata, used by the in-app updater and the about screen.
fun githubLatestRelease(owner: String, repository: String) =
CacheKey("github", "latest-release", owner, repository, "v1")
}
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,17 @@ inline fun <T, R> Outcome<T>.map(transform: (T) -> R): Outcome<R> = when (this)
is Outcome.Failure -> this
}

/**
* Collapses an outcome into a single value, handling both branches.
*
* The same shape as [Result.fold], so that a caller reading either one knows what to expect.
*/
inline fun <T, R> Outcome<T>.fold(
onSuccess: (T) -> R,
onFailure: (Outcome.Failure) -> R,
): R = when (this) {
is Outcome.Success -> onSuccess(value)
is Outcome.Failure -> onFailure(this)
}

fun <T> Outcome<T>.valueOrNull(): T? = (this as? Outcome.Success)?.value
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,15 @@ class AppContainer(
*/
private val payloadCache = PayloadCache(File(appContext.cacheDir, "http_cache"))

/**
* The raw-payload cache, shared with the release-metadata service.
*
* Public because the updater caches the release feed through it, so that the About screen can
* still show something useful when the network is unavailable. Using the same cache as the
* stores means there is one place that decides how long a payload is fresh.
*/
val payloadCacheForUpdates: PayloadCache get() = payloadCache

/**
* Snapshots live in `filesDir`: they are browsable history, not a disposable cache, so they
* must survive the system clearing `cacheDir`.
Expand Down
Loading
Loading