Skip to content

Commit

Permalink
Squashed 'applications/external/' changes from 54870d87b75..b481757d003
Browse files Browse the repository at this point in the history
b481757d003 Save cache for clean merges
058e2daafed Merge subghz_bruteforcer from https://github.com/DarkFlippers/flipperzero-subbrute
cf9b9e4e481 Format
002502741ca Merge picopass from https://gitlab.com/bettse/picopass
a07de342c75 Picopass moved
3227a82 Merge pull request #75 from derskythe/master
0c69d33 Merge pull request #9 from derskythe/fix-typo
48deea4 fix: README.md
5a706106859 Merge subghz_bruteforcer from https://github.com/DarkFlippers/flipperzero-subbrute
797bd846323 Merge qrcode from https://github.com/bmatcuk/flipperzero-qrcode
6bac51db640 Merge magspoof from https://github.com/zacharyweiss/magspoof_flipper
d26b9c1c9f4 Merge gps_nmea from https://github.com/ezod/flipperzero-gps
9b94ae6 Merge pull request #74 from DarkFlippers/feat-add-318--to-9bit-chamber-linear
7c5b548 feat: Update Sub-GHz BruteForcer version to 3.C
a52d025 Delay between repeats
08781c7 Add "repeat" setting
ebd7d20 Merge pull request #30 from lekkas/quectel-l80-support
8c8bd78 Document support for Quectel L80
14a4e0b Merge branch 'save_as_legacy' into 'main'
60d2c64 Save as legacy
4ffa017 update to firmware 0.101.2
c6581be Fix plugin path @Willy-JL
2659fec Fix changelog
250bf0c changelog
d7bd706 v1.14
29405af Add plugin submodule back
9cc6fb0 picopass: Add wiegand parsing plugin (#205)
ae4ce84 Picopass cleanup (#201)
471e8db Picopass: enum to track auth method (#198)
3768efe Picopass: saved card save as lfrfid (#195)
86c31c2 Picopass: add subheader to loclass UI (#197)
97423fc Picopass: Save unknown blocks with ?? (#196)
5e7ae5b Picopass block tracking (#125)
6c50747 Picopass: update with latest API (#165)
adff126 Picopass save written key (#126)
d6f32ef picopass: apply card to back view (#118)
9a26cf8 Picopass: rename AA1 to card_data (#119)
e55f891 picopass: remove backticks in changelog (#116)
8ff393b Update changelog and bump version (#114)
808e36d Picopass read improvements (#109)
7b24843 Add circuit to picopass readme (#110)
a125d70 Picopass nr mac improvements (#108)
95ae7f2 picopass: Add support for non-secure cards (#106)
efe1a38 Picopass: Create seader directory if needed (#101)
d8303dc Picopass: handle NR-MAC auth for legacy cards (#95)
ef3333a Fix markdown headings in the picopass README (#93)
ea1e5bf Picopass: NR-MAC instructions (#92)
e6ba055 Picopass config se problem (#90)
1a6da3d Add additional keys to elite dict (#89)
9012d97 Picopass: update working with keys (#88)
e95daa1 Picopass: More info view (raw bytes) (#86)
cf16630 Picopass: detect config card (#87)
7958963 Picopass save partial (#85)
8a135f2 PicoPass: Fix name buffer size issues (#84)
c8d2411 Picopass save as seader (#81)
6ff62d7 Picopass read card using nr-mac (#79)
83535be Picopass: Update loclass notes (#80)
a465f99 Picopass: Create folder before loclass (#78)
93f32a1 Picopass: typo (#76)
55f43bb FreeRTOS API fixes (#73)
6ccba6c [FL-3593] Picopass rework. Part 1 (#68)
77e776a Picopass: rename RFAL_PICOPASS_BLOCK_LEN (#63)
692dc97 Picopass: check if HID CSN if read fails (#61)
242578c Picopass: bump version + changelog (#56)
2888b9e Picopass: Add haptics to loclass (#53)
eaeee87 Picopass: populate key change input with first key of user dictionary (#54)
b349f4c Picopass more bit formats (#47)
d561b02 Improve loclass logic for readers doing keyrolling. (#50)
83e7c4c Picopass: Remove elite user dictionary from Read Card (#48)
4af84c8 Picopass: allow zero keys (#44)
bf2f50c Picopass: one more readme fix (#42)
d576e77 Picopass readme fix (#41)
c92d228 revamp picopass readme and add loclass (#39)
90bdf47 New random file name API fix (#40)
7b3170a Optimise picopass crypto to fix timing issues with newer readers. (#34)
2bf5b80 Picopass standard key (#32)
c82a982 picopass: clean up UI, espeicially for SR cards (#31)
322cb82 Picopass remove sentinel (#29)
885f01f Picopass, music player version bump (#28)
2bf8d61 Picopass: allow write immediately after read (#26)
9589140 Music player, picopass: assets integration (#23)
7caee8f Picopass: Rename option (#25)
3812f9b Added fap_version field to all apps (#15)
e1a8f9d Add descriptions for all the faps (#13)
0e4e711 Fixes failure to read picopass cards immediately after emulating. (#10)
bbf0cf4 Merge pull request #9 from bettse/custom_key

git-subtree-dir: applications/external
git-subtree-split: b481757d0031408c9c45fc076118c1375cea0b31
  • Loading branch information
RogueMaster committed May 10, 2024
1 parent 064d9f7 commit 065c621
Show file tree
Hide file tree
Showing 35 changed files with 324 additions and 137 deletions.
7 changes: 6 additions & 1 deletion .utils/.subtree-subdir-helper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,13 @@ else
prevhead="$(git rev-parse HEAD)"
exec {capture}>&1
result="$(git subtree "${action}" -P "${path}" "${split}" -m "${action^} ${path} from ${repo}" 2>&1 | tee /proc/self/fd/$capture)"
cleanmerge=false
if git diff --quiet && git diff --cached --quiet && git merge HEAD &> /dev/null; then
cleanmerge=true
fi
bash .utils/.check-merge.sh "${path}" "${repo}" "${result}"
if [ "${prevhead}" = "$(git rev-parse HEAD)" ]; then
if [ "${prevhead}" = "$(git rev-parse HEAD)" ] && ! $cleanmerge; then
# Not a clean merge, and merge was aborted, don't save cache
ok=false
fi
fi
Expand Down
2 changes: 2 additions & 0 deletions gps_nmea/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ the hardware setup.
* [u-Blox NEO-6M]
* [u-Blox NEO-7M]
* [Uputronics u-blox MAX-M8C Pico]
* [Quectel L80]

If you have verified this application working with a module not listed here,
please submit a PR adding it to the list.
Expand All @@ -78,3 +79,4 @@ of the repository.
[u-Blox NEO-7M]: https://www.u-blox.com/en/product/neo-7-series
[uFBT]: https://github.com/flipperdevices/flipperzero-ufbt
[Uputronics u-blox MAX-M8C Pico]: https://store.uputronics.com/index.php?route=product/product&product_id=72
[Quectel L80]: https://www.quectel.com/ProductDownload/L80.html
2 changes: 1 addition & 1 deletion magspoof/application.fam
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ App(
fap_category="GPIO",
fap_icon_assets="icons",
fap_icon_assets_symbol="mag",
fap_version=(0, 7), # major, minor
fap_version=(0, 8), # major, minor
fap_description="Enables wireless transmission of magstripe data",
fap_author="Zachary Weiss",
fap_weburl="https://github.com/zacharyweiss/magspoof_flipper",
Expand Down
62 changes: 36 additions & 26 deletions magspoof/helpers/mag_helpers.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#define ZERO_PREFIX 25 // n zeros prefix
#define ZERO_BETWEEN 53 // n zeros between tracks
#define ZERO_SUFFIX 25 // n zeros suffix
#define REPEAT_DELAY_MS 50

// bits per char on a given track
const uint8_t bitlen[] = {7, 5, 5};
Expand Down Expand Up @@ -331,40 +332,49 @@ void mag_spoof(Mag* mag) {

if(!tx_init(state)) return;

FURI_CRITICAL_ENTER();
for(uint16_t i = 0; i < (ZERO_PREFIX * 2); i++) {
// is this right?
if(!!(i % 2)) bit ^= 1;
play_halfbit(bit, state);
furi_delay_us(state->us_clock);
}
uint8_t i = 0;
do {
FURI_CRITICAL_ENTER();
for(uint16_t i = 0; i < (ZERO_PREFIX * 2); i++) {
// is this right?
if(!!(i % 2)) bit ^= 1;
play_halfbit(bit, state);
furi_delay_us(state->us_clock);
}

if((state->track == MagTrackStateOneAndTwo) || (state->track == MagTrackStateOne))
play_track((uint8_t*)bits_t1_manchester, bits_t1_count, state, false);

if((state->track == MagTrackStateOneAndTwo) || (state->track == MagTrackStateOne))
play_track((uint8_t*)bits_t1_manchester, bits_t1_count, state, false);
if((state->track == MagTrackStateOneAndTwo))
for(uint16_t i = 0; i < (ZERO_BETWEEN * 2); i++) {
if(!!(i % 2)) bit ^= 1;
play_halfbit(bit, state);
furi_delay_us(state->us_clock);
}

if((state->track == MagTrackStateOneAndTwo))
for(uint16_t i = 0; i < (ZERO_BETWEEN * 2); i++) {
if((state->track == MagTrackStateOneAndTwo) || (state->track == MagTrackStateTwo))
play_track(
(uint8_t*)bits_t2_manchester,
bits_t2_count,
state,
(state->reverse == MagReverseStateOn));

if((state->track == MagTrackStateThree))
play_track((uint8_t*)bits_t3_manchester, bits_t3_count, state, false);

for(uint16_t i = 0; i < (ZERO_SUFFIX * 2); i++) {
if(!!(i % 2)) bit ^= 1;
play_halfbit(bit, state);
furi_delay_us(state->us_clock);
}
FURI_CRITICAL_EXIT();

if((state->track == MagTrackStateOneAndTwo) || (state->track == MagTrackStateTwo))
play_track(
(uint8_t*)bits_t2_manchester,
bits_t2_count,
state,
(state->reverse == MagReverseStateOn));

if((state->track == MagTrackStateThree))
play_track((uint8_t*)bits_t3_manchester, bits_t3_count, state, false);
i++;
FURI_LOG_D(
TAG, "TX %u (n_repeats: %u, repeat_mode: %u)", i, state->n_repeats, state->repeat_mode);
furi_delay_ms(REPEAT_DELAY_MS);

for(uint16_t i = 0; i < (ZERO_SUFFIX * 2); i++) {
if(!!(i % 2)) bit ^= 1;
play_halfbit(bit, state);
furi_delay_us(state->us_clock);
}
FURI_CRITICAL_EXIT();
} while((i < state->n_repeats) && state->repeat_mode);

free(data1);
free(data2);
Expand Down
2 changes: 2 additions & 0 deletions magspoof/helpers/mag_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ typedef enum {
#define MAG_STATE_DEFAULT_PIN_OUTPUT MagPinA6
#define MAG_STATE_DEFAULT_PIN_ENABLE MagPinA4
#define MAG_STATE_DEFAULT_ALLOW_UART false
#define MAG_STATE_DEFAULT_N_REPEATS 3
#define MAG_STATE_DEFAULT_REPEAT_MODE true

typedef enum {
MagViewSubmenu,
Expand Down
20 changes: 14 additions & 6 deletions magspoof/mag_state.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,15 @@ bool mag_state_load(MagState* out_state) {
if(tmp != MAG_STATE_VER) break;

if(!flipper_format_read_uint32(file, "pin_input", &tmp, 1)) break;
state.pin_input = tmp;
state.pin_input = (MagPin)tmp;
if(!flipper_format_read_uint32(file, "pin_output", &tmp, 1)) break;
state.pin_output = tmp;
state.pin_output = (MagPin)tmp;
if(!flipper_format_read_uint32(file, "pin_enable", &tmp, 1)) break;
state.pin_enable = tmp;
state.pin_enable = (MagPin)tmp;
if(!flipper_format_read_bool(file, "allow_uart", &state.allow_uart, 1)) break;
if(!flipper_format_read_uint32(file, "n_repeats", &tmp, 1)) break;
state.n_repeats = (uint8_t)tmp;
if(!flipper_format_read_bool(file, "repeat_mode", &state.repeat_mode, 1)) break;

loaded_from_file = true;
} while(0);
Expand All @@ -76,6 +79,8 @@ bool mag_state_load(MagState* out_state) {

if(!loaded_from_file) {
state.allow_uart = MAG_STATE_DEFAULT_ALLOW_UART;
state.n_repeats = MAG_STATE_DEFAULT_N_REPEATS;
state.repeat_mode = MAG_STATE_DEFAULT_REPEAT_MODE;
}

// set defaults we don't save
Expand All @@ -102,13 +107,16 @@ void mag_state_save(MagState* state) {
if(!flipper_format_file_open_always(file, MAG_STATE_PATH)) break;
if(!flipper_format_write_header_cstr(file, MAG_STATE_HEADER, MAG_STATE_VER)) break;

tmp = state->pin_input;
tmp = (uint32_t)state->pin_input;
if(!flipper_format_write_uint32(file, "pin_input", &tmp, 1)) break;
tmp = state->pin_output;
tmp = (uint32_t)state->pin_output;
if(!flipper_format_write_uint32(file, "pin_output", &tmp, 1)) break;
tmp = state->pin_enable;
tmp = (uint32_t)state->pin_enable;
if(!flipper_format_write_uint32(file, "pin_enable", &tmp, 1)) break;
if(!flipper_format_write_bool(file, "allow_uart", &state->allow_uart, 1)) break;
tmp = (uint32_t)state->n_repeats;
if(!flipper_format_write_uint32(file, "n_repeats", &tmp, 1)) break;
if(!flipper_format_write_bool(file, "repeat_mode", &state->repeat_mode, 1)) break;

} while(0);
flipper_format_free(file);
Expand Down
4 changes: 3 additions & 1 deletion magspoof/mag_state.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#include "helpers/mag_types.h"

#define MAG_STATE_HEADER "Mag State"
#define MAG_STATE_VER 1
#define MAG_STATE_VER 2
#define MAG_STATE_DIR STORAGE_APP_DATA_PATH_PREFIX
#define MAG_STATE_PATH MAG_STATE_DIR "/mag_state.txt"

Expand All @@ -29,6 +29,8 @@ typedef struct {
MagPin pin_enable;
bool allow_uart;
bool is_debug;
uint8_t n_repeats;
bool repeat_mode;
} MagState;

const GpioPin* mag_state_enum_to_pin(MagPin pin);
Expand Down
41 changes: 32 additions & 9 deletions magspoof/scenes/mag_scene_emulate_config.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@
#define TAG "MagSceneEmulateConfig"

enum MagEmulateConfigIndex {
MagEmulateConfigIndexTx,
MagEmulateConfigIndexClock,
MagEmulateConfigIndexTrack,
MagEmulateConfigIndexReverse,
MagEmulateConfigIndexClock,
MagEmulateConfigIndexInterpacket,
MagEmulateConfigIndexRepeat,
MagEmulateConfigIndexTx,
// MagEmulateConfigIndexInterpacket,
};

#define TX_COUNT 7
Expand Down Expand Up @@ -163,6 +164,14 @@ static void mag_scene_emulate_config_set_reverse(VariableItem* item) {
}
};

static void mag_scene_emulate_config_set_repeat_mode(VariableItem* item) {
Mag* mag = variable_item_get_context(item);
uint8_t index = variable_item_get_current_value_index(item);
variable_item_set_current_value_text(item, reverse_text[index]);

mag->state.repeat_mode = (bool)index;
}

static void mag_scene_emulate_config_set_clock(VariableItem* item) {
Mag* mag = variable_item_get_context(item);
uint8_t index = variable_item_get_current_value_index(item);
Expand Down Expand Up @@ -190,15 +199,15 @@ void mag_scene_emulate_config_on_enter(void* context) {
item = variable_item_list_add(
mag->variable_item_list, "Clock:", CLOCK_COUNT, mag_scene_emulate_config_set_clock, mag);
value_index = value_index_uint32(mag->state.us_clock, clock_value, CLOCK_COUNT);
scene_manager_set_scene_state(mag->scene_manager, MagSceneEmulateConfig, (uint32_t)item);
// scene_manager_set_scene_state(mag->scene_manager, MagSceneEmulateConfig, (uint32_t)item);
variable_item_set_current_value_index(item, value_index);
variable_item_set_current_value_text(item, clock_text[value_index]);

// Track
item = variable_item_list_add(
mag->variable_item_list, "Track:", TRACK_COUNT, mag_scene_emulate_config_set_track, mag);
value_index = value_index_uint32(mag->state.track, track_value, TRACK_COUNT);
scene_manager_set_scene_state(mag->scene_manager, MagSceneEmulateConfig, (uint32_t)item);
//scene_manager_set_scene_state(mag->scene_manager, MagSceneEmulateConfig, (uint32_t)item);
variable_item_set_current_value_index(item, value_index);
variable_item_set_current_value_text(item, track_text[value_index]);

Expand All @@ -211,7 +220,19 @@ void mag_scene_emulate_config_on_enter(void* context) {
mag_scene_emulate_config_set_reverse,
mag);
value_index = value_index_uint32(mag->state.reverse, reverse_value, REVERSE_COUNT);
scene_manager_set_scene_state(mag->scene_manager, MagSceneEmulateConfig, (uint32_t)item);
//scene_manager_set_scene_state(mag->scene_manager, MagSceneEmulateConfig, (uint32_t)item);
variable_item_set_current_value_index(item, value_index);
variable_item_set_current_value_text(item, reverse_text[value_index]);

// Repeated TX
item = variable_item_list_add(
mag->variable_item_list,
"Repeat:",
REVERSE_COUNT,
mag_scene_emulate_config_set_repeat_mode,
mag);
value_index = (uint32_t)mag->state.repeat_mode;
//scene_manager_set_scene_state(mag->scene_manager, MagSceneEmulateConfig, (uint32_t)item);
variable_item_set_current_value_index(item, value_index);
variable_item_set_current_value_text(item, reverse_text[value_index]);

Expand All @@ -222,7 +243,7 @@ void mag_scene_emulate_config_on_enter(void* context) {
item = variable_item_list_add(
mag->variable_item_list, "TX via:", TX_COUNT, mag_scene_emulate_config_set_tx, mag);
value_index = value_index_uint32(mag->state.tx, tx_value, TX_COUNT);
scene_manager_set_scene_state(mag->scene_manager, MagSceneEmulateConfig, (uint32_t)item);
//scene_manager_set_scene_state(mag->scene_manager, MagSceneEmulateConfig, (uint32_t)item);
variable_item_set_current_value_index(item, value_index);
variable_item_set_current_value_text(item, tx_text[value_index]);
#ifdef FW_ORIGIN_Official
Expand All @@ -245,6 +266,10 @@ void mag_scene_emulate_config_on_enter(void* context) {
variable_item_set_current_value_text(item, interpacket_text[value_index]);*/
UNUSED(mag_scene_emulate_config_set_interpacket);

variable_item_list_set_selected_item(
mag->variable_item_list,
scene_manager_get_scene_state(mag->scene_manager, MagSceneEmulateConfig));

view_dispatcher_switch_to_view(mag->view_dispatcher, MagViewVariableItemList);
}

Expand All @@ -264,6 +289,4 @@ void mag_scene_emulate_config_on_exit(void* context) {
Mag* mag = context;
variable_item_list_set_selected_item(mag->variable_item_list, 0);
variable_item_list_reset(mag->variable_item_list);
// mag_last_settings_save?
// scene_manager_set_scene_state? Using subghz_scene_reciever_config as framework/inspo
}
Loading

0 comments on commit 065c621

Please sign in to comment.