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 Mar 22, 2023
2 parents 1d801c3 + 2ff07a0 commit fd56ac3
Show file tree
Hide file tree
Showing 87 changed files with 1,603 additions and 1,950 deletions.
16 changes: 8 additions & 8 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ steps:
image: hfdj/fztools
pull: never
commands:
- git clone https://github.com/xMasterX/unleashed-extra-pack.git
- cp -R unleashed-extra-pack/apps/* assets/resources/apps/
- rm -rf unleashed-extra-pack
- git clone https://github.com/xMasterX/all-the-plugins.git
- cp -R all-the-plugins/apps/* assets/resources/apps/
- rm -rf all-the-plugins
- export DIST_SUFFIX=${DRONE_TAG}e
- export WORKFLOW_BRANCH_OR_TAG=release-cfw
- export FORCE_NO_DIRTY=yes
Expand Down Expand Up @@ -201,7 +201,7 @@ steps:
[-How to install firmware-](https://github.com/DarkFlippers/unleashed-firmware/blob/dev/documentation/HowToInstall.md)
[-Download latest extra apps pack-](https://github.com/xMasterX/unleashed-extra-pack/archive/refs/heads/main.zip)
[-Download latest extra apps pack-](https://github.com/xMasterX/all-the-plugins/archive/refs/heads/main.zip)
[-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})
Expand All @@ -223,7 +223,7 @@ steps:
commands:
- wget "https://raw.githubusercontent.com/fieu/discord.sh/e1dc1a7595efad2cad8f072f0b3531c470f5b7c8/discord.sh"
- chmod +x ./discord.sh
- ./discord.sh --text 'New Unleashed firmware released!\n\nVersion - '${DRONE_TAG}'\n\n[-> Sponsor our project](https://boosty.to/mmxdev)\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://github.com/xMasterX/unleashed-extra-pack/archive/refs/heads/main.zip)\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)'
- ./discord.sh --text 'New Unleashed firmware released!\n\nVersion - '${DRONE_TAG}'\n\n[-> Sponsor our project](https://boosty.to/mmxdev)\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://github.com/xMasterX/all-the-plugins/archive/refs/heads/main.zip)\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
Expand Down Expand Up @@ -281,9 +281,9 @@ steps:
image: hfdj/fztools
pull: never
commands:
- git clone https://github.com/xMasterX/unleashed-extra-pack.git
- cp -R unleashed-extra-pack/apps/* assets/resources/apps/
- rm -rf unleashed-extra-pack
- git clone --branch dev https://github.com/xMasterX/all-the-plugins.git
- cp -R all-the-plugins/apps/* assets/resources/apps/
- rm -rf all-the-plugins
- export DIST_SUFFIX=${DRONE_BUILD_NUMBER}e
- export WORKFLOW_BRANCH_OR_TAG=dev-cfw
- export FORCE_NO_DIRTY=yes
Expand Down
5 changes: 4 additions & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,7 @@
url = https://github.com/ataradov/free-dap.git
[submodule "applications/external/subbrute"]
path = applications/external/subbrute
url = https://github.com/derskythe/flipperzero-subbrute.git
url = https://github.com/derskythe/flipperzero-subbrute.git
[submodule "lib/heatshrink"]
path = lib/heatshrink
url = https://github.com/flipperdevices/heatshrink.git
28 changes: 16 additions & 12 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
### New changes
* Plugins: Fix minesweeper freeze bugs, do some refactoring
* Plugins: Update WAV Player, 16 bit support by @LTVA1
* Infrared: Update universal remote assets (by @amec0e | PR #394)
* OFW PR: Fixed writing gen1a magic tags with invalid BCC [(PR 2511 by AloneLiberty)](https://github.com/AloneLiberty/flipperzero-firmware/tree/nfc-magic-write-fix)
* OFW: BadUSB: Script interpreter refactoring
* OFW: SubGhz: fix Incorrect comparison in subghz_setting_get_hopper_frequency
* OFW: Add one_wire lib to f18, separate ibutton
* OFW: Improved debugging experience for external apps
* OFW: SD Driver: reinit sd card on error
* OFW: OTP programmer: return exit code based on error type

#### [🎲 Download latest extra apps pack](https://github.com/xMasterX/unleashed-extra-pack/archive/refs/heads/main.zip)
* If you have copied apps into `apps` folder - remove `apps` folder on your microSD before installing this release to avoid issues!
* Dev Builds: Add extra pack dev branch to avoid "bug" reports with `API mismatch`
* App Loader: Add option to ignore api mismatch (warning! some apps WILL not work, please update them to avoid any issues) -> (by @Willy-JL | PR #395)
* SubGHz: Add manually -> GSN protocol support
* SubGHz: Add 318 and 418 MHz back to hopping list
* SubGHz: Fix hopper stuck at 433.42 due to wide range signals -
When we using 433.92 remote flipper in hopping mode will stuck at 433.42 and may loose signal because of that, need to avoid using close freqs in hopping, only freqs with bigger difference like 310 -> 315
* Plugins: Update **TOTP (Authenticator)** [(by akopachov)](https://github.com/akopachov/flipper-zero_authenticator) -> BadBT Support
* OFW: Screen streaming improvements
* OFW: 1-Wire Overdrive Mode -> **Breaking API change, api was changed from 19.x to 20.x**
* OFW: Disable UART IRQs by default
* OFW: BadUSB: implement boot protocol
* OFW: Remove hmac_sha256 from public API -> **Breaking API change, api was changed from 18.x to 19.x**
**(this will make your manually copied plugins not work, update them in same way you installed them, or delete `apps` folder and then install firmware, if you using extra pack builds (with `e` in version) all apps in _Extra will be updated automatically)**

#### [🎲 Download latest extra apps pack](https://github.com/xMasterX/all-the-plugins/archive/refs/heads/main.zip)

[-> How to install firmware](https://github.com/DarkFlippers/unleashed-firmware/blob/dev/documentation/HowToInstall.md)

Expand Down
2 changes: 1 addition & 1 deletion ReadMe.md
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ Games:

### **Plugins**

## [- 🎲 Download Extra plugins for Unleashed](https://github.com/xMasterX/unleashed-extra-pack)
## [- 🎲 Download Extra plugins for Unleashed](https://github.com/xMasterX/all-the-plugins)

## [- TOTP (Authenticator) config description](https://github.com/akopachov/flipper-zero_authenticator/blob/master/docs/conf-file_description.md)

Expand Down
13 changes: 11 additions & 2 deletions applications/examples/example_thermo/example_thermo.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,12 @@
#include <one_wire/maxim_crc.h>
#include <one_wire/one_wire_host.h>

#include <furi_hal_power.h>

#define UPDATE_PERIOD_MS 1000UL
#define TEXT_STORE_SIZE 64U

#define DS18B20_CMD_SKIP_ROM 0xccU
#define DS18B20_CMD_CONVERT 0x44U
#define DS18B20_CMD_READ_SCRATCHPAD 0xbeU

Expand Down Expand Up @@ -92,7 +95,7 @@ static void example_thermo_request_temperature(ExampleThermoContext* context) {
/* After the reset, a ROM operation must follow.
If there is only one device connected, the "Skip ROM" command is most appropriate
(it can also be used to address all of the connected devices in some cases).*/
onewire_host_skip(onewire);
onewire_host_write(onewire, DS18B20_CMD_SKIP_ROM);
/* After the ROM operation, a device-specific command is issued.
In this case, it's a request to start measuring the temperature. */
onewire_host_write(onewire, DS18B20_CMD_CONVERT);
Expand Down Expand Up @@ -133,7 +136,7 @@ static void example_thermo_read_temperature(ExampleThermoContext* context) {
/* After the reset, a ROM operation must follow.
If there is only one device connected, the "Skip ROM" command is most appropriate
(it can also be used to address all of the connected devices in some cases).*/
onewire_host_skip(onewire);
onewire_host_write(onewire, DS18B20_CMD_SKIP_ROM);

/* After the ROM operation, a device-specific command is issued.
This time, it will be the "Read Scratchpad" command which will
Expand Down Expand Up @@ -267,6 +270,9 @@ static void example_thermo_input_callback(InputEvent* event, void* ctx) {

/* Starts the reader thread and handles the input */
static void example_thermo_run(ExampleThermoContext* context) {
/* Enable power on external pins */
furi_hal_power_enable_otg();

/* Configure the hardware in host mode */
onewire_host_start(context->onewire);

Expand Down Expand Up @@ -299,6 +305,9 @@ static void example_thermo_run(ExampleThermoContext* context) {

/* Reset the hardware */
onewire_host_stop(context->onewire);

/* Disable power on external pins */
furi_hal_power_disable_otg();
}

/******************** Initialisation & startup *****************************/
Expand Down
6 changes: 5 additions & 1 deletion applications/external/totp/application.fam
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,14 @@ App(
"dialogs",
"storage",
"input",
"notification"
"notification",
"bt"
],
stack_size=2 * 1024,
order=20,
fap_author="Alexander Kopachov (@akopachov)",
fap_description="Software-based TOTP authenticator for Flipper Zero device",
fap_weburl="https://github.com/akopachov/flipper-zero_authenticator",
fap_category="Misc",
fap_icon_assets="images",
fap_icon="totp_10px.png",
Expand Down
3 changes: 3 additions & 0 deletions applications/external/totp/cli/cli.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include "commands/pin/pin.h"
#include "commands/notification/notification.h"
#include "commands/reset/reset.h"
#include "commands/automation/automation.h"

static void totp_cli_print_unknown_command(const FuriString* unknown_command) {
TOTP_CLI_PRINTF_ERROR(
Expand Down Expand Up @@ -57,6 +58,8 @@ static void totp_cli_handler(Cli* cli, FuriString* args, void* context) {
totp_cli_command_pin_handle(plugin_state, args, cli);
} else if(furi_string_cmp_str(cmd, TOTP_CLI_COMMAND_NOTIFICATION) == 0) {
totp_cli_command_notification_handle(plugin_state, args, cli);
} else if(furi_string_cmp_str(cmd, TOTP_CLI_COMMAND_AUTOMATION) == 0) {
totp_cli_command_automation_handle(plugin_state, args, cli);
} else if(furi_string_cmp_str(cmd, TOTP_CLI_COMMAND_RESET) == 0) {
totp_cli_command_reset_handle(cli, cli_context->event_queue);
} else {
Expand Down
2 changes: 1 addition & 1 deletion applications/external/totp/cli/commands/add/add.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ void totp_cli_command_add_docopt_usage() {
}

void totp_cli_command_add_docopt_arguments() {
TOTP_CLI_PRINTF(" " TOTP_CLI_COMMAND_ADD_ARG_NAME " Token name\r\n");
TOTP_CLI_PRINTF(" " TOTP_CLI_COMMAND_ADD_ARG_NAME " Token name\r\n");
}

void totp_cli_command_add_docopt_options() {
Expand Down
133 changes: 133 additions & 0 deletions applications/external/totp/cli/commands/automation/automation.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
#include "automation.h"
#include <lib/toolbox/args.h>
#include "../../../services/config/config.h"
#include "../../../ui/scene_director.h"
#include "../../cli_helpers.h"

#define TOTP_CLI_COMMAND_AUTOMATION_ARG_METHOD "automation"
#define TOTP_CLI_COMMAND_AUTOMATION_METHOD_NONE "none"
#define TOTP_CLI_COMMAND_AUTOMATION_METHOD_USB "usb"
#ifdef TOTP_BADBT_TYPE_ENABLED
#define TOTP_CLI_COMMAND_AUTOMATION_METHOD_BT "bt"
#endif

void totp_cli_command_automation_docopt_commands() {
TOTP_CLI_PRINTF(" " TOTP_CLI_COMMAND_AUTOMATION " Get or set automation method\r\n");
}

void totp_cli_command_automation_docopt_usage() {
TOTP_CLI_PRINTF(" " TOTP_CLI_COMMAND_NAME " " TOTP_CLI_COMMAND_AUTOMATION " " DOCOPT_OPTIONAL(
DOCOPT_MULTIPLE(DOCOPT_ARGUMENT(TOTP_CLI_COMMAND_AUTOMATION_ARG_METHOD))) "\r\n");
}

void totp_cli_command_automation_docopt_arguments() {
TOTP_CLI_PRINTF(
" " TOTP_CLI_COMMAND_AUTOMATION_ARG_METHOD
" Automation method to be set. Must be one of [" TOTP_CLI_COMMAND_AUTOMATION_METHOD_NONE
", " TOTP_CLI_COMMAND_AUTOMATION_METHOD_USB
#ifdef TOTP_BADBT_TYPE_ENABLED
", " TOTP_CLI_COMMAND_AUTOMATION_METHOD_BT
#endif
"]\r\n");
}

static void totp_cli_command_automation_print_method(AutomationMethod method, char* color) {
#ifdef TOTP_BADBT_TYPE_ENABLED
bool has_previous_method = false;
#endif
if(method & AutomationMethodBadUsb) {
TOTP_CLI_PRINTF_COLORFUL(color, "\"" TOTP_CLI_COMMAND_AUTOMATION_METHOD_USB "\"");
#ifdef TOTP_BADBT_TYPE_ENABLED
has_previous_method = true;
#endif
}

#ifdef TOTP_BADBT_TYPE_ENABLED
if(method & AutomationMethodBadBt) {
if(has_previous_method) {
TOTP_CLI_PRINTF_COLORFUL(color, " and ");
}

TOTP_CLI_PRINTF_COLORFUL(color, "\"" TOTP_CLI_COMMAND_AUTOMATION_METHOD_BT "\"");
}
#endif

if(method == AutomationMethodNone) {
TOTP_CLI_PRINTF_COLORFUL(color, "\"" TOTP_CLI_COMMAND_AUTOMATION_METHOD_NONE "\"");
}
}

void totp_cli_command_automation_handle(PluginState* plugin_state, FuriString* args, Cli* cli) {
if(!totp_cli_ensure_authenticated(plugin_state, cli)) {
return;
}

FuriString* temp_str = furi_string_alloc();
bool new_method_provided = false;
AutomationMethod new_method = AutomationMethodNone;
bool args_valid = true;
while(args_read_string_and_trim(args, temp_str)) {
if(furi_string_cmpi_str(temp_str, TOTP_CLI_COMMAND_AUTOMATION_METHOD_NONE) == 0) {
new_method_provided = true;
new_method = AutomationMethodNone;
} else if(furi_string_cmpi_str(temp_str, TOTP_CLI_COMMAND_AUTOMATION_METHOD_USB) == 0) {
new_method_provided = true;
new_method |= AutomationMethodBadUsb;
}
#ifdef TOTP_BADBT_TYPE_ENABLED
else if(furi_string_cmpi_str(temp_str, TOTP_CLI_COMMAND_AUTOMATION_METHOD_BT) == 0) {
new_method_provided = true;
new_method |= AutomationMethodBadBt;
}
#endif
else {
args_valid = false;
break;
}
}

do {
if(!args_valid) {
TOTP_CLI_PRINT_INVALID_ARGUMENTS();
break;
}

if(new_method_provided) {
Scene previous_scene = TotpSceneNone;
if(plugin_state->current_scene == TotpSceneGenerateToken ||
plugin_state->current_scene == TotpSceneAppSettings) {
previous_scene = plugin_state->current_scene;
totp_scene_director_activate_scene(plugin_state, TotpSceneNone, NULL);
}

plugin_state->automation_method = new_method;
if(totp_config_file_update_automation_method(new_method) ==
TotpConfigFileUpdateSuccess) {
TOTP_CLI_PRINTF_SUCCESS("Automation method is set to ");
totp_cli_command_automation_print_method(new_method, TOTP_CLI_COLOR_SUCCESS);
cli_nl();
} else {
TOTP_CLI_PRINT_ERROR_UPDATING_CONFIG_FILE();
}

#ifdef TOTP_BADBT_TYPE_ENABLED
if(!(new_method & AutomationMethodBadBt) &&
plugin_state->bt_type_code_worker_context != NULL) {
totp_bt_type_code_worker_free(plugin_state->bt_type_code_worker_context);
plugin_state->bt_type_code_worker_context = NULL;
}
#endif

if(previous_scene != TotpSceneNone) {
totp_scene_director_activate_scene(plugin_state, previous_scene, NULL);
}
} else {
TOTP_CLI_PRINTF_INFO("Current automation method is ");
totp_cli_command_automation_print_method(
plugin_state->automation_method, TOTP_CLI_COLOR_INFO);
cli_nl();
}
} while(false);

furi_string_free(temp_str);
}
11 changes: 11 additions & 0 deletions applications/external/totp/cli/commands/automation/automation.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#pragma once

#include <cli/cli.h>
#include "../../../types/plugin_state.h"

#define TOTP_CLI_COMMAND_AUTOMATION "automation"

void totp_cli_command_automation_handle(PluginState* plugin_state, FuriString* args, Cli* cli);
void totp_cli_command_automation_docopt_commands();
void totp_cli_command_automation_docopt_usage();
void totp_cli_command_automation_docopt_arguments();
2 changes: 1 addition & 1 deletion applications/external/totp/cli/commands/delete/delete.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ void totp_cli_command_delete_docopt_usage() {
}

void totp_cli_command_delete_docopt_arguments() {
TOTP_CLI_PRINTF(" " TOTP_CLI_COMMAND_DELETE_ARG_INDEX " Token index in the list\r\n");
TOTP_CLI_PRINTF(" " TOTP_CLI_COMMAND_DELETE_ARG_INDEX " Token index in the list\r\n");
}

void totp_cli_command_delete_docopt_options() {
Expand Down
4 changes: 4 additions & 0 deletions applications/external/totp/cli/commands/help/help.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include "../pin/pin.h"
#include "../notification/notification.h"
#include "../reset/reset.h"
#include "../automation/automation.h"

void totp_cli_command_help_docopt_commands() {
TOTP_CLI_PRINTF(" " TOTP_CLI_COMMAND_HELP ", " TOTP_CLI_COMMAND_HELP_ALT
Expand All @@ -31,6 +32,7 @@ void totp_cli_command_help_handle() {
totp_cli_command_pin_docopt_usage();
totp_cli_command_notification_docopt_usage();
totp_cli_command_reset_docopt_usage();
totp_cli_command_automation_docopt_usage();
cli_nl();
TOTP_CLI_PRINTF("Commands:\r\n");
totp_cli_command_help_docopt_commands();
Expand All @@ -42,12 +44,14 @@ void totp_cli_command_help_handle() {
totp_cli_command_pin_docopt_commands();
totp_cli_command_notification_docopt_commands();
totp_cli_command_reset_docopt_commands();
totp_cli_command_automation_docopt_commands();
cli_nl();
TOTP_CLI_PRINTF("Arguments:\r\n");
totp_cli_command_add_docopt_arguments();
totp_cli_command_delete_docopt_arguments();
totp_cli_command_timezone_docopt_arguments();
totp_cli_command_notification_docopt_arguments();
totp_cli_command_automation_docopt_arguments();
cli_nl();
TOTP_CLI_PRINTF("Options:\r\n");
totp_cli_command_add_docopt_options();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include "../../../ui/scene_director.h"
#include "../../cli_helpers.h"

#define TOTP_CLI_COMMAND_NOTIFICATION_ARG_METHOD "method"
#define TOTP_CLI_COMMAND_NOTIFICATION_ARG_METHOD "notification"
#define TOTP_CLI_COMMAND_NOTIFICATION_METHOD_NONE "none"
#define TOTP_CLI_COMMAND_NOTIFICATION_METHOD_SOUND "sound"
#define TOTP_CLI_COMMAND_NOTIFICATION_METHOD_VIBRO "vibro"
Expand All @@ -23,7 +23,7 @@ void totp_cli_command_notification_docopt_usage() {
void totp_cli_command_notification_docopt_arguments() {
TOTP_CLI_PRINTF(
" " TOTP_CLI_COMMAND_NOTIFICATION_ARG_METHOD
" Notification method to be set. Must be one of [" TOTP_CLI_COMMAND_NOTIFICATION_METHOD_NONE
" Notification method to be set. Must be one of [" TOTP_CLI_COMMAND_NOTIFICATION_METHOD_NONE
", " TOTP_CLI_COMMAND_NOTIFICATION_METHOD_SOUND
", " TOTP_CLI_COMMAND_NOTIFICATION_METHOD_VIBRO "]\r\n");
}
Expand Down
Loading

0 comments on commit fd56ac3

Please sign in to comment.