Skip to content

Commit

Permalink
Merge remote-tracking branch 'mntm/dev' into unload-assetpacks-flag
Browse files Browse the repository at this point in the history
  • Loading branch information
Willy-JL committed Oct 29, 2024
2 parents b328f19 + d0300c7 commit a90461d
Show file tree
Hide file tree
Showing 174 changed files with 8,308 additions and 175 deletions.
8 changes: 6 additions & 2 deletions .subtrees/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,15 @@ def subdir_split_helper(path, repo, branch, subdir, action, cached=None):
if "is not an ancestor of commit" in result:
print("Resetting split branch...")
git("branch", "-D", split)
git("subtree", "split", "-P", subdir, "-b", split)
result, status = git("subtree", "split", "-P", subdir, "-b", split, tee=True)
if "fatal: " in result:
ok = False
git("checkout", prevbranch)
if ok:
if not ok:
print(f"Something went wrong with {path}/.gitsubtree, check above")
send_alert("Subtree merge failed", "Something went wrong, check logs")
sys.exit(1)
else:
prevhead = git("rev-parse", "HEAD", pipe=True)
result, status = git(
"subtree",
Expand Down
2 changes: 1 addition & 1 deletion cli_bridge/cligui_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ int32_t cligui_main(void* p) {
cligui->text_input_store,
TEXT_INPUT_STORE_SIZE,
true);
text_input_add_illegal_symbols(cligui->text_input);
text_input_show_illegal_symbols(cligui->text_input, true);
view_dispatcher_add_view(
cligui->view_dispatcher, ViewTextInput, text_input_get_view(cligui->text_input));

Expand Down
2 changes: 1 addition & 1 deletion esubghz_chat/.gitsubtree
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
https://github.com/xMasterX/all-the-plugins dev non_catalog_apps/esubghz_chat 4558d74c9da36abc851edd96a95d18f7d5511a75
https://github.com/xMasterX/all-the-plugins dev apps_source_code/esubghz_chat 6925308df62214abd3e19982444dc733cf098d92
https://github.com/twisted-pear/esubghz_chat main /
20 changes: 13 additions & 7 deletions esubghz_chat/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ This is a plugin for the Flipper Zero that reimplements the Sub-GHz chat
feature that is available on the CLI. In addition it allows for basic
encryption of messages.

The plugin has been tested on the official firmware (version 0.93.0) and on
Unleashed (version unlshd-065).

## Warning

This plugin is in the early stages of development. It will inevitably have
Expand Down Expand Up @@ -79,18 +76,27 @@ expect to gain any security by using encryption.

## Acknowledgements

App was made by [twisted-pear](https://github.com/twisted-pear).

Support for the external radio,
backporting NFC support due to NFC refactoring,
keeping app compatible with latest API,
support for ufbt builds by
[xMasterX](https://github.com/xMasterX).

The implementations of AES and GCM are taken directly from
https://github.com/mko-x/SharedAES-GCM. They were released to the public domain
by Markus Kosmal.

The app icon was made by [xMasterX](https://github.com/xMasterX). The icon for
The app icon was made by [xMasterX](https://github.com/xMasterX).
The icon for
the hexadecimal key input was taken from [QtRoS](https://github.com/QtRoS) hex
viewer app, which can be found here:
https://github.com/QtRoS/flipper-zero-hex-viewer. Other icons and graphics were
https://github.com/QtRoS/flipper-zero-hex-viewer.
Other icons and graphics were
taken from the Flipper Zero firmware.

The icons used in the key input method menu were picked by
[Willy-JL](https://github.com/Willy-JL).

Support for the external radio was also contributed by
[xMasterX](https://github.com/xMasterX).

4 changes: 4 additions & 0 deletions esubghz_chat/application.fam
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ App(
fap_libs=["mbedtls"],
fap_private_libs=[Lib(name="nfclegacy"), Lib(name="parity")],
fap_icon="assets/chat_10px.png",
fap_author="@twisted-pear & @xMasterX & more in ReadMe",
fap_weburl="https://github.com/twisted-pear/esubghz_chat",
fap_version="1.1",
fap_description="Send text messages over Sub-GHz radio to another Flippers",
fap_icon_assets="assets",
fap_icon_assets_symbol="esubghz_chat",
)
4 changes: 2 additions & 2 deletions esubghz_chat/esubghz_chat_i.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#pragma once

#include <furi.h>
#include <gui/view_dispatcher_i.h>
#include <gui/view_port_i.h>
#include "ui_hacks_for_no_reason/view_dispatcher_i.h"
#include "ui_hacks_for_no_reason/view_port_i.h"
#include <gui/scene_manager.h>
#include <gui/modules/byte_input.h>
#include <gui/modules/dialog_ex.h>
Expand Down
8 changes: 4 additions & 4 deletions esubghz_chat/lib/nfclegacy/digital_signal/digital_signal.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,22 +47,22 @@ struct DigitalSignalInternals {

#define TAG "DigitalSignal"

#define F_TIM (64000000.0)
#define T_TIM 1562 /* 15.625 ns *100 */
#define F_TIM (64000000.0)
#define T_TIM 1562 /* 15.625 ns *100 */
#define T_TIM_DIV2 781 /* 15.625 ns / 2 *100 */

/* end marker in DMA ringbuffer, will get written into timer register at the end */
#define SEQ_TIMER_MAX 0xFFFFFFFF

/* time to wait in loops before returning */
#define SEQ_LOCK_WAIT_MS 10UL
#define SEQ_LOCK_WAIT_MS 10UL
#define SEQ_LOCK_WAIT_TICKS (SEQ_LOCK_WAIT_MS * 1000 * 64)

/* maximum entry count of the sequence dma ring buffer */
#define RINGBUFFER_SIZE 128

/* maximum number of DigitalSignals in a sequence */
#define SEQUENCE_SIGNALS_SIZE 32
#define SEQUENCE_SIGNALS_SIZE 32
/*
* if sequence size runs out from the initial value passed to digital_sequence_alloc
* the size will be increased by this amount and reallocated
Expand Down
6 changes: 3 additions & 3 deletions esubghz_chat/lib/nfclegacy/digital_signal/digital_signal.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ extern "C" {
#endif

/* helper for easier signal generation */
#define DIGITAL_SIGNAL_MS(x) ((x)*100000000UL)
#define DIGITAL_SIGNAL_US(x) ((x)*100000UL)
#define DIGITAL_SIGNAL_NS(x) ((x)*100UL)
#define DIGITAL_SIGNAL_MS(x) ((x) * 100000000UL)
#define DIGITAL_SIGNAL_US(x) ((x) * 100000UL)
#define DIGITAL_SIGNAL_NS(x) ((x) * 100UL)
#define DIGITAL_SIGNAL_PS(x) ((x) / 10UL)

/* using an anonymous type for the internals */
Expand Down
8 changes: 4 additions & 4 deletions esubghz_chat/lib/nfclegacy/furi_hal_nfc.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
static const uint32_t clocks_in_ms = 64 * 1000;

FuriEventFlag* event = NULL;
#define EVENT_FLAG_INTERRUPT (1UL << 0)
#define EVENT_FLAG_INTERRUPT (1UL << 0)
#define EVENT_FLAG_STATE_CHANGED (1UL << 1)
#define EVENT_FLAG_STOP (1UL << 2)
#define EVENT_FLAG_ALL (EVENT_FLAG_INTERRUPT | EVENT_FLAG_STATE_CHANGED | EVENT_FLAG_STOP)
#define EVENT_FLAG_STOP (1UL << 2)
#define EVENT_FLAG_ALL (EVENT_FLAG_INTERRUPT | EVENT_FLAG_STATE_CHANGED | EVENT_FLAG_STOP)

#define FURRY_HAL_NFC_UID_INCOMPLETE (0x04)

Expand Down Expand Up @@ -836,4 +836,4 @@ bool furry_hal_nfc_field_is_present() {
ST25R3916_REG_AUX_DISPLAY,
ST25R3916_REG_AUX_DISPLAY_efd_o,
ST25R3916_REG_AUX_DISPLAY_efd_o);
}
}
3 changes: 1 addition & 2 deletions esubghz_chat/lib/nfclegacy/nfc_device.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
#include "protocols/nfc_util.h"
#include <flipper_format/flipper_format.h>

#define TAG "NfcDevice"

#define TAG "NfcDevice"
#define NFC_DEVICE_KEYS_FOLDER EXT_PATH("nfc/.cache")
#define NFC_DEVICE_KEYS_EXTENSION ".keys"

Expand Down
8 changes: 4 additions & 4 deletions esubghz_chat/lib/nfclegacy/nfc_device.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@
extern "C" {
#endif

#define NFC_DEV_NAME_MAX_LEN 22
#define NFC_DEV_NAME_MAX_LEN 22
#define NFC_READER_DATA_MAX_SIZE 64
#define NFC_DICT_KEY_BATCH_SIZE 10
#define NFC_DICT_KEY_BATCH_SIZE 10

#define NFC_APP_FILENAME_PREFIX "NFC"
#define NFC_APP_FILENAME_PREFIX "NFC"
#define NFC_APP_FILENAME_EXTENSION ".nfc"
#define NFC_APP_SHADOW_EXTENSION ".shd"
#define NFC_APP_SHADOW_EXTENSION ".shd"

typedef void (*NfcLoadingCallback)(void* context, bool state);

Expand Down
7 changes: 4 additions & 3 deletions esubghz_chat/lib/nfclegacy/protocols/crypto1.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
// Algorithm from https://github.com/RfidResearchGroup/proxmark3.git

#define SWAPENDIAN(x) \
((x) = ((x) >> 8 & 0xff00ff) | ((x)&0xff00ff) << 8, (x) = (x) >> 16 | (x) << 16)
#define LF_POLY_ODD (0x29CE5C)
((x) = ((x) >> 8 & 0xff00ff) | ((x) & 0xff00ff) << 8, (x) = (x) >> 16 | (x) << 16)
#define LF_POLY_ODD (0x29CE5C)
#define LF_POLY_EVEN (0x870804)

#define BEBIT(x, n) FURI_BIT(x, (n) ^ 24)
Expand Down Expand Up @@ -70,7 +70,8 @@ uint32_t crypto1_word(Crypto1* crypto1, uint32_t in, int is_encrypted) {

uint32_t prng_successor(uint32_t x, uint32_t n) {
SWAPENDIAN(x);
while(n--) x = x >> 1 | (x >> 16 ^ x >> 18 ^ x >> 19 ^ x >> 21) << 31;
while(n--)
x = x >> 1 | (x >> 16 ^ x >> 18 ^ x >> 19 ^ x >> 21) << 31;

return SWAPENDIAN(x);
}
Expand Down
54 changes: 27 additions & 27 deletions esubghz_chat/lib/nfclegacy/protocols/mifare_ultralight.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,25 @@ extern "C" {

#define MF_UL_TEARING_FLAG_DEFAULT (0xBD)

#define MF_UL_HALT_START (0x50)
#define MF_UL_HALT_START (0x50)
#define MF_UL_GET_VERSION_CMD (0x60)
#define MF_UL_READ_CMD (0x30)
#define MF_UL_FAST_READ_CMD (0x3A)
#define MF_UL_WRITE (0xA2)
#define MF_UL_FAST_WRITE (0xA6)
#define MF_UL_COMP_WRITE (0xA0)
#define MF_UL_READ_CNT (0x39)
#define MF_UL_INC_CNT (0xA5)
#define MF_UL_AUTHENTICATE_1 (0x1A)
#define MF_UL_PWD_AUTH (0x1B)
#define MF_UL_READ_SIG (0x3C)
#define MF_UL_CHECK_TEARING (0x3E)
#define MF_UL_READ_VCSL (0x4B)
#define MF_UL_SECTOR_SELECT (0xC2)

#define MF_UL_ACK (0xa)
#define MF_UL_READ_CMD (0x30)
#define MF_UL_FAST_READ_CMD (0x3A)
#define MF_UL_WRITE (0xA2)
#define MF_UL_FAST_WRITE (0xA6)
#define MF_UL_COMP_WRITE (0xA0)
#define MF_UL_READ_CNT (0x39)
#define MF_UL_INC_CNT (0xA5)
#define MF_UL_AUTHENTICATE_1 (0x1A)
#define MF_UL_PWD_AUTH (0x1B)
#define MF_UL_READ_SIG (0x3C)
#define MF_UL_CHECK_TEARING (0x3E)
#define MF_UL_READ_VCSL (0x4B)
#define MF_UL_SECTOR_SELECT (0xC2)

#define MF_UL_ACK (0xa)
#define MF_UL_NAK_INVALID_ARGUMENT (0x0)
#define MF_UL_NAK_AUTHLIM_REACHED (0x4)
#define MF_UL_NAK_AUTHLIM_REACHED (0x4)

#define MF_UL_NTAG203_COUNTER_PAGE (41)

Expand Down Expand Up @@ -145,10 +145,10 @@ typedef struct __attribute__((packed)) {
union {
uint8_t value;
struct {
uint8_t rfui1 : 2;
bool strg_mod_en : 1;
bool rfui2 : 1;
uint8_t mirror_byte : 2;
uint8_t rfui1 : 2;
bool strg_mod_en : 1;
bool rfui2 : 1;
uint8_t mirror_byte : 2;
MfUltralightMirrorConf mirror_conf : 2;
};
} mirror;
Expand All @@ -158,12 +158,12 @@ typedef struct __attribute__((packed)) {
union {
uint8_t value;
struct {
uint8_t authlim : 3;
uint8_t authlim : 3;
bool nfc_cnt_pwd_prot : 1;
bool nfc_cnt_en : 1;
bool nfc_dis_sec1 : 1; // NTAG I2C Plus only
bool cfglck : 1;
bool prot : 1;
bool nfc_cnt_en : 1;
bool nfc_dis_sec1 : 1; // NTAG I2C Plus only
bool cfglck : 1;
bool prot : 1;
};
} access;
uint8_t vctid;
Expand Down Expand Up @@ -266,4 +266,4 @@ bool mf_ul_is_full_capture(MfUltralightData* data);

#ifdef __cplusplus
}
#endif
#endif
6 changes: 3 additions & 3 deletions esubghz_chat/lib/nfclegacy/protocols/nfca.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@

#define NFCA_CRC_INIT (0x6363)

#define NFCA_F_SIG (13560000.0)
#define T_SIG 7374 //73.746ns*100
#define T_SIG_x8 58992 //T_SIG*8
#define NFCA_F_SIG (13560000.0)
#define T_SIG 7374 //73.746ns*100
#define T_SIG_x8 58992 //T_SIG*8
#define T_SIG_x8_x8 471936 //T_SIG*8*8
#define T_SIG_x8_x9 530928 //T_SIG*8*9

Expand Down
8 changes: 3 additions & 5 deletions esubghz_chat/lib/parity/parity.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,8 @@ static const uint8_t g_odd_byte_parity[256] = {
0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1,
1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1};

#define ODD_PARITY8(x) \
{ g_odd_byte_parity[x] }
#define EVEN_PARITY8(x) \
{ !g_odd_byte_parity[x] }
#define ODD_PARITY8(x) {g_odd_byte_parity[x]}
#define EVEN_PARITY8(x) {!g_odd_byte_parity[x]}

uint8_t oddparity8(const uint8_t x) {
return g_odd_byte_parity[x];
Expand Down Expand Up @@ -68,4 +66,4 @@ uint8_t oddparity32(uint32_t x) {
#else
return !__builtin_parity(x);
#endif
}
}
Binary file added esubghz_chat/screenshots/1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added esubghz_chat/screenshots/2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added esubghz_chat/screenshots/3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added esubghz_chat/screenshots/4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit a90461d

Please sign in to comment.