From 343cb39d08f60b75b537e1a31100707935cf6e9d Mon Sep 17 00:00:00 2001 From: RogueMaster Date: Wed, 12 Jul 2023 14:22:57 -0400 Subject: [PATCH] NFC Maker Split --- .../nfc_maker/scenes/nfc_maker_scene_result.c | 382 ----------------- .../application.fam | 4 +- .../assets/DolphinNice_96x59.png | Bin .../assets/KeyBackspaceSelected_16x9.png | Bin .../assets/KeyBackspace_16x9.png | Bin .../assets/KeyKeyboardSelected_10x11.png | Bin .../assets/KeyKeyboard_10x11.png | Bin .../assets/KeySaveSelected_24x11.png | Bin .../assets/KeySave_24x11.png | Bin .../assets/WarningDolphin_45x42.png | Bin .../{nfc_maker => nfc_maker_203}/nfc_maker.c | 0 .../{nfc_maker => nfc_maker_203}/nfc_maker.h | 0 .../nfc_maker_10px.png | Bin .../nfc_maker_text_input.c | 0 .../nfc_maker_text_input.h | 0 .../nfc_maker_validators.c | 0 .../nfc_maker_validators.h | 0 .../scenes/nfc_maker_scene.c | 0 .../scenes/nfc_maker_scene.h | 0 .../scenes/nfc_maker_scene_bluetooth.c | 0 .../scenes/nfc_maker_scene_config.h | 0 .../scenes/nfc_maker_scene_https.c | 0 .../scenes/nfc_maker_scene_mail.c | 0 .../scenes/nfc_maker_scene_menu.c | 0 .../scenes/nfc_maker_scene_name.c | 0 .../scenes/nfc_maker_scene_phone.c | 0 .../scenes/nfc_maker_scene_result.c | 359 ++++++++++++++++ .../scenes/nfc_maker_scene_text.c | 0 .../scenes/nfc_maker_scene_url.c | 0 .../scenes/nfc_maker_scene_wifi.c | 0 .../scenes/nfc_maker_scene_wifi_auth.c | 0 .../scenes/nfc_maker_scene_wifi_encr.c | 0 .../scenes/nfc_maker_scene_wifi_pass.c | 0 .../{nfc_maker => nfc_maker_203}/strnlen.c | 0 .../{nfc_maker => nfc_maker_203}/strnlen.h | 0 .../external/nfc_maker_215/application.fam | 20 + .../assets/DolphinNice_96x59.png | Bin 0 -> 2459 bytes .../assets/KeyBackspaceSelected_16x9.png | Bin 0 -> 1812 bytes .../assets/KeyBackspace_16x9.png | Bin 0 -> 1829 bytes .../assets/KeyKeyboardSelected_10x11.png | Bin 0 -> 7210 bytes .../assets/KeyKeyboard_10x11.png | Bin 0 -> 7763 bytes .../assets/KeySaveSelected_24x11.png | Bin 0 -> 1853 bytes .../nfc_maker_215/assets/KeySave_24x11.png | Bin 0 -> 1863 bytes .../assets/WarningDolphin_45x42.png | Bin 0 -> 1139 bytes .../external/nfc_maker_215/nfc_maker.c | 82 ++++ .../external/nfc_maker_215/nfc_maker.h | 67 +++ .../external/nfc_maker_215/nfc_maker_10px.png | Bin 0 -> 4142 bytes .../nfc_maker_215/scenes/nfc_maker_scene.c | 30 ++ .../nfc_maker_215/scenes/nfc_maker_scene.h | 29 ++ .../scenes/nfc_maker_scene_bluetooth.c | 57 +++ .../scenes/nfc_maker_scene_config.h | 18 + .../scenes/nfc_maker_scene_contact.c | 53 +++ .../scenes/nfc_maker_scene_contact_last.c | 55 +++ .../scenes/nfc_maker_scene_contact_mail.c | 55 +++ .../scenes/nfc_maker_scene_contact_phone.c | 55 +++ .../scenes/nfc_maker_scene_contact_url.c | 55 +++ .../scenes/nfc_maker_scene_https.c | 53 +++ .../scenes/nfc_maker_scene_mail.c | 53 +++ .../scenes/nfc_maker_scene_phone.c | 53 +++ .../scenes/nfc_maker_scene_result.c | 400 ++++++++++++++++++ .../scenes/nfc_maker_scene_save.c | 57 +++ .../scenes/nfc_maker_scene_start.c | 68 +++ .../scenes/nfc_maker_scene_text.c | 53 +++ .../scenes/nfc_maker_scene_url.c | 53 +++ .../scenes/nfc_maker_scene_wifi.c | 55 +++ .../scenes/nfc_maker_scene_wifi_auth.c | 83 ++++ .../scenes/nfc_maker_scene_wifi_encr.c | 48 +++ .../scenes/nfc_maker_scene_wifi_pass.c | 53 +++ 68 files changed, 1966 insertions(+), 384 deletions(-) delete mode 100644 applications/external/nfc_maker/scenes/nfc_maker_scene_result.c rename applications/external/{nfc_maker => nfc_maker_203}/application.fam (89%) rename applications/external/{nfc_maker => nfc_maker_203}/assets/DolphinNice_96x59.png (100%) rename applications/external/{nfc_maker => nfc_maker_203}/assets/KeyBackspaceSelected_16x9.png (100%) rename applications/external/{nfc_maker => nfc_maker_203}/assets/KeyBackspace_16x9.png (100%) rename applications/external/{nfc_maker => nfc_maker_203}/assets/KeyKeyboardSelected_10x11.png (100%) rename applications/external/{nfc_maker => nfc_maker_203}/assets/KeyKeyboard_10x11.png (100%) rename applications/external/{nfc_maker => nfc_maker_203}/assets/KeySaveSelected_24x11.png (100%) rename applications/external/{nfc_maker => nfc_maker_203}/assets/KeySave_24x11.png (100%) rename applications/external/{nfc_maker => nfc_maker_203}/assets/WarningDolphin_45x42.png (100%) rename applications/external/{nfc_maker => nfc_maker_203}/nfc_maker.c (100%) rename applications/external/{nfc_maker => nfc_maker_203}/nfc_maker.h (100%) rename applications/external/{nfc_maker => nfc_maker_203}/nfc_maker_10px.png (100%) rename applications/external/{nfc_maker => nfc_maker_203}/nfc_maker_text_input.c (100%) rename applications/external/{nfc_maker => nfc_maker_203}/nfc_maker_text_input.h (100%) rename applications/external/{nfc_maker => nfc_maker_203}/nfc_maker_validators.c (100%) rename applications/external/{nfc_maker => nfc_maker_203}/nfc_maker_validators.h (100%) rename applications/external/{nfc_maker => nfc_maker_203}/scenes/nfc_maker_scene.c (100%) rename applications/external/{nfc_maker => nfc_maker_203}/scenes/nfc_maker_scene.h (100%) rename applications/external/{nfc_maker => nfc_maker_203}/scenes/nfc_maker_scene_bluetooth.c (100%) rename applications/external/{nfc_maker => nfc_maker_203}/scenes/nfc_maker_scene_config.h (100%) rename applications/external/{nfc_maker => nfc_maker_203}/scenes/nfc_maker_scene_https.c (100%) rename applications/external/{nfc_maker => nfc_maker_203}/scenes/nfc_maker_scene_mail.c (100%) rename applications/external/{nfc_maker => nfc_maker_203}/scenes/nfc_maker_scene_menu.c (100%) rename applications/external/{nfc_maker => nfc_maker_203}/scenes/nfc_maker_scene_name.c (100%) rename applications/external/{nfc_maker => nfc_maker_203}/scenes/nfc_maker_scene_phone.c (100%) create mode 100644 applications/external/nfc_maker_203/scenes/nfc_maker_scene_result.c rename applications/external/{nfc_maker => nfc_maker_203}/scenes/nfc_maker_scene_text.c (100%) rename applications/external/{nfc_maker => nfc_maker_203}/scenes/nfc_maker_scene_url.c (100%) rename applications/external/{nfc_maker => nfc_maker_203}/scenes/nfc_maker_scene_wifi.c (100%) rename applications/external/{nfc_maker => nfc_maker_203}/scenes/nfc_maker_scene_wifi_auth.c (100%) rename applications/external/{nfc_maker => nfc_maker_203}/scenes/nfc_maker_scene_wifi_encr.c (100%) rename applications/external/{nfc_maker => nfc_maker_203}/scenes/nfc_maker_scene_wifi_pass.c (100%) rename applications/external/{nfc_maker => nfc_maker_203}/strnlen.c (100%) rename applications/external/{nfc_maker => nfc_maker_203}/strnlen.h (100%) create mode 100644 applications/external/nfc_maker_215/application.fam create mode 100644 applications/external/nfc_maker_215/assets/DolphinNice_96x59.png create mode 100644 applications/external/nfc_maker_215/assets/KeyBackspaceSelected_16x9.png create mode 100644 applications/external/nfc_maker_215/assets/KeyBackspace_16x9.png create mode 100644 applications/external/nfc_maker_215/assets/KeyKeyboardSelected_10x11.png create mode 100644 applications/external/nfc_maker_215/assets/KeyKeyboard_10x11.png create mode 100644 applications/external/nfc_maker_215/assets/KeySaveSelected_24x11.png create mode 100644 applications/external/nfc_maker_215/assets/KeySave_24x11.png create mode 100644 applications/external/nfc_maker_215/assets/WarningDolphin_45x42.png create mode 100644 applications/external/nfc_maker_215/nfc_maker.c create mode 100644 applications/external/nfc_maker_215/nfc_maker.h create mode 100644 applications/external/nfc_maker_215/nfc_maker_10px.png create mode 100644 applications/external/nfc_maker_215/scenes/nfc_maker_scene.c create mode 100644 applications/external/nfc_maker_215/scenes/nfc_maker_scene.h create mode 100644 applications/external/nfc_maker_215/scenes/nfc_maker_scene_bluetooth.c create mode 100644 applications/external/nfc_maker_215/scenes/nfc_maker_scene_config.h create mode 100644 applications/external/nfc_maker_215/scenes/nfc_maker_scene_contact.c create mode 100644 applications/external/nfc_maker_215/scenes/nfc_maker_scene_contact_last.c create mode 100644 applications/external/nfc_maker_215/scenes/nfc_maker_scene_contact_mail.c create mode 100644 applications/external/nfc_maker_215/scenes/nfc_maker_scene_contact_phone.c create mode 100644 applications/external/nfc_maker_215/scenes/nfc_maker_scene_contact_url.c create mode 100644 applications/external/nfc_maker_215/scenes/nfc_maker_scene_https.c create mode 100644 applications/external/nfc_maker_215/scenes/nfc_maker_scene_mail.c create mode 100644 applications/external/nfc_maker_215/scenes/nfc_maker_scene_phone.c create mode 100644 applications/external/nfc_maker_215/scenes/nfc_maker_scene_result.c create mode 100644 applications/external/nfc_maker_215/scenes/nfc_maker_scene_save.c create mode 100644 applications/external/nfc_maker_215/scenes/nfc_maker_scene_start.c create mode 100644 applications/external/nfc_maker_215/scenes/nfc_maker_scene_text.c create mode 100644 applications/external/nfc_maker_215/scenes/nfc_maker_scene_url.c create mode 100644 applications/external/nfc_maker_215/scenes/nfc_maker_scene_wifi.c create mode 100644 applications/external/nfc_maker_215/scenes/nfc_maker_scene_wifi_auth.c create mode 100644 applications/external/nfc_maker_215/scenes/nfc_maker_scene_wifi_encr.c create mode 100644 applications/external/nfc_maker_215/scenes/nfc_maker_scene_wifi_pass.c diff --git a/applications/external/nfc_maker/scenes/nfc_maker_scene_result.c b/applications/external/nfc_maker/scenes/nfc_maker_scene_result.c deleted file mode 100644 index 67fdf056769..00000000000 --- a/applications/external/nfc_maker/scenes/nfc_maker_scene_result.c +++ /dev/null @@ -1,382 +0,0 @@ -#include "../nfc_maker.h" - -enum PopupEvent { - PopupEventExit, -}; - -static void nfc_maker_scene_result_popup_callback(void* context) { - NfcMaker* app = context; - - view_dispatcher_send_custom_event(app->view_dispatcher, PopupEventExit); -} - -void nfc_maker_scene_result_on_enter(void* context) { - NfcMaker* app = context; - Popup* popup = app->popup; - bool success = false; - - FlipperFormat* file = flipper_format_file_alloc(furi_record_open(RECORD_STORAGE)); - FuriString* path = furi_string_alloc(); - furi_string_printf(path, NFC_APP_FOLDER "/%s" NFC_APP_EXTENSION, app->name_buf); - - // uint32_t pages = 42; - uint32_t pages = 135; - size_t size = pages * 4; - uint8_t* buf = malloc(size); - do { - if(!flipper_format_file_open_new(file, furi_string_get_cstr(path))) break; - - if(!flipper_format_write_header_cstr(file, "Flipper NFC device", 3)) break; - // if(!flipper_format_write_string_cstr(file, "Device type", "NTAG203")) break; - if(!flipper_format_write_string_cstr(file, "Device type", "NTAG215")) break; - - // Serial number - size_t i = 0; - buf[i++] = 0x04; - furi_hal_random_fill_buf(&buf[i], 8); - i += 8; - uint8_t uid[7]; - memcpy(&uid[0], &buf[0], 3); - memcpy(&uid[3], &buf[4], 4); - - if(!flipper_format_write_hex(file, "UID", uid, sizeof(uid))) break; - if(!flipper_format_write_string_cstr(file, "ATQA", "00 44")) break; - if(!flipper_format_write_string_cstr(file, "SAK", "00")) break; - // TODO: Maybe randomize? - if(!flipper_format_write_string_cstr( - file, - "Signature", - "00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00")) - break; - // if(!flipper_format_write_string_cstr(file, "Mifare version", "00 00 00 00 00 00 00 00")) - if(!flipper_format_write_string_cstr(file, "Mifare version", "00 04 04 02 01 00 11 03")) - break; - - if(!flipper_format_write_string_cstr(file, "Counter 0", "0")) break; - if(!flipper_format_write_string_cstr(file, "Tearing 0", "00")) break; - if(!flipper_format_write_string_cstr(file, "Counter 1", "0")) break; - if(!flipper_format_write_string_cstr(file, "Tearing 1", "00")) break; - if(!flipper_format_write_string_cstr(file, "Counter 2", "0")) break; - if(!flipper_format_write_string_cstr(file, "Tearing 2", "00")) break; - if(!flipper_format_write_uint32(file, "Pages total", &pages, 1)) break; - - // Static data - buf[i++] = 0x48; // Internal - buf[i++] = 0x00; // Lock bytes - buf[i++] = 0x00; // ... - buf[i++] = 0xE1; // Capability container - buf[i++] = 0x10; // ... - buf[i++] = 0x3E; // ... - buf[i++] = 0x00; // ... - buf[i++] = 0x03; // Message flags - size_t start = i++; - - switch(scene_manager_get_scene_state(app->scene_manager, NfcMakerSceneMenu)) { - case NfcMakerSceneBluetooth: { - buf[i++] = 0xD2; - buf[i++] = 0x20; - buf[i++] = 0x08; - buf[i++] = 0x61; - buf[i++] = 0x70; - - buf[i++] = 0x70; - buf[i++] = 0x6C; - buf[i++] = 0x69; - buf[i++] = 0x63; - - buf[i++] = 0x61; - buf[i++] = 0x74; - buf[i++] = 0x69; - buf[i++] = 0x6F; - - buf[i++] = 0x6E; - buf[i++] = 0x2F; - buf[i++] = 0x76; - buf[i++] = 0x6E; - - buf[i++] = 0x64; - buf[i++] = 0x2E; - buf[i++] = 0x62; - buf[i++] = 0x6C; - - buf[i++] = 0x75; - buf[i++] = 0x65; - buf[i++] = 0x74; - buf[i++] = 0x6F; - - buf[i++] = 0x6F; - buf[i++] = 0x74; - buf[i++] = 0x68; - buf[i++] = 0x2E; - - buf[i++] = 0x65; - buf[i++] = 0x70; - buf[i++] = 0x2E; - buf[i++] = 0x6F; - - buf[i++] = 0x6F; - buf[i++] = 0x62; - buf[i++] = 0x08; - buf[i++] = 0x00; - - memcpy(&buf[i], app->mac_buf, GAP_MAC_ADDR_SIZE); - i += GAP_MAC_ADDR_SIZE; - break; - } - case NfcMakerSceneHttps: { - uint8_t data_len = strnlen(app->text_buf, TEXT_INPUT_LEN); - - buf[i++] = 0xD1; - buf[i++] = 0x01; - buf[i++] = data_len + 1; - buf[i++] = 0x55; - - buf[i++] = 0x04; // Prepend "https://" - memcpy(&buf[i], app->text_buf, data_len); - i += data_len; - break; - } - case NfcMakerSceneMail: { - uint8_t data_len = strnlen(app->text_buf, TEXT_INPUT_LEN); - - buf[i++] = 0xD1; - buf[i++] = 0x01; - buf[i++] = data_len + 1; - buf[i++] = 0x55; - - buf[i++] = 0x06; // Prepend "mailto:" - memcpy(&buf[i], app->text_buf, data_len); - i += data_len; - break; - } - case NfcMakerScenePhone: { - uint8_t data_len = strnlen(app->text_buf, TEXT_INPUT_LEN); - - buf[i++] = 0xD1; - buf[i++] = 0x01; - buf[i++] = data_len + 1; - buf[i++] = 0x55; - - buf[i++] = 0x05; // Prepend "tel:" - memcpy(&buf[i], app->text_buf, data_len); - i += data_len; - break; - } - case NfcMakerSceneText: { - uint8_t data_len = strnlen(app->text_buf, TEXT_INPUT_LEN); - - buf[i++] = 0xD1; - buf[i++] = 0x01; - buf[i++] = data_len + 3; - buf[i++] = 0x54; - - buf[i++] = 0x02; - buf[i++] = 0x65; // e - buf[i++] = 0x6E; // n - memcpy(&buf[i], app->text_buf, data_len); - i += data_len; - break; - } - case NfcMakerSceneUrl: { - uint8_t data_len = strnlen(app->text_buf, TEXT_INPUT_LEN); - - buf[i++] = 0xD1; - buf[i++] = 0x01; - buf[i++] = data_len + 1; - buf[i++] = 0x55; - - buf[i++] = 0x00; // No prepend - memcpy(&buf[i], app->text_buf, data_len); - i += data_len; - break; - } - case NfcMakerSceneWifi: { - uint8_t ssid_len = strnlen(app->text_buf, WIFI_INPUT_LEN); - uint8_t pass_len = strnlen(app->pass_buf, WIFI_INPUT_LEN); - uint8_t data_len = ssid_len + pass_len; - - buf[i++] = 0xD2; - buf[i++] = 0x17; - buf[i++] = data_len + 47; - buf[i++] = 0x61; - buf[i++] = 0x70; - - buf[i++] = 0x70; - buf[i++] = 0x6C; - buf[i++] = 0x69; - buf[i++] = 0x63; - - buf[i++] = 0x61; - buf[i++] = 0x74; - buf[i++] = 0x69; - buf[i++] = 0x6F; - - buf[i++] = 0x6E; - buf[i++] = 0x2F; - buf[i++] = 0x76; - buf[i++] = 0x6E; - - buf[i++] = 0x64; - buf[i++] = 0x2E; - buf[i++] = 0x77; - buf[i++] = 0x66; - - buf[i++] = 0x61; - buf[i++] = 0x2E; - buf[i++] = 0x77; - buf[i++] = 0x73; - - buf[i++] = 0x63; - buf[i++] = 0x10; - buf[i++] = 0x0E; - buf[i++] = 0x00; - - buf[i++] = data_len + 43; - buf[i++] = 0x10; - buf[i++] = 0x26; - buf[i++] = 0x00; - - buf[i++] = 0x01; - buf[i++] = 0x01; - buf[i++] = 0x10; - buf[i++] = 0x45; - - buf[i++] = 0x00; - buf[i++] = ssid_len; - memcpy(&buf[i], app->text_buf, ssid_len); - i += ssid_len; - buf[i++] = 0x10; - buf[i++] = 0x03; - - buf[i++] = 0x00; - buf[i++] = 0x02; - buf[i++] = 0x00; - buf[i++] = scene_manager_get_scene_state(app->scene_manager, NfcMakerSceneWifiAuth); - - buf[i++] = 0x10; - buf[i++] = 0x0F; - buf[i++] = 0x00; - buf[i++] = 0x02; - - buf[i++] = 0x00; - buf[i++] = scene_manager_get_scene_state(app->scene_manager, NfcMakerSceneWifiEncr); - buf[i++] = 0x10; - buf[i++] = 0x27; - - buf[i++] = 0x00; - buf[i++] = pass_len; - memcpy(&buf[i], app->pass_buf, pass_len); - i += pass_len; - buf[i++] = 0x10; - buf[i++] = 0x20; - - buf[i++] = 0x00; - buf[i++] = 0x06; - buf[i++] = 0xFF; - buf[i++] = 0xFF; - - buf[i++] = 0xFF; - buf[i++] = 0xFF; - buf[i++] = 0xFF; - buf[i++] = 0xFF; - - break; - } - default: - break; - } - - // Message length and terminator - buf[start] = i - start - 1; - buf[i++] = 0xFE; - - // Padding until last 5 pages - for(; i < size - 20; i++) { - buf[i] = 0x00; - } - - // Last 5 static pages - buf[i++] = 0x00; - buf[i++] = 0x00; - buf[i++] = 0x00; - buf[i++] = 0xBD; - - buf[i++] = 0x04; - buf[i++] = 0x00; - buf[i++] = 0x00; - buf[i++] = 0xFF; - - buf[i++] = 0x00; - buf[i++] = 0x05; - buf[i++] = 0x00; - buf[i++] = 0x00; - - buf[i++] = 0xFF; - buf[i++] = 0xFF; - buf[i++] = 0xFF; - buf[i++] = 0xFF; - - buf[i++] = 0x00; - buf[i++] = 0x00; - buf[i++] = 0x00; - buf[i++] = 0x00; - - // Write pages - char str[16]; - bool ok = true; - for(size_t page = 0; page < pages; page++) { - snprintf(str, sizeof(str), "Page %u", page); - if(!flipper_format_write_hex(file, str, &buf[page * 4], 4)) { - ok = false; - break; - } - } - if(!ok) break; - - success = true; - - } while(false); - free(buf); - - furi_string_free(path); - flipper_format_free(file); - furi_record_close(RECORD_STORAGE); - - if(success) { - popup_set_icon(popup, 32, 5, &I_DolphinNice_96x59); - popup_set_header(popup, "Saved!", 13, 22, AlignLeft, AlignBottom); - } else { - popup_set_icon(popup, 32, 5, &I_DolphinNice_96x59); - popup_set_header(popup, "Saved!", 13, 22, AlignLeft, AlignBottom); - } - popup_set_timeout(popup, 1500); - popup_set_context(popup, app); - popup_set_callback(popup, nfc_maker_scene_result_popup_callback); - popup_enable_timeout(popup); - - view_dispatcher_switch_to_view(app->view_dispatcher, NfcMakerViewPopup); -} - -bool nfc_maker_scene_result_on_event(void* context, SceneManagerEvent event) { - NfcMaker* app = context; - bool consumed = false; - - if(event.type == SceneManagerEventTypeCustom) { - consumed = true; - switch(event.event) { - case PopupEventExit: - scene_manager_search_and_switch_to_previous_scene( - app->scene_manager, NfcMakerSceneMenu); - break; - default: - break; - } - } - - return consumed; -} - -void nfc_maker_scene_result_on_exit(void* context) { - NfcMaker* app = context; - popup_reset(app->popup); -} diff --git a/applications/external/nfc_maker/application.fam b/applications/external/nfc_maker_203/application.fam similarity index 89% rename from applications/external/nfc_maker/application.fam rename to applications/external/nfc_maker_203/application.fam index 6fd1b06f4c0..3154e0caa39 100644 --- a/applications/external/nfc_maker/application.fam +++ b/applications/external/nfc_maker_203/application.fam @@ -1,6 +1,6 @@ App( - appid="NFC_Maker", - name="NFC Maker", + appid="NFC_Maker_NTAG203", + name="NFC Maker NTAG203", apptype=FlipperAppType.EXTERNAL, entry_point="nfc_maker", # cdefines=["APP_NFC_MAKER"], diff --git a/applications/external/nfc_maker/assets/DolphinNice_96x59.png b/applications/external/nfc_maker_203/assets/DolphinNice_96x59.png similarity index 100% rename from applications/external/nfc_maker/assets/DolphinNice_96x59.png rename to applications/external/nfc_maker_203/assets/DolphinNice_96x59.png diff --git a/applications/external/nfc_maker/assets/KeyBackspaceSelected_16x9.png b/applications/external/nfc_maker_203/assets/KeyBackspaceSelected_16x9.png similarity index 100% rename from applications/external/nfc_maker/assets/KeyBackspaceSelected_16x9.png rename to applications/external/nfc_maker_203/assets/KeyBackspaceSelected_16x9.png diff --git a/applications/external/nfc_maker/assets/KeyBackspace_16x9.png b/applications/external/nfc_maker_203/assets/KeyBackspace_16x9.png similarity index 100% rename from applications/external/nfc_maker/assets/KeyBackspace_16x9.png rename to applications/external/nfc_maker_203/assets/KeyBackspace_16x9.png diff --git a/applications/external/nfc_maker/assets/KeyKeyboardSelected_10x11.png b/applications/external/nfc_maker_203/assets/KeyKeyboardSelected_10x11.png similarity index 100% rename from applications/external/nfc_maker/assets/KeyKeyboardSelected_10x11.png rename to applications/external/nfc_maker_203/assets/KeyKeyboardSelected_10x11.png diff --git a/applications/external/nfc_maker/assets/KeyKeyboard_10x11.png b/applications/external/nfc_maker_203/assets/KeyKeyboard_10x11.png similarity index 100% rename from applications/external/nfc_maker/assets/KeyKeyboard_10x11.png rename to applications/external/nfc_maker_203/assets/KeyKeyboard_10x11.png diff --git a/applications/external/nfc_maker/assets/KeySaveSelected_24x11.png b/applications/external/nfc_maker_203/assets/KeySaveSelected_24x11.png similarity index 100% rename from applications/external/nfc_maker/assets/KeySaveSelected_24x11.png rename to applications/external/nfc_maker_203/assets/KeySaveSelected_24x11.png diff --git a/applications/external/nfc_maker/assets/KeySave_24x11.png b/applications/external/nfc_maker_203/assets/KeySave_24x11.png similarity index 100% rename from applications/external/nfc_maker/assets/KeySave_24x11.png rename to applications/external/nfc_maker_203/assets/KeySave_24x11.png diff --git a/applications/external/nfc_maker/assets/WarningDolphin_45x42.png b/applications/external/nfc_maker_203/assets/WarningDolphin_45x42.png similarity index 100% rename from applications/external/nfc_maker/assets/WarningDolphin_45x42.png rename to applications/external/nfc_maker_203/assets/WarningDolphin_45x42.png diff --git a/applications/external/nfc_maker/nfc_maker.c b/applications/external/nfc_maker_203/nfc_maker.c similarity index 100% rename from applications/external/nfc_maker/nfc_maker.c rename to applications/external/nfc_maker_203/nfc_maker.c diff --git a/applications/external/nfc_maker/nfc_maker.h b/applications/external/nfc_maker_203/nfc_maker.h similarity index 100% rename from applications/external/nfc_maker/nfc_maker.h rename to applications/external/nfc_maker_203/nfc_maker.h diff --git a/applications/external/nfc_maker/nfc_maker_10px.png b/applications/external/nfc_maker_203/nfc_maker_10px.png similarity index 100% rename from applications/external/nfc_maker/nfc_maker_10px.png rename to applications/external/nfc_maker_203/nfc_maker_10px.png diff --git a/applications/external/nfc_maker/nfc_maker_text_input.c b/applications/external/nfc_maker_203/nfc_maker_text_input.c similarity index 100% rename from applications/external/nfc_maker/nfc_maker_text_input.c rename to applications/external/nfc_maker_203/nfc_maker_text_input.c diff --git a/applications/external/nfc_maker/nfc_maker_text_input.h b/applications/external/nfc_maker_203/nfc_maker_text_input.h similarity index 100% rename from applications/external/nfc_maker/nfc_maker_text_input.h rename to applications/external/nfc_maker_203/nfc_maker_text_input.h diff --git a/applications/external/nfc_maker/nfc_maker_validators.c b/applications/external/nfc_maker_203/nfc_maker_validators.c similarity index 100% rename from applications/external/nfc_maker/nfc_maker_validators.c rename to applications/external/nfc_maker_203/nfc_maker_validators.c diff --git a/applications/external/nfc_maker/nfc_maker_validators.h b/applications/external/nfc_maker_203/nfc_maker_validators.h similarity index 100% rename from applications/external/nfc_maker/nfc_maker_validators.h rename to applications/external/nfc_maker_203/nfc_maker_validators.h diff --git a/applications/external/nfc_maker/scenes/nfc_maker_scene.c b/applications/external/nfc_maker_203/scenes/nfc_maker_scene.c similarity index 100% rename from applications/external/nfc_maker/scenes/nfc_maker_scene.c rename to applications/external/nfc_maker_203/scenes/nfc_maker_scene.c diff --git a/applications/external/nfc_maker/scenes/nfc_maker_scene.h b/applications/external/nfc_maker_203/scenes/nfc_maker_scene.h similarity index 100% rename from applications/external/nfc_maker/scenes/nfc_maker_scene.h rename to applications/external/nfc_maker_203/scenes/nfc_maker_scene.h diff --git a/applications/external/nfc_maker/scenes/nfc_maker_scene_bluetooth.c b/applications/external/nfc_maker_203/scenes/nfc_maker_scene_bluetooth.c similarity index 100% rename from applications/external/nfc_maker/scenes/nfc_maker_scene_bluetooth.c rename to applications/external/nfc_maker_203/scenes/nfc_maker_scene_bluetooth.c diff --git a/applications/external/nfc_maker/scenes/nfc_maker_scene_config.h b/applications/external/nfc_maker_203/scenes/nfc_maker_scene_config.h similarity index 100% rename from applications/external/nfc_maker/scenes/nfc_maker_scene_config.h rename to applications/external/nfc_maker_203/scenes/nfc_maker_scene_config.h diff --git a/applications/external/nfc_maker/scenes/nfc_maker_scene_https.c b/applications/external/nfc_maker_203/scenes/nfc_maker_scene_https.c similarity index 100% rename from applications/external/nfc_maker/scenes/nfc_maker_scene_https.c rename to applications/external/nfc_maker_203/scenes/nfc_maker_scene_https.c diff --git a/applications/external/nfc_maker/scenes/nfc_maker_scene_mail.c b/applications/external/nfc_maker_203/scenes/nfc_maker_scene_mail.c similarity index 100% rename from applications/external/nfc_maker/scenes/nfc_maker_scene_mail.c rename to applications/external/nfc_maker_203/scenes/nfc_maker_scene_mail.c diff --git a/applications/external/nfc_maker/scenes/nfc_maker_scene_menu.c b/applications/external/nfc_maker_203/scenes/nfc_maker_scene_menu.c similarity index 100% rename from applications/external/nfc_maker/scenes/nfc_maker_scene_menu.c rename to applications/external/nfc_maker_203/scenes/nfc_maker_scene_menu.c diff --git a/applications/external/nfc_maker/scenes/nfc_maker_scene_name.c b/applications/external/nfc_maker_203/scenes/nfc_maker_scene_name.c similarity index 100% rename from applications/external/nfc_maker/scenes/nfc_maker_scene_name.c rename to applications/external/nfc_maker_203/scenes/nfc_maker_scene_name.c diff --git a/applications/external/nfc_maker/scenes/nfc_maker_scene_phone.c b/applications/external/nfc_maker_203/scenes/nfc_maker_scene_phone.c similarity index 100% rename from applications/external/nfc_maker/scenes/nfc_maker_scene_phone.c rename to applications/external/nfc_maker_203/scenes/nfc_maker_scene_phone.c diff --git a/applications/external/nfc_maker_203/scenes/nfc_maker_scene_result.c b/applications/external/nfc_maker_203/scenes/nfc_maker_scene_result.c new file mode 100644 index 00000000000..912bf3c9fc3 --- /dev/null +++ b/applications/external/nfc_maker_203/scenes/nfc_maker_scene_result.c @@ -0,0 +1,359 @@ +#include "../nfc_maker.h" + +enum PopupEvent { + PopupEventExit, +}; + +static void nfc_maker_scene_result_popup_callback(void* context) { + NfcMaker* app = context; + + view_dispatcher_send_custom_event(app->view_dispatcher, PopupEventExit); +} + +void nfc_maker_scene_result_on_enter(void* context) { + NfcMaker* app = context; + Popup* popup = app->popup; + bool success = false; + + FlipperFormat* file = flipper_format_file_alloc(furi_record_open(RECORD_STORAGE)); + FuriString* path = furi_string_alloc(); + furi_string_printf(path, NFC_APP_FOLDER "/%s" NFC_APP_EXTENSION, app->name_buf); + do { + if(!flipper_format_file_open_new(file, furi_string_get_cstr(path))) break; + + uint32_t pages = 42; + size_t size = pages * 4; + uint8_t* buf = malloc(size); + + if(!flipper_format_write_header_cstr(file, "Flipper NFC device", 3)) break; + if(!flipper_format_write_string_cstr(file, "Device type", "NTAG203")) break; + + // Serial number + buf[0] = 0x04; + furi_hal_random_fill_buf(&buf[1], 8); + uint8_t uid[7]; + memcpy(&uid[0], &buf[0], 3); + memcpy(&uid[3], &buf[4], 4); + + if(!flipper_format_write_hex(file, "UID", uid, sizeof(uid))) break; + if(!flipper_format_write_string_cstr(file, "ATQA", "00 44")) break; + if(!flipper_format_write_string_cstr(file, "SAK", "00")) break; + // TODO: Maybe randomize? + if(!flipper_format_write_string_cstr( + file, + "Signature", + "00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00")) + break; + if(!flipper_format_write_string_cstr(file, "Mifare version", "00 00 00 00 00 00 00 00")) + break; + + if(!flipper_format_write_string_cstr(file, "Counter 0", "0")) break; + if(!flipper_format_write_string_cstr(file, "Tearing 0", "00")) break; + if(!flipper_format_write_string_cstr(file, "Counter 1", "0")) break; + if(!flipper_format_write_string_cstr(file, "Tearing 1", "00")) break; + if(!flipper_format_write_string_cstr(file, "Counter 2", "0")) break; + if(!flipper_format_write_string_cstr(file, "Tearing 2", "00")) break; + if(!flipper_format_write_uint32(file, "Pages total", &pages, 1)) break; + + // Static data + buf[9] = 0x48; // Internal + buf[10] = 0x00; // Lock bytes + buf[11] = 0x00; // ... + buf[12] = 0xE1; // Capability container + buf[13] = 0x10; // ... + buf[14] = 0x12; // ... + buf[15] = 0x00; // ... + buf[16] = 0x01; // ... + buf[17] = 0x03; // ... + buf[18] = 0xA0; // ... + buf[19] = 0x10; // ... + buf[20] = 0x44; // ... + buf[21] = 0x03; // Message flags + + size_t msg_len = 0; + switch(scene_manager_get_scene_state(app->scene_manager, NfcMakerSceneMenu)) { + case NfcMakerSceneBluetooth: { + msg_len = 0x2B; + + buf[23] = 0xD2; + buf[24] = 0x20; + buf[25] = 0x08; + buf[26] = 0x61; + buf[27] = 0x70; + + buf[28] = 0x70; + buf[29] = 0x6C; + buf[30] = 0x69; + buf[31] = 0x63; + + buf[32] = 0x61; + buf[33] = 0x74; + buf[34] = 0x69; + buf[35] = 0x6F; + + buf[36] = 0x6E; + buf[37] = 0x2F; + buf[38] = 0x76; + buf[39] = 0x6E; + + buf[40] = 0x64; + buf[41] = 0x2E; + buf[42] = 0x62; + buf[43] = 0x6C; + + buf[44] = 0x75; + buf[45] = 0x65; + buf[46] = 0x74; + buf[47] = 0x6F; + + buf[48] = 0x6F; + buf[49] = 0x74; + buf[50] = 0x68; + buf[51] = 0x2E; + + buf[52] = 0x65; + buf[53] = 0x70; + buf[54] = 0x2E; + buf[55] = 0x6F; + + buf[56] = 0x6F; + buf[57] = 0x62; + buf[58] = 0x08; + buf[59] = 0x00; + + memcpy(&buf[60], app->mac_buf, GAP_MAC_ADDR_SIZE); + break; + } + case NfcMakerSceneHttps: { + uint8_t data_len = strnlen(app->text_buf, TEXT_INPUT_LEN); + msg_len = data_len + 5; + + buf[23] = 0xD1; + buf[24] = 0x01; + buf[25] = data_len + 1; + buf[26] = 0x55; + + buf[27] = 0x04; // Prepend "https://" + memcpy(&buf[28], app->text_buf, data_len); + break; + } + case NfcMakerSceneMail: { + uint8_t data_len = strnlen(app->text_buf, TEXT_INPUT_LEN); + msg_len = data_len + 5; + + buf[23] = 0xD1; + buf[24] = 0x01; + buf[25] = data_len + 1; + buf[26] = 0x55; + + buf[27] = 0x06; // Prepend "mailto:" + memcpy(&buf[28], app->text_buf, data_len); + break; + } + case NfcMakerScenePhone: { + uint8_t data_len = strnlen(app->text_buf, TEXT_INPUT_LEN); + msg_len = data_len + 5; + + buf[23] = 0xD1; + buf[24] = 0x01; + buf[25] = data_len + 1; + buf[26] = 0x55; + + buf[27] = 0x05; // Prepend "tel:" + memcpy(&buf[28], app->text_buf, data_len); + break; + } + case NfcMakerSceneText: { + uint8_t data_len = strnlen(app->text_buf, TEXT_INPUT_LEN); + msg_len = data_len + 7; + + buf[23] = 0xD1; + buf[24] = 0x01; + buf[25] = data_len + 3; + buf[26] = 0x54; + + buf[27] = 0x02; + buf[28] = 0x65; // e + buf[29] = 0x6E; // n + memcpy(&buf[30], app->text_buf, data_len); + break; + } + case NfcMakerSceneUrl: { + uint8_t data_len = strnlen(app->text_buf, TEXT_INPUT_LEN); + msg_len = data_len + 5; + + buf[23] = 0xD1; + buf[24] = 0x01; + buf[25] = data_len + 1; + buf[26] = 0x55; + + buf[27] = 0x00; // No prepend + memcpy(&buf[28], app->text_buf, data_len); + break; + } + case NfcMakerSceneWifi: { + uint8_t ssid_len = strnlen(app->text_buf, WIFI_INPUT_LEN); + uint8_t pass_len = strnlen(app->pass_buf, WIFI_INPUT_LEN); + uint8_t data_len = ssid_len + pass_len; + msg_len = data_len + 73; + + buf[23] = 0xD2; + buf[24] = 0x17; + buf[25] = data_len + 47; + buf[26] = 0x61; + buf[27] = 0x70; + + buf[28] = 0x70; + buf[29] = 0x6C; + buf[30] = 0x69; + buf[31] = 0x63; + + buf[32] = 0x61; + buf[33] = 0x74; + buf[34] = 0x69; + buf[35] = 0x6F; + + buf[36] = 0x6E; + buf[37] = 0x2F; + buf[38] = 0x76; + buf[39] = 0x6E; + + buf[40] = 0x64; + buf[41] = 0x2E; + buf[42] = 0x77; + buf[43] = 0x66; + + buf[44] = 0x61; + buf[45] = 0x2E; + buf[46] = 0x77; + buf[47] = 0x73; + + buf[48] = 0x63; + buf[49] = 0x10; + buf[50] = 0x0E; + buf[51] = 0x00; + + buf[52] = data_len + 43; + buf[53] = 0x10; + buf[54] = 0x26; + buf[55] = 0x00; + + buf[56] = 0x01; + buf[57] = 0x01; + buf[58] = 0x10; + buf[59] = 0x45; + + buf[60] = 0x00; + buf[61] = ssid_len; + memcpy(&buf[62], app->text_buf, ssid_len); + size_t ssid = 62 + ssid_len; + buf[ssid + 0] = 0x10; + buf[ssid + 1] = 0x03; + + buf[ssid + 2] = 0x00; + buf[ssid + 3] = 0x02; + buf[ssid + 4] = 0x00; + buf[ssid + 5] = + scene_manager_get_scene_state(app->scene_manager, NfcMakerSceneWifiAuth); + + buf[ssid + 6] = 0x10; + buf[ssid + 7] = 0x0F; + buf[ssid + 8] = 0x00; + buf[ssid + 9] = 0x02; + + buf[ssid + 10] = 0x00; + buf[ssid + 11] = + scene_manager_get_scene_state(app->scene_manager, NfcMakerSceneWifiEncr); + buf[ssid + 12] = 0x10; + buf[ssid + 13] = 0x27; + + buf[ssid + 14] = 0x00; + buf[ssid + 15] = pass_len; + memcpy(&buf[ssid + 16], app->pass_buf, pass_len); + size_t pass = ssid + 16 + pass_len; + buf[pass + 0] = 0x10; + buf[pass + 1] = 0x20; + + buf[pass + 2] = 0x00; + buf[pass + 3] = 0x06; + buf[pass + 4] = 0xFF; + buf[pass + 5] = 0xFF; + + buf[pass + 6] = 0xFF; + buf[pass + 7] = 0xFF; + buf[pass + 8] = 0xFF; + buf[pass + 9] = 0xFF; + + break; + } + default: + break; + } + + // Message length and terminator + buf[22] = msg_len; + size_t msg_end = 23 + msg_len; + buf[msg_end] = 0xFE; + + // Padding + for(size_t i = msg_end + 1; i < size; i++) { + buf[i] = 0x00; + } + + char str[16]; + bool ok = true; + for(size_t page = 0; page < pages; page++) { + snprintf(str, sizeof(str), "Page %u", page); + if(!flipper_format_write_hex(file, str, &buf[page * 4], 4)) { + ok = false; + break; + } + } + if(!ok) break; + + free(buf); + success = true; + + } while(false); + furi_string_free(path); + flipper_format_free(file); + furi_record_close(RECORD_STORAGE); + + if(success) { + popup_set_icon(popup, 32, 5, &I_DolphinNice_96x59); + popup_set_header(popup, "Saved!", 13, 22, AlignLeft, AlignBottom); + } else { + popup_set_icon(popup, 32, 5, &I_DolphinNice_96x59); + popup_set_header(popup, "Saved!", 13, 22, AlignLeft, AlignBottom); + } + popup_set_timeout(popup, 1500); + popup_set_context(popup, app); + popup_set_callback(popup, nfc_maker_scene_result_popup_callback); + popup_enable_timeout(popup); + + view_dispatcher_switch_to_view(app->view_dispatcher, NfcMakerViewPopup); +} + +bool nfc_maker_scene_result_on_event(void* context, SceneManagerEvent event) { + NfcMaker* app = context; + bool consumed = false; + + if(event.type == SceneManagerEventTypeCustom) { + consumed = true; + switch(event.event) { + case PopupEventExit: + scene_manager_search_and_switch_to_previous_scene( + app->scene_manager, NfcMakerSceneMenu); + break; + default: + break; + } + } + + return consumed; +} + +void nfc_maker_scene_result_on_exit(void* context) { + NfcMaker* app = context; + popup_reset(app->popup); +} diff --git a/applications/external/nfc_maker/scenes/nfc_maker_scene_text.c b/applications/external/nfc_maker_203/scenes/nfc_maker_scene_text.c similarity index 100% rename from applications/external/nfc_maker/scenes/nfc_maker_scene_text.c rename to applications/external/nfc_maker_203/scenes/nfc_maker_scene_text.c diff --git a/applications/external/nfc_maker/scenes/nfc_maker_scene_url.c b/applications/external/nfc_maker_203/scenes/nfc_maker_scene_url.c similarity index 100% rename from applications/external/nfc_maker/scenes/nfc_maker_scene_url.c rename to applications/external/nfc_maker_203/scenes/nfc_maker_scene_url.c diff --git a/applications/external/nfc_maker/scenes/nfc_maker_scene_wifi.c b/applications/external/nfc_maker_203/scenes/nfc_maker_scene_wifi.c similarity index 100% rename from applications/external/nfc_maker/scenes/nfc_maker_scene_wifi.c rename to applications/external/nfc_maker_203/scenes/nfc_maker_scene_wifi.c diff --git a/applications/external/nfc_maker/scenes/nfc_maker_scene_wifi_auth.c b/applications/external/nfc_maker_203/scenes/nfc_maker_scene_wifi_auth.c similarity index 100% rename from applications/external/nfc_maker/scenes/nfc_maker_scene_wifi_auth.c rename to applications/external/nfc_maker_203/scenes/nfc_maker_scene_wifi_auth.c diff --git a/applications/external/nfc_maker/scenes/nfc_maker_scene_wifi_encr.c b/applications/external/nfc_maker_203/scenes/nfc_maker_scene_wifi_encr.c similarity index 100% rename from applications/external/nfc_maker/scenes/nfc_maker_scene_wifi_encr.c rename to applications/external/nfc_maker_203/scenes/nfc_maker_scene_wifi_encr.c diff --git a/applications/external/nfc_maker/scenes/nfc_maker_scene_wifi_pass.c b/applications/external/nfc_maker_203/scenes/nfc_maker_scene_wifi_pass.c similarity index 100% rename from applications/external/nfc_maker/scenes/nfc_maker_scene_wifi_pass.c rename to applications/external/nfc_maker_203/scenes/nfc_maker_scene_wifi_pass.c diff --git a/applications/external/nfc_maker/strnlen.c b/applications/external/nfc_maker_203/strnlen.c similarity index 100% rename from applications/external/nfc_maker/strnlen.c rename to applications/external/nfc_maker_203/strnlen.c diff --git a/applications/external/nfc_maker/strnlen.h b/applications/external/nfc_maker_203/strnlen.h similarity index 100% rename from applications/external/nfc_maker/strnlen.h rename to applications/external/nfc_maker_203/strnlen.h diff --git a/applications/external/nfc_maker_215/application.fam b/applications/external/nfc_maker_215/application.fam new file mode 100644 index 00000000000..b76b678f7d2 --- /dev/null +++ b/applications/external/nfc_maker_215/application.fam @@ -0,0 +1,20 @@ +App( + appid="NFC_Maker_NTAG215", + name="NFC Maker NTAG215", + apptype=FlipperAppType.EXTERNAL, + entry_point="nfc_maker", + # cdefines=["APP_NFC_MAKER"], + requires=[ + "storage", + "gui", + ], + stack_size=1 * 1024, + fap_icon="nfc_maker_10px.png", + fap_category="NFC", + fap_icon_assets="assets", + fap_icon_assets_symbol="nfc_maker2", + fap_author="Willy-JL", + fap_weburl="https://github.com/DarkFlippers/unleashed-firmware/tree/dev/applications/external/nfc_maker", + # fap_version="1.0", + fap_description="make tags with URLs, Wifi and other things", +) \ No newline at end of file diff --git a/applications/external/nfc_maker_215/assets/DolphinNice_96x59.png b/applications/external/nfc_maker_215/assets/DolphinNice_96x59.png new file mode 100644 index 0000000000000000000000000000000000000000..a299d3630239b4486e249cc501872bed5996df3b GIT binary patch literal 2459 zcmbVO3s4i+8V(M(gEFORwSrA`4O0uPn|M|5y* zB*aMDxC&7(gP9JN;POOi-9khrC>Z9YJs2U!LnVcQEEC0fDtKo&ILlzb30%M}3J^;~ zv7RzcsilOs4Mq@tD*&R;!LMSk2A~{(`HK9|hQBqEX)3sQr9Je6SZU*F-^fD-p+~Hs; zHLkO%v?>ZoxEv+F#whudr%615FkA0DYR0tMEo}3OOY#xecLWe>xV?u5KtSmC^ z7)Fmj6gjfKstiEV-*Cxbbb+&rRWuI_rBJ)ybs_f1Rn&f2>q3pYwI^|J(hdn{j{0EZIm_F zpIyIWLsRUgOItR-dUbVd|6Zo=_BU_Tj4|{{jxO#=JH4o8er(5{!nZD_j4}MH&zh~9 zVLC~y(0-D6GO0ghZD8BYzP?o{>22~lT6^d@X{SwQ8vrNY-PPIMajIwC)`s14Ep72@ zeq7YOzM`?U{+W)ocXBr`eSOcpk?Rxc=ou5&)fWW|pD};-Z0mvk9}=&`Rb&y<77W~a z(>6YM;6Y5aIU~JKZ}mQZynKHiSTQ#Bczn@&jTiN^?vPJ(jhm7cXLx0oum5P$`TceG zU+wR;OO^)8CVlnM)5p$CO&e94KJt>HccCaHGusmW_b`T6m| z-R6V6Db1pErTot?^d22ojm+2>_)FbD`_+WbDGMx9f@hO27maS2`csiV(D&Fs`PS2& zvrq18du_&zXID(!KIxsU$)iuTYuZ?zmYiP&n&i@Be{IdbS-jA2c0QAlu5NXQv_0K< z3Hvs4eeu6B7yD&CNT~gIkMV&UkRU=V!iQ(+_(O&u^ah$+s{_yn(yBYeD40HeU{xGsIT6W Zfq!wOp!Q()N{W z-JN@vFI~T+Y1-v}FWiIo6?k5J;aT|qw)dv2CwcE-scA1=t)FMK&%d~)Y0rO}4EC%2 z=aK4R$F?2(hE6fX7H(UFBH{$t4v4EaKLer_Vi@d&Z#A)C)-lFal?RqJo6XEw%T&e4 zBEIiim|Bz~ut4QeR$2KDgeVQ)Gl9#&Q7)}LS*mHl<@TY>s++4|`B+t|9IGdATYvr+ zL&4Vp^Jy_zlt*w&PGkz$CD@V$zdYy`l2xi0C^cC%YIhY;r^KZCtp`aa)U15HX4E*y zkX5o{K-UPu6k#$T&@w-;?b`$g7%xpD(1BnTyO^;O$?)hRrco61v$A3tm;JC~04Xy` zM9{K5&YYn{cI-;z+O~({*abcDHnS;pNXu(4c!7VY__VG>?Z1?*P#iGU)eM+zGa?B_ zvgI?>CU%T`*JH?wZ6SP@IW~7zXzvsW>>M^Zjasu3fJoi8ARJ`vf+uoa+eOUrBobcB zw>cJ!4w<1pj@wleRYXcabz7&```zwtp@zu>K9qa+w)FmX*CD>+AZijr7d#lMB4r@7 zBxNIM<=Lo~JFR)Z8qvz(k!=8Gk?gq@8g zfS#k0rCF(l)r=K#a|A8Qr4h!%R?w1c= z{pq*skHW8}pZxgsP>68$^3NZ9>0PQ& Cw>kg- literal 0 HcmV?d00001 diff --git a/applications/external/nfc_maker_215/assets/KeyBackspace_16x9.png b/applications/external/nfc_maker_215/assets/KeyBackspace_16x9.png new file mode 100644 index 0000000000000000000000000000000000000000..9946232d953ef1cbfbf0e6754be6645e5ea2747b GIT binary patch literal 1829 zcmcIl&u`pB6gEEvMG+BPN`-{wNT>+Lo*8@XwOcpZ?1t{5I;81J4Y!WR<6SFjkFlNX zCgRjnK|!3jpo$Y0E}Xb=;LeTzpnm{T)f-4i;dy_hpfu#tmAsxAzxTcGz4y(`m)l!6 zS1w(-q$tWtuiM#y_bNQEzxE>h|J=PM>Pg=HtW=aY-mae)lh*~S0I8^$I!Q-a=}mlXitE9+UN$s!YEtd_TB{DI?graxTNXmKb&NR1RCQdP z*p_AEk5q~&HgLlr6cO9QmPZ_Q{?i~@5yjq4=i_-SnEBeUs&daT#^bR*Hg#DH4C1=3 zfvG_$0t-|gW)+*DtXx|lbVSLEB(D;gsWl=C<$mRBz;u>EnlE9qa$Y7Vm@#3wL3CWF zv@i^U^G(xqX_e|ijf0zqnN0f5E;9~PYWYyXtSU!}MEQj(L+?JpJ#W3Q_ zfcbtgnwBTxh8T$yuuHHdQ+~PEE(EJ&(U)?xXw>#1qDqNQ)vI@tERy5$gPPIYL3CIp zd=0ur5T*!|K7p3G9x*>8*u!{c8h{QWRntB?yEl08lWCYa({L}SbyS-h=I2pl*a_8oT+S_c~#IXiq#zs}!z^4spCcOR_0+*o_q`N6;X{rjK1`QsBs`Gcx|z4v#k QTVG_o&8^N)8~5)21Ktij=l}o! literal 0 HcmV?d00001 diff --git a/applications/external/nfc_maker_215/assets/KeyKeyboardSelected_10x11.png b/applications/external/nfc_maker_215/assets/KeyKeyboardSelected_10x11.png new file mode 100644 index 0000000000000000000000000000000000000000..231880386a9d9e83911088c9fcd083f84a7f75bb GIT binary patch literal 7210 zcmeHMc{G&m`=?Ublaz#}DWMw1jBO@scCroG3eED&7|aYa!&oaSQQ1?BvQr3^B_u>D zRI(HaN!GGvr}BHKx3~9vzvukUd(Q9oUvtjPbKlo}U7!29KG${M=ef>=S(q8{^N8_q zaB%P&8R}xd=jxbu^9JyDl++f>!NK>$&)SZO!LlG8bQ+QD4nUZ`9smUJArm<`d^+pBC6Dvw@S z{-)=@qQ^b|b+J}=KD@%AUv=la?m*JB2h-;tO5d8_imCrneonb*>iaiOoi~|NgFw@_ z>-`^xAU-r*IlrN-```Pz{aJjIOYe6%&l?S#KG|D$Cg<#&2dHBbi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+33x+k=M$2OW2F;6( z2lTuFDs%7e5Cr@$dk-(V`&u{zygc9zP(W1%xU0fHwlpv@wfJSRN&$&X@mRA0$^M5X zlT7@Ztbh2ny0R9|?~Z`xzi|Jd{a5U3%Al61DO#6?_gZz&NLL-Yx<8sg!;=ZpiDj{I11RM^A$K#X;D1d;66I6eLGNLk=SSlV^g#y9l$RG}YQc)x* zsUTrEWmQ#}B1)AA!x2?M2pmos1t%(kIQZWn%;{vXDzWard$kHh0HJUQ6dq3`sKQk7 z$|^8LMI{x`8w3DTLgL_n0u~ELsw%8O5%6ez8l8d#(@CaaNr1cum9)07N;q2E!bly8 zkc0m%v2e#SiJ*Zx^eCC?<@5J~HJJifF|n&`Dk!U{AmAt^MT81cMMVYqw~`G&XMmNs zim3pXLn78zR?~t8g8_-fuGT3CuqFp%LF>=~ER#mJrqSHhp{p)IRxN)mn}WxQfMsHJ zu}lC2g(Hw?I0B7Ow1y+mNN|8S2#2HLzvgv{X%EZh)foi4rr4=9zm|a@?7HzBD0n# z*?;=NasgJe01^g+BVhkYnEcOxo))aobWI($gGVt;O??U-sm*G#& zK!5)~KR~vOSwT8}y5Z6&x`A8PBTVZMP{#YRdS&a^gaPJ@ k(Oa(fF60b8WFS2`E^HCx5!~3>143{Z>6z)~A2}KPKg=ZgNB{r; literal 0 HcmV?d00001 diff --git a/applications/external/nfc_maker_215/assets/KeyKeyboard_10x11.png b/applications/external/nfc_maker_215/assets/KeyKeyboard_10x11.png new file mode 100644 index 0000000000000000000000000000000000000000..1f4c03478f68cb15c74ef99888ce4faf50e0a140 GIT binary patch literal 7763 zcmeHMcT|(hwg*8VAW}pT5e%V7OCh9?P?TPzgMbtONN-0#Ksbt`qQDF2@p$jMYrS>WdiTGRwen?V&)&b;`?vSZ`eqVoY^cr2evF-g zfq_$3N5ho90!va7!EG^n_JOLaXvtIPYQ|bLIl$M+=)P1CL*XpT|J)pSw`V*_Er$lGUV9}kPM4|w*oUQF?ll7f#pMss4lb=^o zxTHFHbLT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X84bG_S5Oapz-U2_2No;}caH=0Jhz?X1x*6p zZZ%{Or9=^P?a(oNj2+}NPLO5lb>xS(hK#yzQ(Fto(z;~|u)ZaN?XnW(`pULU1i&$^ zrW-ON3~kFtm|7MJL)}ES1tUU3N-T@l>$)*vdoGLM%c1>)tfeXjj8tQ`U&jXGx~+pC zJw&zve}0HDBg6^Jz?Y@lahswqGEXq5ZvEhVyV+dJL>TqqMZUhgD7BZGrskL?B8nzU zEO0}S#T1Md#k9-SH0hSMuhLzKa_I5y_(QtDUmB14ku-9rOM~*GXvjh71`cJarlUj3 ze7uCJ^@AP<(j#0_!EzB61Df%LF0|x7U8vqkd`@?cmVP{k{EyPdWes{X>2la%Rk=(? zE%&0TDeAxbb=w#db1i`F%Wmf5GAz>Wv>@jW_p)ho-#0CeC9cGbyZ*s9Cn^o)Rq=_$h#NIZix%+wt GFa8a7)lmol literal 0 HcmV?d00001 diff --git a/applications/external/nfc_maker_215/assets/KeySave_24x11.png b/applications/external/nfc_maker_215/assets/KeySave_24x11.png new file mode 100644 index 0000000000000000000000000000000000000000..e7dba987a04dad7dd96001913c55566dbde96c8e GIT binary patch literal 1863 zcmcIlO^6&t6dpxnjjSF75f9pQJZy|LUDdzSZ6$n-*6-2D5s-9_fx~uK( zotfQBVDX?Q(UXLzXF6aX)%U*l z-d9y`w^q+Do_PF3p-@5qOL5h2N9RU z^i-~BIziNECdw*wjUcQeOxncsbnKa>(*%1MPoPck0jC)~9$50g-#!ks+4LGwn$d`f zMy;%ZsA3Rsk2!`#ELuW>2#g3fF>;CFBHMCo-El0(@X1&g%&$qdl~*F4Kd~*B3^?Z1 z^bEmDf}0)Wn??sYC6l9$X;6esLO7#_ZCmDy?ZqU3l|%anS#wn!7%f39-Qp(l9fyJ- z(?=x}n~2%2PcX9#VmYdECvH{tWzv)!s%sn^Z&a(TMEXG=KBQ~smzBm!)h4cOBfSV| zapw6l2`LyY2x(Vnan#Li4>BO#dXPeox2Fr~f_P*4)DM)gJ3Y$sMNw8+?gqit>2PpJ znU9yygm%~yKzf8rCa_fc*^nlp(uJ1%rwg^aiBIX^Xz9mu$p0vPT2|JhQCGkYtEqW1 zTD})enxg%?Uw4c#Ggk#{pLa8zmSLH8=LI=?xR>pc=yYsHAgcQUxz^arx`9fR>e$sw zj@}Uy75!kQXF{tT9e=F+z^*!*3|n>nI6oucWq!(t2og`=40-O!tAE1z^ID@;X)nEd zVK7xqj`wg%Ed2Op{k=a*YZpKHX787$ zzhKuN9(?M5ojmn%xcU1}OP>$^`ZD?cW@lIaTn=x3xBtP#z16o~{qVMZ>hecsD?jQQ ME3387mS5lf8`39Il>h($ literal 0 HcmV?d00001 diff --git a/applications/external/nfc_maker_215/assets/WarningDolphin_45x42.png b/applications/external/nfc_maker_215/assets/WarningDolphin_45x42.png new file mode 100644 index 0000000000000000000000000000000000000000..d766ffbb444db1739f2ccd030e506e8bada11ee8 GIT binary patch literal 1139 zcmaJ=TWAz#6rQ4%BpO*okt7zz3Bkm=bK9L=XV}qhW_HceY#KHzP4Z$UGyf(-b}pUy z<8ESW=_MtCk6tj|`k)VrCbo(SMH0n`eW+KIU`wG5O`$IeMg)Vzf7adDhv+af=lqBB zo%5Z`zqhqzdu2s+1%_dji6%LPq#u2o%9fzN?;7Dlq6)^^VVjkKImH23RI|DPo-mXi zkOGP}@Wrnnf?-SQ^>jOIPc{pxWsr*JL*@+|p)oA7EpIDoAAoo_=+RA)c=F3Qf$N$` ze9k55q%DD7y=l+^ZG$aob+Aw6HDcRVJdzhs00Te;&l_3O74jlch$|r7GgAa!aDjay z@rG1;vK5ys2jF3n@vAgV<6)izn!k6Qhd>D(EhD7l zcrhJ1i9|1iwm?z2T#n2INXzM=7@p@Tnx$CQk39VDfC-hn-*jtB5oF-1j&4KUGI1}W z(rxuakw9eMRAJc3%8 zlBq3$QTyJX$a6$&1ldyi4Pe5AEE32Sg@vDzY~7qR?1u@oXh zd9(fBtV<@eK%Tm=yy&p7{=h^#@1W)WFFSe!U5pP~o71uR`FW)7xc*=d5_b}EG@XBZ z@<7MRp-;+|o}SzJvMyfx>37Y4etBizf%0H*zaIF?2ObZt?$D;{o|esJ z*PgAOIO^*8tL%z2)|}k$DP5kN5}8qo*wNa8y?R2=%wO{gCD(`sHt}TzWQuK zMDIJap(nb2=7*ns*oDcRBbC23yy`kvKYV`ovU`a=EmxNv-90;;5r6+l8hQTp^u`Hn XX6*+%8gHC`h)Tl}u@-r>vFqE{F~5F& literal 0 HcmV?d00001 diff --git a/applications/external/nfc_maker_215/nfc_maker.c b/applications/external/nfc_maker_215/nfc_maker.c new file mode 100644 index 00000000000..6e61f1a163e --- /dev/null +++ b/applications/external/nfc_maker_215/nfc_maker.c @@ -0,0 +1,82 @@ +#include "nfc_maker.h" + +static bool nfc_maker_custom_event_callback(void* context, uint32_t event) { + furi_assert(context); + NfcMaker* app = context; + return scene_manager_handle_custom_event(app->scene_manager, event); +} + +static bool nfc_maker_back_event_callback(void* context) { + furi_assert(context); + NfcMaker* app = context; + + return scene_manager_handle_back_event(app->scene_manager); +} + +NfcMaker* nfc_maker_alloc() { + NfcMaker* app = malloc(sizeof(NfcMaker)); + app->gui = furi_record_open(RECORD_GUI); + + // View Dispatcher and Scene Manager + app->view_dispatcher = view_dispatcher_alloc(); + app->scene_manager = scene_manager_alloc(&nfc_maker_scene_handlers, app); + view_dispatcher_enable_queue(app->view_dispatcher); + view_dispatcher_set_event_callback_context(app->view_dispatcher, app); + + view_dispatcher_set_custom_event_callback( + app->view_dispatcher, nfc_maker_custom_event_callback); + view_dispatcher_set_navigation_event_callback( + app->view_dispatcher, nfc_maker_back_event_callback); + + view_dispatcher_attach_to_gui(app->view_dispatcher, app->gui, ViewDispatcherTypeFullscreen); + + // Gui Modules + app->submenu = submenu_alloc(); + view_dispatcher_add_view( + app->view_dispatcher, NfcMakerViewSubmenu, submenu_get_view(app->submenu)); + + app->text_input = text_input_alloc(); + view_dispatcher_add_view( + app->view_dispatcher, NfcMakerViewTextInput, text_input_get_view(app->text_input)); + + app->byte_input = byte_input_alloc(); + view_dispatcher_add_view( + app->view_dispatcher, NfcMakerViewByteInput, byte_input_get_view(app->byte_input)); + + app->popup = popup_alloc(); + view_dispatcher_add_view(app->view_dispatcher, NfcMakerViewPopup, popup_get_view(app->popup)); + + return app; +} + +void nfc_maker_free(NfcMaker* app) { + furi_assert(app); + + // Gui modules + view_dispatcher_remove_view(app->view_dispatcher, NfcMakerViewSubmenu); + submenu_free(app->submenu); + view_dispatcher_remove_view(app->view_dispatcher, NfcMakerViewTextInput); + text_input_free(app->text_input); + view_dispatcher_remove_view(app->view_dispatcher, NfcMakerViewByteInput); + byte_input_free(app->byte_input); + view_dispatcher_remove_view(app->view_dispatcher, NfcMakerViewPopup); + popup_free(app->popup); + + // View Dispatcher and Scene Manager + view_dispatcher_free(app->view_dispatcher); + scene_manager_free(app->scene_manager); + + // Records + furi_record_close(RECORD_GUI); + free(app); +} + +extern int32_t nfc_maker(void* p) { + UNUSED(p); + NfcMaker* app = nfc_maker_alloc(); + scene_manager_set_scene_state(app->scene_manager, NfcMakerSceneStart, NfcMakerSceneHttps); + scene_manager_next_scene(app->scene_manager, NfcMakerSceneStart); + view_dispatcher_run(app->view_dispatcher); + nfc_maker_free(app); + return 0; +} diff --git a/applications/external/nfc_maker_215/nfc_maker.h b/applications/external/nfc_maker_215/nfc_maker.h new file mode 100644 index 00000000000..b09b4bc8404 --- /dev/null +++ b/applications/external/nfc_maker_215/nfc_maker.h @@ -0,0 +1,67 @@ +#pragma once + +#include +#include +#include +#include +#include +#include +#include "nfc_maker2_icons.h" +#include +#include +#include +#include +#include "scenes/nfc_maker_scene.h" +#include +#include +#include +#include + +#define MAC_INPUT_LEN GAP_MAC_ADDR_SIZE +#define MAIL_INPUT_LEN 128 +#define PHONE_INPUT_LEN 17 + +#define BIG_INPUT_LEN 248 +#define SMALL_INPUT_LEN 90 + +typedef enum { + WifiAuthenticationOpen = 0x01, + WifiAuthenticationWpa2Personal = 0x20, + WifiAuthenticationWpa2Enterprise = 0x10, + WifiAuthenticationWpaPersonal = 0x02, + WifiAuthenticationWpaEnterprise = 0x08, + WifiAuthenticationShared = 0x04, +} WifiAuthentication; + +typedef enum { + WifiEncryptionAes = 0x08, + WifiEncryptionWep = 0x02, + WifiEncryptionTkip = 0x04, + WifiEncryptionNone = 0x01, +} WifiEncryption; + +typedef struct { + Gui* gui; + SceneManager* scene_manager; + ViewDispatcher* view_dispatcher; + Submenu* submenu; + TextInput* text_input; + ByteInput* byte_input; + Popup* popup; + + uint8_t mac_buf[MAC_INPUT_LEN]; + char mail_buf[MAIL_INPUT_LEN]; + char phone_buf[PHONE_INPUT_LEN]; + + char big_buf[BIG_INPUT_LEN]; + char small_buf1[SMALL_INPUT_LEN]; + char small_buf2[SMALL_INPUT_LEN]; + char save_buf[BIG_INPUT_LEN]; +} NfcMaker; + +typedef enum { + NfcMakerViewSubmenu, + NfcMakerViewTextInput, + NfcMakerViewByteInput, + NfcMakerViewPopup, +} NfcMakerView; diff --git a/applications/external/nfc_maker_215/nfc_maker_10px.png b/applications/external/nfc_maker_215/nfc_maker_10px.png new file mode 100644 index 0000000000000000000000000000000000000000..a9e2443f1790f0b3a595767feb8622ff3cf7ab31 GIT binary patch literal 4142 zcmeH~d2ka|9LIxVTMCs!E&*YiGEkAt9@%WNYg4F6OCt@Gl4;8T%4YYa-D#2y$)-u` zw47xu$T0}YB`Bg*1cm`RGNYB5wt}_gK2$E{vgI0()=@?}_;z~_%s8Eq|C-6M``&jy z@Avz@-+Pl+nm%nxO!SCojYbn=OSNXeU*$SFsyF-||9T`1f2s=|*>VOKLVSM7CAtA3 z7x(}I!lFx~37_|*Ck{&dxC;rWUClX9DjCN+(S z-&lHktbO*>h|F`R&^6Z^M%Gu4+?E%2=*-Ol%h%5{CafRY{Em4{L~(G%t(w%!v2|HV z%%dBw!Tq^3$HeT))T*fOOGZVQ$9X24emLxR!`#^7+%*k!Egrc0L8EYC_RfkW8JWUZ zeqlxAwS_0p+`})EBktaw=cwOMJ@mnWvR9fS=O3H3`mdt%vPRP@PPACkZ5B&gJ}`?d zAFZi)vwHI2l0&=pE&rlqK}q(Gz4FwVvkp$^ofLa`$ei8#Y(s~=KYZ=P71D2;8>-x~ zQQs}DSX`d7y`)4Ob#Tk-+KT$Reh2Q1O{@K-D0Tl%U$gh|z6IcT#YtC5FhBdnO7dRe zi!lbZ|}mUg?=!zaGHZJ%;OnB zJ1H?bARSDF^xp zy@KVbdWFQRGx%y(bto4o(*q4daTXrlD68BWs|7KTo$8idH z;lH2|JS;VxS#%U0w4QTLonqCjpU_}^2=Ds%QfCD;n!baSPp?y#iXXwoNZDpjj;xOu zGz3MDUV0Bxj%PM&k|XM;xvOgWXz+ej*H1KO<&W|FaOK0e!F$~)OG{Ty9y#Kaqp_bg t_Wr$-tJBizZ`5U#ZOn{0H@d&CSIm|E10x2OB9No8B~P>Nd1Kz + +// Generate scene id and total number +#define ADD_SCENE(prefix, name, id) NfcMakerScene##id, +typedef enum { +#include "nfc_maker_scene_config.h" + NfcMakerSceneNum, +} NfcMakerScene; +#undef ADD_SCENE + +extern const SceneManagerHandlers nfc_maker_scene_handlers; + +// Generate scene on_enter handlers declaration +#define ADD_SCENE(prefix, name, id) void prefix##_scene_##name##_on_enter(void*); +#include "nfc_maker_scene_config.h" +#undef ADD_SCENE + +// Generate scene on_event handlers declaration +#define ADD_SCENE(prefix, name, id) \ + bool prefix##_scene_##name##_on_event(void* context, SceneManagerEvent event); +#include "nfc_maker_scene_config.h" +#undef ADD_SCENE + +// Generate scene on_exit handlers declaration +#define ADD_SCENE(prefix, name, id) void prefix##_scene_##name##_on_exit(void* context); +#include "nfc_maker_scene_config.h" +#undef ADD_SCENE diff --git a/applications/external/nfc_maker_215/scenes/nfc_maker_scene_bluetooth.c b/applications/external/nfc_maker_215/scenes/nfc_maker_scene_bluetooth.c new file mode 100644 index 00000000000..e392ea096bb --- /dev/null +++ b/applications/external/nfc_maker_215/scenes/nfc_maker_scene_bluetooth.c @@ -0,0 +1,57 @@ +#include "../nfc_maker.h" + +enum ByteInputResult { + ByteInputResultOk, +}; + +static void nfc_maker_scene_bluetooth_byte_input_callback(void* context) { + NfcMaker* app = context; + + view_dispatcher_send_custom_event(app->view_dispatcher, ByteInputResultOk); +} + +void nfc_maker_scene_bluetooth_on_enter(void* context) { + NfcMaker* app = context; + ByteInput* byte_input = app->byte_input; + + byte_input_set_header_text(byte_input, "Enter Bluetooth MAC:"); + + for(size_t i = 0; i < MAC_INPUT_LEN; i++) { + app->mac_buf[i] = 0x69; + } + + byte_input_set_result_callback( + byte_input, + nfc_maker_scene_bluetooth_byte_input_callback, + NULL, + app, + app->mac_buf, + MAC_INPUT_LEN); + + view_dispatcher_switch_to_view(app->view_dispatcher, NfcMakerViewByteInput); +} + +bool nfc_maker_scene_bluetooth_on_event(void* context, SceneManagerEvent event) { + NfcMaker* app = context; + bool consumed = false; + + if(event.type == SceneManagerEventTypeCustom) { + consumed = true; + switch(event.event) { + case ByteInputResultOk: + furi_hal_bt_reverse_mac_addr(app->mac_buf); + scene_manager_next_scene(app->scene_manager, NfcMakerSceneSave); + break; + default: + break; + } + } + + return consumed; +} + +void nfc_maker_scene_bluetooth_on_exit(void* context) { + NfcMaker* app = context; + byte_input_set_result_callback(app->byte_input, NULL, NULL, NULL, NULL, 0); + byte_input_set_header_text(app->byte_input, ""); +} diff --git a/applications/external/nfc_maker_215/scenes/nfc_maker_scene_config.h b/applications/external/nfc_maker_215/scenes/nfc_maker_scene_config.h new file mode 100644 index 00000000000..0ef4f021f6a --- /dev/null +++ b/applications/external/nfc_maker_215/scenes/nfc_maker_scene_config.h @@ -0,0 +1,18 @@ +ADD_SCENE(nfc_maker, start, Start) +ADD_SCENE(nfc_maker, bluetooth, Bluetooth) +ADD_SCENE(nfc_maker, contact, Contact) +ADD_SCENE(nfc_maker, contact_last, ContactLast) +ADD_SCENE(nfc_maker, contact_mail, ContactMail) +ADD_SCENE(nfc_maker, contact_phone, ContactPhone) +ADD_SCENE(nfc_maker, contact_url, ContactUrl) +ADD_SCENE(nfc_maker, https, Https) +ADD_SCENE(nfc_maker, mail, Mail) +ADD_SCENE(nfc_maker, phone, Phone) +ADD_SCENE(nfc_maker, text, Text) +ADD_SCENE(nfc_maker, url, Url) +ADD_SCENE(nfc_maker, wifi, Wifi) +ADD_SCENE(nfc_maker, wifi_auth, WifiAuth) +ADD_SCENE(nfc_maker, wifi_encr, WifiEncr) +ADD_SCENE(nfc_maker, wifi_pass, WifiPass) +ADD_SCENE(nfc_maker, save, Save) +ADD_SCENE(nfc_maker, result, Result) diff --git a/applications/external/nfc_maker_215/scenes/nfc_maker_scene_contact.c b/applications/external/nfc_maker_215/scenes/nfc_maker_scene_contact.c new file mode 100644 index 00000000000..ecc0546171f --- /dev/null +++ b/applications/external/nfc_maker_215/scenes/nfc_maker_scene_contact.c @@ -0,0 +1,53 @@ +#include "../nfc_maker.h" + +enum TextInputResult { + TextInputResultOk, +}; + +static void nfc_maker_scene_contact_text_input_callback(void* context) { + NfcMaker* app = context; + + view_dispatcher_send_custom_event(app->view_dispatcher, TextInputResultOk); +} + +void nfc_maker_scene_contact_on_enter(void* context) { + NfcMaker* app = context; + TextInput* text_input = app->text_input; + + text_input_set_header_text(text_input, "Enter First Name:"); + + strlcpy(app->small_buf1, "Ben", SMALL_INPUT_LEN); + + text_input_set_result_callback( + text_input, + nfc_maker_scene_contact_text_input_callback, + app, + app->small_buf1, + SMALL_INPUT_LEN, + true); + + view_dispatcher_switch_to_view(app->view_dispatcher, NfcMakerViewTextInput); +} + +bool nfc_maker_scene_contact_on_event(void* context, SceneManagerEvent event) { + NfcMaker* app = context; + bool consumed = false; + + if(event.type == SceneManagerEventTypeCustom) { + consumed = true; + switch(event.event) { + case TextInputResultOk: + scene_manager_next_scene(app->scene_manager, NfcMakerSceneContactLast); + break; + default: + break; + } + } + + return consumed; +} + +void nfc_maker_scene_contact_on_exit(void* context) { + NfcMaker* app = context; + text_input_reset(app->text_input); +} diff --git a/applications/external/nfc_maker_215/scenes/nfc_maker_scene_contact_last.c b/applications/external/nfc_maker_215/scenes/nfc_maker_scene_contact_last.c new file mode 100644 index 00000000000..78f6ba7126b --- /dev/null +++ b/applications/external/nfc_maker_215/scenes/nfc_maker_scene_contact_last.c @@ -0,0 +1,55 @@ +#include "../nfc_maker.h" + +enum TextInputResult { + TextInputResultOk, +}; + +static void nfc_maker_scene_contact_last_text_input_callback(void* context) { + NfcMaker* app = context; + + view_dispatcher_send_custom_event(app->view_dispatcher, TextInputResultOk); +} + +void nfc_maker_scene_contact_last_on_enter(void* context) { + NfcMaker* app = context; + TextInput* text_input = app->text_input; + + text_input_set_header_text(text_input, "Enter Last Name:"); + + strlcpy(app->small_buf2, "Dover", SMALL_INPUT_LEN); + + text_input_set_result_callback( + text_input, + nfc_maker_scene_contact_last_text_input_callback, + app, + app->small_buf2, + SMALL_INPUT_LEN, + true); + + text_input_set_minimum_length(text_input, 0); + + view_dispatcher_switch_to_view(app->view_dispatcher, NfcMakerViewTextInput); +} + +bool nfc_maker_scene_contact_last_on_event(void* context, SceneManagerEvent event) { + NfcMaker* app = context; + bool consumed = false; + + if(event.type == SceneManagerEventTypeCustom) { + consumed = true; + switch(event.event) { + case TextInputResultOk: + scene_manager_next_scene(app->scene_manager, NfcMakerSceneContactMail); + break; + default: + break; + } + } + + return consumed; +} + +void nfc_maker_scene_contact_last_on_exit(void* context) { + NfcMaker* app = context; + text_input_reset(app->text_input); +} diff --git a/applications/external/nfc_maker_215/scenes/nfc_maker_scene_contact_mail.c b/applications/external/nfc_maker_215/scenes/nfc_maker_scene_contact_mail.c new file mode 100644 index 00000000000..07f9c3cb7c9 --- /dev/null +++ b/applications/external/nfc_maker_215/scenes/nfc_maker_scene_contact_mail.c @@ -0,0 +1,55 @@ +#include "../nfc_maker.h" + +enum TextInputResult { + TextInputResultOk, +}; + +static void nfc_maker_scene_contact_mail_text_input_callback(void* context) { + NfcMaker* app = context; + + view_dispatcher_send_custom_event(app->view_dispatcher, TextInputResultOk); +} + +void nfc_maker_scene_contact_mail_on_enter(void* context) { + NfcMaker* app = context; + TextInput* text_input = app->text_input; + + text_input_set_header_text(text_input, "Enter Mail Address:"); + + strlcpy(app->mail_buf, "ben.dover@yourmom.zip", MAIL_INPUT_LEN); + + text_input_set_result_callback( + text_input, + nfc_maker_scene_contact_mail_text_input_callback, + app, + app->mail_buf, + MAIL_INPUT_LEN, + true); + + text_input_set_minimum_length(text_input, 0); + + view_dispatcher_switch_to_view(app->view_dispatcher, NfcMakerViewTextInput); +} + +bool nfc_maker_scene_contact_mail_on_event(void* context, SceneManagerEvent event) { + NfcMaker* app = context; + bool consumed = false; + + if(event.type == SceneManagerEventTypeCustom) { + consumed = true; + switch(event.event) { + case TextInputResultOk: + scene_manager_next_scene(app->scene_manager, NfcMakerSceneContactPhone); + break; + default: + break; + } + } + + return consumed; +} + +void nfc_maker_scene_contact_mail_on_exit(void* context) { + NfcMaker* app = context; + text_input_reset(app->text_input); +} diff --git a/applications/external/nfc_maker_215/scenes/nfc_maker_scene_contact_phone.c b/applications/external/nfc_maker_215/scenes/nfc_maker_scene_contact_phone.c new file mode 100644 index 00000000000..e9d16a21760 --- /dev/null +++ b/applications/external/nfc_maker_215/scenes/nfc_maker_scene_contact_phone.c @@ -0,0 +1,55 @@ +#include "../nfc_maker.h" + +enum TextInputResult { + TextInputResultOk, +}; + +static void nfc_maker_scene_contact_phone_text_input_callback(void* context) { + NfcMaker* app = context; + + view_dispatcher_send_custom_event(app->view_dispatcher, TextInputResultOk); +} + +void nfc_maker_scene_contact_phone_on_enter(void* context) { + NfcMaker* app = context; + TextInput* text_input = app->text_input; + + text_input_set_header_text(text_input, "Enter Phone Number:"); + + strlcpy(app->phone_buf, "+", PHONE_INPUT_LEN); + + text_input_set_result_callback( + text_input, + nfc_maker_scene_contact_phone_text_input_callback, + app, + app->phone_buf, + PHONE_INPUT_LEN, + false); + + text_input_set_minimum_length(text_input, 0); + + view_dispatcher_switch_to_view(app->view_dispatcher, NfcMakerViewTextInput); +} + +bool nfc_maker_scene_contact_phone_on_event(void* context, SceneManagerEvent event) { + NfcMaker* app = context; + bool consumed = false; + + if(event.type == SceneManagerEventTypeCustom) { + consumed = true; + switch(event.event) { + case TextInputResultOk: + scene_manager_next_scene(app->scene_manager, NfcMakerSceneContactUrl); + break; + default: + break; + } + } + + return consumed; +} + +void nfc_maker_scene_contact_phone_on_exit(void* context) { + NfcMaker* app = context; + text_input_reset(app->text_input); +} diff --git a/applications/external/nfc_maker_215/scenes/nfc_maker_scene_contact_url.c b/applications/external/nfc_maker_215/scenes/nfc_maker_scene_contact_url.c new file mode 100644 index 00000000000..1d2f61d2862 --- /dev/null +++ b/applications/external/nfc_maker_215/scenes/nfc_maker_scene_contact_url.c @@ -0,0 +1,55 @@ +#include "../nfc_maker.h" + +enum TextInputResult { + TextInputResultOk, +}; + +static void nfc_maker_scene_contact_url_text_input_callback(void* context) { + NfcMaker* app = context; + + view_dispatcher_send_custom_event(app->view_dispatcher, TextInputResultOk); +} + +void nfc_maker_scene_contact_url_on_enter(void* context) { + NfcMaker* app = context; + TextInput* text_input = app->text_input; + + text_input_set_header_text(text_input, "Enter URL Link:"); + + strlcpy(app->big_buf, "flipper-xtre.me", BIG_INPUT_LEN); + + text_input_set_result_callback( + text_input, + nfc_maker_scene_contact_url_text_input_callback, + app, + app->big_buf, + BIG_INPUT_LEN, + true); + + text_input_set_minimum_length(text_input, 0); + + view_dispatcher_switch_to_view(app->view_dispatcher, NfcMakerViewTextInput); +} + +bool nfc_maker_scene_contact_url_on_event(void* context, SceneManagerEvent event) { + NfcMaker* app = context; + bool consumed = false; + + if(event.type == SceneManagerEventTypeCustom) { + consumed = true; + switch(event.event) { + case TextInputResultOk: + scene_manager_next_scene(app->scene_manager, NfcMakerSceneSave); + break; + default: + break; + } + } + + return consumed; +} + +void nfc_maker_scene_contact_url_on_exit(void* context) { + NfcMaker* app = context; + text_input_reset(app->text_input); +} diff --git a/applications/external/nfc_maker_215/scenes/nfc_maker_scene_https.c b/applications/external/nfc_maker_215/scenes/nfc_maker_scene_https.c new file mode 100644 index 00000000000..a814f8e222c --- /dev/null +++ b/applications/external/nfc_maker_215/scenes/nfc_maker_scene_https.c @@ -0,0 +1,53 @@ +#include "../nfc_maker.h" + +enum TextInputResult { + TextInputResultOk, +}; + +static void nfc_maker_scene_https_text_input_callback(void* context) { + NfcMaker* app = context; + + view_dispatcher_send_custom_event(app->view_dispatcher, TextInputResultOk); +} + +void nfc_maker_scene_https_on_enter(void* context) { + NfcMaker* app = context; + TextInput* text_input = app->text_input; + + text_input_set_header_text(text_input, "Enter Https Link:"); + + strlcpy(app->big_buf, "flipper-xtre.me", BIG_INPUT_LEN); + + text_input_set_result_callback( + text_input, + nfc_maker_scene_https_text_input_callback, + app, + app->big_buf, + BIG_INPUT_LEN, + true); + + view_dispatcher_switch_to_view(app->view_dispatcher, NfcMakerViewTextInput); +} + +bool nfc_maker_scene_https_on_event(void* context, SceneManagerEvent event) { + NfcMaker* app = context; + bool consumed = false; + + if(event.type == SceneManagerEventTypeCustom) { + consumed = true; + switch(event.event) { + case TextInputResultOk: + scene_manager_next_scene(app->scene_manager, NfcMakerSceneSave); + break; + default: + break; + } + } + + return consumed; +} + +void nfc_maker_scene_https_on_exit(void* context) { + NfcMaker* app = context; + text_input_reset(app->text_input); +} diff --git a/applications/external/nfc_maker_215/scenes/nfc_maker_scene_mail.c b/applications/external/nfc_maker_215/scenes/nfc_maker_scene_mail.c new file mode 100644 index 00000000000..eba7319d482 --- /dev/null +++ b/applications/external/nfc_maker_215/scenes/nfc_maker_scene_mail.c @@ -0,0 +1,53 @@ +#include "../nfc_maker.h" + +enum TextInputResult { + TextInputResultOk, +}; + +static void nfc_maker_scene_mail_text_input_callback(void* context) { + NfcMaker* app = context; + + view_dispatcher_send_custom_event(app->view_dispatcher, TextInputResultOk); +} + +void nfc_maker_scene_mail_on_enter(void* context) { + NfcMaker* app = context; + TextInput* text_input = app->text_input; + + text_input_set_header_text(text_input, "Enter Mail Address:"); + + strlcpy(app->mail_buf, "ben.dover@yourmom.zip", MAIL_INPUT_LEN); + + text_input_set_result_callback( + text_input, + nfc_maker_scene_mail_text_input_callback, + app, + app->mail_buf, + MAIL_INPUT_LEN, + true); + + view_dispatcher_switch_to_view(app->view_dispatcher, NfcMakerViewTextInput); +} + +bool nfc_maker_scene_mail_on_event(void* context, SceneManagerEvent event) { + NfcMaker* app = context; + bool consumed = false; + + if(event.type == SceneManagerEventTypeCustom) { + consumed = true; + switch(event.event) { + case TextInputResultOk: + scene_manager_next_scene(app->scene_manager, NfcMakerSceneSave); + break; + default: + break; + } + } + + return consumed; +} + +void nfc_maker_scene_mail_on_exit(void* context) { + NfcMaker* app = context; + text_input_reset(app->text_input); +} diff --git a/applications/external/nfc_maker_215/scenes/nfc_maker_scene_phone.c b/applications/external/nfc_maker_215/scenes/nfc_maker_scene_phone.c new file mode 100644 index 00000000000..27ad9e67167 --- /dev/null +++ b/applications/external/nfc_maker_215/scenes/nfc_maker_scene_phone.c @@ -0,0 +1,53 @@ +#include "../nfc_maker.h" + +enum TextInputResult { + TextInputResultOk, +}; + +static void nfc_maker_scene_phone_text_input_callback(void* context) { + NfcMaker* app = context; + + view_dispatcher_send_custom_event(app->view_dispatcher, TextInputResultOk); +} + +void nfc_maker_scene_phone_on_enter(void* context) { + NfcMaker* app = context; + TextInput* text_input = app->text_input; + + text_input_set_header_text(text_input, "Enter Phone Number:"); + + strlcpy(app->phone_buf, "+", PHONE_INPUT_LEN); + + text_input_set_result_callback( + text_input, + nfc_maker_scene_phone_text_input_callback, + app, + app->phone_buf, + PHONE_INPUT_LEN, + false); + + view_dispatcher_switch_to_view(app->view_dispatcher, NfcMakerViewTextInput); +} + +bool nfc_maker_scene_phone_on_event(void* context, SceneManagerEvent event) { + NfcMaker* app = context; + bool consumed = false; + + if(event.type == SceneManagerEventTypeCustom) { + consumed = true; + switch(event.event) { + case TextInputResultOk: + scene_manager_next_scene(app->scene_manager, NfcMakerSceneSave); + break; + default: + break; + } + } + + return consumed; +} + +void nfc_maker_scene_phone_on_exit(void* context) { + NfcMaker* app = context; + text_input_reset(app->text_input); +} diff --git a/applications/external/nfc_maker_215/scenes/nfc_maker_scene_result.c b/applications/external/nfc_maker_215/scenes/nfc_maker_scene_result.c new file mode 100644 index 00000000000..ad7371b5c65 --- /dev/null +++ b/applications/external/nfc_maker_215/scenes/nfc_maker_scene_result.c @@ -0,0 +1,400 @@ +#include "../nfc_maker.h" + +enum PopupEvent { + PopupEventExit, +}; + +static void nfc_maker_scene_result_popup_callback(void* context) { + NfcMaker* app = context; + + view_dispatcher_send_custom_event(app->view_dispatcher, PopupEventExit); +} + +void nfc_maker_scene_result_on_enter(void* context) { + NfcMaker* app = context; + Popup* popup = app->popup; + bool success = false; + + FlipperFormat* file = flipper_format_file_alloc(furi_record_open(RECORD_STORAGE)); + FuriString* path = furi_string_alloc(); + furi_string_printf(path, NFC_APP_FOLDER "/%s" NFC_APP_EXTENSION, app->save_buf); + + uint32_t pages = 135; + size_t size = pages * 4; + uint8_t* buf = malloc(size); + do { + if(!flipper_format_file_open_new(file, furi_string_get_cstr(path))) break; + + if(!flipper_format_write_header_cstr(file, "Flipper NFC device", 3)) break; + if(!flipper_format_write_string_cstr(file, "Device type", "NTAG215")) break; + + // Serial number + size_t i = 0; + buf[i++] = 0x04; + furi_hal_random_fill_buf(&buf[i], 8); + i += 8; + uint8_t uid[7]; + memcpy(&uid[0], &buf[0], 3); + memcpy(&uid[3], &buf[4], 4); + + if(!flipper_format_write_hex(file, "UID", uid, sizeof(uid))) break; + if(!flipper_format_write_string_cstr(file, "ATQA", "00 44")) break; + if(!flipper_format_write_string_cstr(file, "SAK", "00")) break; + // TODO: Maybe randomize? + if(!flipper_format_write_string_cstr( + file, + "Signature", + "00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00")) + break; + if(!flipper_format_write_string_cstr(file, "Mifare version", "00 04 04 02 01 00 11 03")) + break; + + if(!flipper_format_write_string_cstr(file, "Counter 0", "0")) break; + if(!flipper_format_write_string_cstr(file, "Tearing 0", "00")) break; + if(!flipper_format_write_string_cstr(file, "Counter 1", "0")) break; + if(!flipper_format_write_string_cstr(file, "Tearing 1", "00")) break; + if(!flipper_format_write_string_cstr(file, "Counter 2", "0")) break; + if(!flipper_format_write_string_cstr(file, "Tearing 2", "00")) break; + if(!flipper_format_write_uint32(file, "Pages total", &pages, 1)) break; + + // Static data + buf[i++] = 0x48; // Internal + buf[i++] = 0x00; // Lock bytes + buf[i++] = 0x00; // ... + + buf[i++] = 0xE1; // Capability container + buf[i++] = 0x10; // ... + buf[i++] = 0x3E; // ... + buf[i++] = 0x00; // ... + + buf[i++] = 0x03; // Container flags + + // NDEF Docs: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/protocols/nfc/index.html#nfc-data-exchange-format-ndef + uint8_t tnf = 0x00; + const char* type = ""; + uint8_t* payload = NULL; + size_t payload_len = 0; + + size_t data_len = 0; + size_t j = 0; + switch(scene_manager_get_scene_state(app->scene_manager, NfcMakerSceneStart)) { + case NfcMakerSceneBluetooth: { + tnf = 0x02; // Media-type [RFC 2046] + type = "application/vnd.bluetooth.ep.oob"; + + data_len = MAC_INPUT_LEN; + payload_len = data_len + 2; + payload = malloc(payload_len); + + payload[j++] = 0x08; + payload[j++] = 0x00; + memcpy(&payload[j], app->mac_buf, data_len); + j += data_len; + break; + } + case NfcMakerSceneContact: { + tnf = 0x02; // Media-type [RFC 2046] + type = "text/vcard"; + + FuriString* vcard = furi_string_alloc_set("BEGIN:VCARD\r\nVERSION:3.0\r\n"); + furi_string_cat_printf( + vcard, "PRODID:-//Flipper Xtreme//%s//EN\r\n", version_get_version(NULL)); + furi_string_cat_printf(vcard, "N:%s;%s;;;\r\n", app->small_buf2, app->small_buf1); + furi_string_cat_printf( + vcard, + "FN:%s%s%s\r\n", + app->small_buf1, + strnlen(app->small_buf2, SMALL_INPUT_LEN) ? " " : "", + app->small_buf2); + if(strnlen(app->mail_buf, MAIL_INPUT_LEN)) { + furi_string_cat_printf(vcard, "EMAIL:%s\r\n", app->mail_buf); + } + if(strnlen(app->phone_buf, PHONE_INPUT_LEN)) { + furi_string_cat_printf(vcard, "TEL:%s\r\n", app->phone_buf); + } + if(strnlen(app->big_buf, BIG_INPUT_LEN)) { + furi_string_cat_printf(vcard, "URL:%s\r\n", app->big_buf); + } + furi_string_cat_printf(vcard, "END:VCARD\r\n"); + + payload_len = furi_string_size(vcard); + payload = malloc(payload_len); + memcpy(payload, furi_string_get_cstr(vcard), payload_len); + furi_string_free(vcard); + break; + } + case NfcMakerSceneHttps: { + tnf = 0x01; // NFC Forum well-known type [NFC RTD] + type = "\x55"; + + data_len = strnlen(app->big_buf, BIG_INPUT_LEN); + payload_len = data_len + 1; + payload = malloc(payload_len); + + payload[j++] = 0x04; // Prepend "https://" + memcpy(&payload[j], app->big_buf, data_len); + j += data_len; + break; + } + case NfcMakerSceneMail: { + tnf = 0x01; // NFC Forum well-known type [NFC RTD] + type = "\x55"; + + data_len = strnlen(app->mail_buf, MAIL_INPUT_LEN); + payload_len = data_len + 1; + payload = malloc(payload_len); + + payload[j++] = 0x06; // Prepend "mailto:" + memcpy(&payload[j], app->mail_buf, data_len); + j += data_len; + break; + } + case NfcMakerScenePhone: { + tnf = 0x01; // NFC Forum well-known type [NFC RTD] + type = "\x55"; + + data_len = strnlen(app->phone_buf, PHONE_INPUT_LEN); + payload_len = data_len + 1; + payload = malloc(payload_len); + + payload[j++] = 0x05; // Prepend "tel:" + memcpy(&payload[j], app->phone_buf, data_len); + j += data_len; + break; + } + case NfcMakerSceneText: { + tnf = 0x01; // NFC Forum well-known type [NFC RTD] + type = "\x54"; + + data_len = strnlen(app->big_buf, BIG_INPUT_LEN); + payload_len = data_len + 3; + payload = malloc(payload_len); + + payload[j++] = 0x02; + payload[j++] = 0x65; // e + payload[j++] = 0x6E; // n + memcpy(&payload[j], app->big_buf, data_len); + j += data_len; + break; + } + case NfcMakerSceneUrl: { + tnf = 0x01; // NFC Forum well-known type [NFC RTD] + type = "\x55"; + + data_len = strnlen(app->big_buf, BIG_INPUT_LEN); + payload_len = data_len + 1; + payload = malloc(payload_len); + + payload[j++] = 0x00; // No prepend + memcpy(&payload[j], app->big_buf, data_len); + j += data_len; + break; + } + case NfcMakerSceneWifi: { + tnf = 0x02; // Media-type [RFC 2046] + type = "application/vnd.wfa.wsc"; + + uint8_t ssid_len = strnlen(app->small_buf1, SMALL_INPUT_LEN); + uint8_t pass_len = strnlen(app->small_buf2, SMALL_INPUT_LEN); + uint8_t data_len = ssid_len + pass_len; + payload_len = data_len + 39; + payload = malloc(payload_len); + + payload[j++] = 0x10; + payload[j++] = 0x0E; + payload[j++] = 0x00; + + payload[j++] = data_len + 43; + payload[j++] = 0x10; + payload[j++] = 0x26; + payload[j++] = 0x00; + + payload[j++] = 0x01; + payload[j++] = 0x01; + payload[j++] = 0x10; + payload[j++] = 0x45; + + payload[j++] = 0x00; + payload[j++] = ssid_len; + memcpy(&payload[j], app->small_buf1, ssid_len); + j += ssid_len; + payload[j++] = 0x10; + payload[j++] = 0x03; + + payload[j++] = 0x00; + payload[j++] = 0x02; + payload[j++] = 0x00; + payload[j++] = + scene_manager_get_scene_state(app->scene_manager, NfcMakerSceneWifiAuth); + + payload[j++] = 0x10; + payload[j++] = 0x0F; + payload[j++] = 0x00; + payload[j++] = 0x02; + + payload[j++] = 0x00; + payload[j++] = + scene_manager_get_scene_state(app->scene_manager, NfcMakerSceneWifiEncr); + payload[j++] = 0x10; + payload[j++] = 0x27; + + payload[j++] = 0x00; + payload[j++] = pass_len; + memcpy(&payload[j], app->small_buf2, pass_len); + j += pass_len; + payload[j++] = 0x10; + payload[j++] = 0x20; + + payload[j++] = 0x00; + payload[j++] = 0x06; + payload[j++] = 0xFF; + payload[j++] = 0xFF; + + payload[j++] = 0xFF; + payload[j++] = 0xFF; + payload[j++] = 0xFF; + payload[j++] = 0xFF; + + break; + } + default: + break; + } + + // Record header + uint8_t flags = 0; + flags |= 1 << 7; // MB (Message Begin) + flags |= 1 << 6; // ME (Message End) + flags |= tnf; // TNF (Type Name Format) + size_t type_len = strlen(type); + + size_t header_len = 0; + header_len += 1; // Flags and TNF + header_len += 1; // Type length + if(payload_len < 0xFF) { + flags |= 1 << 4; // SR (Short Record) + header_len += 1; // Payload length + } else { + header_len += 4; // Payload length + } + header_len += type_len; // Payload type + + size_t record_len = header_len + payload_len; + if(record_len < 0xFF) { + buf[i++] = record_len; // Record length + } else { + buf[i++] = 0xFF; // Record length + buf[i++] = record_len >> 8; // ... + buf[i++] = record_len & 0xFF; // ... + } + buf[i++] = flags; // Flags and TNF + buf[i++] = type_len; // Type length + if(flags & 1 << 4) { // SR (Short Record) + buf[i++] = payload_len; // Payload length + } else { + buf[i++] = 0x00; // Payload length + buf[i++] = 0x00; // ... + buf[i++] = payload_len >> 8; // ... + buf[i++] = payload_len & 0xFF; // ... + } + memcpy(&buf[i], type, type_len); // Payload type + i += type_len; + + // Record payload + memcpy(&buf[i], payload, payload_len); + i += payload_len; + free(payload); + + // Record terminator + buf[i++] = 0xFE; + + // Padding until last 5 pages + for(; i < size - 20; i++) { + buf[i] = 0x00; + } + + // Last 5 static pages + buf[i++] = 0x00; + buf[i++] = 0x00; + buf[i++] = 0x00; + buf[i++] = 0xBD; + + buf[i++] = 0x04; + buf[i++] = 0x00; + buf[i++] = 0x00; + buf[i++] = 0xFF; + + buf[i++] = 0x00; + buf[i++] = 0x05; + buf[i++] = 0x00; + buf[i++] = 0x00; + + buf[i++] = 0xFF; + buf[i++] = 0xFF; + buf[i++] = 0xFF; + buf[i++] = 0xFF; + + buf[i++] = 0x00; + buf[i++] = 0x00; + buf[i++] = 0x00; + buf[i++] = 0x00; + + // Write pages + char str[16]; + bool ok = true; + for(size_t page = 0; page < pages; page++) { + snprintf(str, sizeof(str), "Page %u", page); + if(!flipper_format_write_hex(file, str, &buf[page * 4], 4)) { + ok = false; + break; + } + } + if(!ok) break; + + success = true; + + } while(false); + free(buf); + + furi_string_free(path); + flipper_format_free(file); + furi_record_close(RECORD_STORAGE); + + if(success) { + popup_set_icon(popup, 32, 5, &I_DolphinNice_96x59); + popup_set_header(popup, "Saved!", 13, 22, AlignLeft, AlignBottom); + } else { + popup_set_icon(popup, 32, 5, &I_DolphinNice_96x59); + popup_set_header(popup, "Saved!", 13, 22, AlignLeft, AlignBottom); + } + popup_set_timeout(popup, 1500); + popup_set_context(popup, app); + popup_set_callback(popup, nfc_maker_scene_result_popup_callback); + popup_enable_timeout(popup); + + view_dispatcher_switch_to_view(app->view_dispatcher, NfcMakerViewPopup); +} + +bool nfc_maker_scene_result_on_event(void* context, SceneManagerEvent event) { + NfcMaker* app = context; + bool consumed = false; + + if(event.type == SceneManagerEventTypeCustom) { + consumed = true; + switch(event.event) { + case PopupEventExit: + scene_manager_search_and_switch_to_previous_scene( + app->scene_manager, NfcMakerSceneStart); + break; + default: + break; + } + } + + return consumed; +} + +void nfc_maker_scene_result_on_exit(void* context) { + NfcMaker* app = context; + popup_reset(app->popup); +} diff --git a/applications/external/nfc_maker_215/scenes/nfc_maker_scene_save.c b/applications/external/nfc_maker_215/scenes/nfc_maker_scene_save.c new file mode 100644 index 00000000000..e307c92dcd6 --- /dev/null +++ b/applications/external/nfc_maker_215/scenes/nfc_maker_scene_save.c @@ -0,0 +1,57 @@ +#include "../nfc_maker.h" + +enum TextInputResult { + TextInputResultOk, +}; + +static void nfc_maker_scene_save_text_input_callback(void* context) { + NfcMaker* app = context; + + view_dispatcher_send_custom_event(app->view_dispatcher, TextInputResultOk); +} + +void nfc_maker_scene_save_on_enter(void* context) { + NfcMaker* app = context; + TextInput* text_input = app->text_input; + + text_input_set_header_text(text_input, "Save the NFC tag:"); + + set_random_name(app->save_buf, BIG_INPUT_LEN); + + text_input_set_result_callback( + text_input, + nfc_maker_scene_save_text_input_callback, + app, + app->save_buf, + BIG_INPUT_LEN, + true); + + ValidatorIsFile* validator_is_file = + validator_is_file_alloc_init(NFC_APP_FOLDER, NFC_APP_EXTENSION, NULL); + text_input_set_validator(text_input, validator_is_file_callback, validator_is_file); + + view_dispatcher_switch_to_view(app->view_dispatcher, NfcMakerViewTextInput); +} + +bool nfc_maker_scene_save_on_event(void* context, SceneManagerEvent event) { + NfcMaker* app = context; + bool consumed = false; + + if(event.type == SceneManagerEventTypeCustom) { + consumed = true; + switch(event.event) { + case TextInputResultOk: + scene_manager_next_scene(app->scene_manager, NfcMakerSceneResult); + break; + default: + break; + } + } + + return consumed; +} + +void nfc_maker_scene_save_on_exit(void* context) { + NfcMaker* app = context; + text_input_reset(app->text_input); +} diff --git a/applications/external/nfc_maker_215/scenes/nfc_maker_scene_start.c b/applications/external/nfc_maker_215/scenes/nfc_maker_scene_start.c new file mode 100644 index 00000000000..e791b1284a1 --- /dev/null +++ b/applications/external/nfc_maker_215/scenes/nfc_maker_scene_start.c @@ -0,0 +1,68 @@ +#include "../nfc_maker.h" + +void nfc_maker_scene_start_submenu_callback(void* context, uint32_t index) { + NfcMaker* app = context; + view_dispatcher_send_custom_event(app->view_dispatcher, index); +} + +void nfc_maker_scene_start_on_enter(void* context) { + NfcMaker* app = context; + Submenu* submenu = app->submenu; + + submenu_set_header(submenu, "NFC Tag Maker:"); + + submenu_add_item( + submenu, + "Bluetooth MAC", + NfcMakerSceneBluetooth, + nfc_maker_scene_start_submenu_callback, + app); + + submenu_add_item( + submenu, + "Contact Vcard", + NfcMakerSceneContact, + nfc_maker_scene_start_submenu_callback, + app); + + submenu_add_item( + submenu, "HTTPS Link", NfcMakerSceneHttps, nfc_maker_scene_start_submenu_callback, app); + + submenu_add_item( + submenu, "Mail Address", NfcMakerSceneMail, nfc_maker_scene_start_submenu_callback, app); + + submenu_add_item( + submenu, "Phone Number", NfcMakerScenePhone, nfc_maker_scene_start_submenu_callback, app); + + submenu_add_item( + submenu, "Text Note", NfcMakerSceneText, nfc_maker_scene_start_submenu_callback, app); + + submenu_add_item( + submenu, "Plain URL", NfcMakerSceneUrl, nfc_maker_scene_start_submenu_callback, app); + + submenu_add_item( + submenu, "WiFi Login", NfcMakerSceneWifi, nfc_maker_scene_start_submenu_callback, app); + + submenu_set_selected_item( + submenu, scene_manager_get_scene_state(app->scene_manager, NfcMakerSceneStart)); + + view_dispatcher_switch_to_view(app->view_dispatcher, NfcMakerViewSubmenu); +} + +bool nfc_maker_scene_start_on_event(void* context, SceneManagerEvent event) { + NfcMaker* app = context; + bool consumed = false; + + if(event.type == SceneManagerEventTypeCustom) { + scene_manager_set_scene_state(app->scene_manager, NfcMakerSceneStart, event.event); + consumed = true; + scene_manager_next_scene(app->scene_manager, event.event); + } + + return consumed; +} + +void nfc_maker_scene_start_on_exit(void* context) { + NfcMaker* app = context; + submenu_reset(app->submenu); +} diff --git a/applications/external/nfc_maker_215/scenes/nfc_maker_scene_text.c b/applications/external/nfc_maker_215/scenes/nfc_maker_scene_text.c new file mode 100644 index 00000000000..4c86f3b52d8 --- /dev/null +++ b/applications/external/nfc_maker_215/scenes/nfc_maker_scene_text.c @@ -0,0 +1,53 @@ +#include "../nfc_maker.h" + +enum TextInputResult { + TextInputResultOk, +}; + +static void nfc_maker_scene_text_text_input_callback(void* context) { + NfcMaker* app = context; + + view_dispatcher_send_custom_event(app->view_dispatcher, TextInputResultOk); +} + +void nfc_maker_scene_text_on_enter(void* context) { + NfcMaker* app = context; + TextInput* text_input = app->text_input; + + text_input_set_header_text(text_input, "Enter Text Note:"); + + strlcpy(app->big_buf, "Lorem ipsum", BIG_INPUT_LEN); + + text_input_set_result_callback( + text_input, + nfc_maker_scene_text_text_input_callback, + app, + app->big_buf, + BIG_INPUT_LEN, + true); + + view_dispatcher_switch_to_view(app->view_dispatcher, NfcMakerViewTextInput); +} + +bool nfc_maker_scene_text_on_event(void* context, SceneManagerEvent event) { + NfcMaker* app = context; + bool consumed = false; + + if(event.type == SceneManagerEventTypeCustom) { + consumed = true; + switch(event.event) { + case TextInputResultOk: + scene_manager_next_scene(app->scene_manager, NfcMakerSceneSave); + break; + default: + break; + } + } + + return consumed; +} + +void nfc_maker_scene_text_on_exit(void* context) { + NfcMaker* app = context; + text_input_reset(app->text_input); +} diff --git a/applications/external/nfc_maker_215/scenes/nfc_maker_scene_url.c b/applications/external/nfc_maker_215/scenes/nfc_maker_scene_url.c new file mode 100644 index 00000000000..f5d2eddaaaa --- /dev/null +++ b/applications/external/nfc_maker_215/scenes/nfc_maker_scene_url.c @@ -0,0 +1,53 @@ +#include "../nfc_maker.h" + +enum TextInputResult { + TextInputResultOk, +}; + +static void nfc_maker_scene_url_text_input_callback(void* context) { + NfcMaker* app = context; + + view_dispatcher_send_custom_event(app->view_dispatcher, TextInputResultOk); +} + +void nfc_maker_scene_url_on_enter(void* context) { + NfcMaker* app = context; + TextInput* text_input = app->text_input; + + text_input_set_header_text(text_input, "Enter Plain URL:"); + + strlcpy(app->big_buf, "https://flipper-xtre.me", BIG_INPUT_LEN); + + text_input_set_result_callback( + text_input, + nfc_maker_scene_url_text_input_callback, + app, + app->big_buf, + BIG_INPUT_LEN, + true); + + view_dispatcher_switch_to_view(app->view_dispatcher, NfcMakerViewTextInput); +} + +bool nfc_maker_scene_url_on_event(void* context, SceneManagerEvent event) { + NfcMaker* app = context; + bool consumed = false; + + if(event.type == SceneManagerEventTypeCustom) { + consumed = true; + switch(event.event) { + case TextInputResultOk: + scene_manager_next_scene(app->scene_manager, NfcMakerSceneSave); + break; + default: + break; + } + } + + return consumed; +} + +void nfc_maker_scene_url_on_exit(void* context) { + NfcMaker* app = context; + text_input_reset(app->text_input); +} diff --git a/applications/external/nfc_maker_215/scenes/nfc_maker_scene_wifi.c b/applications/external/nfc_maker_215/scenes/nfc_maker_scene_wifi.c new file mode 100644 index 00000000000..cfbc51ace35 --- /dev/null +++ b/applications/external/nfc_maker_215/scenes/nfc_maker_scene_wifi.c @@ -0,0 +1,55 @@ +#include "../nfc_maker.h" + +enum TextInputResult { + TextInputResultOk, +}; + +static void nfc_maker_scene_wifi_text_input_callback(void* context) { + NfcMaker* app = context; + + view_dispatcher_send_custom_event(app->view_dispatcher, TextInputResultOk); +} + +void nfc_maker_scene_wifi_on_enter(void* context) { + NfcMaker* app = context; + TextInput* text_input = app->text_input; + + text_input_set_header_text(text_input, "Enter WiFi SSID:"); + + strlcpy(app->small_buf1, "Bill Wi the Science Fi", SMALL_INPUT_LEN); + + text_input_set_result_callback( + text_input, + nfc_maker_scene_wifi_text_input_callback, + app, + app->small_buf1, + SMALL_INPUT_LEN, + true); + + view_dispatcher_switch_to_view(app->view_dispatcher, NfcMakerViewTextInput); +} + +bool nfc_maker_scene_wifi_on_event(void* context, SceneManagerEvent event) { + NfcMaker* app = context; + bool consumed = false; + + if(event.type == SceneManagerEventTypeCustom) { + consumed = true; + switch(event.event) { + case TextInputResultOk: + scene_manager_set_scene_state( + app->scene_manager, NfcMakerSceneWifiAuth, WifiAuthenticationWpa2Personal); + scene_manager_next_scene(app->scene_manager, NfcMakerSceneWifiAuth); + break; + default: + break; + } + } + + return consumed; +} + +void nfc_maker_scene_wifi_on_exit(void* context) { + NfcMaker* app = context; + text_input_reset(app->text_input); +} diff --git a/applications/external/nfc_maker_215/scenes/nfc_maker_scene_wifi_auth.c b/applications/external/nfc_maker_215/scenes/nfc_maker_scene_wifi_auth.c new file mode 100644 index 00000000000..6e14c4e97e5 --- /dev/null +++ b/applications/external/nfc_maker_215/scenes/nfc_maker_scene_wifi_auth.c @@ -0,0 +1,83 @@ +#include "../nfc_maker.h" + +void nfc_maker_scene_wifi_auth_submenu_callback(void* context, uint32_t index) { + NfcMaker* app = context; + view_dispatcher_send_custom_event(app->view_dispatcher, index); +} + +void nfc_maker_scene_wifi_auth_on_enter(void* context) { + NfcMaker* app = context; + Submenu* submenu = app->submenu; + + submenu_set_header(submenu, "Authentication Type:"); + + submenu_add_item( + submenu, "Open", WifiAuthenticationOpen, nfc_maker_scene_wifi_auth_submenu_callback, app); + + submenu_add_item( + submenu, + "WPA 2 Personal", + WifiAuthenticationWpa2Personal, + nfc_maker_scene_wifi_auth_submenu_callback, + app); + + submenu_add_item( + submenu, + "WPA 2 Enterprise", + WifiAuthenticationWpa2Enterprise, + nfc_maker_scene_wifi_auth_submenu_callback, + app); + + submenu_add_item( + submenu, + "WPA Personal", + WifiAuthenticationWpaPersonal, + nfc_maker_scene_wifi_auth_submenu_callback, + app); + + submenu_add_item( + submenu, + "WPA Enterprise", + WifiAuthenticationWpaEnterprise, + nfc_maker_scene_wifi_auth_submenu_callback, + app); + + submenu_add_item( + submenu, + "Shared", + WifiAuthenticationShared, + nfc_maker_scene_wifi_auth_submenu_callback, + app); + + submenu_set_selected_item( + submenu, scene_manager_get_scene_state(app->scene_manager, NfcMakerSceneWifiAuth)); + + view_dispatcher_switch_to_view(app->view_dispatcher, NfcMakerViewSubmenu); +} + +bool nfc_maker_scene_wifi_auth_on_event(void* context, SceneManagerEvent event) { + NfcMaker* app = context; + bool consumed = false; + + if(event.type == SceneManagerEventTypeCustom) { + scene_manager_set_scene_state(app->scene_manager, NfcMakerSceneWifiAuth, event.event); + consumed = true; + if(event.event == WifiAuthenticationOpen) { + scene_manager_set_scene_state( + app->scene_manager, NfcMakerSceneWifiEncr, WifiEncryptionNone); + strcpy(app->small_buf2, ""); + scene_manager_next_scene(app->scene_manager, NfcMakerSceneSave); + } else { + scene_manager_set_scene_state( + app->scene_manager, NfcMakerSceneWifiEncr, WifiEncryptionAes); + scene_manager_next_scene(app->scene_manager, NfcMakerSceneWifiEncr); + } + } + + return consumed; +} + +void nfc_maker_scene_wifi_auth_on_exit(void* context) { + NfcMaker* app = context; + submenu_reset(app->submenu); +} diff --git a/applications/external/nfc_maker_215/scenes/nfc_maker_scene_wifi_encr.c b/applications/external/nfc_maker_215/scenes/nfc_maker_scene_wifi_encr.c new file mode 100644 index 00000000000..d1a21f51a5a --- /dev/null +++ b/applications/external/nfc_maker_215/scenes/nfc_maker_scene_wifi_encr.c @@ -0,0 +1,48 @@ +#include "../nfc_maker.h" + +void nfc_maker_scene_wifi_encr_submenu_callback(void* context, uint32_t index) { + NfcMaker* app = context; + view_dispatcher_send_custom_event(app->view_dispatcher, index); +} + +void nfc_maker_scene_wifi_encr_on_enter(void* context) { + NfcMaker* app = context; + Submenu* submenu = app->submenu; + + submenu_set_header(submenu, "Encryption Type:"); + + submenu_add_item( + submenu, "AES", WifiEncryptionAes, nfc_maker_scene_wifi_encr_submenu_callback, app); + + submenu_add_item( + submenu, "WEP", WifiEncryptionWep, nfc_maker_scene_wifi_encr_submenu_callback, app); + + submenu_add_item( + submenu, "TKIP", WifiEncryptionTkip, nfc_maker_scene_wifi_encr_submenu_callback, app); + + submenu_add_item( + submenu, "None", WifiEncryptionNone, nfc_maker_scene_wifi_encr_submenu_callback, app); + + submenu_set_selected_item( + submenu, scene_manager_get_scene_state(app->scene_manager, NfcMakerSceneWifiEncr)); + + view_dispatcher_switch_to_view(app->view_dispatcher, NfcMakerViewSubmenu); +} + +bool nfc_maker_scene_wifi_encr_on_event(void* context, SceneManagerEvent event) { + NfcMaker* app = context; + bool consumed = false; + + if(event.type == SceneManagerEventTypeCustom) { + scene_manager_set_scene_state(app->scene_manager, NfcMakerSceneWifiEncr, event.event); + consumed = true; + scene_manager_next_scene(app->scene_manager, NfcMakerSceneWifiPass); + } + + return consumed; +} + +void nfc_maker_scene_wifi_encr_on_exit(void* context) { + NfcMaker* app = context; + submenu_reset(app->submenu); +} diff --git a/applications/external/nfc_maker_215/scenes/nfc_maker_scene_wifi_pass.c b/applications/external/nfc_maker_215/scenes/nfc_maker_scene_wifi_pass.c new file mode 100644 index 00000000000..acf1d7447b4 --- /dev/null +++ b/applications/external/nfc_maker_215/scenes/nfc_maker_scene_wifi_pass.c @@ -0,0 +1,53 @@ +#include "../nfc_maker.h" + +enum TextInputResult { + TextInputResultOk, +}; + +static void nfc_maker_scene_wifi_pass_text_input_callback(void* context) { + NfcMaker* app = context; + + view_dispatcher_send_custom_event(app->view_dispatcher, TextInputResultOk); +} + +void nfc_maker_scene_wifi_pass_on_enter(void* context) { + NfcMaker* app = context; + TextInput* text_input = app->text_input; + + text_input_set_header_text(text_input, "Enter WiFi Password:"); + + strlcpy(app->small_buf2, "244466666", SMALL_INPUT_LEN); + + text_input_set_result_callback( + text_input, + nfc_maker_scene_wifi_pass_text_input_callback, + app, + app->small_buf2, + SMALL_INPUT_LEN, + true); + + view_dispatcher_switch_to_view(app->view_dispatcher, NfcMakerViewTextInput); +} + +bool nfc_maker_scene_wifi_pass_on_event(void* context, SceneManagerEvent event) { + NfcMaker* app = context; + bool consumed = false; + + if(event.type == SceneManagerEventTypeCustom) { + consumed = true; + switch(event.event) { + case TextInputResultOk: + scene_manager_next_scene(app->scene_manager, NfcMakerSceneSave); + break; + default: + break; + } + } + + return consumed; +} + +void nfc_maker_scene_wifi_pass_on_exit(void* context) { + NfcMaker* app = context; + text_input_reset(app->text_input); +}