|
RADLib
RADical C++ application framework
|
RADUpdate verifies signed app-bundle update manifests and provides A/B slot metadata helpers for embedded products. It bridges verified bundles into RADInstaller for the actual on-disk install step.
A bundle is described by an UpdateManifest, which declares the product, version, channel, and minimumVersion, plus a list of Payload entries. Each Payload names a path relative to the bundle root, an expected lowercase sha256 digest, and an optional size (0 disables size checking). A manifest may also carry an installerManifest path and a signaturePath.
UpdateManager is the entry point. loadManifest() parses manifest JSON into a RADCore::RADResult<UpdateManifest>, and manifestToJson() serializes it back. verifyBundle() checks payload existence, sizes, and SHA-256 hashes, and verifies an RSA-SHA256 manifest signature when a public key PEM is supplied, returning a VerificationResult with an ok flag and an errors list. When a manifest carries an installerManifest, installBundle() hands the verified bundle to RADInstaller and returns a RADInstaller::Result.
For embedded A/B updates, ABMetadata tracks the activeSlot, pendingSlot, bootCount, rollbackReason, and the versions installed in slots A and B. loadABMetadata(), saveABMetadata(), and abMetadataToJson() persist this state without performing rootfs switching directly.
Core features:
Example: