dartufbt
Native Dart port of uFBT — deploys the
Flipper Zero SDK and builds .fap applications. No Python, no SCons, no shell.
Built for qUnleashed, a Flipper Zero companion app.
Features
- SDK deployment — release / release-candidate / dev channels, a firmware branch, a direct URL or a local archive.
- Toolchain — downloads and unpacks the ARM GCC toolchain uFBT expects.
- FAP builder — compiles and links
.fap/.fal, resolves API symbols against the SDK, embeds icons and file assets, writes FastFAP relocation tables and.fapmeta. - Structured logging — events reach sinks as objects, so a GUI can render progress instead of scraping stdout.
Install
dependencies:
dartufbt: ^0.1.0
Usage
import 'dart:io';
import 'package:dartufbt/dartufbt.dart';
final logger = UfbtLogger(sink: UfbtConsoleSink().call);
final ufbt = UfbtInstaller(logger: logger);
// SDK + toolchain into ~/.ufbt
await ufbt.install(SdkDeployTask.channel(channel: UfbtUpdateChannel.release));
// Every app of application.fam into <appDir>/dist
final result = await FapBuilder(
logger: logger,
paths: ufbt.paths,
).build(appDir: Directory('my_app'));
print(result.success ? result.fap!.path : result.error);
SDK sources
SdkDeployTask.channel(channel: UfbtUpdateChannel.dev); // update channel
SdkDeployTask.branch(branch: 'my-feature'); // firmware branch
SdkDeployTask.url(url: '...', hwTarget: 'f7'); // direct archive
SdkDeployTask.local(filePath: '...', hwTarget: 'f7'); // local archive
ufbt.status() reports the deployed target, mode and version; ufbt.checkForUpdate() compares
it against the channel head.
State
Everything lives under ~/.ufbt — SDK in current/, toolchain in toolchain/, archives in
download/. Override with UFBT_HOME and FBT_TOOLCHAIN_PATH, from the environment or from a
.env file next to the project.
License
GPL-3.0. See LICENSE.
Libraries
- build/api_symbols
- build/app_manifest
- build/elf_manifest
- build/elf_reader
- build/fam_parser
- build/fap_builder
- build/fastfap
- build/file_assets
- build/heatshrink
- build/icon
- build/icon_assets
- build/sdk_opts
- build/source_glob
- core/ufbt_paths
- core/ufbt_state
- dartufbt
- log/console_sink
- log/log_event
- log/log_format
- log/log_level
- log/logger
- log/progress
- net/file_fetcher
- sdk/deploy_task
- sdk/directory_index
- sdk/file_type
- sdk/sdk_deployer
- sdk/sdk_loader
- toolchain/toolchain_deployer
- ufbt_installer