From 82465b0c8a96ce59bde9fc6e153beb6ef76f4508 Mon Sep 17 00:00:00 2001 From: Francois Beutin Date: Thu, 23 Oct 2025 19:03:13 +0200 Subject: [PATCH 1/3] Remove NanoS and add Apex P --- Makefile | 12 +++--------- glyphs/icon_apex_p_48.png | Bin 0 -> 415 bytes icons/apex_p_icon.png | Bin 0 -> 4974 bytes ledger_app.toml | 2 +- src/addr.c | 18 ------------------ src/common/main.c | 1 + src/common/tx.c | 7 +------ src/crypto.c | 2 +- src/crypto.h | 2 +- src/json/json_parser.h | 6 ------ 10 files changed, 8 insertions(+), 42 deletions(-) create mode 100644 glyphs/icon_apex_p_48.png create mode 100644 icons/apex_p_icon.png diff --git a/Makefile b/Makefile index f6ff0d10..3fd717fc 100644 --- a/Makefile +++ b/Makefile @@ -29,7 +29,7 @@ include $(BOLOS_SDK)/Makefile.defines APPNAME = "Flow" APPVERSION_M=0 -APPVERSION_N=15 +APPVERSION_N=16 APPVERSION_P=0 APPVERSION = "$(APPVERSION_M).$(APPVERSION_N).$(APPVERSION_P)" @@ -49,6 +49,7 @@ ICON_NANOX = icons/nanox_icon.gif ICON_NANOSP = icons/nanox_icon.gif ICON_STAX = icons/stax_icon.gif ICON_FLEX = icons/flex_icon.png +ICON_APEX_P = icons/apex_p_icon.png # Application allowed derivation curves. # Possibles curves are: secp256k1, secp256r1, ed25519 and bls12381g1 @@ -105,15 +106,12 @@ ENABLE_BLUETOOTH = 1 ######################################## # These advanced settings allow to disable some feature that are by # default enabled in the SDK `Makefile.standard_app`. -DISABLE_STANDARD_APP_FILES = 1 +# DISABLE_STANDARD_APP_FILES = 1 #DISABLE_DEFAULT_IO_SEPROXY_BUFFER_SIZE = 1 # To allow custom size declaration #DISABLE_STANDARD_APP_DEFINES = 1 # Will set all the following disablers #DISABLE_STANDARD_SNPRINTF = 1 #DISABLE_STANDARD_USB = 1 #DISABLE_STANDARD_WEBUSB = 1 -ifeq ($(TARGET_NAME),TARGET_NANOS) -DISABLE_STANDARD_BAGL_UX_FLOW = 1 -endif ######################################## # Main app configuration # @@ -122,10 +120,6 @@ endif DEFINES += HAVE_BOLOS_APP_STACK_CANARY DEFINES += LEDGER_SPECIFIC -ifeq ($(TARGET_NAME),TARGET_NANOS) -APP_STACK_MIN_SIZE:=2480 -endif - ######################################## # Unit tests and misc # ######################################## diff --git a/glyphs/icon_apex_p_48.png b/glyphs/icon_apex_p_48.png new file mode 100644 index 0000000000000000000000000000000000000000..b2378b21eed0c511597ccbc29ff56387d77ddcb5 GIT binary patch literal 415 zcmeAS@N?(olHy`uVBq!ia0vp^1|ZDA3?vioaBc-sEa{HEjtmSN`?>!lvI6-E$sR$z z3=CCj3=9n|3=F@3LJcn%7)pT}UnMXwSj}Ky5HFasE6@fg!4}{X;`;ULSAKr}v-*Df zfFg`Z-tI1p|Cw~}0Xgg?p1!W^FS*18WH^83Tzmo)n&#=^7~*mK?v#Uk2NXD*U;h99 zMbCSir)Ejv^smdlaeAmcT7F3Lylu*alv}1u5iBj+7#iF;q*bphHEBE5$Y_)v*2ew9 zU32pphu~{fVeLnG7}%%9l^&=~XKLX*a{a(oseO}n%rRfYm?SLFpTw2$#r?)ZnGU0~ zhvwUJN+rBBi>fz2apR5gTYZM=JJVe>W`670Qg-j?{Fe-u)tK)s^5X0Px=^*mHKHUX zu_V85nr-MOLF|$jwj5OsmAL!6NwK Qai9hUPgg&ebxsLQ0NZ|uzW@LL literal 0 HcmV?d00001 diff --git a/icons/apex_p_icon.png b/icons/apex_p_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..6ee29509a28c69d6bb25025deb4dbedd7bea7550 GIT binary patch literal 4974 zcmeH~X;f3!7RM75LDV9Hf`}Sos|aMg2}!O51Og#K7$XAWd)(ySKqQk%AOQ<16~tbTFDS{wgB={y6-}rIhQ*f;71P(W@E?pF(i$wGUwMHeC$uWX1O^p#S zgG`FU8CvVNB^Ot+Cua{QPpcmP;gAcZA>rfD{)A$mrHi`q^X(7zaK=rO%VTS9&R@7- z=kQQlw*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*O9Vel}m zL?ct{WGW@W$V9}d6djjH1mlEP`6<*w;cL87JE{WEgJM9`6dIXIQ79;5XJ~Z+sQ@yX z(BIC`ioov_B@)xBQZy1QAQe;U=8i@11;X&x1Y=2wGKJby6cF#NV5sD^pE^Y&H~F9v z3MR)C0ICJ~(cbdc$)s<@dMh{Mh^d^hiGXmg`EPl@s@>!ayo5rSr;?-?g9> zRY_zhY`Vml7=tNhb4V;E${{hBbSepvfGbagWn3nPm__v*gAypUIz%bKj3@vn%K!&M zF(wtIF-bHD!XhywOo${FixCooh0^FO)RXDy$sU6U)5t(qBJ#0W8Br)eAqa$eB4RcP z1yB-$2D0JMSyU3rKoJbVP^p;8F`0Q-guxI{Xc`o z0*lfiM$u?2PZ}Na^rS%$6@uurH%`%*MhhCw$fQxp&fX0z2kVK54RwkOJ z7?%YG#Qf@;A+x%!Q0;YB+Muv zl@8j0N}@v|8XKlVFa)_%=`fW_q>L6!G4ASD6?;+sM-wlT!2_>2}}b z=9_zv>aIlD6}s1SX5PX7`yfyLQ4M}$(DtMPUSyUHx;>B`ox4hXEB0PqUi#O|`uj?^ vI?yzh9pB*Hw8>`TvOi`HJZqV#605E3T{2<091OUU{!Z$Wbt literal 0 HcmV?d00001 diff --git a/ledger_app.toml b/ledger_app.toml index d29d3583..df09cecb 100644 --- a/ledger_app.toml +++ b/ledger_app.toml @@ -1,7 +1,7 @@ [app] build_directory = "./" sdk = "C" -devices = ["nanos+", "nanox", "stax", "flex"] +devices = ["nanos+", "nanox", "stax", "flex", "apex_p"] [tests] unit_directory = "./unit-tests/" diff --git a/src/addr.c b/src/addr.c index 13054977..25c3000c 100644 --- a/src/addr.c +++ b/src/addr.c @@ -71,17 +71,12 @@ zxerr_t addr_getItem_internal(int8_t *displayIdx, pageString(outVal, outValLen, "account data.", pageIdx, pageCount); return zxerr_ok; case SHOW_ADDRESS_EMPTY_SLOT: -#if defined(TARGET_NANOS) - snprintf(outKey, outKeyLen, "Account data"); - pageString(outVal, outValLen, "not saved on the device.", pageIdx, pageCount); -#else snprintf(outKey, outKeyLen, "Address:"); pageString(outVal, outValLen, "Account data not saved on the device.", pageIdx, pageCount); -#endif return zxerr_ok; case SHOW_ADDRESS_HDPATHS_NOT_EQUAL: snprintf(outKey, outKeyLen, "Address:"); @@ -107,24 +102,12 @@ zxerr_t addr_getItem_internal(int8_t *displayIdx, } SCREEN(show_address_yes) { -#if defined(TARGET_NANOS) - snprintf(outKey, outKeyLen, "Verify if this"); - snprintf(outVal, outValLen, " public key was added to"); -#else snprintf(outKey, outKeyLen, "Warning:"); snprintf(outVal, outValLen, "Verify if this public key was added to"); -#endif return zxerr_ok; } SCREEN(show_address_yes) { -#if defined(TARGET_NANOS) - array_to_hexstr(outKey, - outKeyLen, - address_to_display.data, - sizeof(address_to_display.data)); - snprintf(outVal, outValLen, " using any Flow blockch. explorer."); -#else char buffer[2 * sizeof(address_to_display.data) + 1]; array_to_hexstr(buffer, sizeof(buffer), @@ -132,7 +115,6 @@ zxerr_t addr_getItem_internal(int8_t *displayIdx, sizeof(address_to_display.data)); snprintf(outVal, outValLen, "%s using any Flow blockchain explorer.", buffer); snprintf(outKey, outKeyLen, ""); -#endif return zxerr_ok; } diff --git a/src/common/main.c b/src/common/main.c index 3e408e7f..767734fa 100644 --- a/src/common/main.c +++ b/src/common/main.c @@ -31,6 +31,7 @@ __attribute__((section(".boot"))) int main(void) { app_main(); } CATCH_OTHER(e) { + UNUSED(e); } FINALLY { } diff --git a/src/common/tx.c b/src/common/tx.c index 086cf6a2..20fcb32b 100644 --- a/src/common/tx.c +++ b/src/common/tx.c @@ -22,13 +22,8 @@ #include "zxmacros.h" #include "app_mode.h" -#if defined(TARGET_NANOX) || defined(TARGET_NANOS2) || defined(TARGET_STAX) || defined(TARGET_FLEX) #define RAM_BUFFER_SIZE 8192 #define FLASH_BUFFER_SIZE 16384 -#elif defined(TARGET_NANOS) -#define RAM_BUFFER_SIZE 0 -#define FLASH_BUFFER_SIZE 8192 -#endif // Ram uint8_t ram_buffer[RAM_BUFFER_SIZE]; @@ -39,7 +34,7 @@ typedef struct { } storage_t; #if defined(TARGET_NANOS) || defined(TARGET_NANOX) || defined(TARGET_NANOS2) || \ - defined(TARGET_STAX) || defined(TARGET_FLEX) + defined(TARGET_STAX) || defined(TARGET_FLEX) || defined(TARGET_APEX_P) storage_t NV_CONST N_appdata_impl __attribute__((aligned(64))); #define N_appdata (*(NV_VOLATILE storage_t *) PIC(&N_appdata_impl)) #endif diff --git a/src/crypto.c b/src/crypto.c index a3399162..2d4d8fd8 100644 --- a/src/crypto.c +++ b/src/crypto.c @@ -22,7 +22,7 @@ #include "zxerror.h" #if defined(TARGET_NANOS) || defined(TARGET_NANOX) || defined(TARGET_NANOS2) || \ - defined(TARGET_STAX) || defined(TARGET_FLEX) + defined(TARGET_STAX) || defined(TARGET_FLEX) || defined(TARGET_APEX_P) #include "lib_standard_app/crypto_helpers.h" #include "cx.h" diff --git a/src/crypto.h b/src/crypto.h index 7b9692d4..287c52b6 100644 --- a/src/crypto.h +++ b/src/crypto.h @@ -31,7 +31,7 @@ typedef enum { HASH_UNKNOWN, HASH_SHA2_256, HASH_SHA3_256 } digest_type_e; typedef enum { CURVE_UNKNOWN, CURVE_SECP256K1, CURVE_SECP256R1 } curve_e; #if defined(TARGET_NANOS) || defined(TARGET_NANOX) || defined(TARGET_NANOS2) || \ - defined(TARGET_STAX) || defined(TARGET_FLEX) + defined(TARGET_STAX) || defined(TARGET_FLEX) || defined(TARGET_APEX_P) #else #define CX_SHA256_SIZE 32 #define CX_SHA3_256_SIZE 32 diff --git a/src/json/json_parser.h b/src/json/json_parser.h index dbdfbeff..d8b9b4a0 100644 --- a/src/json/json_parser.h +++ b/src/json/json_parser.h @@ -29,12 +29,6 @@ extern "C" { /// Max number of accepted tokens in the JSON input #define MAX_NUMBER_OF_TOKENS 256 -// we must limit the number -#if defined(TARGET_NANOS) -#undef MAX_NUMBER_OF_TOKENS -#define MAX_NUMBER_OF_TOKENS 128 -#endif - #define ROOT_TOKEN_INDEX 0 //--------------------------------------------- From 4cf5c5cc5bcffe5a1c7a1b50cff3d43258a64cc0 Mon Sep 17 00:00:00 2001 From: Francois Beutin Date: Thu, 23 Oct 2025 19:08:29 +0200 Subject: [PATCH 2/3] Bump github actions --- .github/workflows/codeql_checks.yml | 2 +- .github/workflows/documentation_generation.yml | 4 ++-- .github/workflows/js_tests.yml | 4 ++-- .github/workflows/misspellings_checks.yml | 2 +- .github/workflows/python_client_checks.yml | 4 ++-- .github/workflows/unit_tests.yml | 8 ++++---- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/codeql_checks.yml b/.github/workflows/codeql_checks.yml index 8b535779..b7d27944 100644 --- a/.github/workflows/codeql_checks.yml +++ b/.github/workflows/codeql_checks.yml @@ -27,7 +27,7 @@ jobs: steps: - name: Clone - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: submodules: recursive diff --git a/.github/workflows/documentation_generation.yml b/.github/workflows/documentation_generation.yml index 7334769f..d99f72cf 100644 --- a/.github/workflows/documentation_generation.yml +++ b/.github/workflows/documentation_generation.yml @@ -18,14 +18,14 @@ jobs: steps: - name: Clone - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: submodules: recursive - name: HTML documentation run: doxygen .doxygen/Doxyfile - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: name: documentation path: doc/html diff --git a/.github/workflows/js_tests.yml b/.github/workflows/js_tests.yml index c427ca55..f9edea1e 100644 --- a/.github/workflows/js_tests.yml +++ b/.github/workflows/js_tests.yml @@ -13,9 +13,9 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Use Node.js 16 - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: 16 - run: cd js && yarn install && yarn build && yarn test diff --git a/.github/workflows/misspellings_checks.yml b/.github/workflows/misspellings_checks.yml index 6612d6fd..d0cf6e6a 100644 --- a/.github/workflows/misspellings_checks.yml +++ b/.github/workflows/misspellings_checks.yml @@ -19,7 +19,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Clone - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Check misspellings uses: codespell-project/actions-codespell@v2 diff --git a/.github/workflows/python_client_checks.yml b/.github/workflows/python_client_checks.yml index ce58b3cb..152bee11 100644 --- a/.github/workflows/python_client_checks.yml +++ b/.github/workflows/python_client_checks.yml @@ -20,7 +20,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Clone - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Installing PIP dependencies run: | pip install pylint @@ -34,7 +34,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Clone - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Installing PIP dependencies run: | pip install mypy diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index 3a63ea07..8c484b50 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -18,7 +18,7 @@ jobs: steps: - name: Clone - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Check directory run: | @@ -31,7 +31,7 @@ jobs: - name: Clone SDK if: ${{ env.DIR_OK == 'true' }} - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: repository: ledgerHQ/ledger-secure-sdk path: sdk @@ -53,7 +53,7 @@ jobs: lcov --directory . -b "$(realpath build/)" --remove coverage.info '*/unit-tests/*' -o coverage.info && \ genhtml coverage.info -o coverage - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 if: ${{ env.DIR_OK == 'true' }} with: name: code-coverage @@ -61,7 +61,7 @@ jobs: - name: Upload to codecov.io if: ${{ env.DIR_OK == 'true' }} - uses: codecov/codecov-action@v3 + uses: codecov/codecov-action@v4 with: token: ${{ secrets.CODECOV_TOKEN }} files: ./unit-tests/coverage.info From 536adc6e70d40d5f765c0b50bcc5516a4fe1dacb Mon Sep 17 00:00:00 2001 From: Francois Beutin Date: Thu, 23 Oct 2025 19:18:55 +0200 Subject: [PATCH 3/3] Use reusable codeQL workflow --- .github/workflows/codeql_checks.yml | 32 +++-------------------------- 1 file changed, 3 insertions(+), 29 deletions(-) diff --git a/.github/workflows/codeql_checks.yml b/.github/workflows/codeql_checks.yml index b7d27944..1c89d507 100644 --- a/.github/workflows/codeql_checks.yml +++ b/.github/workflows/codeql_checks.yml @@ -15,32 +15,6 @@ on: jobs: analyse: - name: Analyse - strategy: - matrix: - sdk: [ "$NANOS_SDK", "$NANOX_SDK", "$NANOSP_SDK", "$STAX_SDK", "$FLEX_SDK"] - #'cpp' covers C and C++ - language: [ 'cpp' ] - runs-on: ubuntu-latest - container: - image: ghcr.io/ledgerhq/ledger-app-builder/ledger-app-builder-legacy:latest - - steps: - - name: Clone - uses: actions/checkout@v4 - with: - submodules: recursive - - - name: Initialize CodeQL - uses: github/codeql-action/init@v2 - with: - languages: ${{ matrix.language }} - queries: security-and-quality - - # CodeQL will create the database during the compilation - - name: Build - run: | - make BOLOS_SDK=${{ matrix.sdk }} - - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v2 + name: Call Ledger CodeQL analysis + uses: LedgerHQ/ledger-app-workflows/.github/workflows/reusable_codeql_checks.yml@v1 + secrets: inherit