Public Access
Let the phone replace itself, and give CI a channel it may sign
The Android head had no updater and no release path, and the two are one problem: Android refuses an update signed by a different key, and CI generates a fresh debug key in every container. An APK released from a workflow could be installed once and never updated again — each new one an uninstall, which on this product means losing the cache, the outbox and the device key. So there are two channels, and they are two applications because the platform gives no third option. dev.dodotech.dodossh is cut from a v* tag by a person running scripts/release-android.ps1 with the key ADR 0011 rule 1 keeps off runners. dev.dodotech.dodossh.nightly is cut from main by CI and signed with a keystore committed here in the open — a key everybody has cannot be stolen and grants nothing by being held, which is why putting it in CI does not touch the rule. Neither can update the other, by construction. See ADR 0014. The android job assumed an image with a JDK and an Android SDK on it, which is what a GitHub runner is and what this project's is not. It now installs a JDK, fetches Google's command-line tools, accepts the licences and installs API 36 — each a no-op where it is already satisfied, and each cached by the persistent runner's own disk rather than by an action that would move a quarter of a gigabyte to rebuild a directory that never left. The client reads a small JSON manifest beside the APK, the counterpart of releases.win.json, and compares Android's versionCode rather than a version name: that integer is what the platform itself uses to accept or refuse an install, so comparing anything else would offer updates the phone then rejects. It fetches, and then asks Android to ask — the system draws its own confirmation, and from API 26 will not draw even that until unknown sources is on for this application. IUpdateChannel gained ApplyingEndsTheProcess. On Windows applying replaces the files and restarts, so the shell disposes the vault first and that is what zeroes the keys. On the phone the install is a request and the answer may be no, so disposing first would answer "not now" with a locked keychain and every shell closed — a punishment for declining an update. Two measured bugs found on the way, both older than this work and both invisible to a -getProperty check. ApplicationDisplayVersion is read by the Android targets in a top-level PropertyGroup, so the target setting it from MinVer ran after the only thing that reads it: every APK ever built here said versionName 1.0.0. And nothing found so far varies the launcher name per channel — four mechanisms tried, all of them recorded in platform-flags, none of them reaching the label the launcher shows. The two channels share an icon name for now and are told apart by package name, version, and what the preferences screen says.
This commit is contained in:
@@ -122,6 +122,18 @@ public sealed partial class DodoSshApp : Avalonia.Application
|
||||
// key. A straight implementation of the interface the session layer has always taken.
|
||||
var deviceKeys = new AndroidDeviceKeyStore(paths);
|
||||
|
||||
// Difference 6, and the newest: where newer builds come from. The same shape of question
|
||||
// deviceKeys answers — a property of this installation, decided once, here — and the same answer
|
||||
// when this copy was not installed by anything that can replace it. See ADR 0014.
|
||||
//
|
||||
// Its own HttpClient rather than the sync client's: this one talks to the project's forge and that
|
||||
// one talks to the deployment, and the whole point of ADR 0011 rule 2 is that those are different
|
||||
// parties. Sharing a handler would be one connection pool, one set of default headers and one
|
||||
// place for a future change to leak a token from the second into the first. Never disposed, for
|
||||
// the reason nothing else here is: an Avalonia Application has no disposal hook, and this lives as
|
||||
// long as the process.
|
||||
var updates = AndroidUpdateChannels.ForThisPhone(new HttpClient());
|
||||
|
||||
var browser = new AndroidBrowserLauncher();
|
||||
|
||||
var viewModel = new MainWindowViewModel(
|
||||
@@ -151,7 +163,9 @@ public sealed partial class DodoSshApp : Avalonia.Application
|
||||
// answers localhost here — so without this the account's device list would show one localhost
|
||||
// per phone, on the very screen a lost device is revoked from, and every log entry a phone wrote
|
||||
// would name the same machine. See PhoneEnvironment.DeviceName.
|
||||
deviceName: PhoneEnvironment.DeviceName);
|
||||
deviceName: PhoneEnvironment.DeviceName,
|
||||
|
||||
updates: updates);
|
||||
|
||||
// Started rather than awaited: framework initialisation must not block on a schema migration. The
|
||||
// view model shows its own progress and handles its own failures.
|
||||
|
||||
Reference in New Issue
Block a user