From 2c4925a7f436a448f0a04a23cc0b1913dcea94aa Mon Sep 17 00:00:00 2001 From: Alexis Grojean Date: Thu, 30 May 2024 15:30:12 +0200 Subject: [PATCH] Fix lock screen for NBGL based apps. Update version. Update README. --- ledger_device_sdk/Cargo.toml | 2 +- ledger_device_sdk/README.md | 34 +++++++++++++++++++++++++--------- ledger_device_sdk/src/io.rs | 7 ++++++- 3 files changed, 32 insertions(+), 11 deletions(-) diff --git a/ledger_device_sdk/Cargo.toml b/ledger_device_sdk/Cargo.toml index 2019f547..9946500b 100644 --- a/ledger_device_sdk/Cargo.toml +++ b/ledger_device_sdk/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ledger_device_sdk" -version = "1.9.1" +version = "1.9.2" authors = ["yhql", "yogh333", "agrojean-ledger"] edition = "2021" license.workspace = true diff --git a/ledger_device_sdk/README.md b/ledger_device_sdk/README.md index 19aac3ab..f5077e22 100644 --- a/ledger_device_sdk/README.md +++ b/ledger_device_sdk/README.md @@ -1,25 +1,28 @@ # Ledger wallets SDK for Rust Applications -Crate that allows developing Ledger Nano apps in Rust with a default configuration. +Crate that allows developing Ledger device apps in Rust with a default configuration. Contains: - some safe wrappers over common syscalls - IO abstractions - signature abstractions +- UI libraries (the `ui` module for Nano (S/SP/X) apps, `nbgl` module for Stax and Flex apps) -This SDK is incomplete in the sense that wrappers are currently missing, and not all wrappers have a nice Rust abstraction on top, but two apps were made using it: +## Links -- [A demo application with a signature UI workflow](https://github.com/LedgerHQ/rust-app) -- [A Password Manager](https://github.com/LedgerHQ/rust-app-password-manager) +To learn more about using the SDK and what is required to publish an app on the Ledger Live app store, please don't hesitate to check the following resources : -You can submit an issue or even a pull request if you wish to contribute, we will check what we can do. +- 📚 [Developer's documentation](https://developers.ledger.com/) +- 🗣️ [Ledger's Discord server](https://discord.gg/Ledger) +- 📦 [Fully featured boilerplate app](https://github.com/LedgerHQ/app-boilerplate-rust) +- 📦 [A Password Manager app](https://github.com/LedgerHQ/rust-app-password-manager) ## Supported devices -| Nano S | Nano X | Nano S Plus | -| ------------------ | ------------------ | ------------------ | -| :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | +| Nano S | Nano X | Nano S Plus | Stax | Flex | +| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ | +| :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | ## Usage @@ -46,7 +49,7 @@ sudo dnf install clang arm-none-eabi-gcc arm-none-eabi-newlib sudo pacman -S clang arm-none-eabi-gcc arm-none-eabi-newlib ``` -This SDK provides three [custom target](https://doc.rust-lang.org/rustc/targets/custom.html) files for Nano S, Nano X and Nano S+. +This SDK provides [custom target](https://doc.rust-lang.org/rustc/targets/custom.html) files. One for each supported device. ### Building for Nano S @@ -66,6 +69,17 @@ cargo build --release -Z build-std=core --target=./nanox.json cargo build --release -Z build-std=core --target=./nanosplus.json ``` +### Building for Stax + +``` +cargo build --release -Z build-std=core --target=./stax.json +``` + +### Building for Flex + +``` +cargo build --release -Z build-std=core --target=./flex.json +``` ## Building with rustc < 1.54 @@ -75,6 +89,8 @@ This is solved by activating a specific feature: `cargo build --features pre1_54 ## Contributing +You can submit an issue or even a pull request if you wish to contribute, we will check what we can do. + Make sure you've followed the installation steps above. In order for your PR to be accepted, it will have to pass the CI, which performs the following checks: - Check if the code builds on nightly diff --git a/ledger_device_sdk/src/io.rs b/ledger_device_sdk/src/io.rs index 45d4bb56..6c57fc20 100644 --- a/ledger_device_sdk/src/io.rs +++ b/ledger_device_sdk/src/io.rs @@ -401,7 +401,12 @@ impl Comm { return Some(Event::TouchEvent); }, - _ => (), + _ => { + #[cfg(any(target_os = "stax", target_os = "flex"))] + unsafe { + ux_process_default_event(); + } + } } None }