Skip to main content

Releases and Patches Management

The binary lifecycle in TkushPatch is built around two core domain entities:

  1. Base Release (Release): The compiled native binary (application binary on Android or App.framework on iOS) shipped to the Google Play Store or Apple App Store. Once registered, a Release is immutable and locked by its baseSha256Hash.
  2. OTA Patch (Patch): The compressed binary diff (compressed binary diff, .vmcode file) computed by the server between the Day-1 base Release and the newly compiled Dart binary, signed with digital signature (SHA256withRSA).

1. Master Registry (/releases) vs Application View (/apps/[appId]/releases)​

The console provides two complementary views:

  • Master Registry (/releases, src/app/releases/page.tsx): Cross-application view allowing Release, Security, and SRE teams to oversee all releases and patches across the tenant, register a new base Release (POST /api/admin/v1/releases), or submit a new Patch (POST /api/admin/v1/patches).
  • Application View (/apps/[appId]/releases, src/app/apps/[appId]/releases/page.tsx): Application-scoped view featuring multi-ABI consolidation.

Multi-ABI Consolidation​

When tk-ota-push release android runs against an Android App Bundle (.aab), the CLI automatically uploads reference binaries for every CPU architecture (aarch64, arm, x86_64). The /apps/[appId]/releases page consolidates these records into a single logical (releaseVersion, platform) row displaying ABI coverage badges (aarch64, armv7, x86_64), Store status, and total attached patches.


2. Release Detail View (/apps/[appId]/releases/[version])​

Clicking a version in /apps/[appId]/releases opens the version workspace (src/app/apps/[appId]/releases/[version]/layout.tsx), organized into 6 sub-tabs:

Sub-tabRouteContent and Actions
1. Overview/apps/[appId]/releases/[version]Patch timeline (#1, #2...), status (STAGED, APPROVED_AND_SIGNED, ROLLED_BACK), channel, rollout %, country filters, and quick actions
2. Insights/apps/[appId]/insightsTelemetry scoped to this version: successful installs, failures, and stability rate
3. Size/apps/[appId]/releases/[version]/sizeSize comparison: base binary size vs .vmcode patch diff sizes and bandwidth savings (%)
4. Artifacts/apps/[appId]/releases/[version]/artifactsPhysical artifacts per ABI (aarch64, arm, x86_64), SHA-256 hashes (base, pubspec.lock, assets, nativeCodeHash), and .symbols downloads
5. Notes/apps/[appId]/releases/[version]/notesRelease notes / changelog editor persisted per version (localStorage tks_release_notes_<appId>_<version>)
6. Settings/apps/[appId]/releases/[version]/settingsStore lifecycle status toggle (LIVE_ON_STORE, IN_STORE_REVIEW, DEPRECATED) via PATCH /api/admin/v1/releases/{id}/status

3. Operator Actions on Releases and Patches​

All critical operations are protected by RoleGuard and recorded in the immutable audit trail:

Patch Operational Statuses
  • STAGED: Submitted patch quarantined in review. Inaccessible to end users.
  • APPROVED_AND_SIGNED: Peer-reviewed and digitally signed for production rollout.
  • ROLLED_BACK: Revoked due to defects. Mobile devices immediately fall back to the safe base release.

Available Actions Reference​

ActionBackend EndpointAllowed Roles (roles.ts)Technical Effect
Register Base ReleasePOST /api/admin/v1/releasesROLE_ADMIN, ROLE_RELEASE_DEVELOPEREnforces Anti-Bomb quota (maxReleaseSizeMb), computes SHA-256, stores base binary and .symbols
Submit PatchPOST /api/admin/v1/patchesROLE_ADMIN, ROLE_RELEASE_DEVELOPERComputes compressed binary diff diff, checks maxPatchSizeMb, places patch in STAGED (or APPROVED_AND_SIGNED if auto-signed without Four-Eyes)
Approve and SignPOST /api/admin/v1/patches/{id}/approveROLE_ADMIN, ROLE_SECURITY_OFFICEREnforces Four-Eyes rule, signs the 64-character ASCII targetSha256Hash with digital signature, transitions to APPROVED_AND_SIGNED
Update Rollout %PATCH /api/admin/v1/patches/{id}/rolloutROLE_ADMIN, ROLE_SRE_ADMINUpdates Canary percentage (0% to 100%) and evicts L1/L2 cache
Promote ChannelPOST /api/admin/v1/patches/{id}/promoteROLE_ADMIN, ROLE_SECURITY_OFFICERClones an APPROVED_AND_SIGNED patch to a target channel (staging, stable) with zero recompilation
Kill-Switch / RollbackPOST /api/admin/v1/patches/{id}/rollbackROLE_ADMIN, ROLE_SRE_ADMINSets status to ROLLED_BACK, forces rolloutPercentage = 0, and appends patch number to rolled_back_patch_numbers
Update Release StatusPATCH /api/admin/v1/releases/{id}/statusROLE_ADMIN, ROLE_RELEASE_DEVELOPER, ROLE_SRE_ADMINSwitches between LIVE_ON_STORE, IN_STORE_REVIEW (blocks stable patches), and DEPRECATED (eligible for Day-2 purge)
Download .symbolsGET /api/admin/v1/releases/{id}/symbols or /patches/{id}/symbolsROLE_ADMIN, ROLE_RELEASE_DEVELOPER, ROLE_SRE_ADMINDownloads the architecture-specific DWARF .symbols file and logs an audit entry