mirror of
https://github.com/anomalyco/hex.git
synced 2026-11-28 13:02:21 +01:00
| Filename | Latest commit message | Latest commit date |
|---|---|---|
* Android: Hex Preview's setup names "Hex Preview", as Android's lists do
Hex Preview's first run said "Set up Hex", "choose Hex as your keyboard", a
"Hex keyboard" row with "Turn on Hex in Settings" / "Choose Hex in the list",
and "Choose Hex keyboard", while Android's keyboard list, keyboard picker and
microphone prompt say "Hex Preview" (and list both "Hex" and "Hex Preview"
for anyone who also has the Play app), so a person could turn on or pick the
wrong keyboard. Its welcome also said Hex uses the internet only for the
speech model, which isn't true for Hex Preview: it also asks GitHub for
updates.
What changed (preview build type only, src/preview/res, English and Simplified
Chinese; src/main and the Play builds are unchanged):
- setup_title, setup_detail, setup_microphone_detail, setup_keyboard,
setup_keyboard_enabled, setup_keyboard_off, setup_choose_hex now name
"Hex Preview".
- keyboard_hint_microphone ("Allow the microphone in Hex Preview"): the
keyboard's hint tells the person which app to open; MicCapture's sentinel
sentence still maps to this resource, so no code changed.
- setup_welcome_detail: "Hex Preview uses the internet only to download its
speech model (190 MB) and to check GitHub for updates. Your voice and words
stay on this device."
"The Hex key", "Hex menu", "Hex dictation" and the keyboard's TalkBack pane
name stay as they are: they name the key and the keyboard's own parts, not
something to find in Android's lists.
Verified on the Mac Studio (with the next commit): :app:testDebugUnitTest
passes; :app:assemblePreview -PhexPreviewBuild=2300 builds, and aapt2 dump
strings shows the new English and Chinese strings in app-preview.apk.
* Android: Hex Preview's update download keeps going when the person leaves the app
On Android 16 (API 36) the update download, a plain HTTPS read on the
updater's own thread, was cut off about 5 s after the person left Hex
Preview, and the Home card then said "The download stopped..." with Try
again. API 31 was unaffected.
What changed (src/preview only; the Play builds and src/main are unchanged):
- Android 14+ (API 34): the tap on Update (or Download after the mobile-data
note, or Try again) schedules a user-initiated data transfer job
(UpdateJob: setUserInitiated, NETWORK_TYPE_ANY, the APK's size as its
estimated bytes, the release in its extras). The job posts its
notification first thing, then runs the same download and checks as
before on the updater's worker (Channel.download's host allow-list, size
and SHA-256, then Channel.verify's package, build and signing-key checks,
untouched), updating the Home card and the notification's progress.
onStopJob ends the download at its next read, which deletes the partial
file and shows the same "download stopped" card; it is not rescheduled.
With no network at all, or if Android refuses the job, the download runs
in-process as before.
- When the job's download is checked: if Hex Preview's window shows, it
installs exactly as before. If not, nothing installs from the background:
the verified file stays, a notification says "Hex Preview <version> is
downloaded" / "Open Hex Preview to install it.", and the Home card shows
Install (kept across a restart of the process while the file is still
there). Install checks the file's size, SHA-256 and signing key again
before the installer session; if Android cleared it from the cache, it
downloads again (asking first on mobile data). Nothing installs without
the person's tap.
- Below Android 14 the in-process download is unchanged (the same code,
moved into Updates.fetch, which both paths share).
New permission (preview manifest only): android.permission.RUN_USER_INITIATED_JOBS,
plus the UpdateJob service guarded by BIND_JOB_SERVICE (not exported). No
POST_NOTIFICATIONS is declared or asked for, so there is no new prompt.
What the person sees: the Home card's progress as before, and Android's
running-apps list (Task Manager) shows Hex Preview while the job runs. The
notification ("Downloading Hex Preview <version>" with progress, in a
low-importance "Updates" channel; tapping opens Hex Preview) appears in the
notification shade only where Hex Preview may post notifications, which by
default it can't on Android 13+.
Verified on the Mac Studio: :app:testDebugUnitTest passes;
:app:assemblePreview -PhexPreviewBuild=2300 builds (lintVital included);
aapt2 dump badging shows ly.anoma.hex.preview, versionCode 2300, label
"Hex Preview"; aapt2 dump permissions lists RUN_USER_INITIATED_JOBS; the
manifest has the UpdateJob service with BIND_JOB_SERVICE; apksigner verify
passes with certificate SHA-256 133568f6...35d98e. Not yet run on a phone
or emulator.
|
||
| .. | ||
| src | ||
| build.gradle.kts | ||
| proguard-rules.pro | ||