mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-05-10 05:59:08 -07:00
Merge branch 'dev' into nfc-parsers
This commit is contained in:
@@ -400,15 +400,16 @@ bool nfc_load_from_file_select(NfcApp* instance) {
|
||||
browser_options.base_path = NFC_APP_FOLDER;
|
||||
browser_options.hide_dot_files = true;
|
||||
|
||||
// Input events and views are managed by file_browser
|
||||
bool result = dialog_file_browser_show(
|
||||
instance->dialogs, instance->file_path, instance->file_path, &browser_options);
|
||||
bool success = false;
|
||||
do {
|
||||
// Input events and views are managed by file_browser
|
||||
if(!dialog_file_browser_show(
|
||||
instance->dialogs, instance->file_path, instance->file_path, &browser_options))
|
||||
break;
|
||||
success = nfc_load_file(instance, instance->file_path, true);
|
||||
} while(!success);
|
||||
|
||||
if(result) {
|
||||
result = nfc_load_file(instance, instance->file_path, true);
|
||||
}
|
||||
|
||||
return result;
|
||||
return success;
|
||||
}
|
||||
|
||||
void nfc_show_loading_popup(void* context, bool show) {
|
||||
|
||||
@@ -120,10 +120,15 @@ static bool aime_parse(const NfcDevice* device, FuriString* parsed_data) {
|
||||
aime_accesscode[9]);
|
||||
|
||||
// validate decimal hex representation
|
||||
bool code_is_hex = true;
|
||||
for(int i = 0; i < 24; i++) {
|
||||
if(aime_accesscode_str[i] == ' ') continue;
|
||||
if(aime_accesscode_str[i] < '0' || aime_accesscode_str[i] > '9') return false;
|
||||
if(aime_accesscode_str[i] < '0' || aime_accesscode_str[i] > '9') {
|
||||
code_is_hex = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(!code_is_hex) break;
|
||||
|
||||
// Note: Aime access code has some other self-check algorithms that are not public.
|
||||
// This parser does not try to verify the number.
|
||||
|
||||
@@ -620,7 +620,7 @@ bool parse_transport_block(const MfClassicBlock* block, FuriString* result) {
|
||||
|
||||
FuriHalRtcDateTime card_start_trip_minutes_s = {0};
|
||||
from_minutes_to_datetime(
|
||||
(card_start_trip_date) * 24 * 60 + card_start_trip_time,
|
||||
(card_start_trip_date)*24 * 60 + card_start_trip_time,
|
||||
&card_start_trip_minutes_s,
|
||||
1992);
|
||||
furi_string_printf(
|
||||
@@ -697,7 +697,7 @@ bool parse_transport_block(const MfClassicBlock* block, FuriString* result) {
|
||||
|
||||
FuriHalRtcDateTime card_start_trip_minutes_s = {0};
|
||||
from_minutes_to_datetime(
|
||||
(card_start_trip_date) * 24 * 60 + card_start_trip_time,
|
||||
(card_start_trip_date)*24 * 60 + card_start_trip_time,
|
||||
&card_start_trip_minutes_s,
|
||||
1992);
|
||||
furi_string_printf(
|
||||
@@ -871,7 +871,7 @@ bool parse_transport_block(const MfClassicBlock* block, FuriString* result) {
|
||||
from_days_to_datetime(card_use_before_date, &card_use_before_date_s, 1992);
|
||||
FuriHalRtcDateTime card_start_trip_minutes_s = {0};
|
||||
from_minutes_to_datetime(
|
||||
(card_start_trip_date) * 24 * 60 + card_start_trip_time,
|
||||
(card_start_trip_date)*24 * 60 + card_start_trip_time,
|
||||
&card_start_trip_minutes_s,
|
||||
1992);
|
||||
furi_string_printf(
|
||||
@@ -952,7 +952,7 @@ bool parse_transport_block(const MfClassicBlock* block, FuriString* result) {
|
||||
from_days_to_datetime(card_use_before_date, &card_use_before_date_s, 1992);
|
||||
FuriHalRtcDateTime card_start_trip_minutes_s = {0};
|
||||
from_minutes_to_datetime(
|
||||
(card_start_trip_date) * 24 * 60 + card_start_trip_time,
|
||||
(card_start_trip_date)*24 * 60 + card_start_trip_time,
|
||||
&card_start_trip_minutes_s,
|
||||
1992);
|
||||
furi_string_printf(
|
||||
@@ -1092,7 +1092,7 @@ bool parse_transport_block(const MfClassicBlock* block, FuriString* result) {
|
||||
|
||||
FuriHalRtcDateTime card_start_trip_minutes_s = {0};
|
||||
from_minutes_to_datetime(
|
||||
(card_valid_to_date) * 24 * 60 + card_valid_for_minutes - card_start_trip_neg_minutes,
|
||||
(card_valid_to_date)*24 * 60 + card_valid_for_minutes - card_start_trip_neg_minutes,
|
||||
&card_start_trip_minutes_s,
|
||||
2016); //-time
|
||||
furi_string_printf(
|
||||
|
||||
@@ -37,6 +37,7 @@ bool nfc_scene_detect_on_event(void* context, SceneManagerEvent event) {
|
||||
if(event.type == SceneManagerEventTypeCustom) {
|
||||
if(event.event == NfcCustomEventWorkerExit) {
|
||||
if(instance->protocols_detected_num > 1) {
|
||||
notification_message(instance->notifications, &sequence_single_vibro);
|
||||
scene_manager_next_scene(instance->scene_manager, NfcSceneSelectProtocol);
|
||||
} else {
|
||||
scene_manager_next_scene(instance->scene_manager, NfcSceneRead);
|
||||
|
||||
@@ -45,11 +45,7 @@ bool nfc_scene_extra_actions_on_event(void* context, SceneManagerEvent event) {
|
||||
|
||||
if(event.type == SceneManagerEventTypeCustom) {
|
||||
if(event.event == SubmenuIndexMfClassicKeys) {
|
||||
if(nfc_dict_check_presence(NFC_APP_MF_CLASSIC_DICT_USER_PATH)) {
|
||||
scene_manager_next_scene(instance->scene_manager, NfcSceneMfClassicKeys);
|
||||
} else {
|
||||
scene_manager_previous_scene(instance->scene_manager);
|
||||
}
|
||||
scene_manager_next_scene(instance->scene_manager, NfcSceneMfClassicKeys);
|
||||
consumed = true;
|
||||
} else if(event.event == SubmenuIndexMfUltralightUnlock) {
|
||||
mf_ultralight_auth_reset(instance->mf_ul_auth);
|
||||
|
||||
@@ -52,11 +52,12 @@ bool nfc_scene_mf_ultralight_unlock_warn_on_event(void* context, SceneManagerEve
|
||||
|
||||
bool consumed = false;
|
||||
|
||||
nfc->protocols_detected[0] = nfc_device_get_protocol(nfc->nfc_device);
|
||||
MfUltralightAuthType type = nfc->mf_ul_auth->type;
|
||||
if((type == MfUltralightAuthTypeReader) || (type == MfUltralightAuthTypeManual)) {
|
||||
if(event.type == SceneManagerEventTypeCustom) {
|
||||
if(event.event == DialogExResultRight) {
|
||||
const NfcProtocol mfu_protocol[] = {NfcProtocolMfUltralight};
|
||||
nfc_app_set_detected_protocols(nfc, mfu_protocol, COUNT_OF(mfu_protocol));
|
||||
scene_manager_next_scene(nfc->scene_manager, NfcSceneRead);
|
||||
dolphin_deed(DolphinDeedNfcRead);
|
||||
consumed = true;
|
||||
|
||||
@@ -21,7 +21,6 @@ void nfc_scene_select_protocol_on_enter(void* context) {
|
||||
} else {
|
||||
prefix = "Read as";
|
||||
submenu_set_header(submenu, "Multi-protocol card");
|
||||
notification_message(instance->notifications, &sequence_single_vibro);
|
||||
}
|
||||
|
||||
for(uint32_t i = 0; i < instance->protocols_detected_num; i++) {
|
||||
|
||||
@@ -125,7 +125,6 @@ void dict_attack_reset(DictAttack* instance) {
|
||||
instance->view,
|
||||
DictAttackViewModel * model,
|
||||
{
|
||||
model->card_detected = false;
|
||||
model->sectors_total = 0;
|
||||
model->sectors_read = 0;
|
||||
model->current_sector = 0;
|
||||
|
||||
Reference in New Issue
Block a user