Skip to content

Commit a750fd5

Browse files
committed
upd evilportal
1 parent fd7cdae commit a750fd5

File tree

2 files changed

+2
-20
lines changed

2 files changed

+2
-20
lines changed

non_catalog_apps/flipper_evil_portal/helpers/evil_portal_storage.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ void evil_portal_read_index_html(void* context) {
2323
File* index_html = storage_file_alloc(storage);
2424
if(storage_file_open(
2525
index_html, EVIL_PORTAL_INDEX_SAVE_PATH, FSAM_READ, FSOM_OPEN_EXISTING)) {
26-
app->index_html = malloc((size_t)fi.size);
26+
app->index_html = malloc((size_t)fi.size + 1);
2727
uint8_t* buf_ptr = app->index_html;
2828
size_t read = 0;
2929
while(read < fi.size) {
@@ -33,7 +33,7 @@ void evil_portal_read_index_html(void* context) {
3333
read += now_read;
3434
buf_ptr += now_read;
3535
}
36-
free(buf_ptr);
36+
*buf_ptr = '\0';
3737
}
3838
storage_file_close(index_html);
3939
storage_file_free(index_html);
@@ -94,8 +94,6 @@ void evil_portal_read_ap_name(void* context) {
9494
buf_ptr += now_read;
9595
}
9696
*buf_ptr = '\0';
97-
buf_ptr++;
98-
free(buf_ptr);
9997
}
10098
storage_file_close(ap_name);
10199
storage_file_free(ap_name);

non_catalog_apps/flipper_evil_portal/scenes/evil_portal_scene_select_html.c

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,6 @@
11
#include "../evil_portal_app_i.h"
22
#include "../helpers/evil_portal_storage.h"
33

4-
void evil_portal_show_loading_popup(Evil_PortalApp* app, bool show) {
5-
ViewStack* view_stack = app->view_stack;
6-
Loading* loading = app->loading;
7-
if(show) {
8-
// Raise timer priority so that animations can play
9-
furi_timer_set_thread_priority(FuriTimerThreadPriorityElevated);
10-
view_stack_add_view(view_stack, loading_get_view(loading));
11-
} else {
12-
view_stack_remove_view(view_stack, loading_get_view(loading));
13-
// Restore default timer priority
14-
furi_timer_set_thread_priority(FuriTimerThreadPriorityNormal);
15-
}
16-
}
17-
184
void evil_portal_scene_select_html_on_enter(void* context) {
195
Evil_PortalApp* app = context;
206
DialogsFileBrowserOptions browser_options;
@@ -33,9 +19,7 @@ void evil_portal_scene_select_html_on_enter(void* context) {
3319

3420
if(success) {
3521
//Replace HTML File
36-
evil_portal_show_loading_popup(app, true);
3722
evil_portal_replace_index_html(app->file_path);
38-
evil_portal_show_loading_popup(app, false);
3923
}
4024

4125
scene_manager_search_and_switch_to_previous_scene(app->scene_manager, Evil_PortalSceneStart);

0 commit comments

Comments
 (0)