chore(core/bootloader): add option to disable animations in bootloader
What changed, and why it matters
This commit adds a build-time and emulator option to turn off visual animations in the bootloader. It is a routine developer convenience change and does not fix, introduce, or change any security behavior.
No security action required; treat as normal feature/development tooling commit.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch introduces a DISABLE_ANIMATION compile flag controlled by TREZOR_DISABLE_ANIMATION, plus an emulator -a switch. When enabled, it calls disable_animation(true), which under the ui_debug feature sets an internal animation-disabled flag; in non-debug builds the function is a no-op. No cryptographic, boot, storage, or communication logic is modified.
Changed components
core/SConscript.bootloadercore/embed/projects/bootloader/emulator.ccore/embed/projects/bootloader/main.ccore/embed/rust/rust_ui_common.hcore/embed/rust/src/ui/api/common_c.rsInspect captured patch +28 / −1
diff --git a/core/SConscript.bootloader b/core/SConscript.bootloader
index aeb6c193..9f6c2d62 100644
--- a/core/SConscript.bootloader
+++ b/core/SConscript.bootloader
@@ -11,6 +11,7 @@ PRODUCTION = 0 if BOOTLOADER_QA else ARGUMENTS.get('PRODUCTION', '0') == '1'
HW_REVISION = ARGUMENTS.get('HW_REVISION', None)
UI_PERFORMANCE_OVERLAY = ARGUMENTS.get('UI_PERFORMANCE_OVERLAY', '0') == '1'
DBG_CONSOLE = ARGUMENTS.get('DBG_CONSOLE', '')
+DISABLE_ANIMATION = ARGUMENTS.get('TREZOR_DISABLE_ANIMATION', '0') == '1'
FEATURES_WANTED = [
"ble",
@@ -70,6 +71,7 @@ CPPDEFINES_MOD += [
'USE_KECCAK',
'ED25519_NO_PRECOMP',
'FANCY_FATAL_ERROR',
+ ('DISABLE_ANIMATION', '1' if DISABLE_ANIMATION else '0'),
]
SOURCE_MOD_CRYPTO = [
diff --git a/core/embed/projects/bootloader/emulator.c b/core/embed/projects/bootloader/emulator.c
index 0768ad5f..d8c6e9d3 100644
--- a/core/embed/projects/bootloader/emulator.c
+++ b/core/embed/projects/bootloader/emulator.c
@@ -17,6 +17,7 @@
#endif
#include "emulator.h"
+#include "rust_ui_common.h"
#undef FIRMWARE_START
@@ -39,6 +40,7 @@ bool storage_empty(const flash_area_t *area) {
void usage(void) {
printf("Usage: ./build/bootloader/bootloader_emu [options]\n");
printf("Options:\n");
+ printf(" -a disable animations\n");
printf(" -s stay in bootloader\n");
printf(" -w wipe any firmware before booting\n");
printf(" -e MESSAGE [TITLE [FOOTER]] display error screen and stop\n");
@@ -149,8 +151,11 @@ int main(int argc, char **argv) {
uint8_t set_variant = 0xff;
uint8_t color_variant = 0;
uint8_t bitcoin_only = 0;
- while ((opt = getopt(argc, argv, "hslewc:b:f:i:")) != -1) {
+ while ((opt = getopt(argc, argv, "ahslewc:b:f:i:")) != -1) {
switch (opt) {
+ case 'a':
+ disable_animation(true);
+ break;
case 's':
bootargs_set(BOOT_COMMAND_STOP_AND_WAIT, NULL, 0);
break;
diff --git a/core/embed/projects/bootloader/main.c b/core/embed/projects/bootloader/main.c
index aa1751bb..49e074f2 100644
--- a/core/embed/projects/bootloader/main.c
+++ b/core/embed/projects/bootloader/main.c
@@ -89,6 +89,7 @@
#endif
#include "bootui.h"
+#include "rust_ui_common.h"
#include "ui_helpers.h"
#include "version_check.h"
#include "wire/wire_iface_usb.h"
@@ -513,6 +514,10 @@ int bootloader_main(void) {
drivers_init(manufacturing_mode, &touch_initialized);
+#ifdef DISABLE_ANIMATION
+ disable_animation(true);
+#endif
+
#ifdef USE_BOOTARGS_RSOD
if (bootargs_get_command() == BOOT_COMMAND_SHOW_RSOD) {
#ifdef LAZY_DISPLAY_INIT
diff --git a/core/embed/rust/rust_ui_common.h b/core/embed/rust/rust_ui_common.h
index d1015337..cf4effa9 100644
--- a/core/embed/rust/rust_ui_common.h
+++ b/core/embed/rust/rust_ui_common.h
@@ -10,3 +10,5 @@ void screen_update(void);
void display_image(int16_t x, int16_t y, const uint8_t* data, uint32_t datalen);
void display_icon(int16_t x, int16_t y, const uint8_t* data, uint32_t datalen,
uint16_t fg_color, uint16_t bg_color);
+
+void disable_animation(bool disable);
diff --git a/core/embed/rust/src/ui/api/common_c.rs b/core/embed/rust/src/ui/api/common_c.rs
index 1fe45960..9b2e4227 100644
--- a/core/embed/rust/src/ui/api/common_c.rs
+++ b/core/embed/rust/src/ui/api/common_c.rs
@@ -5,6 +5,9 @@ use crate::ui::{CommonUI, ModelUI};
use crate::{ui::shape, util::from_c_str};
+#[cfg(feature = "ui_debug")]
+use crate::ui::util::set_animation_disabled;
+
#[no_mangle]
extern "C" fn display_rsod_rust(
title: *const cty::c_char,
@@ -35,3 +38,13 @@ extern "C" fn screen_boot_stage_2(fade_in: bool) {
extern "C" fn screen_update() {
ModelUI::screen_update();
}
+
+#[no_mangle]
+#[cfg(feature = "ui_debug")]
+extern "C" fn disable_animation(disable: bool) {
+ set_animation_disabled(disable);
+}
+
+#[no_mangle]
+#[cfg(not(feature = "ui_debug"))]
+extern "C" fn disable_animation(_disable: bool) {}
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.