Skip to content

Commit 0aa5b7b

Browse files
authored
Fix for #153 (#154)
1 parent 3538f31 commit 0aa5b7b

8 files changed

+21
-21
lines changed

build.ps1

+4-4
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ function Get-LatestDirectory {
1313

1414
$build_commands = @(
1515
[PSCustomObject]@{
16-
Name = "Official Dev \ Unleashed";
16+
Name = "Official Dev";
1717
FbtSwitch = "od";
1818
FirmwarePath = "flipperzero-firmware_official_dev";
19-
ArtifactName = "totp_official-dev_unleashed_fw{FEATURES_SUFFIX}.fap";
19+
ArtifactName = "totp_official-dev_fw{FEATURES_SUFFIX}.fap";
2020
}
2121
[PSCustomObject]@{
2222
Name = "Official Stable";
@@ -25,10 +25,10 @@ $build_commands = @(
2525
ArtifactName = "totp_official-stable_fw{FEATURES_SUFFIX}.fap";
2626
}
2727
[PSCustomObject]@{
28-
Name = "Xtreme";
28+
Name = "Xtreme \ Unleashed";
2929
FbtSwitch = "x";
3030
FirmwarePath = "flipperzero-firmware_xtreme";
31-
ArtifactName = "totp_xtreme_fw{FEATURES_SUFFIX}.fap";
31+
ArtifactName = "totp_xtreme_unleashed_fw{FEATURES_SUFFIX}.fap";
3232
}
3333
)
3434

fbt.ps1

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ elseif (('official-stable', 'off-stbl', 'os').Contains($args[0])) {
1515
} elseif (('xtreme', 'xt', 'x').Contains($args[0])) {
1616
$firmware_path = "flipperzero-firmware_xtreme"
1717
$firmware_name = "Xtreme"
18-
$FW_CDEF = "TOTP_FIRMWARE_XTREME"
18+
$FW_CDEF = "TOTP_FIRMWARE_XTREME_UL"
1919
}
2020
else {
2121
throw "Unable to recognize which firmware to use"

flipperzero-firmware_official_dev

totp/features_config.h

+5-5
Original file line numberDiff line numberDiff line change
@@ -11,22 +11,22 @@
1111
// List of compatible firmwares
1212
#define TOTP_FIRMWARE_OFFICIAL_STABLE (1)
1313
#define TOTP_FIRMWARE_OFFICIAL_DEV (2)
14-
#define TOTP_FIRMWARE_XTREME (3)
14+
#define TOTP_FIRMWARE_XTREME_UL (3)
1515
// End of list
1616

1717
// Checking FlipC.org definitions (https://github.com/playmean/fap-list/issues/9)
1818
#if defined(TARGET_FIRMWARE_OFFICIAL)
1919
#define TOTP_TARGET_FIRMWARE TOTP_FIRMWARE_OFFICIAL_STABLE
2020
#elif defined(TARGET_FIRMWARE_UNLEASHED)
21-
#define TOTP_TARGET_FIRMWARE TOTP_FIRMWARE_OFFICIAL_DEV
21+
#define TOTP_TARGET_FIRMWARE TOTP_FIRMWARE_XTREME_UL
2222
#elif defined(TARGET_FIRMWARE_XTREME)
23-
#define TOTP_TARGET_FIRMWARE TOTP_FIRMWARE_XTREME
23+
#define TOTP_TARGET_FIRMWARE TOTP_FIRMWARE_XTREME_UL
2424
#endif
2525
// End of FlipC.org definition checks
2626

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

3232
// List of available font for TOTP code

totp/services/crypto/crypto.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ CryptoSeedIVResult
9090
max_i = uid_size;
9191
}
9292

93-
const uint8_t* uid = furi_hal_version_uid();
93+
const uint8_t* uid = (const uint8_t*)UID64_BASE;
9494
for(uint8_t i = 0; i < max_i; i++) {
9595
plugin_state->iv[i] = plugin_state->iv[i] ^ uid[i];
9696
}

totp/workers/bt_type_code/bt_type_code.c

+7-7
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
#include "../type-code-common.h"
1414
#include "../../features_config.h"
1515

16-
#if TOTP_TARGET_FIRMWARE == TOTP_FIRMWARE_XTREME
16+
#if TOTP_TARGET_FIRMWARE == TOTP_FIRMWARE_XTREME_UL
1717
#define TOTP_BT_WORKER_BT_ADV_NAME_MAX_LEN FURI_HAL_BT_ADV_NAME_LENGTH
1818
#define TOTP_BT_WORKER_BT_MAC_ADDRESS_LEN GAP_MAC_ADDR_SIZE
1919
#endif
@@ -29,7 +29,7 @@ struct TotpBtTypeCodeWorkerContext {
2929
Bt* bt;
3030
bool is_advertising;
3131
bool is_connected;
32-
#if TOTP_TARGET_FIRMWARE == TOTP_FIRMWARE_XTREME
32+
#if TOTP_TARGET_FIRMWARE == TOTP_FIRMWARE_XTREME_UL
3333
char previous_bt_name[TOTP_BT_WORKER_BT_ADV_NAME_MAX_LEN];
3434
uint8_t previous_bt_mac[TOTP_BT_WORKER_BT_MAC_ADDRESS_LEN];
3535
#endif
@@ -39,7 +39,7 @@ static inline bool totp_type_code_worker_stop_requested() {
3939
return furi_thread_flags_get() & TotpBtTypeCodeWorkerEventStop;
4040
}
4141

42-
#if TOTP_TARGET_FIRMWARE == TOTP_FIRMWARE_XTREME
42+
#if TOTP_TARGET_FIRMWARE == TOTP_FIRMWARE_XTREME_UL
4343
static void totp_type_code_worker_bt_set_app_mac(uint8_t* mac) {
4444
uint8_t max_i;
4545
size_t uid_size = furi_hal_version_uid_size();
@@ -49,7 +49,7 @@ static void totp_type_code_worker_bt_set_app_mac(uint8_t* mac) {
4949
max_i = TOTP_BT_WORKER_BT_MAC_ADDRESS_LEN;
5050
}
5151

52-
const uint8_t* uid = furi_hal_version_uid();
52+
const uint8_t* uid = (const uint8_t*)UID64_BASE;
5353
memcpy(mac, uid, max_i);
5454
for(uint8_t i = max_i; i < TOTP_BT_WORKER_BT_MAC_ADDRESS_LEN; i++) {
5555
mac[i] = 0;
@@ -161,7 +161,7 @@ TotpBtTypeCodeWorkerContext* totp_bt_type_code_worker_init() {
161161
furi_delay_ms(200);
162162
bt_keys_storage_set_storage_path(context->bt, HID_BT_KEYS_STORAGE_PATH);
163163

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

185185
furi_hal_bt_start_advertising();
186186

187-
#if TOTP_TARGET_FIRMWARE == TOTP_FIRMWARE_XTREME
187+
#if TOTP_TARGET_FIRMWARE == TOTP_FIRMWARE_XTREME_UL
188188
bt_enable_peer_key_update(context->bt);
189189
#endif
190190

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

214-
#if TOTP_TARGET_FIRMWARE == TOTP_FIRMWARE_XTREME
214+
#if TOTP_TARGET_FIRMWARE == TOTP_FIRMWARE_XTREME_UL
215215
furi_hal_bt_set_profile_adv_name(FuriHalBtProfileHidKeyboard, context->previous_bt_name);
216216
furi_hal_bt_set_profile_mac_addr(FuriHalBtProfileHidKeyboard, context->previous_bt_mac);
217217
#endif

0 commit comments

Comments
 (0)