Skip to content

Commit

Permalink
Fix for #153 (#154)
Browse files Browse the repository at this point in the history
  • Loading branch information
akopachov authored Jun 5, 2023
1 parent 3538f31 commit 0aa5b7b
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 21 deletions.
8 changes: 4 additions & 4 deletions build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ function Get-LatestDirectory {

$build_commands = @(
[PSCustomObject]@{
Name = "Official Dev \ Unleashed";
Name = "Official Dev";
FbtSwitch = "od";
FirmwarePath = "flipperzero-firmware_official_dev";
ArtifactName = "totp_official-dev_unleashed_fw{FEATURES_SUFFIX}.fap";
ArtifactName = "totp_official-dev_fw{FEATURES_SUFFIX}.fap";
}
[PSCustomObject]@{
Name = "Official Stable";
Expand All @@ -25,10 +25,10 @@ $build_commands = @(
ArtifactName = "totp_official-stable_fw{FEATURES_SUFFIX}.fap";
}
[PSCustomObject]@{
Name = "Xtreme";
Name = "Xtreme \ Unleashed";
FbtSwitch = "x";
FirmwarePath = "flipperzero-firmware_xtreme";
ArtifactName = "totp_xtreme_fw{FEATURES_SUFFIX}.fap";
ArtifactName = "totp_xtreme_unleashed_fw{FEATURES_SUFFIX}.fap";
}
)

Expand Down
2 changes: 1 addition & 1 deletion fbt.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ elseif (('official-stable', 'off-stbl', 'os').Contains($args[0])) {
} elseif (('xtreme', 'xt', 'x').Contains($args[0])) {
$firmware_path = "flipperzero-firmware_xtreme"
$firmware_name = "Xtreme"
$FW_CDEF = "TOTP_FIRMWARE_XTREME"
$FW_CDEF = "TOTP_FIRMWARE_XTREME_UL"
}
else {
throw "Unable to recognize which firmware to use"
Expand Down
2 changes: 1 addition & 1 deletion flipperzero-firmware_official_dev
Submodule flipperzero-firmware_official_dev updated 69 files
+52 −9 applications/debug/unit_tests/nfc/nfc_test.c
+0 −30 applications/external/nfc_magic/lib/magic/classic_gen1.c
+0 −2 applications/external/nfc_magic/lib/magic/classic_gen1.h
+0 −175 applications/external/nfc_magic/lib/magic/magic.c
+45 −21 applications/external/nfc_magic/nfc_magic_worker.c
+1 −0 applications/main/subghz/helpers/subghz_error_type.h
+22 −11 applications/main/subghz/scenes/subghz_scene_rpc.c
+10 −7 applications/main/subghz/subghz_cli.c
+ assets/dolphin/external/L1_Kaiju_128x64/frame_0.png
+ assets/dolphin/external/L1_Kaiju_128x64/frame_1.png
+ assets/dolphin/external/L1_Kaiju_128x64/frame_10.png
+ assets/dolphin/external/L1_Kaiju_128x64/frame_11.png
+ assets/dolphin/external/L1_Kaiju_128x64/frame_12.png
+ assets/dolphin/external/L1_Kaiju_128x64/frame_13.png
+ assets/dolphin/external/L1_Kaiju_128x64/frame_14.png
+ assets/dolphin/external/L1_Kaiju_128x64/frame_15.png
+ assets/dolphin/external/L1_Kaiju_128x64/frame_16.png
+ assets/dolphin/external/L1_Kaiju_128x64/frame_17.png
+ assets/dolphin/external/L1_Kaiju_128x64/frame_18.png
+ assets/dolphin/external/L1_Kaiju_128x64/frame_19.png
+ assets/dolphin/external/L1_Kaiju_128x64/frame_2.png
+ assets/dolphin/external/L1_Kaiju_128x64/frame_20.png
+ assets/dolphin/external/L1_Kaiju_128x64/frame_21.png
+ assets/dolphin/external/L1_Kaiju_128x64/frame_22.png
+ assets/dolphin/external/L1_Kaiju_128x64/frame_23.png
+ assets/dolphin/external/L1_Kaiju_128x64/frame_24.png
+ assets/dolphin/external/L1_Kaiju_128x64/frame_25.png
+ assets/dolphin/external/L1_Kaiju_128x64/frame_26.png
+ assets/dolphin/external/L1_Kaiju_128x64/frame_27.png
+ assets/dolphin/external/L1_Kaiju_128x64/frame_28.png
+ assets/dolphin/external/L1_Kaiju_128x64/frame_29.png
+ assets/dolphin/external/L1_Kaiju_128x64/frame_3.png
+ assets/dolphin/external/L1_Kaiju_128x64/frame_30.png
+ assets/dolphin/external/L1_Kaiju_128x64/frame_31.png
+ assets/dolphin/external/L1_Kaiju_128x64/frame_32.png
+ assets/dolphin/external/L1_Kaiju_128x64/frame_33.png
+ assets/dolphin/external/L1_Kaiju_128x64/frame_34.png
+ assets/dolphin/external/L1_Kaiju_128x64/frame_35.png
+ assets/dolphin/external/L1_Kaiju_128x64/frame_36.png
+ assets/dolphin/external/L1_Kaiju_128x64/frame_37.png
+ assets/dolphin/external/L1_Kaiju_128x64/frame_38.png
+ assets/dolphin/external/L1_Kaiju_128x64/frame_39.png
+ assets/dolphin/external/L1_Kaiju_128x64/frame_4.png
+ assets/dolphin/external/L1_Kaiju_128x64/frame_40.png
+ assets/dolphin/external/L1_Kaiju_128x64/frame_41.png
+ assets/dolphin/external/L1_Kaiju_128x64/frame_42.png
+ assets/dolphin/external/L1_Kaiju_128x64/frame_43.png
+ assets/dolphin/external/L1_Kaiju_128x64/frame_44.png
+ assets/dolphin/external/L1_Kaiju_128x64/frame_45.png
+ assets/dolphin/external/L1_Kaiju_128x64/frame_46.png
+ assets/dolphin/external/L1_Kaiju_128x64/frame_47.png
+ assets/dolphin/external/L1_Kaiju_128x64/frame_5.png
+ assets/dolphin/external/L1_Kaiju_128x64/frame_6.png
+ assets/dolphin/external/L1_Kaiju_128x64/frame_7.png
+ assets/dolphin/external/L1_Kaiju_128x64/frame_8.png
+ assets/dolphin/external/L1_Kaiju_128x64/frame_9.png
+50 −0 assets/dolphin/external/L1_Kaiju_128x64/meta.txt
+7 −0 assets/dolphin/external/manifest.txt
+20 −1 firmware/targets/f18/api_symbols.csv
+2 −1 firmware/targets/f7/api_symbols.csv
+2 −0 firmware/targets/f7/furi_hal/furi_hal_bt.c
+22 −22 firmware/targets/f7/furi_hal/furi_hal_bus.c
+1 −0 firmware/targets/f7/target.json
+1 −0 lib/ReadMe.md
+1 −1 lib/SConscript
+20 −0 lib/digital_signal/SConscript
+1 −2 lib/digital_signal/digital_signal.c
+0 −2 lib/misc.scons
+2 −2 scripts/flipper/assets/dolphin.py
2 changes: 1 addition & 1 deletion flipperzero-firmware_official_stable
2 changes: 1 addition & 1 deletion flipperzero-firmware_xtreme
10 changes: 5 additions & 5 deletions totp/features_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,22 @@
// List of compatible firmwares
#define TOTP_FIRMWARE_OFFICIAL_STABLE (1)
#define TOTP_FIRMWARE_OFFICIAL_DEV (2)
#define TOTP_FIRMWARE_XTREME (3)
#define TOTP_FIRMWARE_XTREME_UL (3)
// End of list

// Checking FlipC.org definitions (https://github.com/playmean/fap-list/issues/9)
#if defined(TARGET_FIRMWARE_OFFICIAL)
#define TOTP_TARGET_FIRMWARE TOTP_FIRMWARE_OFFICIAL_STABLE
#elif defined(TARGET_FIRMWARE_UNLEASHED)
#define TOTP_TARGET_FIRMWARE TOTP_FIRMWARE_OFFICIAL_DEV
#define TOTP_TARGET_FIRMWARE TOTP_FIRMWARE_XTREME_UL
#elif defined(TARGET_FIRMWARE_XTREME)
#define TOTP_TARGET_FIRMWARE TOTP_FIRMWARE_XTREME
#define TOTP_TARGET_FIRMWARE TOTP_FIRMWARE_XTREME_UL
#endif
// End of FlipC.org definition checks

// If target firmware is not yet set, default it to Xtreme as I'm using it, and it is cool :)
// If target firmware is not yet set, default it to Xtreme\Unleashed as I'm using it, and it is cool :)
#ifndef TOTP_TARGET_FIRMWARE
#define TOTP_TARGET_FIRMWARE TOTP_FIRMWARE_XTREME
#define TOTP_TARGET_FIRMWARE TOTP_FIRMWARE_XTREME_UL
#endif

// List of available font for TOTP code
Expand Down
2 changes: 1 addition & 1 deletion totp/services/crypto/crypto.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ CryptoSeedIVResult
max_i = uid_size;
}

const uint8_t* uid = furi_hal_version_uid();
const uint8_t* uid = (const uint8_t*)UID64_BASE;
for(uint8_t i = 0; i < max_i; i++) {
plugin_state->iv[i] = plugin_state->iv[i] ^ uid[i];
}
Expand Down
14 changes: 7 additions & 7 deletions totp/workers/bt_type_code/bt_type_code.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include "../type-code-common.h"
#include "../../features_config.h"

#if TOTP_TARGET_FIRMWARE == TOTP_FIRMWARE_XTREME
#if TOTP_TARGET_FIRMWARE == TOTP_FIRMWARE_XTREME_UL
#define TOTP_BT_WORKER_BT_ADV_NAME_MAX_LEN FURI_HAL_BT_ADV_NAME_LENGTH
#define TOTP_BT_WORKER_BT_MAC_ADDRESS_LEN GAP_MAC_ADDR_SIZE
#endif
Expand All @@ -29,7 +29,7 @@ struct TotpBtTypeCodeWorkerContext {
Bt* bt;
bool is_advertising;
bool is_connected;
#if TOTP_TARGET_FIRMWARE == TOTP_FIRMWARE_XTREME
#if TOTP_TARGET_FIRMWARE == TOTP_FIRMWARE_XTREME_UL
char previous_bt_name[TOTP_BT_WORKER_BT_ADV_NAME_MAX_LEN];
uint8_t previous_bt_mac[TOTP_BT_WORKER_BT_MAC_ADDRESS_LEN];
#endif
Expand All @@ -39,7 +39,7 @@ static inline bool totp_type_code_worker_stop_requested() {
return furi_thread_flags_get() & TotpBtTypeCodeWorkerEventStop;
}

#if TOTP_TARGET_FIRMWARE == TOTP_FIRMWARE_XTREME
#if TOTP_TARGET_FIRMWARE == TOTP_FIRMWARE_XTREME_UL
static void totp_type_code_worker_bt_set_app_mac(uint8_t* mac) {
uint8_t max_i;
size_t uid_size = furi_hal_version_uid_size();
Expand All @@ -49,7 +49,7 @@ static void totp_type_code_worker_bt_set_app_mac(uint8_t* mac) {
max_i = TOTP_BT_WORKER_BT_MAC_ADDRESS_LEN;
}

const uint8_t* uid = furi_hal_version_uid();
const uint8_t* uid = (const uint8_t*)UID64_BASE;
memcpy(mac, uid, max_i);
for(uint8_t i = max_i; i < TOTP_BT_WORKER_BT_MAC_ADDRESS_LEN; i++) {
mac[i] = 0;
Expand Down Expand Up @@ -161,7 +161,7 @@ TotpBtTypeCodeWorkerContext* totp_bt_type_code_worker_init() {
furi_delay_ms(200);
bt_keys_storage_set_storage_path(context->bt, HID_BT_KEYS_STORAGE_PATH);

#if TOTP_TARGET_FIRMWARE == TOTP_FIRMWARE_XTREME
#if TOTP_TARGET_FIRMWARE == TOTP_FIRMWARE_XTREME_UL
memcpy(
&context->previous_bt_name[0],
furi_hal_bt_get_profile_adv_name(FuriHalBtProfileHidKeyboard),
Expand All @@ -184,7 +184,7 @@ TotpBtTypeCodeWorkerContext* totp_bt_type_code_worker_init() {

furi_hal_bt_start_advertising();

#if TOTP_TARGET_FIRMWARE == TOTP_FIRMWARE_XTREME
#if TOTP_TARGET_FIRMWARE == TOTP_FIRMWARE_XTREME_UL
bt_enable_peer_key_update(context->bt);
#endif

Expand All @@ -211,7 +211,7 @@ void totp_bt_type_code_worker_free(TotpBtTypeCodeWorkerContext* context) {
furi_delay_ms(200);
bt_keys_storage_set_default_path(context->bt);

#if TOTP_TARGET_FIRMWARE == TOTP_FIRMWARE_XTREME
#if TOTP_TARGET_FIRMWARE == TOTP_FIRMWARE_XTREME_UL
furi_hal_bt_set_profile_adv_name(FuriHalBtProfileHidKeyboard, context->previous_bt_name);
furi_hal_bt_set_profile_mac_addr(FuriHalBtProfileHidKeyboard, context->previous_bt_mac);
#endif
Expand Down

0 comments on commit 0aa5b7b

Please sign in to comment.