mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-06-07 19:01:54 -07:00
Use totp var for forgetting bt keys
This commit is contained in:
@@ -18,8 +18,6 @@
|
||||
#define TOTP_BT_WORKER_BT_MAC_ADDRESS_LEN GAP_MAC_ADDR_SIZE
|
||||
#endif
|
||||
|
||||
#define HID_BT_KEYS_STORAGE_PATH EXT_PATH("authenticator/.bt_hid.keys")
|
||||
|
||||
struct TotpBtTypeCodeWorkerContext {
|
||||
char* code_buffer;
|
||||
uint8_t code_buffer_size;
|
||||
@@ -159,7 +157,7 @@ TotpBtTypeCodeWorkerContext* totp_bt_type_code_worker_init() {
|
||||
bt_disconnect(context->bt);
|
||||
furi_hal_bt_reinit();
|
||||
furi_delay_ms(200);
|
||||
bt_keys_storage_set_storage_path(context->bt, HID_BT_KEYS_STORAGE_PATH);
|
||||
bt_keys_storage_set_storage_path(context->bt, TOTP_BT_KEYS_STORAGE_PATH);
|
||||
|
||||
#if TOTP_TARGET_FIRMWARE == TOTP_FIRMWARE_XTREME
|
||||
memcpy(
|
||||
@@ -227,4 +225,4 @@ void totp_bt_type_code_worker_free(TotpBtTypeCodeWorkerContext* context) {
|
||||
|
||||
bool totp_bt_type_code_worker_is_advertising(const TotpBtTypeCodeWorkerContext* context) {
|
||||
return context->is_advertising;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
#include <stdbool.h>
|
||||
#include <furi/core/mutex.h>
|
||||
|
||||
#define TOTP_BT_KEYS_STORAGE_PATH EXT_PATH("authenticator/.bt_hid.keys")
|
||||
|
||||
typedef uint8_t TotpBtTypeCodeWorkerEvent;
|
||||
|
||||
typedef struct TotpBtTypeCodeWorkerContext TotpBtTypeCodeWorkerContext;
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#include <furi_hal_bt.h>
|
||||
#include <applications/main/bad_kb/bad_kb_paths.h>
|
||||
#include <applications/external/hid_app/hid_path.h>
|
||||
#include <applications/external/totp/workers/bt_type_code/bt_type_code.h>
|
||||
|
||||
void bt_settings_scene_forget_dev_confirm_dialog_callback(DialogExResult result, void* context) {
|
||||
furi_assert(context);
|
||||
@@ -39,7 +40,7 @@ bool bt_settings_scene_forget_dev_confirm_on_event(void* context, SceneManagerEv
|
||||
storage_simply_remove(storage, BAD_KB_KEYS_PATH);
|
||||
storage_simply_remove(
|
||||
storage, EXT_PATH("apps_data/hid_ble/") HID_BT_KEYS_STORAGE_NAME);
|
||||
storage_simply_remove(storage, EXT_PATH("authenticator/.bt_hid.keys"));
|
||||
storage_simply_remove(storage, TOTP_BT_KEYS_STORAGE_PATH);
|
||||
furi_record_close(RECORD_STORAGE);
|
||||
|
||||
scene_manager_next_scene(app->scene_manager, BtSettingsAppSceneForgetDevSuccess);
|
||||
|
||||
Reference in New Issue
Block a user