Skip to content

Commit

Permalink
Add Ledger Blue support
Browse files Browse the repository at this point in the history
  • Loading branch information
fbsobreira committed Aug 5, 2018
1 parent dd67962 commit feb6728
Show file tree
Hide file tree
Showing 10 changed files with 1,375 additions and 73 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ dkms.conf
#virtual env pip
ledger/

# SDK
/.env

# IDE
/.vscode
/.idea
9 changes: 7 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
FROM zondax/ledger-docker-bolos

ENV BOLOS_ENV=/opt/bolos
ENV BOLOS_SDK=$BOLOS_ENV/nanos-secure-sdk
# ENV BOLOS_SDK=$BOLOS_ENV/nanos-secure-sdk
ENV BOLOS_SDK=$BOLOS_ENV/blue-secure-sdk

# RUN git clone https://github.com/LedgerHQ/nanos-secure-sdk.git $BOLOS_SDK
RUN git clone https://github.com/ledgerhq/blue-secure-sdk $BOLOS_SDK
RUN apt-get update && apt-get install -y \
python3-pip

RUN git clone https://github.com/LedgerHQ/nanos-secure-sdk.git $BOLOS_SDK

USER test
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ Enter your PIN and **make sure you're seeing the Dashboard app**.
virtualenv -p python3 ledger
source ledger/bin/activate
pip install ledgerblue
or pip install git+https://github.com/LedgerHQ/blue-loader-python.git
```

If you run into errors here, make sure you have the required dependencies installed. See [Ledger - Loader Python](https://github.com/LedgerHQ/blue-loader-python).
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.0.2
0.0.4
Binary file added glyphs/badge_transaction.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added glyphs/badge_tron.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified icon_blue.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
110 changes: 110 additions & 0 deletions src/glyphs.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,114 @@
#include "glyphs.h"
unsigned int const C_badge_transaction_colors[]
= {
0x00cccccc,
0x00d8d8d8,
0x00e9e9e9,
0x00f9f9f9,
};

unsigned char const C_badge_transaction_bitmap[] = {
0xff, 0xff, 0xff, 0xff, 0xbf, 0x15, 0x40, 0xe5, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0x6f, 0x00, 0x00, 0x00, 0x90, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1b, 0x00, 0x00, 0x00,
0x00, 0x40, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1f, 0x00, 0xa4, 0xff, 0xaf, 0x01, 0x40, 0xff,
0xff, 0xff, 0xff, 0xff, 0x2f, 0x00, 0xf9, 0xff, 0xff, 0xff, 0x06, 0x80, 0xff, 0xff, 0xff, 0xff,
0x7f, 0x00, 0xf9, 0xff, 0xff, 0xff, 0xff, 0x06, 0xd0, 0xff, 0xff, 0xff, 0xff, 0x01, 0xf9, 0xff,
0xff, 0xff, 0xff, 0xff, 0x06, 0xf4, 0xff, 0xff, 0xff, 0x07, 0xf4, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0x01, 0xfd, 0xff, 0xff, 0x1f, 0xe0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xbf, 0x40, 0xff,
0xff, 0x7f, 0x80, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x2f, 0xd0, 0xff, 0xff, 0x02, 0xfe,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0b, 0xf8, 0xff, 0x0f, 0xf4, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0x01, 0xff, 0x7f, 0xd0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0x7f, 0xd0, 0xff, 0x02, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0b, 0xf8, 0x1f,
0xf4, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x41, 0xff, 0x80, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x2f, 0xf0, 0x0b, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0x07, 0x7e, 0xe0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe7, 0xff, 0xff, 0xbf,
0xd0, 0x03, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xf8, 0xff, 0xff, 0x0f, 0x2c, 0xf4, 0xff,
0xff, 0xaa, 0xaa, 0xaa, 0xaa, 0x06, 0xfe, 0xff, 0xff, 0x81, 0x81, 0xff, 0xff, 0x0f, 0x00, 0x00,
0x00, 0x00, 0x80, 0xff, 0xff, 0x2f, 0x14, 0xf8, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf4,
0xff, 0xff, 0x42, 0xc1, 0xff, 0xff, 0x5f, 0x55, 0x55, 0x55, 0x15, 0xd0, 0xff, 0xff, 0x3f, 0x04,
0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x47, 0xff, 0xff, 0xff, 0x03, 0xc0, 0xff, 0xff, 0xff,
0xef, 0xff, 0xff, 0x7f, 0xfd, 0xff, 0xff, 0x3f, 0x00, 0xfc, 0xff, 0xff, 0x7f, 0xfd, 0xff, 0xff,
0xfb, 0xff, 0xff, 0xff, 0x03, 0xc0, 0xff, 0xff, 0xff, 0xd1, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0x3f, 0x10, 0xfc, 0xff, 0xff, 0x07, 0x54, 0x55, 0x55, 0x55, 0xf5, 0xff, 0xff, 0x43, 0x81, 0xff,
0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x2f, 0x14, 0xf8, 0xff, 0xff, 0x02, 0x00,
0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0x42, 0x42, 0xff, 0xff, 0xbf, 0x90, 0xaa, 0xaa, 0xaa, 0xaa,
0xff, 0xff, 0x1f, 0x38, 0xf0, 0xff, 0xff, 0x2f, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc0,
0x07, 0xfe, 0xff, 0xff, 0xdb, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0b, 0xbd, 0xd0, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xe0, 0x0f, 0xf8, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0x02, 0xff, 0x41, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0x1f, 0xf4, 0x2f, 0xe0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xbf, 0x80, 0xff, 0x07,
0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x07, 0xfd, 0xff, 0x40, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0x1f, 0xf0, 0xff, 0x2f, 0xe0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xbf, 0x80, 0xff, 0xff, 0x07, 0xf8, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x02, 0xfd,
0xff, 0xff, 0x01, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0b, 0xf4, 0xff, 0xff, 0x7f, 0x40,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1f, 0xd0, 0xff, 0xff, 0xff, 0x1f, 0x90, 0xff, 0xff, 0xff,
0xff, 0xff, 0x6f, 0x40, 0xff, 0xff, 0xff, 0xff, 0x07, 0x90, 0xff, 0xff, 0xff, 0xff, 0x6f, 0x00,
0xfd, 0xff, 0xff, 0xff, 0xff, 0x02, 0x90, 0xff, 0xff, 0xff, 0x6f, 0x00, 0xf8, 0xff, 0xff, 0xff,
0xff, 0xff, 0x01, 0x40, 0xfa, 0xff, 0x1a, 0x00, 0xf4, 0xff, 0xff, 0xff, 0xff, 0xff, 0xbf, 0x01,
0x00, 0x00, 0x00, 0x00, 0xe4, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x06, 0x00, 0x00, 0x00,
0xf9, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x5b, 0x01, 0x54, 0xfe, 0xff, 0xff, 0xff,
0xff, };

#ifdef OS_IO_SEPROXYHAL
#include "os_io_seproxyhal.h"
const bagl_icon_details_t C_badge_transaction = { GLYPH_badge_transaction_WIDTH, GLYPH_badge_transaction_HEIGHT, 2, C_badge_transaction_colors, C_badge_transaction_bitmap };
#endif // OS_IO_SEPROXYHAL
#include "glyphs.h"
unsigned int const C_badge_tron_colors[]
= {
0x00cccccc,
0x00dddddd,
0x00ededed,
0x00f9f9f9,
};

unsigned char const C_badge_tron_bitmap[] = {
0xff, 0xff, 0xff, 0xff, 0xaf, 0x05, 0x00, 0xe5, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0x5f, 0x00, 0x00, 0x00, 0x40, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1b, 0x00, 0x00, 0x00,
0x00, 0x40, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1f, 0x00, 0x94, 0xfe, 0x6b, 0x01, 0x40, 0xff,
0xff, 0xff, 0xff, 0xff, 0x2f, 0x00, 0xf9, 0xff, 0xff, 0xff, 0x06, 0x80, 0xff, 0xff, 0xff, 0xff,
0x7f, 0x00, 0xf9, 0xff, 0xff, 0xff, 0xff, 0x06, 0xd0, 0xff, 0xff, 0xff, 0xff, 0x01, 0xf8, 0xff,
0xff, 0xff, 0xff, 0xff, 0x02, 0xf4, 0xff, 0xff, 0xff, 0x07, 0xf4, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0x01, 0xfd, 0xff, 0xff, 0x1f, 0xd0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x40, 0xff,
0xff, 0x7f, 0x80, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x2f, 0xd0, 0xff, 0xff, 0x02, 0xfd,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x07, 0xf8, 0xff, 0x0f, 0xf4, 0x57, 0xa9, 0xfe, 0xff,
0xff, 0xff, 0xff, 0xff, 0x01, 0xff, 0x7f, 0xc0, 0x7f, 0x51, 0x95, 0xaa, 0xff, 0xff, 0xff, 0xff,
0x3f, 0xd0, 0xff, 0x02, 0xfe, 0x1b, 0x50, 0x55, 0xa5, 0xaa, 0xff, 0xff, 0xff, 0x0b, 0xf8, 0x1f,
0xf4, 0xbf, 0x41, 0xa9, 0x56, 0x55, 0xa5, 0xea, 0xff, 0xff, 0x41, 0xff, 0x80, 0xff, 0x6f, 0x55,
0xba, 0xaa, 0x55, 0x55, 0xf9, 0xff, 0x2f, 0xf0, 0x07, 0xfd, 0xff, 0x56, 0x95, 0xff, 0xbf, 0x6a,
0x55, 0xfe, 0xff, 0x07, 0x3d, 0xe0, 0xff, 0xaf, 0xa9, 0xa5, 0xff, 0xff, 0x56, 0x95, 0xff, 0xbf,
0xc0, 0x02, 0xff, 0xff, 0x5b, 0x6a, 0xe9, 0xff, 0x6b, 0xa9, 0xe5, 0xff, 0x0f, 0x28, 0xf4, 0xff,
0xbf, 0xe5, 0x5a, 0xfa, 0x6f, 0xe5, 0x6b, 0xe9, 0xff, 0x81, 0x41, 0xff, 0xff, 0x6f, 0xfe, 0x56,
0xbe, 0x95, 0xbe, 0x56, 0xfe, 0x1f, 0x14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0x2f, 0xe0, 0xff, 0xff, 0xff, 0x56, 0x55, 0xf9, 0xff, 0xff, 0xbf, 0x80, 0xff, 0x07,
0xfc, 0xff, 0xff, 0x6f, 0x55, 0xe5, 0xff, 0xff, 0xff, 0x03, 0xfd, 0xff, 0x40, 0xff, 0xff, 0xff,
0x1b, 0x94, 0xff, 0xff, 0xff, 0x1f, 0xf0, 0xff, 0x2f, 0xd0, 0xff, 0xff, 0xbf, 0x41, 0xfa, 0xff,
0xff, 0x7f, 0x80, 0xff, 0xff, 0x07, 0xf8, 0xff, 0xff, 0x5f, 0xe5, 0xff, 0xff, 0xff, 0x02, 0xfd,
0xff, 0xff, 0x01, 0xfd, 0xff, 0xff, 0x96, 0xff, 0xff, 0xff, 0x07, 0xf4, 0xff, 0xff, 0x7f, 0x40,
0xff, 0xff, 0xaf, 0xfe, 0xff, 0xff, 0x1f, 0xd0, 0xff, 0xff, 0xff, 0x1f, 0x80, 0xff, 0xff, 0xff,
0xff, 0xff, 0x2f, 0x40, 0xff, 0xff, 0xff, 0xff, 0x07, 0x90, 0xff, 0xff, 0xff, 0xff, 0x6f, 0x00,
0xfd, 0xff, 0xff, 0xff, 0xff, 0x02, 0x90, 0xff, 0xff, 0xff, 0x6f, 0x00, 0xf8, 0xff, 0xff, 0xff,
0xff, 0xff, 0x01, 0x40, 0xe9, 0xbf, 0x16, 0x00, 0xf4, 0xff, 0xff, 0xff, 0xff, 0xff, 0xbf, 0x01,
0x00, 0x00, 0x00, 0x00, 0xe4, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00,
0xf4, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x5a, 0x00, 0x50, 0xfa, 0xff, 0xff, 0xff,
0xff, };

#ifdef OS_IO_SEPROXYHAL
#include "os_io_seproxyhal.h"
const bagl_icon_details_t C_badge_tron = { GLYPH_badge_tron_WIDTH, GLYPH_badge_tron_HEIGHT, 2, C_badge_tron_colors, C_badge_tron_bitmap };
#endif // OS_IO_SEPROXYHAL
#include "glyphs.h"
unsigned int const C_icon_colors[]
= {
0x00000000,
Expand Down
30 changes: 30 additions & 0 deletions src/glyphs.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,33 @@
#ifndef GLYPH_badge_transaction_BPP
#define GLYPH_badge_transaction_WIDTH 50
#define GLYPH_badge_transaction_HEIGHT 50
#define GLYPH_badge_transaction_BPP 2
extern
unsigned int const C_badge_transaction_colors[]
;
extern
unsigned char const C_badge_transaction_bitmap[];
#ifdef OS_IO_SEPROXYHAL
#include "os_io_seproxyhal.h"
extern
const bagl_icon_details_t C_badge_transaction;
#endif // GLYPH_badge_transaction_BPP
#endif // OS_IO_SEPROXYHAL
#ifndef GLYPH_badge_tron_BPP
#define GLYPH_badge_tron_WIDTH 50
#define GLYPH_badge_tron_HEIGHT 50
#define GLYPH_badge_tron_BPP 2
extern
unsigned int const C_badge_tron_colors[]
;
extern
unsigned char const C_badge_tron_bitmap[];
#ifdef OS_IO_SEPROXYHAL
#include "os_io_seproxyhal.h"
extern
const bagl_icon_details_t C_badge_tron;
#endif // GLYPH_badge_tron_BPP
#endif // OS_IO_SEPROXYHAL
#ifndef GLYPH_icon_BPP
#define GLYPH_icon_WIDTH 16
#define GLYPH_icon_HEIGHT 16
Expand Down
Loading

0 comments on commit feb6728

Please sign in to comment.