Skip to main content

zaparoo_update/
lib.rs

1// Copyright José Manuel Barroso Galindo <theypsilon@gmail.com>
2// SPDX-License-Identifier: PolyForm-Noncommercial-1.0.0
3
4#[cfg(all(
5    target_os = "linux",
6    target_arch = "arm",
7    target_env = "gnu",
8    target_abi = "eabihf"
9))]
10use zaparoo_update_runtime_linux_armv7 as zaparoo_update_runtime;
11#[cfg(all(target_os = "linux", target_arch = "x86_64"))]
12use zaparoo_update_runtime_linux_x86_64 as zaparoo_update_runtime;
13#[cfg(all(target_os = "windows", target_arch = "x86_64"))]
14use zaparoo_update_runtime_windows_x86_64 as zaparoo_update_runtime;
15
16#[must_use]
17pub fn runtime_artifact_root() -> Option<std::path::PathBuf> {
18    Some(zaparoo_update_runtime::artifact_root())
19}
20
21/// Returns whether the updater script is available on this device.
22///
23/// This intentionally checks the real updater tool, not `PLAY_EVENTS` playback.
24/// The platform-specific resolver lives in the selected runtime crate.
25#[must_use]
26pub fn is_updater_available() -> bool {
27    zaparoo_update_runtime::is_updater_available()
28}
29
30pub fn init_runtime(_handle: tokio::runtime::Handle) {
31    // Binary runtime artifacts own their private async runtime. This facade
32    // keeps the historical host API so existing frontends do not need changes.
33}