Skip to content

Commit

Permalink
NFC wording fixes (#3512)
Browse files Browse the repository at this point in the history
* NFC wording fixes
* Fix filename

Co-authored-by: hedger <[email protected]>
Co-authored-by: あく <[email protected]>
  • Loading branch information
3 people authored and xMasterX committed Mar 20, 2024
1 parent 7c607ab commit a5bb1ea
Show file tree
Hide file tree
Showing 12 changed files with 90 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ static void nfc_scene_read_setup_view(NfcApp* instance) {
popup_set_icon(instance->popup, 0, 8, &I_NFC_manual_60x50);
popup_set_header(instance->popup, "Unlocking", 97, 15, AlignCenter, AlignTop);
popup_set_text(
instance->popup, "Apply card to\nFlipper's back", 97, 27, AlignCenter, AlignTop);
instance->popup, "Hold card next\nto Flipper's back", 94, 27, AlignCenter, AlignTop);
} else {
popup_set_header(instance->popup, "Don't move", 85, 27, AlignCenter, AlignTop);
popup_set_icon(instance->popup, 12, 20, &A_Loading_24);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@ static void nfc_render_mf_ultralight_pages_count(const MfUltralightData* data, F

void nfc_render_mf_ultralight_pwd_pack(const MfUltralightData* data, FuriString* str) {
bool all_pages = mf_ultralight_is_all_data_read(data);
furi_string_cat_printf(str, "\e#%s pages unlocked!", all_pages ? "All" : "Not all");
if(all_pages) {
furi_string_cat_printf(str, "\e#All Pages Are Unlocked!");
} else {
furi_string_cat_printf(str, "\e#Some Pages Are Locked!");
}

MfUltralightConfigPages* config;
mf_ultralight_get_config_page(data, &config);
Expand Down
3 changes: 2 additions & 1 deletion applications/main/nfc/scenes/nfc_scene_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,11 @@ ADD_SCENE(nfc, mf_classic_mfkey_nonces_info, MfClassicMfkeyNoncesInfo)
ADD_SCENE(nfc, mf_classic_mfkey_complete, MfClassicMfkeyComplete)
ADD_SCENE(nfc, mf_classic_update_initial, MfClassicUpdateInitial)
ADD_SCENE(nfc, mf_classic_update_initial_success, MfClassicUpdateInitialSuccess)
ADD_SCENE(nfc, mf_classic_update_initial_wrong_card, MfClassicUpdateInitialWrongCard)
ADD_SCENE(nfc, mf_classic_write_initial, MfClassicWriteInitial)
ADD_SCENE(nfc, mf_classic_write_initial_success, MfClassicWriteInitialSuccess)
ADD_SCENE(nfc, mf_classic_write_initial_fail, MfClassicWriteInitialFail)
ADD_SCENE(nfc, mf_classic_wrong_card, MfClassicWrongCard)
ADD_SCENE(nfc, mf_classic_write_initial_wrong_card, MfClassicWriteInitialWrongCard)

ADD_SCENE(nfc, mf_classic_keys, MfClassicKeys)
ADD_SCENE(nfc, mf_classic_keys_list, MfClassicKeysList)
Expand Down
2 changes: 1 addition & 1 deletion applications/main/nfc/scenes/nfc_scene_detect.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ void nfc_scene_detect_on_enter(void* context) {
popup_reset(instance->popup);
popup_set_header(instance->popup, "Reading", 97, 15, AlignCenter, AlignTop);
popup_set_text(
instance->popup, "Apply card to\nFlipper's back", 97, 27, AlignCenter, AlignTop);
instance->popup, "Hold card next\nto Flipper's back", 94, 27, AlignCenter, AlignTop);
popup_set_icon(instance->popup, 0, 8, &I_NFC_manual_60x50);
view_dispatcher_switch_to_view(instance->view_dispatcher, NfcViewPopup);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ void nfc_scene_mf_classic_keys_warn_duplicate_on_enter(void* context) {
// Setup view
Popup* popup = instance->popup;
popup_set_icon(popup, 83, 22, &I_WarningDolphinFlip_45x42);
popup_set_header(popup, "Key already exists!", 64, 3, AlignCenter, AlignTop);
popup_set_header(popup, "Key Already Exists!", 64, 3, AlignCenter, AlignTop);
popup_set_text(
popup,
"Please enter a\n"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ void nfc_scene_mf_classic_mfkey_complete_on_enter(void* context) {
NfcApp* instance = context;

widget_add_string_element(
instance->widget, 64, 0, AlignCenter, AlignTop, FontPrimary, "Complete!");
instance->widget, 64, 0, AlignCenter, AlignTop, FontPrimary, "Completed!");
widget_add_string_multiline_element(
instance->widget,
64,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ static void nfc_scene_mf_classic_update_initial_setup_view(NfcApp* instance) {

if(state == NfcSceneMfClassicUpdateInitialStateCardSearch) {
popup_set_text(
instance->popup, "Apply the initial\ncard only", 128, 32, AlignRight, AlignCenter);
instance->popup, "Use the source\ncard only", 128, 32, AlignRight, AlignCenter);
popup_set_icon(instance->popup, 0, 8, &I_NFC_manual_60x50);
} else {
popup_set_header(popup, "Updating\nDon't move...", 52, 32, AlignLeft, AlignCenter);
Expand Down Expand Up @@ -111,14 +111,16 @@ bool nfc_scene_mf_classic_update_initial_on_event(void* context, SceneManagerEve
nfc_scene_mf_classic_update_initial_setup_view(instance);
consumed = true;
} else if(event.event == NfcCustomEventWrongCard) {
scene_manager_next_scene(instance->scene_manager, NfcSceneMfClassicWrongCard);
scene_manager_next_scene(
instance->scene_manager, NfcSceneMfClassicUpdateInitialWrongCard);
consumed = true;
} else if(event.event == NfcCustomEventWorkerExit) {
if(nfc_save_shadow_file(instance)) {
scene_manager_next_scene(
instance->scene_manager, NfcSceneMfClassicUpdateInitialSuccess);
} else {
scene_manager_next_scene(instance->scene_manager, NfcSceneMfClassicWrongCard);
scene_manager_next_scene(
instance->scene_manager, NfcSceneMfClassicUpdateInitialWrongCard);
consumed = true;
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
#include "../nfc_app_i.h"

void nfc_scene_mf_classic_update_initial_wrong_card_widget_callback(
GuiButtonType result,
InputType type,
void* context) {
NfcApp* instance = context;
if(type == InputTypeShort) {
view_dispatcher_send_custom_event(instance->view_dispatcher, result);
}
}

void nfc_scene_mf_classic_update_initial_wrong_card_on_enter(void* context) {
NfcApp* instance = context;
Widget* widget = instance->widget;

notification_message(instance->notifications, &sequence_error);

widget_add_icon_element(widget, 83, 22, &I_WarningDolphinFlip_45x42);
widget_add_string_element(widget, 3, 4, AlignLeft, AlignTop, FontPrimary, "Wrong Card!");
widget_add_string_multiline_element(
widget,
4,
17,
AlignLeft,
AlignTop,
FontSecondary,
"Data management\nis only possible\nwith source card");
widget_add_button_element(
widget,
GuiButtonTypeLeft,
"Retry",
nfc_scene_mf_classic_update_initial_wrong_card_widget_callback,
instance);

// Setup and start worker
view_dispatcher_switch_to_view(instance->view_dispatcher, NfcViewWidget);
}

bool nfc_scene_mf_classic_update_initial_wrong_card_on_event(
void* context,
SceneManagerEvent event) {
NfcApp* instance = context;
bool consumed = false;

if(event.type == SceneManagerEventTypeCustom) {
if(event.event == GuiButtonTypeLeft) {
consumed = scene_manager_previous_scene(instance->scene_manager);
}
}
return consumed;
}

void nfc_scene_mf_classic_update_initial_wrong_card_on_exit(void* context) {
NfcApp* instance = context;

widget_reset(instance->widget);
}
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ static void nfc_scene_mf_classic_write_initial_setup_view(NfcApp* instance) {
if(state == NfcSceneMfClassicWriteInitialStateCardSearch) {
popup_set_header(instance->popup, "Writing", 95, 20, AlignCenter, AlignCenter);
popup_set_text(
instance->popup, "Apply the initial\ncard only", 95, 38, AlignCenter, AlignCenter);
instance->popup, "Use the source\ncard only", 95, 38, AlignCenter, AlignCenter);
popup_set_icon(instance->popup, 0, 8, &I_NFC_manual_60x50);
} else {
popup_set_header(popup, "Writing\nDon't move...", 52, 32, AlignLeft, AlignCenter);
Expand Down Expand Up @@ -115,7 +115,8 @@ bool nfc_scene_mf_classic_write_initial_on_event(void* context, SceneManagerEven
nfc_scene_mf_classic_write_initial_setup_view(instance);
consumed = true;
} else if(event.event == NfcCustomEventWrongCard) {
scene_manager_next_scene(instance->scene_manager, NfcSceneMfClassicWrongCard);
scene_manager_next_scene(
instance->scene_manager, NfcSceneMfClassicWriteInitialWrongCard);
consumed = true;
} else if(event.event == NfcCustomEventPollerSuccess) {
scene_manager_next_scene(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "../nfc_app_i.h"

void nfc_scene_mf_classic_wrong_card_widget_callback(
void nfc_scene_mf_classic_write_initial_wrong_card_widget_callback(
GuiButtonType result,
InputType type,
void* context) {
Expand All @@ -10,35 +10,35 @@ void nfc_scene_mf_classic_wrong_card_widget_callback(
}
}

void nfc_scene_mf_classic_wrong_card_on_enter(void* context) {
void nfc_scene_mf_classic_write_initial_wrong_card_on_enter(void* context) {
NfcApp* instance = context;
Widget* widget = instance->widget;

notification_message(instance->notifications, &sequence_error);

widget_add_icon_element(widget, 83, 22, &I_WarningDolphinFlip_45x42);
widget_add_string_element(
widget, 3, 4, AlignLeft, AlignTop, FontPrimary, "This is wrong card");
widget, 3, 4, AlignLeft, AlignTop, FontPrimary, "Use The Source Card!");
widget_add_string_multiline_element(
widget,
4,
17,
AlignLeft,
AlignTop,
FontSecondary,
"Data management\nis only possible\nwith initial card");
"Go to NFC Magic\napp if you want to\nwrite blanks");
widget_add_button_element(
widget,
GuiButtonTypeLeft,
"Retry",
nfc_scene_mf_classic_wrong_card_widget_callback,
nfc_scene_mf_classic_write_initial_wrong_card_widget_callback,
instance);

// Setup and start worker
view_dispatcher_switch_to_view(instance->view_dispatcher, NfcViewWidget);
}

bool nfc_scene_mf_classic_wrong_card_on_event(void* context, SceneManagerEvent event) {
bool nfc_scene_mf_classic_write_initial_wrong_card_on_event(void* context, SceneManagerEvent event) {
NfcApp* instance = context;
bool consumed = false;

Expand All @@ -50,7 +50,7 @@ bool nfc_scene_mf_classic_wrong_card_on_event(void* context, SceneManagerEvent e
return consumed;
}

void nfc_scene_mf_classic_wrong_card_on_exit(void* context) {
void nfc_scene_mf_classic_write_initial_wrong_card_on_exit(void* context) {
NfcApp* instance = context;

widget_reset(instance->widget);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,22 @@ void nfc_scene_mf_ultralight_unlock_warn_on_enter(void* context) {
for(size_t i = 0; i < sizeof(nfc->mf_ul_auth->password.data); i++) {
furi_string_cat_printf(password_str, "%02X ", nfc->mf_ul_auth->password.data[i]);
}
furi_string_cat_str(password_str, "?\nCaution, a wrong password\ncan block the card!");
furi_string_cat_str(password_str, "\nWarning: incorrect password\nwill block the card!");
nfc_text_store_set(nfc, furi_string_get_cstr(password_str));
furi_string_free(password_str);

const char* message = (type == MfUltralightAuthTypeReader) ? "Password captured!" :
"Risky function!";
const char* message = (type == MfUltralightAuthTypeReader) ? "Password Captured!" :
"Risky Action!";
dialog_ex_set_header(dialog_ex, message, 64, 0, AlignCenter, AlignTop);
dialog_ex_set_text(dialog_ex, nfc->text_store, 64, 12, AlignCenter, AlignTop);
dialog_ex_set_text(dialog_ex, nfc->text_store, 64, 10, AlignCenter, AlignTop);
dialog_ex_set_left_button_text(dialog_ex, "Cancel");
dialog_ex_set_right_button_text(dialog_ex, "Continue");

if(type == MfUltralightAuthTypeReader) {
notification_message(nfc->notifications, &sequence_set_green_255);
}
} else {
dialog_ex_set_header(dialog_ex, "Risky function!", 64, 4, AlignCenter, AlignTop);
dialog_ex_set_header(dialog_ex, "Risky action!", 64, 4, AlignCenter, AlignTop);
dialog_ex_set_text(
dialog_ex, "Wrong password\ncan block your\ncard.", 4, 18, AlignLeft, AlignTop);
dialog_ex_set_icon(dialog_ex, 83, 22, &I_WarningDolphinFlip_45x42);
Expand Down
2 changes: 1 addition & 1 deletion applications/main/nfc/scenes/nfc_scene_slix_unlock.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ void nfc_scene_slix_unlock_on_enter(void* context) {
popup_set_icon(instance->popup, 0, 8, &I_NFC_manual_60x50);
popup_set_header(instance->popup, "Unlocking", 97, 15, AlignCenter, AlignTop);
popup_set_text(
instance->popup, "Apply card to\nFlipper's back", 97, 27, AlignCenter, AlignTop);
instance->popup, "Hold card next\nto Flipper's back", 94, 27, AlignCenter, AlignTop);
view_dispatcher_switch_to_view(instance->view_dispatcher, NfcViewPopup);

instance->poller = nfc_poller_alloc(instance->nfc, NfcProtocolSlix);
Expand Down

0 comments on commit a5bb1ea

Please sign in to comment.