module

Quartz::SDK::Downloader

Fetches and extracts an SDK archive for a variant+channel into a target dir.

Flow:

  1. Resolve (url, sha256?) via variant-specific strategy
  2. Stream body to <target>.partial/archive.{zip|tgz}
  3. Verify sha256 if expected
  4. Extract into <target>.partial
  5. Atomic rename <target>.partial -> <target>

Constants

ALLOWED_HOSTS = ["update.flipperzero.one", "github.com", "api.github.com", "objects.githubusercontent.com", "codeload.github.com", "raw.githubusercontent.com"] of ::String

Allowlist of SDK/firmware hosts. Extend via QUARTZ_SDK_HOSTS (comma-sep). Blocks SSRF via user-controlled URLs: localhost, RFC1918, link-local, cloud metadata.

DEFAULT_MAX_REDIRECTS = 5
DEFAULT_TIMEOUT = 60.seconds

Class methods

download_to(url : String, dest : String, timeout : Time::Span = DEFAULT_TIMEOUT, max_redirects : Int32 = DEFAULT_MAX_REDIRECTS) : Nil

Exposed for tests & drivers that want to stream to an arbitrary URL.

Source
extract(archive : String, dest : String, kind : String) : Nil
Source
fetch(variant : Variant, channel : String, target : Path, expected_sha : String | Nil = nil) : Path

Public entrypoint. Returns the final target path.

Source
resolve(variant : Variant, channel : String) : Source
Source

Nested types