@@ -6,32 +6,17 @@ static Storage *evil_portal_open_storage() {
6
6
7
7
static void evil_portal_close_storage () { furi_record_close (RECORD_STORAGE ); }
8
8
9
- bool evil_portal_read_index_html (void * context ) {
10
- FuriString * file_path = furi_string_alloc ();
11
-
12
- DialogsFileBrowserOptions browser_options ;
13
- dialog_file_browser_set_basic_options (& browser_options ,
14
- EVIL_PORTAL_INDEX_EXTENSION ,
15
- NULL ); // TODO configure icon
16
- browser_options .base_path = EVIL_PORTAL_BASE_FOLDER ;
9
+ void evil_portal_read_index_html (void * context ) {
17
10
18
11
Evil_PortalApp * app = context ;
19
- bool res = dialog_file_browser_show (app -> dialogs , file_path , file_path ,
20
- & browser_options );
21
-
22
- if (!res ) {
23
- furi_string_free (file_path );
24
- return false;
25
- }
26
-
27
12
Storage * storage = evil_portal_open_storage ();
28
13
FileInfo fi ;
29
14
30
- if (storage_common_stat (storage , furi_string_get_cstr ( file_path ) , & fi ) ==
15
+ if (storage_common_stat (storage , EVIL_PORTAL_INDEX_SAVE_PATH , & fi ) ==
31
16
FSE_OK ) {
32
17
File * index_html = storage_file_alloc (storage );
33
- if (storage_file_open (index_html , furi_string_get_cstr ( file_path ) ,
34
- FSAM_READ , FSOM_OPEN_EXISTING )) {
18
+ if (storage_file_open (index_html , EVIL_PORTAL_INDEX_SAVE_PATH , FSAM_READ ,
19
+ FSOM_OPEN_EXISTING )) {
35
20
app -> index_html = malloc ((size_t )fi .size );
36
21
uint8_t * buf_ptr = app -> index_html ;
37
22
size_t read = 0 ;
@@ -46,7 +31,6 @@ bool evil_portal_read_index_html(void *context) {
46
31
}
47
32
free (buf_ptr );
48
33
}
49
- furi_string_free (file_path );
50
34
storage_file_close (index_html );
51
35
storage_file_free (index_html );
52
36
} else {
@@ -59,7 +43,6 @@ bool evil_portal_read_index_html(void *context) {
59
43
}
60
44
61
45
evil_portal_close_storage ();
62
- return true;
63
46
}
64
47
65
48
void evil_portal_read_ap_name (void * context ) {
@@ -127,8 +110,7 @@ void write_logs(FuriString *portal_logs) {
127
110
File * file = storage_file_alloc (storage );
128
111
129
112
if (storage_file_open (file , seq_file_path , FSAM_WRITE , FSOM_CREATE_ALWAYS )) {
130
- storage_file_write (file , furi_string_get_cstr (portal_logs ),
131
- furi_string_utf8_length (portal_logs ));
113
+ storage_file_write (file , furi_string_get_cstr (portal_logs ), furi_string_utf8_length (portal_logs ));
132
114
}
133
115
storage_file_close (file );
134
116
storage_file_free (file );
0 commit comments