remove unnecessary checks from brute plugin, subghz improvements

fix subghz gui in add manually, add BETT protocol in add manually
This commit is contained in:
MX 2022-09-28 07:50:09 +03:00
parent 9c62e1f6ac
commit aa00606d22
No known key found for this signature in database
GPG key ID: 6C4C311DFD4B4AB5
6 changed files with 69 additions and 59 deletions

View file

@ -14,6 +14,7 @@ typedef enum {
SubmenuIndexNiceFlo24bit,
SubmenuIndexCAME12bit,
SubmenuIndexCAME24bit,
SubmenuIndexBETT_433,
SubmenuIndexCAMETwee,
SubmenuIndexNeroSketch,
SubmenuIndexNeroRadio,

View file

@ -69,61 +69,67 @@ void subghz_scene_set_type_on_enter(void* context) {
submenu_add_item(
subghz->submenu,
"Faac SLH_868",
"Faac SLH 868MHz",
SubmenuIndexFaacSLH_868,
subghz_scene_set_type_submenu_callback,
subghz);
submenu_add_item(
subghz->submenu,
"Faac SLH_433",
"Faac SLH 433MHz",
SubmenuIndexFaacSLH_433,
subghz_scene_set_type_submenu_callback,
subghz);
submenu_add_item(
subghz->submenu,
"BFT Mitto",
"BFT Mitto 433MHz",
SubmenuIndexBFT,
subghz_scene_set_type_submenu_callback,
subghz);
submenu_add_item(
subghz->submenu,
"Princeton_433",
"Princeton 433MHz",
SubmenuIndexPricenton,
subghz_scene_set_type_submenu_callback,
subghz);
submenu_add_item(
subghz->submenu,
"Nice Flo 12bit_433",
"Nice Flo 12bit 433MHz",
SubmenuIndexNiceFlo12bit,
subghz_scene_set_type_submenu_callback,
subghz);
submenu_add_item(
subghz->submenu,
"Nice Flo 24bit_433",
"Nice Flo 24bit 433MHz",
SubmenuIndexNiceFlo24bit,
subghz_scene_set_type_submenu_callback,
subghz);
submenu_add_item(
subghz->submenu,
"CAME 12bit_433",
"CAME 12bit 433MHz",
SubmenuIndexCAME12bit,
subghz_scene_set_type_submenu_callback,
subghz);
submenu_add_item(
subghz->submenu,
"CAME 24bit_433",
"CAME 24bit 433MHz",
SubmenuIndexCAME24bit,
subghz_scene_set_type_submenu_callback,
subghz);
submenu_add_item(
subghz->submenu,
"Linear_300",
"BETT 433MHz",
SubmenuIndexBETT_433,
subghz_scene_set_type_submenu_callback,
subghz);
submenu_add_item(
subghz->submenu,
"Linear 300MHz",
SubmenuIndexLinear_300_00,
subghz_scene_set_type_submenu_callback,
subghz);
submenu_add_item(
subghz->submenu,
"CAME TWEE",
"CAME TWEE 433MHz",
SubmenuIndexCAMETwee,
subghz_scene_set_type_submenu_callback,
subghz);
@ -133,49 +139,49 @@ void subghz_scene_set_type_on_enter(void* context) {
// subghz->submenu, "Nero Radio", SubmenuIndexNeroRadio, subghz_scene_set_type_submenu_callback, subghz);
submenu_add_item(
subghz->submenu,
"Gate TX_433",
"Gate TX 433MHz",
SubmenuIndexGateTX,
subghz_scene_set_type_submenu_callback,
subghz);
submenu_add_item(
subghz->submenu,
"DoorHan_315",
"DoorHan 315MHz",
SubmenuIndexDoorHan_315_00,
subghz_scene_set_type_submenu_callback,
subghz);
submenu_add_item(
subghz->submenu,
"DoorHan_433",
"DoorHan 433MHz",
SubmenuIndexDoorHan_433_92,
subghz_scene_set_type_submenu_callback,
subghz);
submenu_add_item(
subghz->submenu,
"LiftMaster_315",
"Security+1.0 315MHz",
SubmenuIndexLiftMaster_315_00,
subghz_scene_set_type_submenu_callback,
subghz);
submenu_add_item(
subghz->submenu,
"LiftMaster_390",
"Security+1.0 390MHz",
SubmenuIndexLiftMaster_390_00,
subghz_scene_set_type_submenu_callback,
subghz);
submenu_add_item(
subghz->submenu,
"Security+2.0_310",
"Security+2.0 310MHz",
SubmenuIndexSecPlus_v2_310_00,
subghz_scene_set_type_submenu_callback,
subghz);
submenu_add_item(
subghz->submenu,
"Security+2.0_315",
"Security+2.0 315MHz",
SubmenuIndexSecPlus_v2_315_00,
subghz_scene_set_type_submenu_callback,
subghz);
submenu_add_item(
subghz->submenu,
"Security+2.0_390",
"Security+2.0 390MHz",
SubmenuIndexSecPlus_v2_390_00,
subghz_scene_set_type_submenu_callback,
subghz);
@ -247,6 +253,13 @@ bool subghz_scene_set_type_on_event(void* context, SceneManagerEvent event) {
generated_protocol = true;
}
break;
case SubmenuIndexBETT_433:
key = (key & 0x0000FFF0);
if(subghz_scene_set_type_submenu_gen_data_protocol(
subghz, SUBGHZ_PROTOCOL_BETT_NAME, key, 18, 433920000, "AM650")) {
generated_protocol = true;
}
break;
case SubmenuIndexCAMETwee:
key = (key & 0x0FFFFFF0);
key = 0x003FFF7200000000 | (key ^ 0xE0E0E0EE);

View file

@ -106,10 +106,10 @@ bool subbrute_worker_start(
furi_hal_subghz_set_frequency_and_path(instance->frequency);
furi_hal_subghz_flush_rx();
if(furi_hal_subghz_is_tx_allowed(frequency)) {
instance->frequency = frequency;
res = true;
}
//if(furi_hal_subghz_is_tx_allowed(frequency)) {
instance->frequency = frequency;
res = true;
//}
instance->worker_running = res;
#ifdef FURI_DEBUG
@ -245,13 +245,13 @@ bool subbrute_worker_init_manual_transmit(
furi_hal_subghz_set_frequency_and_path(instance->frequency);
furi_hal_subghz_flush_rx();
if(!furi_hal_subghz_is_tx_allowed(frequency)) {
/*if(!furi_hal_subghz_is_tx_allowed(frequency)) {
FURI_LOG_E(TAG, "Frequency: %d invalid!", frequency);
instance->frequency = frequency;
instance->worker_manual_mode = false;
return false;
}
}*/
#ifdef FURI_DEBUG
FURI_LOG_I(TAG, "Frequency: %d", frequency);

View file

@ -21,31 +21,31 @@
#define TAG "SubBruteApp"
static const char* subbrute_menu_names[] = {
[SubBruteAttackCAME12bit307] = "CAME 12bit 307mhz",
[SubBruteAttackCAME12bit433] = "CAME 12bit 433mhz",
[SubBruteAttackCAME12bit868] = "CAME 12bit 868mhz",
[SubBruteAttackChamberlain9bit300] = "Chamberlain 9bit 300mhz",
[SubBruteAttackChamberlain9bit315] = "Chamberlain 9bit 315mhz",
[SubBruteAttackChamberlain9bit390] = "Chamberlain 9bit 390mhz",
[SubBruteAttackLinear10bit300] = "Linear 10bit 300mhz",
[SubBruteAttackLinear10bit310] = "Linear 10bit 310mhz",
[SubBruteAttackNICE12bit433] = "NICE 12bit 433mhz",
[SubBruteAttackNICE12bit868] = "NICE 12bit 868mhz",
[SubBruteAttackCAME12bit307] = "CAME 12bit 307MHz",
[SubBruteAttackCAME12bit433] = "CAME 12bit 433MHz",
[SubBruteAttackCAME12bit868] = "CAME 12bit 868MHz",
[SubBruteAttackNICE12bit433] = "NICE 12bit 433MHz",
[SubBruteAttackNICE12bit868] = "NICE 12bit 868MHz",
[SubBruteAttackChamberlain9bit300] = "Chamberlain 9bit 300MHz",
[SubBruteAttackChamberlain9bit315] = "Chamberlain 9bit 315MHz",
[SubBruteAttackChamberlain9bit390] = "Chamberlain 9bit 390MHz",
[SubBruteAttackLinear10bit300] = "Linear 10bit 300MHz",
[SubBruteAttackLinear10bit310] = "Linear 10bit 310MHz",
[SubBruteAttackLoadFile] = "BF existing dump",
[SubBruteAttackTotalCount] = "Total Count",
};
static const char* subbrute_menu_names_small[] = {
[SubBruteAttackCAME12bit307] = "CAME 307mhz",
[SubBruteAttackCAME12bit433] = "CAME 433mhz",
[SubBruteAttackCAME12bit868] = "CAME 868mhz",
[SubBruteAttackChamberlain9bit300] = "Cham 300mhz",
[SubBruteAttackChamberlain9bit315] = "Cham 315mhz",
[SubBruteAttackChamberlain9bit390] = "Cham 390mhz",
[SubBruteAttackLinear10bit300] = "Linear 300mhz",
[SubBruteAttackLinear10bit310] = "Linear 310mhz",
[SubBruteAttackNICE12bit433] = "NICE 433mhz",
[SubBruteAttackNICE12bit868] = "NICE 868mhz",
[SubBruteAttackCAME12bit307] = "CAME 307MHz",
[SubBruteAttackCAME12bit433] = "CAME 433MHz",
[SubBruteAttackCAME12bit868] = "CAME 868MHz",
[SubBruteAttackNICE12bit433] = "NICE 433MHz",
[SubBruteAttackNICE12bit868] = "NICE 868MHz",
[SubBruteAttackChamberlain9bit300] = "Cham 300MHz",
[SubBruteAttackChamberlain9bit315] = "Cham 315MHz",
[SubBruteAttackChamberlain9bit390] = "Cham 390MHz",
[SubBruteAttackLinear10bit300] = "Linear 300MHz",
[SubBruteAttackLinear10bit310] = "Linear 310MHz",
[SubBruteAttackLoadFile] = "Existing",
[SubBruteAttackTotalCount] = "Total Count",
};

View file

@ -307,19 +307,15 @@ SubBruteFileResult subbrute_device_attack_set(SubBruteDevice* instance, SubBrute
string_set_str(instance->preset_name, preset_ook650_async);
break;
case SubBruteAttackChamberlain9bit300:
instance->frequency = 300000000;
instance->bit = 9;
string_set_str(instance->protocol_name, protocol_cham_code);
string_set_str(instance->preset_name, preset_ook650_async);
break;
case SubBruteAttackChamberlain9bit315:
instance->frequency = 315000000;
instance->bit = 9;
string_set_str(instance->protocol_name, protocol_cham_code);
string_set_str(instance->preset_name, preset_ook650_async);
break;
case SubBruteAttackChamberlain9bit390:
instance->frequency = 390000000;
if(type == SubBruteAttackChamberlain9bit300) {
instance->frequency = 300000000;
} else if(type == SubBruteAttackChamberlain9bit315) {
instance->frequency = 315000000;
} else /* ALWAYS TRUE if(type == SubBruteAttackChamberlain9bit390) */ {
instance->frequency = 390000000;
}
instance->bit = 9;
string_set_str(instance->protocol_name, protocol_cham_code);
string_set_str(instance->preset_name, preset_ook650_async);
@ -353,10 +349,10 @@ SubBruteFileResult subbrute_device_attack_set(SubBruteDevice* instance, SubBrute
return SubBruteFileResultProtocolNotFound; // RETURN
}
if(!furi_hal_subghz_is_tx_allowed(instance->frequency)) {
/*if(!furi_hal_subghz_is_tx_allowed(instance->frequency)) {
FURI_LOG_E(TAG, "Frequency invalid: %d", instance->frequency);
return SubBruteFileResultMissingOrIncorrectFrequency; // RETURN
}
}*/
// For non-file types we didn't set SubGhzProtocolDecoderBase
instance->receiver = subghz_receiver_alloc_init(instance->environment);

View file

@ -20,13 +20,13 @@ typedef enum {
SubBruteAttackCAME12bit307,
SubBruteAttackCAME12bit433,
SubBruteAttackCAME12bit868,
SubBruteAttackNICE12bit433,
SubBruteAttackNICE12bit868,
SubBruteAttackChamberlain9bit300,
SubBruteAttackChamberlain9bit315,
SubBruteAttackChamberlain9bit390,
SubBruteAttackLinear10bit300,
SubBruteAttackLinear10bit310,
SubBruteAttackNICE12bit433,
SubBruteAttackNICE12bit868,
SubBruteAttackLoadFile,
SubBruteAttackTotalCount,
} SubBruteAttacks;