extractFirmware

abstract suspend fun extractFirmware(uri: CommonUri, hardware: DeviceHardware, fileExtension: String, preferredFilename: String? = null): FirmwareArtifact?(source)

Extract a matching firmware binary from a platform URI (e.g. content:// or file://) zip archive.

Return

The extracted FirmwareArtifact, or null if no file matched or the archive is corrupt or over the extraction limits.

Parameters

hardware

Used to match the correct binary inside the zip.

fileExtension

The extension to filter for (e.g. ".bin", ".uf2").

preferredFilename

Optional exact filename to prefer within the zip.