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:

  • Signed manifest parsing and JSON round-tripping.
  • Payload existence, size, and SHA-256 verification.
  • Optional RSA-SHA256 manifest signature checks.
  • RADInstaller bridge for verified bundles.
  • A/B slot metadata tracking for embedded products.

Example:

"/mnt/bundle", "manifest.json", publicKeyPem);
if (result.ok) {
auto manifest = RADUpdate::UpdateManager::loadManifest("/mnt/bundle/manifest.json");
if (manifest.hasValue()) {
"/mnt/bundle", manifest.value(), "/opt/app");
}
} else {
for (const auto& err : result.errors) {
// Report each verification failure.
}
}
static VerificationResult verifyBundle(const std::string &bundleRoot, const std::string &manifestPath, const std::string &publicKeyPem={})
Verifies payload hashes, sizes, and optional manifest signature.
static RADInstaller::Result installBundle(const std::string &bundleRoot, const UpdateManifest &manifest, const std::string &targetRoot, const std::vector< std::string > &selectedComponents={})
Installs a bundle using RADInstaller when installerManifest is present.
static RADCore::RADResult< UpdateManifest > loadManifest(const std::string &path)
Loads an update manifest from JSON.