KoolbaseVmPatchClient class

System B (VM-level) code-push client — companion to KoolbaseCodePushClient (System A runtime bundles). This one ships compiled-Dart patches: it checks the resolver for a patch matching the running binary, downloads the signed .kbpatch, and stages it where the patched Flutter engine reads it at the NEXT cold launch. The engine verifies (Ed25519 + build_id) and applies before any Dart runs, then renames the staged file to mark it applied; on the following launch this client reconciles that into the persisted current_patch.

Boot order makes the handshake work: engine init writes runtime_build_id and applies any staged patch before Dart, so this client just reads the results.

Matching model (dual): the client sends whichever release identity it has.

  • build_id (content hash) — self-distributed/sideloaded apps where the CLI stamps the build_id. Engine verifies it cryptographically.
  • release_version (store versionName+versionCode) — Play Store apps, the only identity that survives Play App Signing. Sent when available.

Constructors

KoolbaseVmPatchClient({required String baseUrl, required String apiKey, String channel = 'stable'})

Properties

apiKey → String
final
appliedThisLaunch → bool
True when a NEWLY downloaded patch (staged.kbc) was applied on this cold launch — i.e. the user just received an update. The routine re-apply of the durable applied.kbc does NOT set this. Flips shortly after init() (the apply runs async); sample it, don't read once.
no setter
baseUrl → String
final
channel → String
final
hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

currentPatch() → Future<int>
Current applied patch number (0 = base binary).
init({String? buildIdOverride}) → Future<void>
Reconcile + background check. Non-blocking, like System A.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
releaseVersion() → Future<String?>
The store release version (versionName+versionCode) for release_version matching. Android only; resolved by the platform layer. Null elsewhere.
runtimeBuildId({String? override}) → Future<String?>
The build_id the running binary advertises, for build_id-mode matching. Null when the app uses release_version matching (Play Store) or when the engine is unpatched. override lets a test inject a known build_id.
runtimeFlutterVersion() → Future<String?>
The Flutter version this binary was built against, for the resolver's engine guard. CLI-stamped into assets/koolbase_flutter_version by koolbase build / koolbase release (a bare string, identical across ABIs — unlike build_id there is no per-ABI map). Null when the asset is absent (older builds, or apps built before the stamping CLI shipped), in which case no flutter_version is sent and the server falls back to legacy matching — so this is fully backward-compatible.
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited