Преглед изворни кода

new file: .clang-format
modified: key_generator.c

Milk-Cool пре 2 година
родитељ
комит
11b98c5e46
2 измењених фајлова са 346 додато и 118 уклоњено
  1. 191 0
      .clang-format
  2. 155 118
      key_generator.c

+ 191 - 0
.clang-format

@@ -0,0 +1,191 @@
+---
+Language:        Cpp
+AccessModifierOffset: -4
+AlignAfterOpenBracket: AlwaysBreak
+AlignArrayOfStructures: None
+AlignConsecutiveMacros: None
+AlignConsecutiveAssignments: None
+AlignConsecutiveBitFields: None
+AlignConsecutiveDeclarations: None
+AlignEscapedNewlines: Left
+AlignOperands:   Align
+AlignTrailingComments: false
+AllowAllArgumentsOnNextLine: true
+AllowAllParametersOfDeclarationOnNextLine: false
+AllowShortEnumsOnASingleLine: true
+AllowShortBlocksOnASingleLine: Never
+AllowShortCaseLabelsOnASingleLine: false
+AllowShortFunctionsOnASingleLine: None
+AllowShortLambdasOnASingleLine: All
+AllowShortIfStatementsOnASingleLine: WithoutElse
+AllowShortLoopsOnASingleLine: true
+AlwaysBreakAfterDefinitionReturnType: None
+AlwaysBreakAfterReturnType: None
+AlwaysBreakBeforeMultilineStrings: false
+AlwaysBreakTemplateDeclarations: Yes
+AttributeMacros:
+  - __capability
+BinPackArguments: false
+BinPackParameters: false
+BraceWrapping:
+  AfterCaseLabel:  false
+  AfterClass:      false
+  AfterControlStatement: Never
+  AfterEnum:       false
+  AfterFunction:   false
+  AfterNamespace:  false
+  AfterObjCDeclaration: false
+  AfterStruct:     false
+  AfterUnion:      false
+  AfterExternBlock: false
+  BeforeCatch:     false
+  BeforeElse:      false
+  BeforeLambdaBody: false
+  BeforeWhile:     false
+  IndentBraces:    false
+  SplitEmptyFunction: true
+  SplitEmptyRecord: true
+  SplitEmptyNamespace: true
+BreakBeforeBinaryOperators: None
+BreakBeforeConceptDeclarations: true
+BreakBeforeBraces: Attach
+BreakBeforeInheritanceComma: false
+BreakInheritanceList: BeforeColon
+BreakBeforeTernaryOperators: false
+BreakConstructorInitializersBeforeComma: false
+BreakConstructorInitializers: BeforeComma
+BreakAfterJavaFieldAnnotations: false
+BreakStringLiterals: false
+ColumnLimit:     99
+CommentPragmas:  '^ IWYU pragma:'
+QualifierAlignment: Leave
+CompactNamespaces: false
+ConstructorInitializerIndentWidth: 4
+ContinuationIndentWidth: 4
+Cpp11BracedListStyle: true
+DeriveLineEnding: true
+DerivePointerAlignment: false
+DisableFormat:   false
+EmptyLineAfterAccessModifier: Never
+EmptyLineBeforeAccessModifier: LogicalBlock
+ExperimentalAutoDetectBinPacking: false
+PackConstructorInitializers: BinPack
+BasedOnStyle:    ''
+ConstructorInitializerAllOnOneLineOrOnePerLine: false
+AllowAllConstructorInitializersOnNextLine: true
+FixNamespaceComments: false
+ForEachMacros:
+  - foreach
+  - Q_FOREACH
+  - BOOST_FOREACH
+IfMacros:
+  - KJ_IF_MAYBE
+IncludeBlocks:   Preserve
+IncludeCategories:
+  - Regex:           '.*'
+    Priority:        1
+    SortPriority:    0
+    CaseSensitive:   false
+  - Regex:           '^(<|"(gtest|gmock|isl|json)/)'
+    Priority:        3
+    SortPriority:    0
+    CaseSensitive:   false
+  - Regex:           '.*'
+    Priority:        1
+    SortPriority:    0
+    CaseSensitive:   false
+IncludeIsMainRegex: '(Test)?$'
+IncludeIsMainSourceRegex: ''
+IndentAccessModifiers: false
+IndentCaseLabels: false
+IndentCaseBlocks: false
+IndentGotoLabels: true
+IndentPPDirectives: None
+IndentExternBlock: AfterExternBlock
+IndentRequires:  false
+IndentWidth:     4
+IndentWrappedFunctionNames: true
+InsertTrailingCommas: None
+JavaScriptQuotes: Leave
+JavaScriptWrapImports: true
+KeepEmptyLinesAtTheStartOfBlocks: false
+LambdaBodyIndentation: Signature
+MacroBlockBegin: ''
+MacroBlockEnd:   ''
+MaxEmptyLinesToKeep: 1
+NamespaceIndentation: None
+ObjCBinPackProtocolList: Auto
+ObjCBlockIndentWidth: 4
+ObjCBreakBeforeNestedBlockParam: true
+ObjCSpaceAfterProperty: true
+ObjCSpaceBeforeProtocolList: true
+PenaltyBreakAssignment: 10
+PenaltyBreakBeforeFirstCallParameter: 30
+PenaltyBreakComment: 10
+PenaltyBreakFirstLessLess: 0
+PenaltyBreakOpenParenthesis: 0
+PenaltyBreakString: 10
+PenaltyBreakTemplateDeclaration: 10
+PenaltyExcessCharacter: 100
+PenaltyReturnTypeOnItsOwnLine: 60
+PenaltyIndentedWhitespace: 0
+PointerAlignment: Left
+PPIndentWidth:   -1
+ReferenceAlignment: Pointer
+ReflowComments:  false
+RemoveBracesLLVM: false
+SeparateDefinitionBlocks: Leave
+ShortNamespaceLines: 1
+SortIncludes:    Never
+SortJavaStaticImport: Before
+SortUsingDeclarations: false
+SpaceAfterCStyleCast: false
+SpaceAfterLogicalNot: false
+SpaceAfterTemplateKeyword: true
+SpaceBeforeAssignmentOperators: true
+SpaceBeforeCaseColon: false
+SpaceBeforeCpp11BracedList: false
+SpaceBeforeCtorInitializerColon: true
+SpaceBeforeInheritanceColon: true
+SpaceBeforeParens: Never
+SpaceBeforeParensOptions:
+  AfterControlStatements: false
+  AfterForeachMacros: false
+  AfterFunctionDefinitionName: false
+  AfterFunctionDeclarationName: false
+  AfterIfMacros:   false
+  AfterOverloadedOperator: false
+  BeforeNonEmptyParentheses: false
+SpaceAroundPointerQualifiers: Default
+SpaceBeforeRangeBasedForLoopColon: true
+SpaceInEmptyBlock: false
+SpaceInEmptyParentheses: false
+SpacesBeforeTrailingComments: 1
+SpacesInAngles:  Never
+SpacesInConditionalStatement: false
+SpacesInContainerLiterals: false
+SpacesInCStyleCastParentheses: false
+SpacesInLineCommentPrefix:
+  Minimum:         1
+  Maximum:         -1
+SpacesInParentheses: false
+SpacesInSquareBrackets: false
+SpaceBeforeSquareBrackets: false
+BitFieldColonSpacing: Both
+Standard:        c++03
+StatementAttributeLikeMacros:
+  - Q_EMIT
+StatementMacros:
+  - Q_UNUSED
+  - QT_REQUIRE_VERSION
+TabWidth:        4
+UseCRLF:         false
+UseTab:          Never
+WhitespaceSensitiveMacros:
+  - STRINGIZE
+  - PP_STRINGIZE
+  - BOOST_PP_STRINGIZE
+  - NS_SWIFT_NAME
+  - CF_SWIFT_NAME
+...
+

+ 155 - 118
key_generator.c

@@ -20,132 +20,169 @@ FuriString* key;
 
 // Screen is 128x64 px
 static void app_draw_callback(Canvas* canvas, void* ctx) {
-	UNUSED(ctx);
+    UNUSED(ctx);
 
-	canvas_clear(canvas);
-	canvas_draw_icon(canvas, 0, 0, &I_ok_64x64);
-	canvas_draw_str(canvas, 80, 24, "Saved as");
-	canvas_draw_str(canvas, 75, 36, "rfidfuzzer/");
-	canvas_draw_str(canvas, 70, 48, "generated.txt");
+    canvas_clear(canvas);
+    canvas_draw_icon(canvas, 0, 0, &I_ok_64x64);
+    canvas_draw_str(canvas, 80, 24, "Saved as");
+    canvas_draw_str(canvas, 75, 36, "rfidfuzzer/");
+    canvas_draw_str(canvas, 70, 48, "generated.txt");
 }
 
 static void app_input_callback(InputEvent* input_event, void* ctx) {
-	furi_assert(ctx);
+    furi_assert(ctx);
 
-	FuriMessageQueue* event_queue = ctx;
-	furi_message_queue_put(event_queue, input_event, FuriWaitForever);
+    FuriMessageQueue* event_queue = ctx;
+    furi_message_queue_put(event_queue, input_event, FuriWaitForever);
 }
 
-static void beep(){
-	NotificationApp* notification = furi_record_open(RECORD_NOTIFICATION);
-	notification_message(notification, &sequence_success);
-	furi_record_close(RECORD_NOTIFICATION);
+static void beep() {
+    NotificationApp* notification = furi_record_open(RECORD_NOTIFICATION);
+    notification_message(notification, &sequence_success);
+    furi_record_close(RECORD_NOTIFICATION);
 }
 
 int32_t key_generator_main(void* p) {
-	UNUSED(p);
-	FuriMessageQueue* event_queue = furi_message_queue_alloc(8, sizeof(InputEvent));
-
-	// Configure view port
-	ViewPort* view_port = view_port_alloc();
-	view_port_draw_callback_set(view_port, app_draw_callback, view_port);
-	view_port_input_callback_set(view_port, app_input_callback, event_queue);
-
-	// Register view port in GUI
-	Gui* gui = furi_record_open(RECORD_GUI);
-	gui_add_view_port(gui, view_port, GuiLayerFullscreen);
-	
-	// Selecting file
-	file_path = furi_string_alloc_set_str("/ext/lfrfid");
-	key = furi_string_alloc_set_str("");
-	DialogsFileBrowserOptions browser_options;
-	dialog_file_browser_set_basic_options(&browser_options, ".rfid", &I_icon_10x10);
-	browser_options.base_path = "/ext/lfrfid";
-	DialogsApp* dialogs = furi_record_open(RECORD_DIALOGS);
-	bool running = dialog_file_browser_show(dialogs, file_path, file_path, &browser_options);
-	furi_record_close(RECORD_DIALOGS);
-	
-	if(running){
-		Storage* storage = furi_record_open(RECORD_STORAGE);
-		FlipperFormat* format = flipper_format_file_alloc(storage);
-		
-		// Parsing file
-		flipper_format_file_open_existing(format, furi_string_get_cstr(file_path));
-		flipper_format_read_string(format, "Data", key);
-		furi_string_replace_str(key, " ", "", 0);
-		
-		flipper_format_file_close(format);
-		flipper_format_free(format);
-
-		if(!storage_dir_exists(storage, DIR_PATH))
-			storage_simply_mkdir(storage, DIR_PATH);
-		
-		File* file = storage_file_alloc(storage);
-		bool ok = storage_file_open(file, FILE_PATH, FSAM_WRITE, FSOM_OPEN_ALWAYS);
-		if(ok){
-			storage_file_write(file, (uint8_t*)furi_string_get_cstr(key), 2); storage_file_write(file, (uint8_t*)"11111111\r\n", 10);
-			storage_file_write(file, (uint8_t*)furi_string_get_cstr(key), 2); storage_file_write(file, (uint8_t*)"22222222\r\n", 10);
-			storage_file_write(file, (uint8_t*)furi_string_get_cstr(key), 2); storage_file_write(file, (uint8_t*)"33333333\r\n", 10);
-			storage_file_write(file, (uint8_t*)furi_string_get_cstr(key), 2); storage_file_write(file, (uint8_t*)"44444444\r\n", 10);
-			storage_file_write(file, (uint8_t*)furi_string_get_cstr(key), 2); storage_file_write(file, (uint8_t*)"55555555\r\n", 10);
-			storage_file_write(file, (uint8_t*)furi_string_get_cstr(key), 2); storage_file_write(file, (uint8_t*)"66666666\r\n", 10);
-			storage_file_write(file, (uint8_t*)furi_string_get_cstr(key), 2); storage_file_write(file, (uint8_t*)"77777777\r\n", 10);
-			storage_file_write(file, (uint8_t*)furi_string_get_cstr(key), 2); storage_file_write(file, (uint8_t*)"88888888\r\n", 10);
-			storage_file_write(file, (uint8_t*)furi_string_get_cstr(key), 2); storage_file_write(file, (uint8_t*)"99999999\r\n", 10);
-			storage_file_write(file, (uint8_t*)furi_string_get_cstr(key), 2); storage_file_write(file, (uint8_t*)"AAAAAAAA\r\n", 10);
-			storage_file_write(file, (uint8_t*)furi_string_get_cstr(key), 2); storage_file_write(file, (uint8_t*)"BBBBBBBB\r\n", 10);
-			storage_file_write(file, (uint8_t*)furi_string_get_cstr(key), 2); storage_file_write(file, (uint8_t*)"CCCCCCCC\r\n", 10);
-			storage_file_write(file, (uint8_t*)furi_string_get_cstr(key), 2); storage_file_write(file, (uint8_t*)"DDDDDDDD\r\n", 10);
-			storage_file_write(file, (uint8_t*)furi_string_get_cstr(key), 2); storage_file_write(file, (uint8_t*)"EEEEEEEE\r\n", 10);
-			storage_file_write(file, (uint8_t*)furi_string_get_cstr(key), 2); storage_file_write(file, (uint8_t*)"FFFFFFFF\r\n", 10);
-			storage_file_write(file, (uint8_t*)furi_string_get_cstr(key), 2); storage_file_write(file, (uint8_t*)"12345678\r\n", 10);
-			storage_file_write(file, (uint8_t*)furi_string_get_cstr(key), 2); storage_file_write(file, (uint8_t*)"01234567\r\n", 10);
-			storage_file_write(file, (uint8_t*)furi_string_get_cstr(key), 2); storage_file_write(file, (uint8_t*)"98765432\r\n", 10);
-			storage_file_write(file, (uint8_t*)furi_string_get_cstr(key), 2); storage_file_write(file, (uint8_t*)"FEDCBA98\r\n", 10);
-			
-			storage_file_write(file, (uint8_t*)furi_string_get_cstr(key), 4); storage_file_write(file, (uint8_t*)"111111\r\n", 8);
-			storage_file_write(file, (uint8_t*)furi_string_get_cstr(key), 4); storage_file_write(file, (uint8_t*)"222222\r\n", 8);
-			storage_file_write(file, (uint8_t*)furi_string_get_cstr(key), 4); storage_file_write(file, (uint8_t*)"333333\r\n", 8);
-			storage_file_write(file, (uint8_t*)furi_string_get_cstr(key), 4); storage_file_write(file, (uint8_t*)"444444\r\n", 8);
-			storage_file_write(file, (uint8_t*)furi_string_get_cstr(key), 4); storage_file_write(file, (uint8_t*)"555555\r\n", 8);
-			storage_file_write(file, (uint8_t*)furi_string_get_cstr(key), 4); storage_file_write(file, (uint8_t*)"666666\r\n", 8);
-			storage_file_write(file, (uint8_t*)furi_string_get_cstr(key), 4); storage_file_write(file, (uint8_t*)"777777\r\n", 8);
-			storage_file_write(file, (uint8_t*)furi_string_get_cstr(key), 4); storage_file_write(file, (uint8_t*)"888888\r\n", 8);
-			storage_file_write(file, (uint8_t*)furi_string_get_cstr(key), 4); storage_file_write(file, (uint8_t*)"999999\r\n", 8);
-			storage_file_write(file, (uint8_t*)furi_string_get_cstr(key), 4); storage_file_write(file, (uint8_t*)"AAAAAA\r\n", 8);
-			storage_file_write(file, (uint8_t*)furi_string_get_cstr(key), 4); storage_file_write(file, (uint8_t*)"BBBBBB\r\n", 8);
-			storage_file_write(file, (uint8_t*)furi_string_get_cstr(key), 4); storage_file_write(file, (uint8_t*)"CCCCCC\r\n", 8);
-			storage_file_write(file, (uint8_t*)furi_string_get_cstr(key), 4); storage_file_write(file, (uint8_t*)"DDDDDD\r\n", 8);
-			storage_file_write(file, (uint8_t*)furi_string_get_cstr(key), 4); storage_file_write(file, (uint8_t*)"EEEEEE\r\n", 8);
-			storage_file_write(file, (uint8_t*)furi_string_get_cstr(key), 4); storage_file_write(file, (uint8_t*)"FFFFFF\r\n", 8);
-			storage_file_write(file, (uint8_t*)furi_string_get_cstr(key), 4); storage_file_write(file, (uint8_t*)"123456\r\n", 8);
-			storage_file_write(file, (uint8_t*)furi_string_get_cstr(key), 4); storage_file_write(file, (uint8_t*)"012345\r\n", 8);
-			storage_file_write(file, (uint8_t*)furi_string_get_cstr(key), 4); storage_file_write(file, (uint8_t*)"987654\r\n", 8);
-			storage_file_write(file, (uint8_t*)furi_string_get_cstr(key), 4); storage_file_write(file, (uint8_t*)"FEDCBA\r\n", 8);
-		}
-		storage_file_close(file);
-		storage_file_free(file);
-		
-		furi_record_close(RECORD_STORAGE);
-		
-		beep();
-	}
-
-	InputEvent event;
-	
-	while(running) {
-		if(furi_message_queue_get(event_queue, &event, 100) == FuriStatusOk) {
-			if(event.type == InputTypePress && event.key == InputKeyBack) running = false;
-		}
-		view_port_update(view_port);
-	}
-
-	view_port_enabled_set(view_port, false);
-	gui_remove_view_port(gui, view_port);
-	view_port_free(view_port);
-	furi_message_queue_free(event_queue);
-
-	furi_record_close(RECORD_GUI);
-
-	return 0;
+    UNUSED(p);
+    FuriMessageQueue* event_queue = furi_message_queue_alloc(8, sizeof(InputEvent));
+
+    // Configure view port
+    ViewPort* view_port = view_port_alloc();
+    view_port_draw_callback_set(view_port, app_draw_callback, view_port);
+    view_port_input_callback_set(view_port, app_input_callback, event_queue);
+
+    // Register view port in GUI
+    Gui* gui = furi_record_open(RECORD_GUI);
+    gui_add_view_port(gui, view_port, GuiLayerFullscreen);
+
+    // Selecting file
+    file_path = furi_string_alloc_set_str("/ext/lfrfid");
+    key = furi_string_alloc_set_str("");
+    DialogsFileBrowserOptions browser_options;
+    dialog_file_browser_set_basic_options(&browser_options, ".rfid", &I_icon_10x10);
+    browser_options.base_path = "/ext/lfrfid";
+    DialogsApp* dialogs = furi_record_open(RECORD_DIALOGS);
+    bool running = dialog_file_browser_show(dialogs, file_path, file_path, &browser_options);
+    furi_record_close(RECORD_DIALOGS);
+
+    if(running) {
+        Storage* storage = furi_record_open(RECORD_STORAGE);
+        FlipperFormat* format = flipper_format_file_alloc(storage);
+
+        // Parsing file
+        flipper_format_file_open_existing(format, furi_string_get_cstr(file_path));
+        flipper_format_read_string(format, "Data", key);
+        furi_string_replace_str(key, " ", "", 0);
+
+        flipper_format_file_close(format);
+        flipper_format_free(format);
+
+        if(!storage_dir_exists(storage, DIR_PATH)) storage_simply_mkdir(storage, DIR_PATH);
+
+        File* file = storage_file_alloc(storage);
+        bool ok = storage_file_open(file, FILE_PATH, FSAM_WRITE, FSOM_OPEN_ALWAYS);
+        if(ok) {
+            storage_file_write(file, (uint8_t*)furi_string_get_cstr(key), 2);
+            storage_file_write(file, (uint8_t*)"11111111\r\n", 10);
+            storage_file_write(file, (uint8_t*)furi_string_get_cstr(key), 2);
+            storage_file_write(file, (uint8_t*)"22222222\r\n", 10);
+            storage_file_write(file, (uint8_t*)furi_string_get_cstr(key), 2);
+            storage_file_write(file, (uint8_t*)"33333333\r\n", 10);
+            storage_file_write(file, (uint8_t*)furi_string_get_cstr(key), 2);
+            storage_file_write(file, (uint8_t*)"44444444\r\n", 10);
+            storage_file_write(file, (uint8_t*)furi_string_get_cstr(key), 2);
+            storage_file_write(file, (uint8_t*)"55555555\r\n", 10);
+            storage_file_write(file, (uint8_t*)furi_string_get_cstr(key), 2);
+            storage_file_write(file, (uint8_t*)"66666666\r\n", 10);
+            storage_file_write(file, (uint8_t*)furi_string_get_cstr(key), 2);
+            storage_file_write(file, (uint8_t*)"77777777\r\n", 10);
+            storage_file_write(file, (uint8_t*)furi_string_get_cstr(key), 2);
+            storage_file_write(file, (uint8_t*)"88888888\r\n", 10);
+            storage_file_write(file, (uint8_t*)furi_string_get_cstr(key), 2);
+            storage_file_write(file, (uint8_t*)"99999999\r\n", 10);
+            storage_file_write(file, (uint8_t*)furi_string_get_cstr(key), 2);
+            storage_file_write(file, (uint8_t*)"AAAAAAAA\r\n", 10);
+            storage_file_write(file, (uint8_t*)furi_string_get_cstr(key), 2);
+            storage_file_write(file, (uint8_t*)"BBBBBBBB\r\n", 10);
+            storage_file_write(file, (uint8_t*)furi_string_get_cstr(key), 2);
+            storage_file_write(file, (uint8_t*)"CCCCCCCC\r\n", 10);
+            storage_file_write(file, (uint8_t*)furi_string_get_cstr(key), 2);
+            storage_file_write(file, (uint8_t*)"DDDDDDDD\r\n", 10);
+            storage_file_write(file, (uint8_t*)furi_string_get_cstr(key), 2);
+            storage_file_write(file, (uint8_t*)"EEEEEEEE\r\n", 10);
+            storage_file_write(file, (uint8_t*)furi_string_get_cstr(key), 2);
+            storage_file_write(file, (uint8_t*)"FFFFFFFF\r\n", 10);
+            storage_file_write(file, (uint8_t*)furi_string_get_cstr(key), 2);
+            storage_file_write(file, (uint8_t*)"12345678\r\n", 10);
+            storage_file_write(file, (uint8_t*)furi_string_get_cstr(key), 2);
+            storage_file_write(file, (uint8_t*)"01234567\r\n", 10);
+            storage_file_write(file, (uint8_t*)furi_string_get_cstr(key), 2);
+            storage_file_write(file, (uint8_t*)"98765432\r\n", 10);
+            storage_file_write(file, (uint8_t*)furi_string_get_cstr(key), 2);
+            storage_file_write(file, (uint8_t*)"FEDCBA98\r\n", 10);
+
+            storage_file_write(file, (uint8_t*)furi_string_get_cstr(key), 4);
+            storage_file_write(file, (uint8_t*)"111111\r\n", 8);
+            storage_file_write(file, (uint8_t*)furi_string_get_cstr(key), 4);
+            storage_file_write(file, (uint8_t*)"222222\r\n", 8);
+            storage_file_write(file, (uint8_t*)furi_string_get_cstr(key), 4);
+            storage_file_write(file, (uint8_t*)"333333\r\n", 8);
+            storage_file_write(file, (uint8_t*)furi_string_get_cstr(key), 4);
+            storage_file_write(file, (uint8_t*)"444444\r\n", 8);
+            storage_file_write(file, (uint8_t*)furi_string_get_cstr(key), 4);
+            storage_file_write(file, (uint8_t*)"555555\r\n", 8);
+            storage_file_write(file, (uint8_t*)furi_string_get_cstr(key), 4);
+            storage_file_write(file, (uint8_t*)"666666\r\n", 8);
+            storage_file_write(file, (uint8_t*)furi_string_get_cstr(key), 4);
+            storage_file_write(file, (uint8_t*)"777777\r\n", 8);
+            storage_file_write(file, (uint8_t*)furi_string_get_cstr(key), 4);
+            storage_file_write(file, (uint8_t*)"888888\r\n", 8);
+            storage_file_write(file, (uint8_t*)furi_string_get_cstr(key), 4);
+            storage_file_write(file, (uint8_t*)"999999\r\n", 8);
+            storage_file_write(file, (uint8_t*)furi_string_get_cstr(key), 4);
+            storage_file_write(file, (uint8_t*)"AAAAAA\r\n", 8);
+            storage_file_write(file, (uint8_t*)furi_string_get_cstr(key), 4);
+            storage_file_write(file, (uint8_t*)"BBBBBB\r\n", 8);
+            storage_file_write(file, (uint8_t*)furi_string_get_cstr(key), 4);
+            storage_file_write(file, (uint8_t*)"CCCCCC\r\n", 8);
+            storage_file_write(file, (uint8_t*)furi_string_get_cstr(key), 4);
+            storage_file_write(file, (uint8_t*)"DDDDDD\r\n", 8);
+            storage_file_write(file, (uint8_t*)furi_string_get_cstr(key), 4);
+            storage_file_write(file, (uint8_t*)"EEEEEE\r\n", 8);
+            storage_file_write(file, (uint8_t*)furi_string_get_cstr(key), 4);
+            storage_file_write(file, (uint8_t*)"FFFFFF\r\n", 8);
+            storage_file_write(file, (uint8_t*)furi_string_get_cstr(key), 4);
+            storage_file_write(file, (uint8_t*)"123456\r\n", 8);
+            storage_file_write(file, (uint8_t*)furi_string_get_cstr(key), 4);
+            storage_file_write(file, (uint8_t*)"012345\r\n", 8);
+            storage_file_write(file, (uint8_t*)furi_string_get_cstr(key), 4);
+            storage_file_write(file, (uint8_t*)"987654\r\n", 8);
+            storage_file_write(file, (uint8_t*)furi_string_get_cstr(key), 4);
+            storage_file_write(file, (uint8_t*)"FEDCBA\r\n", 8);
+        }
+        storage_file_close(file);
+        storage_file_free(file);
+
+        furi_record_close(RECORD_STORAGE);
+
+        beep();
+    }
+
+    InputEvent event;
+
+    while(running) {
+        if(furi_message_queue_get(event_queue, &event, 100) == FuriStatusOk) {
+            if(event.type == InputTypePress && event.key == InputKeyBack) running = false;
+        }
+        view_port_update(view_port);
+    }
+
+    view_port_enabled_set(view_port, false);
+    gui_remove_view_port(gui, view_port);
+    view_port_free(view_port);
+    furi_message_queue_free(event_queue);
+
+    furi_record_close(RECORD_GUI);
+
+    return 0;
 }