Skip to content
This repository has been archived by the owner on Nov 19, 2024. It is now read-only.

Commit

Permalink
V45 Hotfix (#231)
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] authored May 4, 2023
2 parents e614249 + 103abfe commit 326e114
Show file tree
Hide file tree
Showing 107 changed files with 970 additions and 498 deletions.
45 changes: 25 additions & 20 deletions .github/workflow_data/hotfix.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,37 +12,37 @@
event = json.load(f)

release = requests.get(
event["repository"]["releases_url"].rsplit("{/")[0] + "latest",
event["repository"]["releases_url"].rsplit("{/")[0] + "/latest",
headers={
"Accept": "application/vnd.github.v3+json",
"Authorization": f"token {os.environ['GITHUB_TOKEN']}"
}
).json()

artifacts = (
os.environ['ARTIFACT_TGZ'],
os.environ['ARTIFACT_ZIP']
)
artifacts = {
os.environ['ARTIFACT_TGZ']: "application/gzip",
os.environ['ARTIFACT_ZIP']: "application/zip"
}

for asset in release["assets"]:
if asset["name"] in artifacts:
req = requests.delete(
asset["url"],
headers={
"Accept": "application/vnd.github.v3+json",
"Authorization": f"token {os.environ['GITHUB_TOKEN']}"
}
)
if not req.ok:
print(f"{req.url = }\n{req.status_code = }\n{req.content = }")
sys.exit(1)
req = requests.delete(
asset["url"],
headers={
"Accept": "application/vnd.github.v3+json",
"Authorization": f"token {os.environ['GITHUB_TOKEN']}"
}
)
if not req.ok:
print(f"{req.url = }\n{req.status_code = }\n{req.content = }")
sys.exit(1)

for artifact in artifacts:
for artifact, mediatype in artifacts.items():
req = requests.post(
release["upload_url"].rsplit("{?", 1)[0],
headers={
"Accept": "application/vnd.github.v3+json",
"Authorization": f"token {os.environ['GITHUB_TOKEN']}"
"Authorization": f"token {os.environ['GITHUB_TOKEN']}",
"Content-Type": mediatype
},
params={
"name": artifact
Expand All @@ -59,8 +59,13 @@

body = release["body"]
body = re.sub(
r"(https://lab\.flipper\.net/\?url=).*?(&channel=XFW-Updater&version=" + os.environ['VERSION_TAG'] + r")",
r"\1" + os.environ['ARTIFACT_WEB'] + r"\2",
r"(https://lab\.flipper\.net/\?url=).*?(&channel=XFW-Updater&version=)[A-Za-z0-9_-]+",
r"\1" + os.environ['ARTIFACT_WEB'] + r"\2" + os.environ['VERSION_TAG'],
body
)
body = re.sub(
r"(https://github\.com/ClaraCrazy/Flipper-Xtreme/releases/download/[A-Za-z0-9_-]+?/)[A-Za-z0-9_-]+",
r"\1" + os.environ['VERSION_TAG'],
body
)
body = body.replace("<!--- <HOTFIXES>\n", "")
Expand Down
2 changes: 1 addition & 1 deletion .github/workflow_data/webupdater.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
client = nextcloud_client.Client(os.environ["NC_HOST"])
client.login(os.environ["NC_USER"], os.environ["NC_PASS"])
file = os.environ["NC_FILE"]
path = os.environ["NC_PATH"] + file
path = os.environ["NC_PATH"] + "/" + file
try:
client.delete(path)
except Exception:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/hotfix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ jobs:

- name: "Upload hotfix"
run: python .github/workflow_data/hotfix.py
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"

- name: "Merge pull request"
uses: "pascalgn/automerge-action@v0.15.6"
Expand Down
16 changes: 16 additions & 0 deletions applications/external/hid_app/hid.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ enum HidDebugSubmenuIndex {
HidSubmenuIndexKeynote,
HidSubmenuIndexKeynoteVertical,
HidSubmenuIndexKeyboard,
HidSubmenuIndexNumpad,
HidSubmenuIndexMedia,
HidSubmenuIndexTikTok,
HidSubmenuIndexYTShorts,
Expand All @@ -29,6 +30,9 @@ static void hid_submenu_callback(void* context, uint32_t index) {
} else if(index == HidSubmenuIndexKeyboard) {
app->view_id = HidViewKeyboard;
view_dispatcher_switch_to_view(app->view_dispatcher, HidViewKeyboard);
} else if(index == HidSubmenuIndexNumpad) {
app->view_id = HidViewNumpad;
view_dispatcher_switch_to_view(app->view_dispatcher, HidViewNumpad);
} else if(index == HidSubmenuIndexMedia) {
app->view_id = HidViewMedia;
view_dispatcher_switch_to_view(app->view_dispatcher, HidViewMedia);
Expand Down Expand Up @@ -64,6 +68,7 @@ static void bt_hid_connection_status_changed_callback(BtStatus status, void* con
hid_keynote_set_connected_status(hid->hid_keynote, connected);
hid_keynote_vertical_set_connected_status(hid->hid_keynote_vertical, connected);
hid_keyboard_set_connected_status(hid->hid_keyboard, connected);
hid_numpad_set_connected_status(hid->hid_numpad, connected);
hid_media_set_connected_status(hid->hid_media, connected);
hid_mouse_set_connected_status(hid->hid_mouse, connected);
hid_mouse_clicker_set_connected_status(hid->hid_mouse_clicker, connected);
Expand Down Expand Up @@ -123,6 +128,8 @@ Hid* hid_alloc(HidTransport transport) {
app);
submenu_add_item(
app->device_type_submenu, "Keyboard", HidSubmenuIndexKeyboard, hid_submenu_callback, app);
submenu_add_item(
app->device_type_submenu, "Numpad", HidSubmenuIndexNumpad, hid_submenu_callback, app);
submenu_add_item(
app->device_type_submenu, "Media", HidSubmenuIndexMedia, hid_submenu_callback, app);
submenu_add_item(
Expand Down Expand Up @@ -196,6 +203,12 @@ Hid* hid_app_alloc_view(void* context) {
view_dispatcher_add_view(
app->view_dispatcher, HidViewKeyboard, hid_keyboard_get_view(app->hid_keyboard));

//Numpad keyboard view
app->hid_numpad = hid_numpad_alloc(app);
view_set_previous_callback(hid_numpad_get_view(app->hid_numpad), hid_exit_confirm_view);
view_dispatcher_add_view(
app->view_dispatcher, HidViewNumpad, hid_numpad_get_view(app->hid_numpad));

// Media view
app->hid_media = hid_media_alloc(app);
view_set_previous_callback(hid_media_get_view(app->hid_media), hid_exit_confirm_view);
Expand Down Expand Up @@ -228,6 +241,7 @@ Hid* hid_app_alloc_view(void* context) {
app->view_dispatcher,
HidViewMouseClicker,
hid_mouse_clicker_get_view(app->hid_mouse_clicker));

// Mouse jiggler view
app->hid_mouse_jiggler = hid_mouse_jiggler_alloc(app);
view_set_previous_callback(
Expand Down Expand Up @@ -259,6 +273,8 @@ void hid_free(Hid* app) {
hid_keynote_vertical_free(app->hid_keynote_vertical);
view_dispatcher_remove_view(app->view_dispatcher, HidViewKeyboard);
hid_keyboard_free(app->hid_keyboard);
view_dispatcher_remove_view(app->view_dispatcher, HidViewNumpad);
hid_numpad_free(app->hid_numpad);
view_dispatcher_remove_view(app->view_dispatcher, HidViewMedia);
hid_media_free(app->hid_media);
view_dispatcher_remove_view(app->view_dispatcher, HidViewMouse);
Expand Down
2 changes: 2 additions & 0 deletions applications/external/hid_app/hid.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include "views/hid_keynote.h"
#include "views/hid_keynote_vertical.h"
#include "views/hid_keyboard.h"
#include "views/hid_numpad.h"
#include "views/hid_media.h"
#include "views/hid_mouse.h"
#include "views/hid_mouse_jiggler.h"
Expand All @@ -45,6 +46,7 @@ struct Hid {
HidKeynote* hid_keynote;
HidKeynoteVertical* hid_keynote_vertical;
HidKeyboard* hid_keyboard;
HidNumpad* hid_numpad;
HidMedia* hid_media;
HidMouse* hid_mouse;
HidMouseClicker* hid_mouse_clicker;
Expand Down
1 change: 1 addition & 0 deletions applications/external/hid_app/views.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ typedef enum {
HidViewKeynote,
HidViewKeynoteVertical,
HidViewKeyboard,
HidViewNumpad,
HidViewMedia,
HidViewMouse,
HidViewMouseClicker,
Expand Down
2 changes: 1 addition & 1 deletion applications/external/hid_app/views/hid_mouse_clicker.c
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ static bool hid_mouse_clicker_input_callback(InputEvent* event, void* context) {
bool consumed = false;
bool rate_changed = false;

if(event->type != InputTypeRelease) {
if(event->type != InputTypeShort && event->type != InputTypeRepeat) {
return false;
}

Expand Down
Loading

0 comments on commit 326e114

Please sign in to comment.