Skip to content

Commit

Permalink
Latest Release RM0206-0000-0.93.9-bbf0731 on PATREON - UPD NFC MAKER
Browse files Browse the repository at this point in the history
  • Loading branch information
RogueMaster committed Feb 7, 2024
1 parent 2ba5d76 commit 6a7d4b2
Show file tree
Hide file tree
Showing 22 changed files with 1,212 additions and 501 deletions.
4 changes: 2 additions & 2 deletions ReadMe.md
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ This software is for experimental purposes only and is not meant for any illegal
- NFC: Parsers PartialRead fixes (By Willy-JL)
- NFC: Improve NDEF parser safety (By Willy-JL)
- Removed: [NFC Maker NTAG203 (by Willy-JL)](https://github.com/RogueMaster/flipperzero-firmware-wPlugins/commit/343cb39d08f60b75b537e1a31100707935cf6e9d)
- Updated: [NFC Maker v1.1 (by Willy-JL)](https://github.com/RogueMaster/flipperzero-firmware-wPlugins/commit/343cb39d08f60b75b537e1a31100707935cf6e9d)
- Updated: [NFC Maker v1.2 (by Willy-JL)](https://github.com/RogueMaster/flipperzero-firmware-wPlugins/commit/343cb39d08f60b75b537e1a31100707935cf6e9d)

<a name="release">

Expand Down Expand Up @@ -593,7 +593,7 @@ $ ./fbt dolphin_ext
- [Mx2125 Step Counter v1.0 (By 47lecoste a.k.a. grugnoymeme)](https://github.com/grugnoymeme/flipperzero-stepcounter-fap)
- [Name Changer (By ESurge)](https://github.com/RogueMaster/flipperzero-firmware-wPlugins/pull/488) (Change Flipper name)
- [NFC Magic v1.5 (By gornekich)](https://github.com/flipperdevices/flipperzero-firmware/pull/1966)
- [NFC Maker v1.1 (by Willy-JL)](https://github.com/RogueMaster/flipperzero-firmware-wPlugins/commit/343cb39d08f60b75b537e1a31100707935cf6e9d)
- [NFC Maker v1.2 (by Willy-JL)](https://github.com/RogueMaster/flipperzero-firmware-wPlugins/commit/343cb39d08f60b75b537e1a31100707935cf6e9d)
- [NFC Playlist v1.1 (By acegoal07)](https://github.com/acegoal07/FlipperZero_NFC_Playlist/tree/main)
- [NFC Seader v2.3 (By bettse)](https://github.com/bettse/seader)
- [Nightstand Clock v1.1 (By nymda)](https://github.com/nymda/FlipperNightStand)
Expand Down
674 changes: 674 additions & 0 deletions applications/external/nfc_maker/LICENSE

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions applications/external/nfc_maker/application.fam
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@ App(
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, 1),
fap_version=(1, 2),
fap_description="make tags with URLs, Wifi and other things",
)
11 changes: 0 additions & 11 deletions applications/external/nfc_maker/newstrnlen.c

This file was deleted.

6 changes: 0 additions & 6 deletions applications/external/nfc_maker/newstrnlen.h

This file was deleted.

33 changes: 33 additions & 0 deletions applications/external/nfc_maker/nfc_maker.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,30 @@
#include "nfc_maker.h"

const NfcDataGeneratorType ntag_generators[NtagMAX] = {
[Ntag203] = NfcDataGeneratorTypeNTAG203,
[Ntag213] = NfcDataGeneratorTypeNTAG213,
[Ntag215] = NfcDataGeneratorTypeNTAG215,
[Ntag216] = NfcDataGeneratorTypeNTAG216,
[NtagI2C1K] = NfcDataGeneratorTypeNTAGI2C1k,
[NtagI2C2K] = NfcDataGeneratorTypeNTAGI2C2k,
};
const char* ntag_names[NtagMAX] = {
[Ntag203] = "NTAG203",
[Ntag213] = "NTAG213",
[Ntag215] = "NTAG215",
[Ntag216] = "NTAG216",
[NtagI2C1K] = "NTAG I2C 1K",
[NtagI2C2K] = "NTAG I2C 2K",
};
const size_t ntag_sizes[NtagMAX] = {
[Ntag203] = 0x12 * NTAG_DATA_AREA_UNIT_SIZE,
[Ntag213] = 0x12 * NTAG_DATA_AREA_UNIT_SIZE,
[Ntag215] = 0x3E * NTAG_DATA_AREA_UNIT_SIZE,
[Ntag216] = 0x6D * NTAG_DATA_AREA_UNIT_SIZE,
[NtagI2C1K] = 0x6D * NTAG_DATA_AREA_UNIT_SIZE,
[NtagI2C2K] = 0xEA * NTAG_DATA_AREA_UNIT_SIZE,
};

static bool nfc_maker_custom_event_callback(void* context, uint32_t event) {
furi_assert(context);
NfcMaker* app = context;
Expand Down Expand Up @@ -48,12 +73,20 @@ NfcMaker* nfc_maker_alloc() {
app->popup = popup_alloc();
view_dispatcher_add_view(app->view_dispatcher, NfcMakerViewPopup, popup_get_view(app->popup));

// Nfc Device
app->nfc_device = nfc_device_alloc();
app->ndef_buffer = malloc(MAX_NDEF_LEN);

return app;
}

void nfc_maker_free(NfcMaker* app) {
furi_assert(app);

// Nfc Device
nfc_device_free(app->nfc_device);
free(app->ndef_buffer);

// Gui modules
view_dispatcher_remove_view(app->view_dispatcher, NfcMakerViewSubmenu);
submenu_free(app->submenu);
Expand Down
28 changes: 23 additions & 5 deletions applications/external/nfc_maker/nfc_maker.h
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
#pragma once

#include <furi.h>
#include <gui/gui.h>
#include <gui/view.h>
#include <gui/modules/validators.h>
#include <gui/view_dispatcher.h>
#include <gui/scene_manager.h>
#include "nfc_maker2_icons.h"
#include <nfc_maker_icons.h>
#include <gui/modules/submenu.h>
#include "nfc_maker_text_input.h"
#include <gui/modules/byte_input.h>
#include <gui/modules/popup.h>
#include "scenes/nfc_maker_scene.h"
#include <lib/flipper_format/flipper_format.h>
#include <toolbox/name_generator.h>
#include <applications/main/nfc/nfc_app_i.h>
#include <furi_hal_bt.h>
#include "newstrnlen.h"

#define NFC_MK_APP_FOLDER EXT_PATH("nfc")
#define NFC_MK_APP_EXTENSION ".nfc"

#define MAC_INPUT_LEN GAP_MAC_ADDR_SIZE
#define MAIL_INPUT_LEN 128
Expand All @@ -24,6 +24,21 @@
#define BIG_INPUT_LEN 248
#define SMALL_INPUT_LEN 90

#define NTAG_DATA_AREA_UNIT_SIZE 2 * MF_ULTRALIGHT_PAGE_SIZE
typedef enum {
Ntag203,
Ntag213,
Ntag215,
Ntag216,
NtagI2C1K,
NtagI2C2K,
NtagMAX,
} Ntag;
extern const NfcDataGeneratorType ntag_generators[NtagMAX];
extern const char* ntag_names[NtagMAX];
extern const size_t ntag_sizes[NtagMAX];
#define MAX_NDEF_LEN ntag_sizes[NtagI2C2K]

typedef enum {
WifiAuthenticationOpen = 0x01,
WifiAuthenticationWpa2Personal = 0x20,
Expand All @@ -49,6 +64,9 @@ typedef struct {
ByteInput* byte_input;
Popup* popup;

NfcDevice* nfc_device;
uint8_t* ndef_buffer;

uint8_t mac_buf[MAC_INPUT_LEN];
char mail_buf[MAIL_INPUT_LEN];
char phone_buf[PHONE_INPUT_LEN];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ bool nfc_maker_scene_bluetooth_on_event(void* context, SceneManagerEvent event)
switch(event.event) {
case ByteInputResultOk:
furi_hal_bt_reverse_mac_addr(app->mac_buf);
scene_manager_next_scene(app->scene_manager, NfcMakerSceneSave);
scene_manager_next_scene(app->scene_manager, NfcMakerSceneSaveGenerate);
break;
default:
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@ 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)
ADD_SCENE(nfc_maker, save_generate, SaveGenerate)
ADD_SCENE(nfc_maker, save_name, SaveName)
ADD_SCENE(nfc_maker, save_result, SaveResult)
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ bool nfc_maker_scene_contact_url_on_event(void* context, SceneManagerEvent event
consumed = true;
switch(event.event) {
case TextInputResultOk:
scene_manager_next_scene(app->scene_manager, NfcMakerSceneSave);
scene_manager_next_scene(app->scene_manager, NfcMakerSceneSaveGenerate);
break;
default:
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ bool nfc_maker_scene_https_on_event(void* context, SceneManagerEvent event) {
consumed = true;
switch(event.event) {
case TextInputResultOk:
scene_manager_next_scene(app->scene_manager, NfcMakerSceneSave);
scene_manager_next_scene(app->scene_manager, NfcMakerSceneSaveGenerate);
break;
default:
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ bool nfc_maker_scene_mail_on_event(void* context, SceneManagerEvent event) {
consumed = true;
switch(event.event) {
case TextInputResultOk:
scene_manager_next_scene(app->scene_manager, NfcMakerSceneSave);
scene_manager_next_scene(app->scene_manager, NfcMakerSceneSaveGenerate);
break;
default:
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ bool nfc_maker_scene_phone_on_event(void* context, SceneManagerEvent event) {
consumed = true;
switch(event.event) {
case TextInputResultOk:
scene_manager_next_scene(app->scene_manager, NfcMakerSceneSave);
scene_manager_next_scene(app->scene_manager, NfcMakerSceneSaveGenerate);
break;
default:
break;
Expand Down
Loading

0 comments on commit 6a7d4b2

Please sign in to comment.