This commit is contained in:
Willy-JL
2024-02-01 02:46:43 +00:00
12 changed files with 131 additions and 34 deletions

View File

@@ -35,10 +35,13 @@ void lfrfid_scene_emulate_on_enter(void* context) {
timer_auto_exit =
furi_timer_alloc(lfrfid_scene_emulate_popup_callback, FuriTimerTypeOnce, app);
furi_timer_start(
timer_auto_exit,
app->fav_timeout ? xtreme_settings.favorite_timeout * furi_kernel_get_tick_frequency() :
LFRFID_EMULATION_TIME_MAX_MS);
if(!furi_hal_rtc_is_flag_set(FuriHalRtcFlagDebug) || app->fav_timeout)
furi_timer_start(
timer_auto_exit,
app->fav_timeout ?
xtreme_settings.favorite_timeout * furi_kernel_get_tick_frequency() :
LFRFID_EMULATION_TIME_MAX_MS);
view_dispatcher_switch_to_view(app->view_dispatcher, LfRfidViewPopup);
}

View File

@@ -7,7 +7,6 @@ void lfrfid_scene_enter_password_on_enter(void* context) {
LfRfid* app = context;
ByteInput* byte_input = app->byte_input;
// true - use password for write, false - use password for clear pass
next_scene = scene_manager_get_scene_state(app->scene_manager, LfRfidSceneEnterPassword);
bool password_set = app->password[0] | app->password[1] | app->password[2] | app->password[3];
@@ -17,7 +16,7 @@ void lfrfid_scene_enter_password_on_enter(void* context) {
const uint32_t* password_list = lfrfid_get_t5577_default_passwords(&password_list_size);
uint32_t pass = password_list[furi_get_tick() % password_list_size];
for(uint8_t i = 0; i < 4; i++) app->password[i] = (pass >> (8 * i)) & 0xFF;
for(uint8_t i = 0; i < 4; i++) app->password[4 - (i + 1)] = (pass >> (8 * i)) & 0xFF;
}
byte_input_set_header_text(byte_input, "Enter the password in hex");
@@ -38,11 +37,9 @@ bool lfrfid_scene_enter_password_on_event(void* context, SceneManagerEvent event
consumed = true;
scene_manager_next_scene(scene_manager, next_scene);
scene_manager_set_scene_state(scene_manager, LfRfidSceneEnterPassword, 1);
}
} else if(event.type == SceneManagerEventTypeBack) {
uint32_t prev_scenes[] = {LfRfidSceneExtraActions, LfRfidSceneSavedKeyMenu};
scene_manager_set_scene_state(scene_manager, LfRfidSceneEnterPassword, 0);
scene_manager_search_and_switch_to_previous_scene_one_of(
scene_manager, prev_scenes, sizeof(prev_scenes[0]));
}

View File

@@ -26,7 +26,7 @@ void lfrfid_scene_saved_key_menu_on_enter(void* context) {
submenu, "Write", SubmenuIndexWrite, lfrfid_scene_saved_key_menu_submenu_callback, app);
submenu_add_item(
submenu,
"Write and set pass",
"Write and set password",
SubmenuIndexWriteAndSetPass,
lfrfid_scene_saved_key_menu_submenu_callback,
app);

View File

@@ -117,7 +117,8 @@ void nfc_render_emv_transactions(const EmvApplication* apl, FuriString* str) {
furi_string_cat_printf(str, "Transactions:\n");
for(int i = 0; i < len; i++) {
//if(!apl->trans[i].amount) continue; - NO Skip here pls
// If no date and amount - skip
if((!apl->trans[i].date) && (!apl->trans[i].amount)) continue;
// transaction counter
furi_string_cat_printf(str, "\e#%d: ", apl->trans[i].atc);
@@ -167,10 +168,13 @@ void nfc_render_emv_transactions(const EmvApplication* apl, FuriString* str) {
if(apl->trans[i].time)
furi_string_cat_printf(
str,
"%02lx:%02lx:%02lx\n",
"%02lx:%02lx:%02lx",
apl->trans[i].time & 0xff,
(apl->trans[i].time >> 8) & 0xff,
apl->trans[i].time >> 16);
// Line break
furi_string_cat_printf(str, "\n");
}
furi_string_free(tmp);

View File

@@ -13,7 +13,7 @@ static bool mykey_is_blank(const St25tbData* data) {
}
static bool mykey_has_lockid(const St25tbData* data) {
return (data->blocks[5] & 0xFF) == 0x7F;
return (data->blocks[5] >> 24) == 0x7F;
}
static bool check_invalid_low_nibble(uint8_t value) {

View File

@@ -22,11 +22,13 @@ void nfc_scene_emulate_on_enter(void* context) {
timer_auto_exit =
furi_timer_alloc(nfc_scene_emulate_timer_callback, FuriTimerTypeOnce, instance);
furi_timer_start(
timer_auto_exit,
instance->fav_timeout ?
xtreme_settings.favorite_timeout * furi_kernel_get_tick_frequency() :
NFC_EMULATION_TIME_MAX_MS);
if(!furi_hal_rtc_is_flag_set(FuriHalRtcFlagDebug) || instance->fav_timeout)
furi_timer_start(
timer_auto_exit,
instance->fav_timeout ?
xtreme_settings.favorite_timeout * furi_kernel_get_tick_frequency() :
NFC_EMULATION_TIME_MAX_MS);
}
bool nfc_scene_emulate_on_event(void* context, SceneManagerEvent event) {

View File

@@ -31,12 +31,22 @@ bool nfc_scene_save_success_on_event(void* context, SceneManagerEvent event) {
} else if(scene_manager_has_previous_scene(nfc->scene_manager, NfcSceneSaveConfirm)) {
scene_manager_next_scene(nfc->scene_manager, NfcSceneMfClassicDetectReader);
consumed = true;
} else if(scene_manager_has_previous_scene(nfc->scene_manager, NfcSceneSetType)) {
consumed = scene_manager_search_and_switch_to_another_scene(
nfc->scene_manager, NfcSceneFileSelect);
} else if(scene_manager_has_previous_scene(nfc->scene_manager, NfcSceneReadSuccess)) {
consumed = scene_manager_search_and_switch_to_another_scene(
nfc->scene_manager, NfcSceneFileSelect);
} else {
consumed = scene_manager_search_and_switch_to_previous_scene(
nfc->scene_manager, NfcSceneFileSelect);
if(!consumed) {
consumed = scene_manager_search_and_switch_to_previous_scene(
nfc->scene_manager, NfcSceneSavedMenu);
if(!consumed) {
consumed = scene_manager_search_and_switch_to_another_scene(
nfc->scene_manager, NfcSceneFileSelect);
}
}
}
}

View File

@@ -24,6 +24,9 @@ void nfc_scene_start_on_enter(void* context) {
furi_string_reset(nfc->file_name);
nfc_device_clear(nfc->nfc_device);
iso14443_3a_reset(nfc->iso14443_3a_edit_data);
// Clear detected protocols list
memset(nfc->protocols_detected, NfcProtocolIso14443_3a, NfcProtocolNum);
nfc_app_reset_detected_protocols(nfc);
submenu_add_item(submenu, "Read", SubmenuIndexRead, nfc_scene_start_submenu_callback, nfc);
submenu_add_item(