This commit is contained in:
Willy-JL
2023-02-11 23:55:28 +00:00
15 changed files with 101 additions and 33 deletions
@@ -3,7 +3,6 @@
#include <m-array.h>
#include <furi.h>
#include <m-algo.h>
#include <m-string.h>
#include <storage/storage.h>
#include "toolbox/path.h"
#include "xtreme/settings.h"
+16 -5
View File
@@ -208,27 +208,38 @@ SubGhz* subghz_alloc(bool alloc_for_tx_only) {
flipper_format_free(temp_fm_preset2);
// # HND - FM presets
// Pagers
FlipperFormat* temp_fm_preset3 = flipper_format_string_alloc();
flipper_format_write_string_cstr(
temp_fm_preset3,
(const char*)"Custom_preset_data",
(const char*)"02 0D 0B 06 08 32 07 04 14 00 13 02 12 04 11 36 10 69 15 32 18 18 19 16 1D 91 1C 00 1B 07 20 FB 22 10 21 56 00 00 C0 00 00 00 00 00 00 00");
(const char*)"02 0D 07 04 08 32 0B 06 10 64 11 93 12 0C 13 02 14 00 15 15 18 18 19 16 1B 07 1C 00 1D 91 20 FB 21 56 22 10 00 00 C0 00 00 00 00 00 00 00");
flipper_format_rewind(temp_fm_preset3);
subghz_setting_load_custom_preset(subghz->setting, (const char*)"HND_1", temp_fm_preset3);
subghz_setting_load_custom_preset(subghz->setting, (const char*)"Pagers", temp_fm_preset3);
flipper_format_free(temp_fm_preset3);
// # HND - FM presets
FlipperFormat* temp_fm_preset4 = flipper_format_string_alloc();
flipper_format_write_string_cstr(
temp_fm_preset4,
(const char*)"Custom_preset_data",
(const char*)"02 0D 0B 06 08 32 07 04 14 00 13 02 12 07 11 36 10 E9 15 32 18 18 19 16 1D 92 1C 40 1B 03 20 FB 22 10 21 56 00 00 C0 00 00 00 00 00 00 00");
(const char*)"02 0D 0B 06 08 32 07 04 14 00 13 02 12 04 11 36 10 69 15 32 18 18 19 16 1D 91 1C 00 1B 07 20 FB 22 10 21 56 00 00 C0 00 00 00 00 00 00 00");
flipper_format_rewind(temp_fm_preset4);
subghz_setting_load_custom_preset(subghz->setting, (const char*)"HND_2", temp_fm_preset4);
subghz_setting_load_custom_preset(subghz->setting, (const char*)"HND_1", temp_fm_preset4);
flipper_format_free(temp_fm_preset4);
FlipperFormat* temp_fm_preset5 = flipper_format_string_alloc();
flipper_format_write_string_cstr(
temp_fm_preset5,
(const char*)"Custom_preset_data",
(const char*)"02 0D 0B 06 08 32 07 04 14 00 13 02 12 07 11 36 10 E9 15 32 18 18 19 16 1D 92 1C 40 1B 03 20 FB 22 10 21 56 00 00 C0 00 00 00 00 00 00 00");
flipper_format_rewind(temp_fm_preset5);
subghz_setting_load_custom_preset(subghz->setting, (const char*)"HND_2", temp_fm_preset5);
flipper_format_free(temp_fm_preset5);
// custom presets loading - end
// Load last used values for Read, Read RAW, etc. or default
+6 -2
View File
@@ -602,7 +602,8 @@ static void subghz_cli_command_encrypt_raw(Cli* cli, FuriString* args) {
furi_string_free(source);
}
static void subghz_cli_command_chat(Cli* cli, FuriString* args) {
static void subghz_cli_command_chat(Cli* cli, FuriString* args, void* context) {
UNUSED(context);
uint32_t frequency = 433920000;
if(furi_string_size(args)) {
@@ -795,7 +796,7 @@ static void subghz_cli_command(Cli* cli, FuriString* args, void* context) {
}
if(furi_string_cmp_str(cmd, "chat") == 0) {
subghz_cli_command_chat(cli, args);
subghz_cli_command_chat(cli, args, NULL);
break;
}
@@ -853,6 +854,9 @@ void subghz_on_system_start() {
cli_add_command(cli, "subghz", CliCommandFlagDefault, subghz_cli_command, NULL);
// psst RM... i know you dont care much about errors, but if you ever see this... incompatible pointer type :3
cli_add_command(cli, "chat", CliCommandFlagDefault, subghz_cli_command_chat, NULL);
furi_record_close(RECORD_CLI);
#else
UNUSED(subghz_cli_command);
@@ -25,7 +25,7 @@ static const uint32_t subghz_frequency_list[] = {
310000000, 312000000, 312100000, 313000000, 313850000, 314000000, 314350000, 314980000,
315000000, 318000000, 330000000, 345000000, 348000000, 350000000, 387000000, 390000000,
418000000, 433075000, 433220000, 433420000, 433657070, 433889000, 433920000, 434075000,
434176948, 434390000, 434420000, 434775000, 438900000, 440175000, 464000000, 779000000,
434176948, 434390000, 434420000, 434775000, 438900000, 440175000, 464000000, 467750000, 779000000,
868350000, 868400000, 868800000, 868950000, 906400000, 915000000, 925000000, 928000000};
typedef enum {
@@ -645,4 +645,4 @@ SubGHzFrequencyAnalyzerFeedbackLevel subghz_frequency_analyzer_feedback_level(
float subghz_frequency_analyzer_get_trigger_level(SubGhzFrequencyAnalyzer* instance) {
furi_assert(instance);
return subghz_frequency_analyzer_worker_get_trigger_level(instance->worker);
}
}
@@ -11,7 +11,6 @@
#include <core/check.h>
#include <core/common_defines.h>
#include <core/log.h>
#include "m-string.h"
#include "m-algo.h"
#include <m-array.h>
#include "xtreme/settings.h"
@@ -519,19 +518,25 @@ static void browser_draw_list(Canvas* canvas, FileBrowserModel* model) {
for(uint32_t i = 0; i < MIN(model->item_cnt, LIST_ITEMS); i++) {
int32_t idx = CLAMP((uint32_t)(i + model->list_offset), model->item_cnt, 0u);
BrowserItemType item_type = BrowserItemTypeLoading;
BrowserItemType item_type;
uint8_t* custom_icon_data = NULL;
if(browser_is_item_in_array(model, idx)) {
BrowserItem_t* item = items_array_get(
model->items, CLAMP(idx - model->array_offset, (int32_t)(array_size - 1), 0));
item_type = item->type;
furi_string_set(filename, item->display_name);
if(item_type == BrowserItemTypeFile) {
custom_icon_data = item->custom_icon_data;
if(model->list_loading && item_type != BrowserItemTypeBack) {
furi_string_set(filename, "---");
item_type = BrowserItemTypeLoading;
} else {
furi_string_set(filename, item->display_name);
if(item_type == BrowserItemTypeFile) {
custom_icon_data = item->custom_icon_data;
}
}
} else {
furi_string_set(filename, "---");
item_type = BrowserItemTypeLoading;
}
if(item_type == BrowserItemTypeBack) {
@@ -15,8 +15,6 @@
#define TAG "BrowserWorker"
#define ASSETS_DIR "assets"
#define BADKB_LAYOUTS_DIR "layouts"
#define SUBGHZ_TEMP_DIR "tmp_history"
#define BROWSER_ROOT STORAGE_ANY_PATH_PREFIX
#define FILE_NAME_LEN_MAX 256
#define LONG_LOAD_THRESHOLD 100
@@ -92,9 +90,7 @@ static bool browser_filter_by_name(BrowserWorker* browser, FuriString* name, boo
if(is_folder) {
// Skip assets folders (if enabled)
if(browser->skip_assets) {
return ((furi_string_cmp_str(name, ASSETS_DIR) == 0) ? (false) : (true)) &&
((furi_string_cmp_str(name, BADKB_LAYOUTS_DIR) == 0) ? (false) : (true)) &&
((furi_string_cmp_str(name, SUBGHZ_TEMP_DIR) == 0) ? (false) : (true));
return ((furi_string_cmp_str(name, ASSETS_DIR) == 0) ? (false) : (true));
} else {
return true;
}
@@ -228,7 +228,7 @@ void xtreme_app_scene_main_on_enter(void* context) {
item = variable_item_list_add(
var_item_list,
"Sort Dirs Before",
"Sort Dirs First",
2,
xtreme_app_scene_main_sort_folders_before_changed,
app);
Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

@@ -1,2 +0,0 @@
# Pager Bruteforce Playlist
sub: /ext/subghz/Misc/Pager_Bruteforce.sub
+54 -10
View File
@@ -1,6 +1,6 @@
#include <furi_hal_subghz.h>
#include <furi_hal_subghz_configs.h>
#include <furi_hal_region.h>
#include <furi_hal_version.h>
#include <furi_hal_rtc.h>
#include <furi_hal_spi.h>
@@ -390,7 +390,8 @@ uint8_t furi_hal_subghz_get_lqi() {
/*
Modified by @tkerby & MX to the full YARD Stick One extended range of 281-361 MHz, 378-481 MHz, and 749-962 MHz.
These changes are at your own risk. The PLL may not lock and FZ devs have warned of possible damage!
These changes are at your own risk. The PLL may not lock and FZ devs have warned of possible damage
Set flag use_ext_range_at_own_risk in extend_range.txt to use
*/
bool furi_hal_subghz_is_frequency_valid(uint32_t value) {
@@ -420,29 +421,69 @@ uint32_t furi_hal_subghz_set_frequency_and_path(uint32_t value) {
bool furi_hal_subghz_is_tx_allowed(uint32_t value) {
bool is_extended = false;
bool is_allowed = false;
// TODO: !!! Move file check to another place
Storage* storage = furi_record_open(RECORD_STORAGE);
FlipperFormat* fff_data_file = flipper_format_file_alloc(storage);
if(flipper_format_file_open_existing(fff_data_file, "/ext/subghz/assets/dangerous_settings")) {
flipper_format_read_bool(
fff_data_file, "yes_i_want_to_destroy_my_flipper", &is_extended, 1);
if(flipper_format_file_open_existing(fff_data_file, "/ext/subghz/assets/extend_range.txt")) {
flipper_format_read_bool(fff_data_file, "use_ext_range_at_own_risk", &is_extended, 1);
flipper_format_read_bool(fff_data_file, "ignore_default_tx_region", &is_allowed, 1);
}
flipper_format_free(fff_data_file);
furi_record_close(RECORD_STORAGE);
if(!(value >= 299999755 && value <= 350000335) &&
switch(furi_hal_version_get_hw_region()) {
case FuriHalVersionRegionEuRu:
//433,05..434,79; 868,15..868,55
if(!(value >= 433050000 && value <= 434790000) &&
!(value >= 868150000 && value <= 868550000)) {
} else {
is_allowed = true;
}
break;
case FuriHalVersionRegionUsCaAu:
//304,10..321,95; 433,05..434,79; 915,00..928,00
if(!(value >= 304100000 && value <= 321950000) &&
!(value >= 433050000 && value <= 434790000) &&
!(value >= 915000000 && value <= 928000000)) {
} else {
if(furi_hal_rtc_is_flag_set(FuriHalRtcFlagDebug)) {
if(value <= 321950000 &&
((furi_hal_subghz.preset == FuriHalSubGhzPresetOok270Async) ||
(furi_hal_subghz.preset == FuriHalSubGhzPresetOok650Async))) {
furi_hal_subghz_load_patable(furi_hal_subghz_preset_ook_async_patable_au);
}
}
is_allowed = true;
}
break;
case FuriHalVersionRegionJp:
//312,00..315,25; 920,50..923,50
if(!(value >= 312000000 && value <= 315250000) &&
!(value >= 920500000 && value <= 923500000)) {
} else {
is_allowed = true;
}
break;
default:
is_allowed = true;
break;
}
// No flag - test original range, flag set, test extended range
if(!(value >= 299999755 && value <= 348000335) &&
!(value >= 386999938 && value <= 464000000) &&
!(value >= 778999847 && value <= 928000000) && !(is_extended)) {
FURI_LOG_I(TAG, "Frequency blocked - outside default range");
FURI_LOG_I(TAG, "Frequency blocked - outside regional range");
return false;
} else if(
!(value >= 281000000 && value <= 361000000) &&
!(value >= 378000000 && value <= 481000000) &&
!(value >= 749000000 && value <= 962000000) && is_extended) {
FURI_LOG_I(TAG, "Frequency blocked - outside dangerous range");
FURI_LOG_I(TAG, "Frequency blocked - outside extended range");
return false;
}
@@ -450,8 +491,11 @@ bool furi_hal_subghz_is_tx_allowed(uint32_t value) {
}
uint32_t furi_hal_subghz_set_frequency(uint32_t value) {
furi_hal_subghz.regulation = SubGhzRegulationTxRx;
if(furi_hal_region_is_frequency_allowed(value)) {
furi_hal_subghz.regulation = SubGhzRegulationTxRx;
} else {
furi_hal_subghz.regulation = SubGhzRegulationTxRx;
}
furi_hal_spi_acquire(furi_hal_subghz.spi_bus_handle);
uint32_t real_frequency = cc1101_set_frequency(furi_hal_subghz.spi_bus_handle, value);
cc1101_calibrate(furi_hal_subghz.spi_bus_handle);
@@ -273,6 +273,16 @@ static const uint8_t furi_hal_subghz_preset_ook_async_patable[8] = {
0x00,
0x00};
static const uint8_t furi_hal_subghz_preset_ook_async_patable_au[8] = {
0x00,
0x37, // 12dBm 0xC0, 10dBm 0xC5, 7dBm 0xCD, 5dBm 0x86, 0dBm 0x50, -6dBm 0x37, -10dBm 0x26, -15dBm 0x1D, -20dBm 0x17, -30dBm 0x03
0x00,
0x00,
0x00,
0x00,
0x00,
0x00};
static const uint8_t furi_hal_subghz_preset_2fsk_async_patable[8] = {
0xC0, // 10dBm 0xC0, 7dBm 0xC8, 5dBm 0x84, 0dBm 0x60, -10dBm 0x34, -15dBm 0x1D, -20dBm 0x0E, -30dBm 0x12
0x00,
+1
View File
@@ -61,6 +61,7 @@ static const uint32_t subghz_frequency_list[] = {
438900000,
440175000,
464000000,
467750000,
/* 779 - 928 */
779000000,