hex/android/app
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Ryan Vogel d8c9878f7a Android: Hex Preview's Update opens only its own channel's release files
Why: with the browser hand-off, Hex Preview no longer checks the download's size, SHA-256 or
signing key; the browser opens whatever latest.json's apk.url names. Until now that could be any
HTTPS address on the four GitHub hosts.

The rule: apk.url must be https://github.com/<owner>/<repo>/releases/download/<tag>/<name>.apk,
<owner>/<repo> taken from the build's own channel address (update_channel,
https://raw.githubusercontent.com/<owner>/<repo>/<branch>/latest.json). No user info, query or
fragment, the default port; the tag and file name are letters, digits, '.', '_' and '-' starting
with a letter or digit, so no '..' or percent-escapes. A test channel on a fork opens only that
fork's releases; the real channel only anomalyco/hex's. Anything else fails latest.json as a
malformed one does (Problem.Server): no update card, and Check now says "Couldn't check". A
release saved by an earlier check is held to the same rule. The four-host list still governs
fetching latest.json and its redirects.

Removed behaviour: an apk.url in another repository, on raw.githubusercontent.com or the asset
hosts, over http, or anything but a release .apk is no longer offered.

Verified:
- ./gradlew :app:testDebugUnitTest :app:assemblePreview green.
- The same logic in jshell: the real channel's build 2332 address is accepted; another
  repository, http, raw.githubusercontent.com, a query, a fragment, user info, port 8443, '..',
  '%2e%2e', .APK, a missing tag, a nested path, a similar repo name and a trailing-dot host are
  rejected.
- By hand on an Android 16 emulator (AVD hex-playprotect-vogel), a debug-signed preview build
  whose latest.json came from a local server. The throwaway test copy changed only the fetch
  line, cleartext and opening on Home; the channel string, parsing, the rule and the UI were as
  shipped. Another repository, http and raw.githubusercontent.com: no update card, Check now
  "Couldn't check", no browser. A good address: the card, and Download update opened
  github.com/anomalyco/hex/releases/download/... in Chrome (ACTION_VIEW).
2026-11-23 20:06:16 -05:00
..
src Android: Hex Preview's Update opens only its own channel's release files 2026-11-23 20:06:16 -05:00
build.gradle.kts Android: Send feedback form that posts to Bellhop (#2582) 2026-11-23 15:51:14 -05:00
proguard-rules.pro Hex for Android: on-device dictation keyboard (#2074) 2026-11-20 17:27:17 +00:00