Skip to content

Commit

Permalink
Merge branch 'dev' into release
Browse files Browse the repository at this point in the history
  • Loading branch information
xMasterX committed Feb 13, 2023
2 parents 8f16dbb + 928d57b commit da68f2e
Show file tree
Hide file tree
Showing 36 changed files with 326 additions and 318 deletions.
24 changes: 24 additions & 0 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,18 @@ steps:
- chmod +x ./discord.sh
- ./discord.sh --text 'New Unleashed firmware released!\n\nVersion - '${DRONE_TAG}'\n\n[[Github - Changelog]](https://github.com/DarkFlippers/unleashed-firmware/releases/tag/'${DRONE_TAG}')\n\n[-How to install firmware-](https://github.com/DarkFlippers/unleashed-firmware/blob/dev/documentation/HowToInstall.md)\n\n[-Download latest extra apps pack-](https://download-directory.github.io/?url=https://github.com/xMasterX/unleashed-extra-pack/tree/main/apps)\n\n[-Install FW via Web Updater-](https://lab.flipper.net/?url=https://unleashedflip.com/fw/'${DRONE_TAG}'/flipper-z-f7-update-'${DRONE_TAG}'.tgz&channel=release-cfw&version='${DRONE_TAG}')\n\n[-Version without custom animations - Install FW via Web Updater-](https://lab.flipper.net/?url=https://unleashedflip.com/fw_no_anim/flipper-z-f7-update-'${DRONE_TAG}'n.tgz&channel=release-cfw&version='${DRONE_TAG}'n)\n\n[-Version with extra apps - Install FW via Web Updater-](https://lab.flipper.net/?url=https://unleashedflip.com/fw_extra_apps/flipper-z-f7-update-'${DRONE_TAG}'e.tgz&channel=release-cfw&version='${DRONE_TAG}'e)'

- name: "Send extra pack build to telegram"
image: appleboy/drone-telegram
settings:
token:
from_secret: tgtoken
to:
from_secret: tgid
format: markdown
message: "Build with extra apps pack:"
document:
- flipper-z-f7-update-${DRONE_TAG}e.tgz

trigger:
event:
- tag
Expand Down Expand Up @@ -380,6 +392,18 @@ steps:
document:
- dev/flipper-z-f7-update-${DRONE_BUILD_NUMBER}.tgz

- name: "Send extra pack build to telegram"
image: appleboy/drone-telegram
settings:
token:
from_secret: tgtoken
to:
from_secret: tgid_dev
format: markdown
message: "Build with extra apps pack:"
document:
- flipper-z-f7-update-${DRONE_BUILD_NUMBER}e.tgz

- name: "Send discord notification"
image: hfdj/fztools
pull: never
Expand Down
12 changes: 8 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
### New changes
* Archive and FileBrowser: Fixed #332 (large folders parse issue)
* Archive and FileBrowser: Fixed navigation issues and improved performance (by @Willy-JL | PR #333)
* SubGHz -> HAL: **Fixed external CC1101 module issues** (transmission now works correctly) (fixed issue #331)
* SubGHz: Use 17 (1W) pin for subghz debug mode
* SubGHz: **Nice ON2E (Nice One)** support (by @assasinfil | PR #335)
* SubGHz: Remove 467.75 From freq analyzer since it has too much noise (Frequency is still can be used, just excluded from FA to avoid false detections)
* Archive and FileBrowser: **Fixed more navigation issues** (by @Willy-JL | PR #334)
* Plugins -> SubGHz Bruteforcer: Fix Linear Delta 3 repeats (now its more stable and we will be sure signal is received correctly)
* Plugins: Updated TOTP (Authenticator) [(by akopachov)](https://github.com/akopachov/flipper-zero_authenticator)
* OFW: **Fix Cyfral & Metakom emulation (My temp fix removed and proper fix from OFW applied)**
* OFW: BadUSB: disable CDC mode, USB mode switch fix
* OFW: Updater visual fixes

#### [🎲 Download latest extra apps pack](https://download-directory.github.io/?url=https://github.com/xMasterX/unleashed-extra-pack/tree/main/apps)

Expand Down
16 changes: 12 additions & 4 deletions ReadMe.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ Our Discord Community:
Also check the changelog in releases for latest updates!

### Current modified and new Sub-GHz protocols list:
Thanks to Official team (to thier SubGHz Developer, Skorp) for implementing decoders for these protocols.

Encoders/sending made by Eng1n33r & @xMasterX:

- Keeloq [Not ALL systems supported for decode or emulation yet!] - [Supported manufacturers list](https://0bin.net/paste/VwR2lNJY#WH9vnPgvcp7w6zVKucFCuNREKAcOij8KsJ6vqLfMn3b)
- Keeloq: HCS101
- Keeloq: AN-Motors
Expand All @@ -72,15 +76,19 @@ Also check the changelog in releases for latest updates!
- BFT Mitto [External seed calculation required (For info contact me in Discord: Nano#8998)]
- Security+ v1 & v2
- Star Line
- Somfy Telis (encoder by @assasinfil & @TQMatvey)
- Somfy Keytis (encoder by @assasinfil)
- KingGates Stylo 4k (encoder by @assasinfil)
- Alutech AT-4N (encoder by @assasinfil)

Encoders made by @assasinfil & @xMasterX:
- Somfy Telis
- Somfy Keytis
- KingGates Stylo 4k
- Alutech AT-4N
- Nice ON2E (Nice One)

## Please support development of the project
The majority of this project is developed and maintained by me, @xMasterX.
I'm unemployed because of the war, and the only income I receive is from your donations.
Our team is small and the guys are working on this project as much as they can solely based on the enthusiasm they have for this project and the community.
- @assasinfil - SubGHz
- @Svaarich - UI design and animations
- @Amec0e - Infrared assets
- Community moderators in Telegram, Discord, and Reddit
Expand Down
4 changes: 3 additions & 1 deletion applications/main/archive/helpers/archive_browser.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,9 @@ static void archive_list_item_cb(
browser->view,
ArchiveBrowserViewModel * model,
{
files_array_sort(model->files);
if(model->item_cnt <= BROWSER_SORT_THRESHOLD) {
files_array_sort(model->files);
}
model->list_loading = false;
},
true);
Expand Down
5 changes: 5 additions & 0 deletions applications/main/archive/views/archive_browser_view.c
Original file line number Diff line number Diff line change
Expand Up @@ -398,15 +398,20 @@ static bool archive_view_input(InputEvent* event, void* context) {

bool in_menu;
bool move_fav_mode;
bool is_loading;
with_view_model(
browser->view,
ArchiveBrowserViewModel * model,
{
in_menu = model->menu;
move_fav_mode = model->move_fav;
is_loading = model->folder_loading || model->list_loading;
},
false);

if(is_loading) {
return false;
}
if(in_menu) {
if(event->type != InputTypeShort) {
return true; // RETURN
Expand Down
8 changes: 8 additions & 0 deletions applications/main/bad_usb/bad_usb_app.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,12 @@ BadUsbApp* bad_usb_app_alloc(char* arg) {

if(furi_hal_usb_is_locked()) {
app->error = BadUsbAppErrorCloseRpc;
app->usb_if_prev = NULL;
scene_manager_next_scene(app->scene_manager, BadUsbSceneError);
} else {
app->usb_if_prev = furi_hal_usb_get_config();
furi_check(furi_hal_usb_set_config(NULL, NULL));

if(!furi_string_empty(app->file_path)) {
app->bad_usb_script = bad_usb_script_open(app->file_path);
bad_usb_script_set_keyboard_layout(app->bad_usb_script, app->keyboard_layout);
Expand All @@ -138,6 +142,10 @@ void bad_usb_app_free(BadUsbApp* app) {
app->bad_usb_script = NULL;
}

if(app->usb_if_prev) {
furi_check(furi_hal_usb_set_config(app->usb_if_prev, NULL));
}

// Views
view_dispatcher_remove_view(app->view_dispatcher, BadUsbAppViewWork);
bad_usb_free(app->bad_usb_view);
Expand Down
3 changes: 3 additions & 0 deletions applications/main/bad_usb/bad_usb_app_i.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include <gui/modules/variable_item_list.h>
#include <gui/modules/widget.h>
#include "views/bad_usb_view.h"
#include <furi_hal_usb.h>

#define BAD_USB_APP_BASE_FOLDER ANY_PATH("badusb")
#define BAD_USB_APP_PATH_LAYOUT_FOLDER BAD_USB_APP_BASE_FOLDER "/assets/layouts"
Expand All @@ -39,6 +40,8 @@ struct BadUsbApp {
FuriString* keyboard_layout;
BadUsb* bad_usb_view;
BadUsbScript* bad_usb_script;

FuriHalUsbInterface* usb_if_prev;
};

typedef enum {
Expand Down
4 changes: 0 additions & 4 deletions applications/main/bad_usb/bad_usb_script.c
Original file line number Diff line number Diff line change
Expand Up @@ -490,8 +490,6 @@ static int32_t bad_usb_worker(void* context) {
BadUsbWorkerState worker_state = BadUsbStateInit;
int32_t delay_val = 0;

FuriHalUsbInterface* usb_mode_prev = furi_hal_usb_get_config();

FURI_LOG_I(WORKER_TAG, "Init");
File* script_file = storage_file_alloc(furi_record_open(RECORD_STORAGE));
bad_usb->line = furi_string_alloc();
Expand Down Expand Up @@ -642,8 +640,6 @@ static int32_t bad_usb_worker(void* context) {

furi_hal_hid_set_state_callback(NULL, NULL);

furi_hal_usb_set_config(usb_mode_prev, NULL);

storage_file_close(script_file);
storage_file_free(script_file);
furi_string_free(bad_usb->line);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,16 +117,15 @@ static int32_t subghz_frequency_analyzer_worker_thread(void* context) {

// First stage: coarse scan
for(size_t i = 0; i < subghz_setting_get_frequency_count(instance->setting); i++) {
if(furi_hal_subghz_is_frequency_valid(
subghz_setting_get_frequency(instance->setting, i)) &&
uint32_t current_frequnecy = subghz_setting_get_frequency(instance->setting, i);
if(furi_hal_subghz_is_frequency_valid(current_frequnecy) &&
(current_frequnecy != 467750000) &&
!((furi_hal_subghz.radio_type == SubGhzRadioExternal) &&
(subghz_setting_get_frequency(instance->setting, i) >= 311900000 &&
subghz_setting_get_frequency(instance->setting, i) <= 312200000))) {
(current_frequnecy >= 311900000 && current_frequnecy <= 312200000))) {
furi_hal_spi_acquire(furi_hal_subghz.spi_bus_handle);
cc1101_switch_to_idle(furi_hal_subghz.spi_bus_handle);
frequency = cc1101_set_frequency(
furi_hal_subghz.spi_bus_handle,
subghz_setting_get_frequency(instance->setting, i));
frequency =
cc1101_set_frequency(furi_hal_subghz.spi_bus_handle, current_frequnecy);

cc1101_calibrate(furi_hal_subghz.spi_bus_handle);
do {
Expand Down
13 changes: 6 additions & 7 deletions applications/main/subghz/views/subghz_frequency_analyzer.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,12 @@
#define MAX_HISTORY 4

static const uint32_t subghz_frequency_list[] = {
300000000, 302757000, 303875000, 304250000, 307000000, 307500000, 307800000,
309000000, 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, 467750000, 779000000, 868350000,
868400000, 868800000, 868950000, 906400000, 915000000, 925000000, 928000000};
300000000, 302757000, 303875000, 304250000, 307000000, 307500000, 307800000, 309000000,
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,
868350000, 868400000, 868800000, 868950000, 906400000, 915000000, 925000000, 928000000};

typedef enum {
SubGhzFrequencyAnalyzerStatusIDLE,
Expand Down
2 changes: 1 addition & 1 deletion applications/plugins/subbrute
Submodule subbrute updated 1 files
+1 −1 subbrute_protocols.c
4 changes: 2 additions & 2 deletions applications/plugins/totp/cli/commands/move/move.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ void totp_cli_command_move_docopt_usage() {
void totp_cli_command_move_docopt_options() {
TOTP_CLI_PRINTF(" " DOCOPT_OPTION(
TOTP_CLI_COMMAND_MOVE_ARG_NEW_NAME_PREFIX,
DOCOPT_ARGUMENT(TOTP_CLI_COMMAND_MOVE_ARG_NEW_NAME)) " New token name.\r\n");
DOCOPT_ARGUMENT(TOTP_CLI_COMMAND_MOVE_ARG_NEW_NAME)) " New token name\r\n");
TOTP_CLI_PRINTF(" " DOCOPT_OPTION(
TOTP_CLI_COMMAND_MOVE_ARG_NEW_INDEX_PREFIX,
DOCOPT_ARGUMENT(TOTP_CLI_COMMAND_MOVE_ARG_NEW_INDEX)) " New token index.\r\n");
DOCOPT_ARGUMENT(TOTP_CLI_COMMAND_MOVE_ARG_NEW_INDEX)) " New token index\r\n");
}

void totp_cli_command_move_handle(PluginState* plugin_state, FuriString* args, Cli* cli) {
Expand Down
2 changes: 1 addition & 1 deletion applications/plugins/totp/cli/commands/timezone/timezone.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ void totp_cli_command_timezone_docopt_usage() {

void totp_cli_command_timezone_docopt_arguments() {
TOTP_CLI_PRINTF(" " TOTP_CLI_COMMAND_TIMEZONE_ARG_TIMEZONE
" Timezone offset in hours to be set.\r\n");
" Timezone offset in hours to be set\r\n");
}

void totp_cli_command_timezone_handle(PluginState* plugin_state, FuriString* args, Cli* cli) {
Expand Down
2 changes: 1 addition & 1 deletion applications/plugins/totp/services/config/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ static TotpConfigFileOpenResult totp_open_config_file(Storage* storage, FlipperF
return TotpConfigFileOpenSuccess;
}

TotpConfigFileUpdateResult
static TotpConfigFileUpdateResult
totp_config_file_save_new_token_i(FlipperFormat* file, const TokenInfo* token_info) {
TotpConfigFileUpdateResult update_result;
do {
Expand Down
4 changes: 4 additions & 0 deletions applications/plugins/totp/totp_app.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include <flipper_format/flipper_format.h>
#include <notification/notification.h>
#include <notification/notification_messages.h>
#include <dolphin/dolphin.h>
#include "services/config/config.h"
#include "types/plugin_state.h"
#include "types/token_info.h"
Expand Down Expand Up @@ -151,6 +152,9 @@ int32_t totp_app() {
return 253;
}

// Affecting dolphin level
DOLPHIN_DEED(DolphinDeedPluginStart);

// Set system callbacks
ViewPort* view_port = view_port_alloc();
view_port_draw_callback_set(view_port, render_callback, &state_mutex);
Expand Down
7 changes: 5 additions & 2 deletions applications/services/gui/modules/file_browser.c
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@ static void browser_list_item_cb(
browser->view,
FileBrowserModel * model,
{
if(model->item_cnt < 430) {
if(model->item_cnt <= BROWSER_SORT_THRESHOLD) {
FuriString* selected = NULL;
if(model->item_idx > 0) {
selected = furi_string_alloc_set(
Expand Down Expand Up @@ -646,7 +646,10 @@ static bool file_browser_view_input_callback(InputEvent* event, void* context) {
bool is_loading = false;

with_view_model(
browser->view, FileBrowserModel * model, { is_loading = model->folder_loading; }, false);
browser->view,
FileBrowserModel * model,
{ is_loading = model->folder_loading || model->list_loading; },
false);

if(is_loading) {
return false;
Expand Down
2 changes: 1 addition & 1 deletion applications/services/gui/modules/file_browser_worker.c
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ static int32_t browser_worker(void* context) {
if(flags & WorkerEvtLoad) {
FURI_LOG_D(
TAG, "Load offset: %lu cnt: %lu", browser->load_offset, browser->load_count);
if(items_cnt > 430) {
if(items_cnt > BROWSER_SORT_THRESHOLD) {
browser_folder_load_chunked(
browser, path, browser->load_offset, browser->load_count);
} else {
Expand Down
2 changes: 2 additions & 0 deletions applications/services/gui/modules/file_browser_worker.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
extern "C" {
#endif

#define BROWSER_SORT_THRESHOLD 400

typedef struct BrowserWorker BrowserWorker;
typedef void (*BrowserWorkerFolderOpenCallback)(
void* context,
Expand Down
6 changes: 5 additions & 1 deletion applications/system/updater/scenes/updater_scene_error.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,12 @@ bool updater_scene_error_on_event(void* context, SceneManagerEvent event) {
}

void updater_scene_error_on_exit(void* context) {
furi_assert(context);
Updater* updater = (Updater*)context;

widget_reset(updater->widget);
free(updater->pending_update);

if(updater->loaded_manifest) {
update_manifest_free(updater->loaded_manifest);
}
}
19 changes: 8 additions & 11 deletions applications/system/updater/scenes/updater_scene_loadcfg.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,9 @@ void updater_scene_loadcfg_apply_callback(GuiButtonType result, InputType type,

void updater_scene_loadcfg_on_enter(void* context) {
Updater* updater = (Updater*)context;
UpdaterManifestProcessingState* pending_upd = updater->pending_update =
malloc(sizeof(UpdaterManifestProcessingState));
pending_upd->manifest = update_manifest_alloc();
UpdateManifest* loaded_manifest = updater->loaded_manifest = update_manifest_alloc();

if(update_manifest_init(pending_upd->manifest, furi_string_get_cstr(updater->startup_arg))) {
if(update_manifest_init(loaded_manifest, furi_string_get_cstr(updater->startup_arg))) {
widget_add_string_element(
updater->widget, 64, 12, AlignCenter, AlignCenter, FontPrimary, "Update");

Expand All @@ -37,7 +35,7 @@ void updater_scene_loadcfg_on_enter(void* context) {
32,
AlignCenter,
AlignCenter,
furi_string_get_cstr(pending_upd->manifest->version),
furi_string_get_cstr(loaded_manifest->version),
true);

widget_add_button_element(
Expand Down Expand Up @@ -95,13 +93,12 @@ bool updater_scene_loadcfg_on_event(void* context, SceneManagerEvent event) {
}

void updater_scene_loadcfg_on_exit(void* context) {
furi_assert(context);
Updater* updater = (Updater*)context;

if(updater->pending_update) {
update_manifest_free(updater->pending_update->manifest);
furi_string_free(updater->pending_update->message);
}

widget_reset(updater->widget);
free(updater->pending_update);

if(updater->loaded_manifest) {
update_manifest_free(updater->loaded_manifest);
}
}
8 changes: 1 addition & 7 deletions applications/system/updater/updater_i.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,6 @@ typedef enum {
UpdaterCustomEventSdUnmounted,
} UpdaterCustomEvent;

typedef struct UpdaterManifestProcessingState {
UpdateManifest* manifest;
FuriString* message;
bool ready_to_be_applied;
} UpdaterManifestProcessingState;

typedef struct {
// GUI
Gui* gui;
Expand All @@ -49,7 +43,7 @@ typedef struct {

UpdaterMainView* main_view;

UpdaterManifestProcessingState* pending_update;
UpdateManifest* loaded_manifest;
UpdatePrepareResult preparation_result;

UpdateTask* update_task;
Expand Down
Loading

0 comments on commit da68f2e

Please sign in to comment.