فهرست منبع

fix and move mag fap

MX 2 سال پیش
والد
کامیت
7042d7cfa0
100فایلهای تغییر یافته به همراه21 افزوده شده و 9019 حذف شده
  1. 0 132
      .drone.yml
  2. 0 0
      .gitattributes
  3. 0 0
      .github/FUNDING.yml
  4. 0 2
      .gitignore
  5. 0 6
      .gitmodules
  6. 0 7
      CHANGELOG.md
  7. 21 674
      LICENSE
  8. 0 0
      README.md
  9. 0 260
      ReadMe.md
  10. 0 0
      application.fam
  11. 0 674
      apps_broken_by_last_refactors/cli_bridge/LICENSE
  12. 0 10
      apps_broken_by_last_refactors/cli_bridge/application.fam
  13. 0 104
      apps_broken_by_last_refactors/cli_bridge/cli_control.c
  14. 0 8
      apps_broken_by_last_refactors/cli_bridge/cli_control.h
  15. BIN
      apps_broken_by_last_refactors/cli_bridge/cligui.png
  16. 0 147
      apps_broken_by_last_refactors/cli_bridge/cligui_main.c
  17. 0 41
      apps_broken_by_last_refactors/cli_bridge/cligui_main_i.h
  18. 0 12
      apps_broken_by_last_refactors/cli_bridge/console_output.c
  19. 0 4
      apps_broken_by_last_refactors/cli_bridge/console_output.h
  20. 0 101
      apps_broken_by_last_refactors/cli_bridge/internal_defs.h
  21. 0 34
      apps_broken_by_last_refactors/cli_bridge/text_input.c
  22. 0 5
      apps_broken_by_last_refactors/cli_bridge/text_input.h
  23. 0 3
      apps_broken_by_last_refactors/esubghz_chat/.gitignore
  24. 0 674
      apps_broken_by_last_refactors/esubghz_chat/LICENSE
  25. 0 97
      apps_broken_by_last_refactors/esubghz_chat/README.md
  26. 0 15
      apps_broken_by_last_refactors/esubghz_chat/application.fam
  27. BIN
      apps_broken_by_last_refactors/esubghz_chat/assets/Cry_dolph_55x52.png
  28. BIN
      apps_broken_by_last_refactors/esubghz_chat/assets/Loading_24.png
  29. BIN
      apps_broken_by_last_refactors/esubghz_chat/assets/NFC_dolphin_emulation_47x61.png
  30. BIN
      apps_broken_by_last_refactors/esubghz_chat/assets/NFC_manual_60x50.png
  31. BIN
      apps_broken_by_last_refactors/esubghz_chat/assets/Nfc_14px.png
  32. BIN
      apps_broken_by_last_refactors/esubghz_chat/assets/Pin_back_arrow_10x8.png
  33. BIN
      apps_broken_by_last_refactors/esubghz_chat/assets/WarningDolphin_45x42.png
  34. BIN
      apps_broken_by_last_refactors/esubghz_chat/assets/chat_10px.png
  35. BIN
      apps_broken_by_last_refactors/esubghz_chat/assets/chat_14px.png
  36. BIN
      apps_broken_by_last_refactors/esubghz_chat/assets/hex_14px.png
  37. BIN
      apps_broken_by_last_refactors/esubghz_chat/assets/keyboard_14px.png
  38. BIN
      apps_broken_by_last_refactors/esubghz_chat/assets/u2f_14px.png
  39. 0 21
      apps_broken_by_last_refactors/esubghz_chat/bgloader_api.h
  40. 0 483
      apps_broken_by_last_refactors/esubghz_chat/crypto/aes.c
  41. 0 81
      apps_broken_by_last_refactors/esubghz_chat/crypto/aes.h
  42. 0 511
      apps_broken_by_last_refactors/esubghz_chat/crypto/gcm.c
  43. 0 187
      apps_broken_by_last_refactors/esubghz_chat/crypto/gcm.h
  44. 0 229
      apps_broken_by_last_refactors/esubghz_chat/crypto_wrapper.c
  45. 0 48
      apps_broken_by_last_refactors/esubghz_chat/crypto_wrapper.h
  46. 0 874
      apps_broken_by_last_refactors/esubghz_chat/esubghz_chat.c
  47. 0 126
      apps_broken_by_last_refactors/esubghz_chat/esubghz_chat_i.h
  48. 0 25
      apps_broken_by_last_refactors/esubghz_chat/helpers/nfc_helpers.h
  49. 0 65
      apps_broken_by_last_refactors/esubghz_chat/helpers/radio_device_loader.c
  50. 0 15
      apps_broken_by_last_refactors/esubghz_chat/helpers/radio_device_loader.h
  51. 0 67
      apps_broken_by_last_refactors/esubghz_chat/scenes/esubghz_chat_chat_box.c
  52. 0 118
      apps_broken_by_last_refactors/esubghz_chat/scenes/esubghz_chat_chat_input.c
  53. 0 128
      apps_broken_by_last_refactors/esubghz_chat/scenes/esubghz_chat_freq_input.c
  54. 0 89
      apps_broken_by_last_refactors/esubghz_chat/scenes/esubghz_chat_hex_key_input.c
  55. 0 130
      apps_broken_by_last_refactors/esubghz_chat/scenes/esubghz_chat_key_display.c
  56. 0 196
      apps_broken_by_last_refactors/esubghz_chat/scenes/esubghz_chat_key_menu.c
  57. 0 303
      apps_broken_by_last_refactors/esubghz_chat/scenes/esubghz_chat_key_read_popup.c
  58. 0 140
      apps_broken_by_last_refactors/esubghz_chat/scenes/esubghz_chat_key_share_popup.c
  59. 0 125
      apps_broken_by_last_refactors/esubghz_chat/scenes/esubghz_chat_pass_input.c
  60. 0 30
      apps_broken_by_last_refactors/esubghz_chat/scenes/esubghz_chat_scene.c
  61. 0 29
      apps_broken_by_last_refactors/esubghz_chat/scenes/esubghz_chat_scene.h
  62. 0 9
      apps_broken_by_last_refactors/esubghz_chat/scenes/esubghz_chat_scene_config.h
  63. 0 1
      apps_broken_by_last_refactors/flipperzero_vb_migrate/.github/FUNDING.yml
  64. 0 12
      apps_broken_by_last_refactors/flipperzero_vb_migrate/.github/workflows/build-fap.yml
  65. 0 8
      apps_broken_by_last_refactors/flipperzero_vb_migrate/CHANGES.md
  66. 0 674
      apps_broken_by_last_refactors/flipperzero_vb_migrate/LICENSE
  67. 0 178
      apps_broken_by_last_refactors/flipperzero_vb_migrate/README.md
  68. 0 25
      apps_broken_by_last_refactors/flipperzero_vb_migrate/README_catalog.md
  69. 0 34
      apps_broken_by_last_refactors/flipperzero_vb_migrate/application.fam
  70. 0 481
      apps_broken_by_last_refactors/flipperzero_vb_migrate/gui/modules/file_select.c
  71. 0 31
      apps_broken_by_last_refactors/flipperzero_vb_migrate/gui/modules/file_select.h
  72. 0 419
      apps_broken_by_last_refactors/flipperzero_vb_migrate/gui/modules/variable_item_list_ex.c
  73. 0 117
      apps_broken_by_last_refactors/flipperzero_vb_migrate/gui/modules/variable_item_list_ex.h
  74. BIN
      apps_broken_by_last_refactors/flipperzero_vb_migrate/icons/AppInteract_32x27.png
  75. BIN
      apps_broken_by_last_refactors/flipperzero_vb_migrate/icons/Background_128x64.png
  76. BIN
      apps_broken_by_last_refactors/flipperzero_vb_migrate/icons/CommComplete_32x20.png
  77. BIN
      apps_broken_by_last_refactors/flipperzero_vb_migrate/icons/CommReady_32x27.png
  78. BIN
      apps_broken_by_last_refactors/flipperzero_vb_migrate/icons/CommReturn_10x8.png
  79. BIN
      apps_broken_by_last_refactors/flipperzero_vb_migrate/icons/CommVB_32x20.png
  80. BIN
      apps_broken_by_last_refactors/flipperzero_vb_migrate/icons/CommWave_12x8.png
  81. BIN
      apps_broken_by_last_refactors/flipperzero_vb_migrate/icons/Comm_32x20.png
  82. BIN
      apps_broken_by_last_refactors/flipperzero_vb_migrate/icons/Delete_32x20.png
  83. BIN
      apps_broken_by_last_refactors/flipperzero_vb_migrate/icons/LeftButtonBg_54x15.png
  84. BIN
      apps_broken_by_last_refactors/flipperzero_vb_migrate/icons/PulsemonLeftStand_14x16.png
  85. BIN
      apps_broken_by_last_refactors/flipperzero_vb_migrate/icons/PulsemonLeftWait_15x15.png
  86. BIN
      apps_broken_by_last_refactors/flipperzero_vb_migrate/icons/PulsemonRightHappy_14x16.png
  87. BIN
      apps_broken_by_last_refactors/flipperzero_vb_migrate/icons/PulsemonRightSad_15x15.png
  88. BIN
      apps_broken_by_last_refactors/flipperzero_vb_migrate/icons/PulsemonRightWaiting_15x16.png
  89. BIN
      apps_broken_by_last_refactors/flipperzero_vb_migrate/icons/RightButtonBg_54x15.png
  90. BIN
      apps_broken_by_last_refactors/flipperzero_vb_migrate/icons/TextClearCaptures_49x13.png
  91. BIN
      apps_broken_by_last_refactors/flipperzero_vb_migrate/icons/TextCleared_47x6.png
  92. BIN
      apps_broken_by_last_refactors/flipperzero_vb_migrate/icons/TextDeleteVb_49x13.png
  93. BIN
      apps_broken_by_last_refactors/flipperzero_vb_migrate/icons/TextDeleted_46x6.png
  94. BIN
      apps_broken_by_last_refactors/flipperzero_vb_migrate/icons/TextErrLoadCapture_65x13.png
  95. BIN
      apps_broken_by_last_refactors/flipperzero_vb_migrate/icons/TextErrLoadTemplate_69x13.png
  96. BIN
      apps_broken_by_last_refactors/flipperzero_vb_migrate/icons/TextErrReadFailed_71x20.png
  97. BIN
      apps_broken_by_last_refactors/flipperzero_vb_migrate/icons/TextErrRegisterDifferentTag_47x20.png
  98. BIN
      apps_broken_by_last_refactors/flipperzero_vb_migrate/icons/TextErrSaveCapture_65x13.png
  99. BIN
      apps_broken_by_last_refactors/flipperzero_vb_migrate/icons/TextRegister1_71x20.png
  100. BIN
      apps_broken_by_last_refactors/flipperzero_vb_migrate/icons/TextRegisterErrNotVb_71x20.png

+ 0 - 132
.drone.yml

@@ -1,132 +0,0 @@
-kind: pipeline
-type: docker
-name: "Build apps"
-
-platform:
-  os: linux
-  arch: amd64
-
-steps:
-  - name: "Update submodules"
-    image: alpine/git
-    commands: 
-      - git submodule sync
-      - git -c protocol.version=2 submodule update --init --force --recursive --jobs 4
-      - git submodule foreach git config --local gc.auto 0
-      - git log -1 --format='%H'
-
-  - name: "Build base pack"
-    image: hfdj/fztools
-    pull: never
-    commands:
-      - git clone --branch dev https://github.com/DarkFlippers/unleashed-firmware.git
-      - rm -rf unleashed-firmware/assets/resources/apps/
-      - rm -rf unleashed-firmware/build/
-      - rm -rf unleashed-firmware/dist/
-      - rm -rf unleashed-firmware/.sconsign.dblite
-      - mv base_pack/* unleashed-firmware/applications_user/
-      - ./parse_api_ver.sh
-      - cd unleashed-firmware
-      - export FBT_GIT_SUBMODULE_SHALLOW=1
-      - ./fbt COMPACT=1 DEBUG=0 updater_package
-      - mkdir artifacts-base
-      - mkdir artifacts-totp
-      - mv assets/resources/apps/* artifacts-base/
-      - mv assets/resources/apps_data/totp/* artifacts-totp/
-      - ls -laS artifacts-base
-      - ls -laS artifacts-totp
-      - ls -laS artifacts-totp/plugins
-      - rm -f artifacts-base/GPIO/gpio.fap
-      - rm -f artifacts-base/iButton/ibutton.fap
-      - rm -f artifacts-base/Infrared/infrared.fap
-      - rm -f artifacts-base/NFC/nfc.fap
-      - rm -f artifacts-base/RFID/lfrfid.fap
-      - rm -f artifacts-base/Sub-GHz/subghz_remote.fap
-      - rm -f artifacts-base/Tools/clock.fap
-      - rm -f artifacts-base/USB/bad_usb.fap
-      - rm -f artifacts-base/USB/u2f.fap
-      - cd ..
-      - mkdir base_pack_build
-      - mv unleashed-firmware/artifacts-base/ base_pack_build
-      - mkdir -p base_pack_build/apps_data/totp
-      - mv unleashed-firmware/artifacts-totp/* base_pack_build/apps_data/totp/
-    environment:
-      FBT_TOOLS_CUSTOM_LINK:
-        from_secret: fbt_link
-
-  - name: "Build extra apps"
-    image: hfdj/fztools
-    pull: never
-    commands:
-      - rm -rf unleashed-firmware/assets/resources/apps/
-      - rm -rf unleashed-firmware/build/
-      - rm -rf unleashed-firmware/dist/
-      - rm -rf unleashed-firmware/.sconsign.dblite
-      - rm -rf unleashed-firmware/applications_user/*
-      - mv apps_source_code/* unleashed-firmware/applications_user/
-      - mv non_catalog_apps/* unleashed-firmware/applications_user/
-      - cd unleashed-firmware
-      - export FBT_GIT_SUBMODULE_SHALLOW=1
-      - ./fbt COMPACT=1 DEBUG=0 updater_package
-      - mkdir artifacts-extra
-      - mv assets/resources/apps/* artifacts-extra/
-      - ls -laS artifacts-extra
-      - rm -f artifacts-extra/GPIO/gpio.fap
-      - rm -f artifacts-extra/iButton/ibutton.fap
-      - rm -f artifacts-extra/Infrared/infrared.fap
-      - rm -f artifacts-extra/NFC/nfc.fap
-      - rm -f artifacts-extra/RFID/lfrfid.fap
-      - rm -f artifacts-extra/Sub-GHz/subghz_remote.fap
-      - rm -f artifacts-extra/Tools/clock.fap
-      - rm -f artifacts-extra/USB/bad_usb.fap
-      - rm -f artifacts-extra/USB/u2f.fap
-      - cd ..
-      - mkdir extra_pack_build
-      - mv unleashed-firmware/artifacts-extra/ extra_pack_build
-    environment:
-      FBT_TOOLS_CUSTOM_LINK:
-        from_secret: fbt_link
-
-  - name: "Bundle packages"
-    image: kramos/alpine-zip
-    commands:
-      - zip -r all-the-apps-extra.zip extra_pack_build
-      - zip -r all-the-apps-base.zip base_pack_build
-      - tar czpf all-the-apps-extra.tgz extra_pack_build
-      - tar czpf all-the-apps-base.tgz base_pack_build
-      - mkdir ${DRONE_TAG}
-      - mv all-the-apps-extra.zip ${DRONE_TAG}/
-      - mv all-the-apps-base.zip ${DRONE_TAG}/
-      - mv all-the-apps-extra.tgz ${DRONE_TAG}/
-      - mv all-the-apps-base.tgz ${DRONE_TAG}/
-      - rm -rf extra_pack_build
-      - rm -rf base_pack_build
-      - rm -rf unleashed-firmware
-      - ls -laS
-      - ls -laS ${DRONE_TAG}
-
-  - name: "Do Github release"
-    image: ddplugins/github-release
-    pull: never
-    settings:
-      github_url: https://github.com
-      repo_owner:
-        from_secret: github_repoowner
-      api_key:
-        from_secret: github_apikey
-      files:
-        - ${DRONE_TAG}/*.tgz
-        - ${DRONE_TAG}/*.zip
-      title: ${DRONE_TAG}
-      note: CHANGELOG.md
-      checksum:
-        - md5
-        - sha1
-        - crc32
-
-trigger:
-  event:
-    - tag
-
-node:
-  typ: haupt

+ 0 - 0
apps_broken_by_last_refactors/magspoof_flipper/.gitattributes → .gitattributes


+ 0 - 0
apps_broken_by_last_refactors/magspoof_flipper/.github/FUNDING.yml → .github/FUNDING.yml


+ 0 - 2
.gitignore

@@ -1,2 +0,0 @@
-
-.DS_Store

+ 0 - 6
.gitmodules

@@ -1,6 +0,0 @@
-[submodule "base_pack/subbrute"]
-	path = base_pack/subbrute
-	url = https://github.com/DarkFlippers/flipperzero-subbrute.git
-[submodule "base_pack/multi_fuzzer"]
-	path = base_pack/multi_fuzzer
-	url = https://github.com/DarkFlippers/Multi_Fuzzer.git

+ 0 - 7
CHANGELOG.md

@@ -1,7 +0,0 @@
-# Flipper Application Files (FAPs)
-
-Base pack = apps that was in Unleashed FW by default
-Extra pack = all apps that was in `e`(extra pack) builds of Unleashed FW (all-the-apps-extra archive does not contain Base Pack apps)
-
-### This release contains almost all working apps for Flipper Zero, compare your firmware API version with version below
-

+ 21 - 674
LICENSE

@@ -1,674 +1,21 @@
-                    GNU GENERAL PUBLIC LICENSE
-                       Version 3, 29 June 2007
-
- Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
-                            Preamble
-
-  The GNU General Public License is a free, copyleft license for
-software and other kinds of works.
-
-  The licenses for most software and other practical works are designed
-to take away your freedom to share and change the works.  By contrast,
-the GNU General Public License is intended to guarantee your freedom to
-share and change all versions of a program--to make sure it remains free
-software for all its users.  We, the Free Software Foundation, use the
-GNU General Public License for most of our software; it applies also to
-any other work released this way by its authors.  You can apply it to
-your programs, too.
-
-  When we speak of free software, we are referring to freedom, not
-price.  Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-them if you wish), that you receive source code or can get it if you
-want it, that you can change the software or use pieces of it in new
-free programs, and that you know you can do these things.
-
-  To protect your rights, we need to prevent others from denying you
-these rights or asking you to surrender the rights.  Therefore, you have
-certain responsibilities if you distribute copies of the software, or if
-you modify it: responsibilities to respect the freedom of others.
-
-  For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must pass on to the recipients the same
-freedoms that you received.  You must make sure that they, too, receive
-or can get the source code.  And you must show them these terms so they
-know their rights.
-
-  Developers that use the GNU GPL protect your rights with two steps:
-(1) assert copyright on the software, and (2) offer you this License
-giving you legal permission to copy, distribute and/or modify it.
-
-  For the developers' and authors' protection, the GPL clearly explains
-that there is no warranty for this free software.  For both users' and
-authors' sake, the GPL requires that modified versions be marked as
-changed, so that their problems will not be attributed erroneously to
-authors of previous versions.
-
-  Some devices are designed to deny users access to install or run
-modified versions of the software inside them, although the manufacturer
-can do so.  This is fundamentally incompatible with the aim of
-protecting users' freedom to change the software.  The systematic
-pattern of such abuse occurs in the area of products for individuals to
-use, which is precisely where it is most unacceptable.  Therefore, we
-have designed this version of the GPL to prohibit the practice for those
-products.  If such problems arise substantially in other domains, we
-stand ready to extend this provision to those domains in future versions
-of the GPL, as needed to protect the freedom of users.
-
-  Finally, every program is threatened constantly by software patents.
-States should not allow patents to restrict development and use of
-software on general-purpose computers, but in those that do, we wish to
-avoid the special danger that patents applied to a free program could
-make it effectively proprietary.  To prevent this, the GPL assures that
-patents cannot be used to render the program non-free.
-
-  The precise terms and conditions for copying, distribution and
-modification follow.
-
-                       TERMS AND CONDITIONS
-
-  0. Definitions.
-
-  "This License" refers to version 3 of the GNU General Public License.
-
-  "Copyright" also means copyright-like laws that apply to other kinds of
-works, such as semiconductor masks.
-
-  "The Program" refers to any copyrightable work licensed under this
-License.  Each licensee is addressed as "you".  "Licensees" and
-"recipients" may be individuals or organizations.
-
-  To "modify" a work means to copy from or adapt all or part of the work
-in a fashion requiring copyright permission, other than the making of an
-exact copy.  The resulting work is called a "modified version" of the
-earlier work or a work "based on" the earlier work.
-
-  A "covered work" means either the unmodified Program or a work based
-on the Program.
-
-  To "propagate" a work means to do anything with it that, without
-permission, would make you directly or secondarily liable for
-infringement under applicable copyright law, except executing it on a
-computer or modifying a private copy.  Propagation includes copying,
-distribution (with or without modification), making available to the
-public, and in some countries other activities as well.
-
-  To "convey" a work means any kind of propagation that enables other
-parties to make or receive copies.  Mere interaction with a user through
-a computer network, with no transfer of a copy, is not conveying.
-
-  An interactive user interface displays "Appropriate Legal Notices"
-to the extent that it includes a convenient and prominently visible
-feature that (1) displays an appropriate copyright notice, and (2)
-tells the user that there is no warranty for the work (except to the
-extent that warranties are provided), that licensees may convey the
-work under this License, and how to view a copy of this License.  If
-the interface presents a list of user commands or options, such as a
-menu, a prominent item in the list meets this criterion.
-
-  1. Source Code.
-
-  The "source code" for a work means the preferred form of the work
-for making modifications to it.  "Object code" means any non-source
-form of a work.
-
-  A "Standard Interface" means an interface that either is an official
-standard defined by a recognized standards body, or, in the case of
-interfaces specified for a particular programming language, one that
-is widely used among developers working in that language.
-
-  The "System Libraries" of an executable work include anything, other
-than the work as a whole, that (a) is included in the normal form of
-packaging a Major Component, but which is not part of that Major
-Component, and (b) serves only to enable use of the work with that
-Major Component, or to implement a Standard Interface for which an
-implementation is available to the public in source code form.  A
-"Major Component", in this context, means a major essential component
-(kernel, window system, and so on) of the specific operating system
-(if any) on which the executable work runs, or a compiler used to
-produce the work, or an object code interpreter used to run it.
-
-  The "Corresponding Source" for a work in object code form means all
-the source code needed to generate, install, and (for an executable
-work) run the object code and to modify the work, including scripts to
-control those activities.  However, it does not include the work's
-System Libraries, or general-purpose tools or generally available free
-programs which are used unmodified in performing those activities but
-which are not part of the work.  For example, Corresponding Source
-includes interface definition files associated with source files for
-the work, and the source code for shared libraries and dynamically
-linked subprograms that the work is specifically designed to require,
-such as by intimate data communication or control flow between those
-subprograms and other parts of the work.
-
-  The Corresponding Source need not include anything that users
-can regenerate automatically from other parts of the Corresponding
-Source.
-
-  The Corresponding Source for a work in source code form is that
-same work.
-
-  2. Basic Permissions.
-
-  All rights granted under this License are granted for the term of
-copyright on the Program, and are irrevocable provided the stated
-conditions are met.  This License explicitly affirms your unlimited
-permission to run the unmodified Program.  The output from running a
-covered work is covered by this License only if the output, given its
-content, constitutes a covered work.  This License acknowledges your
-rights of fair use or other equivalent, as provided by copyright law.
-
-  You may make, run and propagate covered works that you do not
-convey, without conditions so long as your license otherwise remains
-in force.  You may convey covered works to others for the sole purpose
-of having them make modifications exclusively for you, or provide you
-with facilities for running those works, provided that you comply with
-the terms of this License in conveying all material for which you do
-not control copyright.  Those thus making or running the covered works
-for you must do so exclusively on your behalf, under your direction
-and control, on terms that prohibit them from making any copies of
-your copyrighted material outside their relationship with you.
-
-  Conveying under any other circumstances is permitted solely under
-the conditions stated below.  Sublicensing is not allowed; section 10
-makes it unnecessary.
-
-  3. Protecting Users' Legal Rights From Anti-Circumvention Law.
-
-  No covered work shall be deemed part of an effective technological
-measure under any applicable law fulfilling obligations under article
-11 of the WIPO copyright treaty adopted on 20 December 1996, or
-similar laws prohibiting or restricting circumvention of such
-measures.
-
-  When you convey a covered work, you waive any legal power to forbid
-circumvention of technological measures to the extent such circumvention
-is effected by exercising rights under this License with respect to
-the covered work, and you disclaim any intention to limit operation or
-modification of the work as a means of enforcing, against the work's
-users, your or third parties' legal rights to forbid circumvention of
-technological measures.
-
-  4. Conveying Verbatim Copies.
-
-  You may convey verbatim copies of the Program's source code as you
-receive it, in any medium, provided that you conspicuously and
-appropriately publish on each copy an appropriate copyright notice;
-keep intact all notices stating that this License and any
-non-permissive terms added in accord with section 7 apply to the code;
-keep intact all notices of the absence of any warranty; and give all
-recipients a copy of this License along with the Program.
-
-  You may charge any price or no price for each copy that you convey,
-and you may offer support or warranty protection for a fee.
-
-  5. Conveying Modified Source Versions.
-
-  You may convey a work based on the Program, or the modifications to
-produce it from the Program, in the form of source code under the
-terms of section 4, provided that you also meet all of these conditions:
-
-    a) The work must carry prominent notices stating that you modified
-    it, and giving a relevant date.
-
-    b) The work must carry prominent notices stating that it is
-    released under this License and any conditions added under section
-    7.  This requirement modifies the requirement in section 4 to
-    "keep intact all notices".
-
-    c) You must license the entire work, as a whole, under this
-    License to anyone who comes into possession of a copy.  This
-    License will therefore apply, along with any applicable section 7
-    additional terms, to the whole of the work, and all its parts,
-    regardless of how they are packaged.  This License gives no
-    permission to license the work in any other way, but it does not
-    invalidate such permission if you have separately received it.
-
-    d) If the work has interactive user interfaces, each must display
-    Appropriate Legal Notices; however, if the Program has interactive
-    interfaces that do not display Appropriate Legal Notices, your
-    work need not make them do so.
-
-  A compilation of a covered work with other separate and independent
-works, which are not by their nature extensions of the covered work,
-and which are not combined with it such as to form a larger program,
-in or on a volume of a storage or distribution medium, is called an
-"aggregate" if the compilation and its resulting copyright are not
-used to limit the access or legal rights of the compilation's users
-beyond what the individual works permit.  Inclusion of a covered work
-in an aggregate does not cause this License to apply to the other
-parts of the aggregate.
-
-  6. Conveying Non-Source Forms.
-
-  You may convey a covered work in object code form under the terms
-of sections 4 and 5, provided that you also convey the
-machine-readable Corresponding Source under the terms of this License,
-in one of these ways:
-
-    a) Convey the object code in, or embodied in, a physical product
-    (including a physical distribution medium), accompanied by the
-    Corresponding Source fixed on a durable physical medium
-    customarily used for software interchange.
-
-    b) Convey the object code in, or embodied in, a physical product
-    (including a physical distribution medium), accompanied by a
-    written offer, valid for at least three years and valid for as
-    long as you offer spare parts or customer support for that product
-    model, to give anyone who possesses the object code either (1) a
-    copy of the Corresponding Source for all the software in the
-    product that is covered by this License, on a durable physical
-    medium customarily used for software interchange, for a price no
-    more than your reasonable cost of physically performing this
-    conveying of source, or (2) access to copy the
-    Corresponding Source from a network server at no charge.
-
-    c) Convey individual copies of the object code with a copy of the
-    written offer to provide the Corresponding Source.  This
-    alternative is allowed only occasionally and noncommercially, and
-    only if you received the object code with such an offer, in accord
-    with subsection 6b.
-
-    d) Convey the object code by offering access from a designated
-    place (gratis or for a charge), and offer equivalent access to the
-    Corresponding Source in the same way through the same place at no
-    further charge.  You need not require recipients to copy the
-    Corresponding Source along with the object code.  If the place to
-    copy the object code is a network server, the Corresponding Source
-    may be on a different server (operated by you or a third party)
-    that supports equivalent copying facilities, provided you maintain
-    clear directions next to the object code saying where to find the
-    Corresponding Source.  Regardless of what server hosts the
-    Corresponding Source, you remain obligated to ensure that it is
-    available for as long as needed to satisfy these requirements.
-
-    e) Convey the object code using peer-to-peer transmission, provided
-    you inform other peers where the object code and Corresponding
-    Source of the work are being offered to the general public at no
-    charge under subsection 6d.
-
-  A separable portion of the object code, whose source code is excluded
-from the Corresponding Source as a System Library, need not be
-included in conveying the object code work.
-
-  A "User Product" is either (1) a "consumer product", which means any
-tangible personal property which is normally used for personal, family,
-or household purposes, or (2) anything designed or sold for incorporation
-into a dwelling.  In determining whether a product is a consumer product,
-doubtful cases shall be resolved in favor of coverage.  For a particular
-product received by a particular user, "normally used" refers to a
-typical or common use of that class of product, regardless of the status
-of the particular user or of the way in which the particular user
-actually uses, or expects or is expected to use, the product.  A product
-is a consumer product regardless of whether the product has substantial
-commercial, industrial or non-consumer uses, unless such uses represent
-the only significant mode of use of the product.
-
-  "Installation Information" for a User Product means any methods,
-procedures, authorization keys, or other information required to install
-and execute modified versions of a covered work in that User Product from
-a modified version of its Corresponding Source.  The information must
-suffice to ensure that the continued functioning of the modified object
-code is in no case prevented or interfered with solely because
-modification has been made.
-
-  If you convey an object code work under this section in, or with, or
-specifically for use in, a User Product, and the conveying occurs as
-part of a transaction in which the right of possession and use of the
-User Product is transferred to the recipient in perpetuity or for a
-fixed term (regardless of how the transaction is characterized), the
-Corresponding Source conveyed under this section must be accompanied
-by the Installation Information.  But this requirement does not apply
-if neither you nor any third party retains the ability to install
-modified object code on the User Product (for example, the work has
-been installed in ROM).
-
-  The requirement to provide Installation Information does not include a
-requirement to continue to provide support service, warranty, or updates
-for a work that has been modified or installed by the recipient, or for
-the User Product in which it has been modified or installed.  Access to a
-network may be denied when the modification itself materially and
-adversely affects the operation of the network or violates the rules and
-protocols for communication across the network.
-
-  Corresponding Source conveyed, and Installation Information provided,
-in accord with this section must be in a format that is publicly
-documented (and with an implementation available to the public in
-source code form), and must require no special password or key for
-unpacking, reading or copying.
-
-  7. Additional Terms.
-
-  "Additional permissions" are terms that supplement the terms of this
-License by making exceptions from one or more of its conditions.
-Additional permissions that are applicable to the entire Program shall
-be treated as though they were included in this License, to the extent
-that they are valid under applicable law.  If additional permissions
-apply only to part of the Program, that part may be used separately
-under those permissions, but the entire Program remains governed by
-this License without regard to the additional permissions.
-
-  When you convey a copy of a covered work, you may at your option
-remove any additional permissions from that copy, or from any part of
-it.  (Additional permissions may be written to require their own
-removal in certain cases when you modify the work.)  You may place
-additional permissions on material, added by you to a covered work,
-for which you have or can give appropriate copyright permission.
-
-  Notwithstanding any other provision of this License, for material you
-add to a covered work, you may (if authorized by the copyright holders of
-that material) supplement the terms of this License with terms:
-
-    a) Disclaiming warranty or limiting liability differently from the
-    terms of sections 15 and 16 of this License; or
-
-    b) Requiring preservation of specified reasonable legal notices or
-    author attributions in that material or in the Appropriate Legal
-    Notices displayed by works containing it; or
-
-    c) Prohibiting misrepresentation of the origin of that material, or
-    requiring that modified versions of such material be marked in
-    reasonable ways as different from the original version; or
-
-    d) Limiting the use for publicity purposes of names of licensors or
-    authors of the material; or
-
-    e) Declining to grant rights under trademark law for use of some
-    trade names, trademarks, or service marks; or
-
-    f) Requiring indemnification of licensors and authors of that
-    material by anyone who conveys the material (or modified versions of
-    it) with contractual assumptions of liability to the recipient, for
-    any liability that these contractual assumptions directly impose on
-    those licensors and authors.
-
-  All other non-permissive additional terms are considered "further
-restrictions" within the meaning of section 10.  If the Program as you
-received it, or any part of it, contains a notice stating that it is
-governed by this License along with a term that is a further
-restriction, you may remove that term.  If a license document contains
-a further restriction but permits relicensing or conveying under this
-License, you may add to a covered work material governed by the terms
-of that license document, provided that the further restriction does
-not survive such relicensing or conveying.
-
-  If you add terms to a covered work in accord with this section, you
-must place, in the relevant source files, a statement of the
-additional terms that apply to those files, or a notice indicating
-where to find the applicable terms.
-
-  Additional terms, permissive or non-permissive, may be stated in the
-form of a separately written license, or stated as exceptions;
-the above requirements apply either way.
-
-  8. Termination.
-
-  You may not propagate or modify a covered work except as expressly
-provided under this License.  Any attempt otherwise to propagate or
-modify it is void, and will automatically terminate your rights under
-this License (including any patent licenses granted under the third
-paragraph of section 11).
-
-  However, if you cease all violation of this License, then your
-license from a particular copyright holder is reinstated (a)
-provisionally, unless and until the copyright holder explicitly and
-finally terminates your license, and (b) permanently, if the copyright
-holder fails to notify you of the violation by some reasonable means
-prior to 60 days after the cessation.
-
-  Moreover, your license from a particular copyright holder is
-reinstated permanently if the copyright holder notifies you of the
-violation by some reasonable means, this is the first time you have
-received notice of violation of this License (for any work) from that
-copyright holder, and you cure the violation prior to 30 days after
-your receipt of the notice.
-
-  Termination of your rights under this section does not terminate the
-licenses of parties who have received copies or rights from you under
-this License.  If your rights have been terminated and not permanently
-reinstated, you do not qualify to receive new licenses for the same
-material under section 10.
-
-  9. Acceptance Not Required for Having Copies.
-
-  You are not required to accept this License in order to receive or
-run a copy of the Program.  Ancillary propagation of a covered work
-occurring solely as a consequence of using peer-to-peer transmission
-to receive a copy likewise does not require acceptance.  However,
-nothing other than this License grants you permission to propagate or
-modify any covered work.  These actions infringe copyright if you do
-not accept this License.  Therefore, by modifying or propagating a
-covered work, you indicate your acceptance of this License to do so.
-
-  10. Automatic Licensing of Downstream Recipients.
-
-  Each time you convey a covered work, the recipient automatically
-receives a license from the original licensors, to run, modify and
-propagate that work, subject to this License.  You are not responsible
-for enforcing compliance by third parties with this License.
-
-  An "entity transaction" is a transaction transferring control of an
-organization, or substantially all assets of one, or subdividing an
-organization, or merging organizations.  If propagation of a covered
-work results from an entity transaction, each party to that
-transaction who receives a copy of the work also receives whatever
-licenses to the work the party's predecessor in interest had or could
-give under the previous paragraph, plus a right to possession of the
-Corresponding Source of the work from the predecessor in interest, if
-the predecessor has it or can get it with reasonable efforts.
-
-  You may not impose any further restrictions on the exercise of the
-rights granted or affirmed under this License.  For example, you may
-not impose a license fee, royalty, or other charge for exercise of
-rights granted under this License, and you may not initiate litigation
-(including a cross-claim or counterclaim in a lawsuit) alleging that
-any patent claim is infringed by making, using, selling, offering for
-sale, or importing the Program or any portion of it.
-
-  11. Patents.
-
-  A "contributor" is a copyright holder who authorizes use under this
-License of the Program or a work on which the Program is based.  The
-work thus licensed is called the contributor's "contributor version".
-
-  A contributor's "essential patent claims" are all patent claims
-owned or controlled by the contributor, whether already acquired or
-hereafter acquired, that would be infringed by some manner, permitted
-by this License, of making, using, or selling its contributor version,
-but do not include claims that would be infringed only as a
-consequence of further modification of the contributor version.  For
-purposes of this definition, "control" includes the right to grant
-patent sublicenses in a manner consistent with the requirements of
-this License.
-
-  Each contributor grants you a non-exclusive, worldwide, royalty-free
-patent license under the contributor's essential patent claims, to
-make, use, sell, offer for sale, import and otherwise run, modify and
-propagate the contents of its contributor version.
-
-  In the following three paragraphs, a "patent license" is any express
-agreement or commitment, however denominated, not to enforce a patent
-(such as an express permission to practice a patent or covenant not to
-sue for patent infringement).  To "grant" such a patent license to a
-party means to make such an agreement or commitment not to enforce a
-patent against the party.
-
-  If you convey a covered work, knowingly relying on a patent license,
-and the Corresponding Source of the work is not available for anyone
-to copy, free of charge and under the terms of this License, through a
-publicly available network server or other readily accessible means,
-then you must either (1) cause the Corresponding Source to be so
-available, or (2) arrange to deprive yourself of the benefit of the
-patent license for this particular work, or (3) arrange, in a manner
-consistent with the requirements of this License, to extend the patent
-license to downstream recipients.  "Knowingly relying" means you have
-actual knowledge that, but for the patent license, your conveying the
-covered work in a country, or your recipient's use of the covered work
-in a country, would infringe one or more identifiable patents in that
-country that you have reason to believe are valid.
-
-  If, pursuant to or in connection with a single transaction or
-arrangement, you convey, or propagate by procuring conveyance of, a
-covered work, and grant a patent license to some of the parties
-receiving the covered work authorizing them to use, propagate, modify
-or convey a specific copy of the covered work, then the patent license
-you grant is automatically extended to all recipients of the covered
-work and works based on it.
-
-  A patent license is "discriminatory" if it does not include within
-the scope of its coverage, prohibits the exercise of, or is
-conditioned on the non-exercise of one or more of the rights that are
-specifically granted under this License.  You may not convey a covered
-work if you are a party to an arrangement with a third party that is
-in the business of distributing software, under which you make payment
-to the third party based on the extent of your activity of conveying
-the work, and under which the third party grants, to any of the
-parties who would receive the covered work from you, a discriminatory
-patent license (a) in connection with copies of the covered work
-conveyed by you (or copies made from those copies), or (b) primarily
-for and in connection with specific products or compilations that
-contain the covered work, unless you entered into that arrangement,
-or that patent license was granted, prior to 28 March 2007.
-
-  Nothing in this License shall be construed as excluding or limiting
-any implied license or other defenses to infringement that may
-otherwise be available to you under applicable patent law.
-
-  12. No Surrender of Others' Freedom.
-
-  If conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License.  If you cannot convey a
-covered work so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you may
-not convey it at all.  For example, if you agree to terms that obligate you
-to collect a royalty for further conveying from those to whom you convey
-the Program, the only way you could satisfy both those terms and this
-License would be to refrain entirely from conveying the Program.
-
-  13. Use with the GNU Affero General Public License.
-
-  Notwithstanding any other provision of this License, you have
-permission to link or combine any covered work with a work licensed
-under version 3 of the GNU Affero General Public License into a single
-combined work, and to convey the resulting work.  The terms of this
-License will continue to apply to the part which is the covered work,
-but the special requirements of the GNU Affero General Public License,
-section 13, concerning interaction through a network will apply to the
-combination as such.
-
-  14. Revised Versions of this License.
-
-  The Free Software Foundation may publish revised and/or new versions of
-the GNU General Public License from time to time.  Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-  Each version is given a distinguishing version number.  If the
-Program specifies that a certain numbered version of the GNU General
-Public License "or any later version" applies to it, you have the
-option of following the terms and conditions either of that numbered
-version or of any later version published by the Free Software
-Foundation.  If the Program does not specify a version number of the
-GNU General Public License, you may choose any version ever published
-by the Free Software Foundation.
-
-  If the Program specifies that a proxy can decide which future
-versions of the GNU General Public License can be used, that proxy's
-public statement of acceptance of a version permanently authorizes you
-to choose that version for the Program.
-
-  Later license versions may give you additional or different
-permissions.  However, no additional obligations are imposed on any
-author or copyright holder as a result of your choosing to follow a
-later version.
-
-  15. Disclaimer of Warranty.
-
-  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
-APPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
-HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
-OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
-THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
-IS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
-ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
-
-  16. Limitation of Liability.
-
-  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
-THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
-GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
-USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
-DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
-PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
-EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
-SUCH DAMAGES.
-
-  17. Interpretation of Sections 15 and 16.
-
-  If the disclaimer of warranty and limitation of liability provided
-above cannot be given local legal effect according to their terms,
-reviewing courts shall apply local law that most closely approximates
-an absolute waiver of all civil liability in connection with the
-Program, unless a warranty or assumption of liability accompanies a
-copy of the Program in return for a fee.
-
-                     END OF TERMS AND CONDITIONS
-
-            How to Apply These Terms to Your New Programs
-
-  If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
-  To do so, attach the following notices to the program.  It is safest
-to attach them to the start of each source file to most effectively
-state the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
-    <one line to give the program's name and a brief idea of what it does.>
-    Copyright (C) <year>  <name of author>
-
-    This program is free software: you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation, either version 3 of the License, or
-    (at your option) any later version.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with this program.  If not, see <https://www.gnu.org/licenses/>.
-
-Also add information on how to contact you by electronic and paper mail.
-
-  If the program does terminal interaction, make it output a short
-notice like this when it starts in an interactive mode:
-
-    <program>  Copyright (C) <year>  <name of author>
-    This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
-    This is free software, and you are welcome to redistribute it
-    under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License.  Of course, your program's commands
-might be different; for a GUI interface, you would use an "about box".
-
-  You should also get your employer (if you work as a programmer) or school,
-if any, to sign a "copyright disclaimer" for the program, if necessary.
-For more information on this, and how to apply and follow the GNU GPL, see
-<https://www.gnu.org/licenses/>.
-
-  The GNU General Public License does not permit incorporating your program
-into proprietary programs.  If your program is a subroutine library, you
-may consider it more useful to permit linking proprietary applications with
-the library.  If this is what you want to do, use the GNU Lesser General
-Public License instead of this License.  But first, please read
-<https://www.gnu.org/licenses/why-not-lgpl.html>.
+MIT License
+
+Copyright (c) 2023 Zachary Weiss
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.

+ 0 - 0
apps_broken_by_last_refactors/magspoof_flipper/README.md → README.md


+ 0 - 260
ReadMe.md

@@ -1,260 +0,0 @@
-# Flipper Application Files (FAPs)
-## Compare your firmware API version with API version in releases to avoid compatibility issues
-
-#### [Download .zip file by using this link, unpack, and copy only specific apps folders or specific apps onto your microSD into apps folder](https://github.com/xMasterX/all-the-plugins/releases/latest)
-
-
----
-
-Apps contains changes needed to compile them on latest firmware, fixes has been done by @xMasterX
-
-
-## Thank you to the authors!
-
-The Flipper and its community wouldn't be as rich as it is without your contributions and support. Thank you for all you have done.
-
-### Apps checked & updated at `25 Oct 21:33 GMT +3`
-
-
-# Default pack
-
-<details>
- <summary>Legend</summary>
-  <img src="https://img.shields.io/badge/by_UFW-%2314D411?style=flat-square"> - published by Unleashed team <br>
-  <img src="https://img.shields.io/badge/by_OFW-%23FF8200?style=flat-square"> - published by OFW developers <br>
-  <img src="https://img.shields.io/badge/by_author-%23FFFF00?style=flat-square"> - published by original Author <br>
-  <img src="https://img.shields.io/badge/None-%23FF0000?style=flat-square"> - not in the catalog
-</details>
-
-### The default package includes all applications from [official](https://github.com/flipperdevices/flipperzero-good-faps) developers:
-
-| Name | <div style="width:100px">Category</div> | Remark | <div style="width:70px">Catalog</div> |
-|---|:---:|---|:---:|
-| AVR Flasher | ![GPIO Badge] |  | [![Official Badge]](https://lab.flipper.net/apps/avr_isp) |
-| DAP Link | ![GPIO Badge] |  | [![Official Badge]](https://lab.flipper.net/apps/dap_link) |
-| SPI Mem Manager | ![GPIO Badge] |  | [![Official Badge]](https://lab.flipper.net/apps/spi_mem_manager) |
-| Signal Generator | ![GPIO Badge] |  | [![Official Badge]](https://lab.flipper.net/apps/signal_generator) |
-| Mfkey32 | ![NFC Badge] |  | [![Official Badge]](https://lab.flipper.net/apps/mfkey32) |
-| PicoPass | ![NFC Badge] |  | [![Official Badge]](https://lab.flipper.net/apps/picopass) |
-| Nfc Magic | ![NFC Badge] |  | [![Official Badge]](https://lab.flipper.net/apps/nfc_magic) |
-| NFC/RFID detector | ![Tools Badge] |  | [![Official Badge]](https://lab.flipper.net/apps/nfc_rfid_detector) |
-| Simple Clock | ![Tools Badge] | [original by CompaqDisc](https://gist.github.com/CompaqDisc/4e329c501bd03c1e801849b81f48ea61), timer by GMMan, included in OFW<br>Part of UFW as main app [sources](https://github.com/DarkFlippers/unleashed-firmware/tree/dev/applications/main/clock_app) | [![Official Badge]](https://lab.flipper.net/apps/clock) |
-| Weather Station | ![SubGhz Badge] | added External Radio Support | [![Official Badge]](https://lab.flipper.net/apps/weather_station) |
-| USB Keyboard & Mouse | ![USB Badge] | Renamed, added Mouse `Clicker`/`Jiggler` | [![Official Badge]](https://lab.flipper.net/apps/hid_usb) |
-| Bluetooth Remote | ![BT Badge] | Renamed, added Mouse `Clicker`/`Jiggler` & `Tikshorts` | [![Official Badge]](https://lab.flipper.net/apps/hid_ble) |
-| USB Mass Storage | ![USB Badge] | [by hedger & nminaylov](https://github.com/flipperdevices/flipperzero-good-faps) | [![Official Badge]](https://lab.flipper.net/apps/mass_storage) |
-| Snake Game | ![Games Badge] |  | [![Official Badge]](https://lab.flipper.net/apps/snake_game) |
-| Music Player | ![Media Badge] |  | [![Official Badge]](https://lab.flipper.net/apps/music_player) |
-
-### Community and Unleashed Apps in default pack:
-
-| Name | <div style="width:100px">Category</div> | Author | Remark | <div style="width:70px">Catalog</div> |
-|---|:---:|---|---|:---:|
-| **Sub-GHz bruteforcer** | ![SubGhz Badge] | [by @derskythe & xMasterX](https://github.com/derskythe/flipperzero-subbrute) | [original by Ganapati & xMasterX](https://github.com/DarkFlippers/unleashed-firmware/pull/57) | ![None Badge] |
-| **Sub-GHz playlist** | ![SubGhz Badge] | [by darmiel](https://github.com/DarkFlippers/unleashed-firmware/pull/62) |  | ![None Badge] |
-| **Sub-GHz Remote** | ![SubGhz Badge] | [by @gid9798](https://github.com/gid9798) | Part of UFW as main app [sources](https://github.com/DarkFlippers/unleashed-firmware/tree/dev/applications/main/subghz_remote)<br>Using version from flipper catalog on CFW can break your .sub files | [![UFW Badge]](https://lab.flipper.net/apps/subghz_remote_ofw) |
-| Spectrum Analyzer (with changes) | ![SubGhz Badge] | [by jolcese](https://github.com/jolcese/flipperzero-firmware/tree/spectrum/applications/spectrum_analyzer) | [Ultra Narrow mode & scan channels non-consecutively](https://github.com/theY4Kman/flipperzero-firmware/commits?author=theY4Kman) + Many improvements by @ALEEF02 | [![UFW Badge]](https://lab.flipper.net/apps/spectrum_analyzer) |
-| POCSAG Pager | ![SubGhz Badge] | [by xMasterX & Shmuma](https://github.com/xMasterX/flipper-pager) |  | [![UFW Badge]](https://lab.flipper.net/apps/pocsag_pager) |
-| **ProtoView** | ![SubGhz Badge] | [by antirez](https://github.com/antirez/protoview) |  | [![UFW Badge]](https://lab.flipper.net/apps/protoview) |
-| Rolling Flaws | ![SubGhz Badge] | [by CodeAllNight & jamisonderek](https://github.com/jamisonderek/flipper-zero-tutorials/tree/main/subghz/apps/rolling-flaws) |  | ![None Badge] |
-| **Mifare Nested** | ![NFC Badge] | [by AloneLiberty](https://github.com/AloneLiberty/FlipperNested) | Works with PC and python app `FlipperNested` | [![Author Badge]](https://lab.flipper.net/apps/mifare_nested) |
-| **NFC Maker** plugin | ![NFC Badge] | [by Willy-JL](https://github.com/ClaraCrazy/Flipper-Xtreme/tree/dev/applications/external/nfc_maker) | make tags with URLs, Wifi and other things | ![None Badge] |
-| **MFKey** with nested | ![NFC Badge] | [by noproto](https://github.com/noproto/FlipperMfkey) | mfkey32 upgrade | ![None Badge] |
-| **RFID Fuzzer** | ![RFID Badge] | [by @gid9798](https://github.com/DarkFlippers/Multi_Fuzzer) | original by Ganapati & xMasterX | [![UFW Badge]](https://lab.flipper.net/apps/fuzzer_rfid) |
-| **iButton Fuzzer** | ![iButton Badge] | [by @gid9798](https://github.com/DarkFlippers/Multi_Fuzzer) | original by xMasterX | [![UFW Badge]](https://lab.flipper.net/apps/fuzzer_ibtn) |
-| IR Scope | ![IR Badge] | [by kallanreed](https://github.com/DarkFlippers/unleashed-firmware/pull/407) |  | [![UFW Badge]](https://lab.flipper.net/apps/ir_scope) |
-| MultiConverter plugin | ![Tools Badge] | [by theisolinearchip](https://github.com/theisolinearchip/flipperzero_stuff) |  | [![UFW Badge]](https://lab.flipper.net/apps/multi_converter) |
-| Barcode Generator | ![Tools Badge] | [by Kingal1337](https://github.com/Kingal1337/flipper-barcode-generator) |  | [![UFW Badge]](https://lab.flipper.net/apps/barcode_app) |
-| **TOTP (Authenticator)** | ![Tools Badge] | [by akopachov](https://github.com/akopachov/flipper-zero_authenticator) |  | [![None Badge]](https://github.com/akopachov/flipper-zero_authenticator/wiki/Why-it-is-not-listed-in-official-Flipper-Application-Catalog%3F) |
-| HEX Viewer | ![Tools Badge] | [by QtRoS](https://github.com/QtRoS/flipper-zero-hex-viewer) |  | [![UFW Badge]](https://lab.flipper.net/apps/hex_viewer) |
-| Text Viewer | ![Tools Badge] | [by Willy-JL](https://github.com/Flipper-XFW/Xtreme-Firmware/tree/dev/applications/external/text_viewer) | original by kowalski7cc & kyhwana | [![UFW Badge]](https://lab.flipper.net/apps/text_viewer) |
-| DTMF Dolphin | ![Tools Badge] | [by litui](https://github.com/litui/dtmf_dolphin) |  | [![UFW Badge]](https://lab.flipper.net/apps/dtmf_dolphin) |
-| ESP8266 Deauther plugin | ![GPIO Badge] | [by SequoiaSan](https://github.com/SequoiaSan/FlipperZero-Wifi-ESP8266-Deauther-Module) |  | ![None Badge] |
-| WiFi Scanner plugin | ![GPIO Badge] | [by SequoiaSan](https://github.com/SequoiaSan/FlipperZero-WiFi-Scanner_Module) |  | ![None Badge] |
-| GPIO: Sentry Safe plugin | ![GPIO Badge] | [by H4ckd4ddy](https://github.com/H4ckd4ddy/flipperzero-sentry-safe-plugin) |  | [![UFW Badge]](https://lab.flipper.net/apps/gpio_sentry_safe) |
-| ESP32: WiFi Marauder companion plugin | ![GPIO Badge] | [by 0xchocolate](https://github.com/0xchocolate/flipperzero-wifi-marauder) | Saving .pcap on flipper microSD [by tcpassos](https://github.com/tcpassos/flipperzero-firmware-with-wifi-marauder-companion) -> Only with custom marauder build (It is necessary to uncomment "#define WRITE_PACKETS_SERIAL" in configs.h (in marauder fw) and compile the firmware for the wifi board.) Or download precompiled build -> [Download esp32_marauder_ver_flipper_sd_serial.bin](https://github.com/justcallmekoko/ESP32Marauder/releases/latest) | [![Author Badge]](https://lab.flipper.net/apps/esp32_wifi_marauder) |
-| NRF24: Sniffer & MouseJacker (with changes) | ![GPIO Badge] | [by mothball187](https://github.com/mothball187/flipperzero-nrf24/tree/main/mousejacker) |  | ![None Badge] |
-| [NMEA] GPS | ![GPIO Badge] | [by ezod](https://github.com/ezod/flipperzero-gps) | works with module `NMEA 0183` via UART (13TX, 14RX, GND pins on Flipper) | [![UFW Badge]](https://lab.flipper.net/apps/gps_nmea) |
-| i2c Tools | ![GPIO Badge] | [by NaejEL](https://github.com/NaejEL/flipperzero-i2ctools) | C0 -> SCL / C1 -> SDA / GND -> GND | [![Author Badge]](https://lab.flipper.net/apps/i2ctools) |
-| HC-SR04 Distance sensor | ![GPIO Badge] | Ported and modified by @xMasterX | [(original by Sanqui)](https://github.com/Sanqui/flipperzero-firmware/tree/hc_sr04) - How to connect -> (5V -> VCC) / (GND -> GND) / (13\|TX -> Trig) / (14\|RX -> Echo) | ![None Badge] |
-| **Unitemp Temperature sensors reader** | ![GPIO Badge] | [by quen0n](https://github.com/quen0n/unitemp-flipperzero) | DHT11/22, DS18B20, BMP280, HTU21x and more | [![Author Badge]](https://lab.flipper.net/apps/unitemp) |
-| Lightmeter | ![GPIO Badge] | [by oleksiikutuzov](https://github.com/oleksiikutuzov/flipperzero-lightmeter) |  | [![Author Badge]](https://lab.flipper.net/apps/lightmeter) |
-| **UART Terminal** | ![GPIO Badge] | [by cool4uma](https://github.com/cool4uma/UART_Terminal/tree/main) |  | [![UFW Badge]](https://lab.flipper.net/apps/uart_terminal) |
-| **SWD Probe** | ![GPIO Badge] | [by g3gg0](https://github.com/g3gg0/flipper-swd_probe) |  | [![UFW Badge]](https://lab.flipper.net/apps/swd_probe) |
-| ESP32-CAM -> Camera Suite | ![GPIO Badge] | [by CodyTolene](https://github.com/CodyTolene/Flipper-Zero-Camera-Suite) |  | [![Author Badge]](https://lab.flipper.net/apps/camera_suite) |
-| WAV Player | ![Media Badge] | [OFW: DrZlo13](https://github.com/flipperdevices/flipperzero-firmware/tree/zlo/wav-player) | Fixed and improved by [LTVA1](https://github.com/LTVA1/wav_player) -> Also outputs audio on `PA6` `3(A6)` pin | [![UFW Badge]](https://lab.flipper.net/apps/wav_player) |
-| Metronome | ![Media Badge] | [by panki27](https://github.com/panki27/Metronome) |  | [![UFW Badge]](https://lab.flipper.net/apps/metronome) |
-| Morse Code | ![Media Badge] | [by wh00hw](https://github.com/wh00hw/MorseCodeFAP) |  | [![UFW Badge]](https://lab.flipper.net/apps/morse_code) |
-| **BadBT** plugin | ![BT Badge] | [by Willy-JL, ClaraCrazy, XFW contributors](https://github.com/ClaraCrazy/Flipper-Xtreme/tree/dev/applications/main/bad_kb) | BT version of BadKB (aka BadUSB via Bluetooth) | ![None Badge] |
-| BLE Spam | ![BT Badge] | [by @Willy-JL & @ECTO-1A & @Spooks4576](https://github.com/Flipper-XFW/Xtreme-Firmware/tree/dev/applications/external/ble_spam) |  | ![None Badge] |
-
-### Games
-
-| Name | <div style="width:100px">Category</div> | Author | Remark | <div style="width:70px">Catalog</div> |
-|---|:---:|---|---|:---:|
-| DOOM | ![Games Badge] | ported and fixed by @xMasterX & @Svarich & @hedger | [original by p4nic4ttack](https://github.com/p4nic4ttack/doomflipperzero/) | [![UFW Badge]](https://lab.flipper.net/apps/doom) |
-| Zombiez | ![Games Badge] | [Reworked by DevMilanIan](https://github.com/RogueMaster/flipperzerofirmwarewPlugins/pull/240) | [original by Dooskington](https://github.com/Dooskington/flipperzerozombiez) | [![UFW Badge]](https://lab.flipper.net/apps/zombiez) |
-| Flappy Bird | ![Games Badge] | [by DroomOne](https://github.com/DroomOne/flipperzerofirmware/tree/dev/applications/flappy_bird) |  | [![UFW Badge]](https://lab.flipper.net/apps/flappy_bird) |
-| Arkanoid | ![Games Badge] | by xMasterX | refactored by xMasterX, [original by gotnull](https://github.com/gotnull/flipperzerofirmwarewPlugins) | [![UFW Badge]](https://lab.flipper.net/apps/arkanoid) |
-| Tic Tac Toe | ![Games Badge] | by xMasterX | refactored by xMasterX, [original by gotnull](https://github.com/gotnull/flipperzerofirmwarewPlugins) | [![UFW Badge]](https://lab.flipper.net/apps/tictactoe) |
-| Tetris (with fixes) | ![Games Badge] | [by jeffplang](https://github.com/jeffplang/flipperzerofirmware/tree/tetris_game/applications/tetris) |  | [![UFW Badge]](https://lab.flipper.net/apps/tetris_game) |
-| Minesweeper | ![Games Badge] | [by panki27](https://github.com/panki27/minesweeper) |  | [![UFW Badge]](https://lab.flipper.net/apps/minesweeper) |
-| Heap Defence (aka Stack Attack) | ![Games Badge] | by xMasterX | ported to latest firmware by xMasterX, [original by wquinoa & Vedmein](https://github.com/Vedmein/flipperzerofirmware/tree/hd/svistoperdelki) | [![UFW Badge]](https://lab.flipper.net/apps/heap_defence) |
-| Game15 | ![Games Badge] | [by x27](https://github.com/x27/flipperzerogame15) |  | [![UFW Badge]](https://lab.flipper.net/apps/game15) |
-| Solitaire | ![Games Badge] | [by teeebor](https://github.com/teeebor/flipper_games) |  | ![None Badge] |
-| BlackJack | ![Games Badge] | [by teeebor](https://github.com/teeebor/flipper_games) |  | ![None Badge] |
-| 2048 game | ![Games Badge] | [by eugenekirzhanov](https://github.com/eugene-kirzhanov/flipper-zero-2048-game) |  | [![UFW Badge]](https://lab.flipper.net/apps/game_2048) |
-| Bomberduck | ![Games Badge] | [by leoneedmorecoffee](https://github.com/leoneedmorecoffee/flipperzerobomberduck) |  | ![None Badge] |
-| JetPack Joyride | ![Games Badge] | [by timstrasser](https://github.com/timstrasser) |  | [![Author Badge]](https://lab.flipper.net/apps/jetpack_game) |
-
----
-# Extra pack
-| Name | <div style="width:100px">Category</div> | Original author<br>or Source | Remark | <div style="width:70px">Catalog</div> |
-|---|:---:|---|---|:---:|
-| BT Camera Trigger | ![BT Badge] | [by Nem0oo](https://github.com/Nem0oo/flipper-zero-bluetooth-trigger) |  | [![UFW Badge]](https://lab.flipper.net/apps/bt_trigger) |
-| BT Serial Example | ![BT Badge] | [by maybe-hello-world](https://github.com/maybe-hello-world/fbs) |  | ![None Badge] |
-| 4 in row | ![Games Badge] | [by leo-need-more-coffee](https://github.com/leo-need-more-coffee/flipperzero-4inrow) |  | [![UFW Badge]](https://lab.flipper.net/apps/4inrow) |
-| Asteroids | ![Games Badge] | [by antirez & SimplyMinimal](https://github.com/antirez/flipper-asteroids) | Modified by [SimplyMinimal](https://github.com/SimplyMinimal/FlipperZero-Asteroids) all changes can be found by clicking on [this link](https://github.com/SimplyMinimal/FlipperZero-Asteroids) | [![UFW Badge]](https://lab.flipper.net/apps/asteroids) |
-| Chess Clock | ![Games Badge] | [by ihatecsv](https://github.com/ihatecsv/flipper_chess_clock) |  | ![None Badge] |
-| Chess | ![Games Badge] | [by xtruan](https://github.com/xtruan/flipper-chess) |  | [![Author Badge]](https://lab.flipper.net/apps/chess) |
-| Color Guess | ![Games Badge] | [by leedave](https://github.com/leedave/Leeds-Flipper-Zero-Applications) |  | [![Author Badge]](https://lab.flipper.net/apps/color_guess) |
-| Dice | ![Games Badge] | [by Ka3u6y6a](https://github.com/Ka3u6y6a/flipper-zero-dice) |  | [![Author Badge]](https://lab.flipper.net/apps/dice_app) |
-| DVD Bounce | ![Games Badge] | [by schaene](https://github.com/schaene/Flipper-DVD-Bounce) |  | ![None Badge] |
-| Etch-A-Sketch | ![Games Badge] | [by SimplyMinimal](https://github.com/SimplyMinimal/FlipperZero-Etch-A-Sketch) |  | ![None Badge] |
-| Pong | ![Games Badge] | [by nmrr](https://github.com/nmrr/flipperzero-pong) | Modified by [SimplyMinimal](https://github.com/SimplyMinimal/FlipperZero-Pong) | [![UFW Badge]](https://lab.flipper.net/apps/flipper_pong) |
-| Game of Life (Updated to work by tgxn) | ![Games Badge] | [by itsyourbedtime](https://github.com/tgxn/flipperzero-firmware/blob/dev/applications/game_of_life/game_of_life.c) |  | [![UFW Badge]](https://lab.flipper.net/apps/gameoflife) |
-| Mandelbrot Set | ![Games Badge] | [by Possibly-Matt](https://github.com/Possibly-Matt/flipperzero-firmware-wPlugins) |  | [![UFW Badge]](https://lab.flipper.net/apps/mandelbrotset) |
-| Monty Hall | ![Games Badge] | [by DevMilanIan](https://github.com/RogueMaster/flipperzero-firmware-wPlugins/pull/203) |  | [![UFW Badge]](https://lab.flipper.net/apps/montyhall) |
-| Nu Pogodi! (Ну, погоди!) | ![Games Badge] | [by sionyx](https://github.com/sionyx/flipper_nupogodi) |  | [![UFW Badge]](https://lab.flipper.net/apps/nupogodi) |
-| Paint | ![Games Badge] | [by n-o-T-I-n-s-a-n-e](https://github.com/n-o-T-I-n-s-a-n-e) |  | [![UFW Badge]](https://lab.flipper.net/apps/paint) |
-| Race | ![Games Badge] | [by zyuhel](https://github.com/zyuhel/flipperzero-racegame) |  | [![UFW Badge]](https://lab.flipper.net/apps/racegame) |
-| Reaction test Game | ![Games Badge] | [by Milk-Cool](https://github.com/Milk-Cool/fz-reaction-game) |  | [![UFW Badge]](https://lab.flipper.net/apps/reaction) |
-| Reversi | ![Games Badge] | [by dimat](https://github.com/dimat/flipperzero-reversi) |  | [![UFW Badge]](https://lab.flipper.net/apps/reversi) |
-| Root of Life | ![Games Badge] | [by Xorboo](https://github.com/Xorboo/root-of-life) |  | [![UFW Badge]](https://lab.flipper.net/apps/roots_of_life) |
-| Rubik's Cube Scrambler | ![Games Badge] | [by RaZeSloth](https://github.com/RaZeSloth/flipperzero-rubiks-cube-scrambler) |  | [![UFW Badge]](https://lab.flipper.net/apps/rubiks_cube_scrambler) |
-| SUPER-CHIP (Chip8) Emulator | ![Games Badge] | [by Milk-Cool](https://github.com/Milk-Cool/fz-schip) | WIP, please report found issues [here](https://github.com/Milk-Cool/fz-schip/issues) | ![None Badge] |
-| Scorched Tanks | ![Games Badge] | [by jasniec](https://github.com/jasniec/flipper-scorched-tanks-game) |  | [![UFW Badge]](https://lab.flipper.net/apps/scorched_tanks) |
-| Simon Says | ![Games Badge] | [by SimplyMinimal](https://github.com/SimplyMinimal/FlipperZero-SimonSays) |  | ![None Badge] |
-| Slots for Flipper Zero | ![Games Badge] | [by Daniel-dev-s](https://github.com/Daniel-dev-s/flipperzero-slots) |  | [![UFW Badge]](https://lab.flipper.net/apps/slotmachine) |
-| Snake 2.0 | ![Games Badge] | [by Willzvul](https://github.com/Willzvul/Snake_2.0) |  | [![UFW Badge]](https://lab.flipper.net/apps/snake20) |
-| T-rex game | ![Games Badge] | [by Rrycbarm](https://github.com/Rrycbarm/t-rex-runner) |  | [![UFW Badge]](https://lab.flipper.net/apps/t_rex_runner) |
-| TAMA P1 | ![Games Badge] | [by GMMan & DroomOne](https://github.com/GMMan/flipperzero-tamagotch-p1) | requires [this rom](https://tinyurl.com/tamap1) IN `tama_p1` folder on SD renamed as `rom.bin` to make it work. - Modified to allow saving game state by [DroomOne](https://github.com/DroomOne/flipperzero-tamagotch-p1) - Mute mode & settings by [Round-Pi](https://github.com/Round-Pi/flipperzero-tamagotch-p1) | ![None Badge] |
-| Tanks Game | ![Games Badge] | [by alexgr13](https://github.com/alexgr13/flipperzero-firmware/tree/fork/dev/applications/tanks-game) | Fixes for latest subghz changes **by @Sil333033** | ![None Badge] |
-| Tic-Tac-Toe Multi | ![Games Badge] | [by RouNNdeL](https://github.com/RouNNdeL/flipper-tictactoe-multi) |  | [![UFW Badge]](https://lab.flipper.net/apps/ttt_multi) |
-| Video Poker | ![Games Badge] | [by PixlEmly](https://github.com/PixlEmly/flipperzero-firmware-testing/blob/420/applications/VideoPoker/poker.c) |  | [![UFW Badge]](https://lab.flipper.net/apps/videopoker) |
-| Yatzee | ![Games Badge] | [by emfleak](https://github.com/emfleak/flipperzero-yatzee) |  | [![UFW Badge]](https://lab.flipper.net/apps/yatzee) |
-| Secret Toggle | ![Games Badge] | [by nostrumuva](https://github.com/nostrumuva/secret_toggle) |  | [![Author Badge]](https://lab.flipper.net/apps/secret_toggle) |
-| Sudoku Game | ![Games Badge] | [by profelis](https://github.com/profelis/fz-sudoku) |  | [![Author Badge]](https://lab.flipper.net/apps/sudoku) |
-| Ultimate Tic-Tac-Toe | ![Games Badge] | [by Racso](https://github.com/Racso/fzero-apps/tree/main) |  | [![Author Badge]](https://lab.flipper.net/apps/racso_ultimate_tic_tac_toe) |
-| Zero! | ![Games Badge] | [by Racso](https://github.com/Racso/fzero-apps/tree/main) |  | [![Author Badge]](https://lab.flipper.net/apps/racso_zero) |
-| Sokoban | ![Games Badge] | [by Racso](https://github.com/Racso/fzero-apps/tree/main) |  | [![Author Badge]](https://lab.flipper.net/apps/racso_sokoban) |
-| Air Mouse | ![GPIO Badge] | [by ginkage](https://github.com/ginkage/FlippAirMouse/) |  | [![Author Badge]](https://lab.flipper.net/apps/air_mouse) |
-| Plantower PMSx003 sensor reader | ![GPIO Badge] | [by 3cky](https://github.com/3cky/flipperzero-airmon) |  | [![UFW Badge]](https://lab.flipper.net/apps/airmon) |
-| Bar code scanner emulator via COM port | ![GPIO Badge] | [by polarikus](https://github.com/polarikus/flipper-zero_bc_scanner_emulator) |  | ![None Badge] |
-| ESP32->Flipper Camera | ![GPIO Badge] | [by Z4urce](https://github.com/Z4urce/flipperzero-camera) |  | ![None Badge] |
-| RC2014 ColecoVision | ![GPIO Badge] | [by ezod](https://github.com/ezod/flipperzero-rc2014-coleco) |  | ![None Badge] |
-| ESP Flasher | ![GPIO Badge] | [by 0xchocolate](https://github.com/0xchocolate/flipperzero-esp-flasher) |  | [![Author Badge]](https://lab.flipper.net/apps/esp_flasher) |
-| ESP32-C6 Gravity terminal | ![GPIO Badge] | [by chris-bc](https://github.com/chris-bc/Flipper-Gravity) |  | ![None Badge] |
-| IFTTT Virtual Button for ESP8266 | ![GPIO Badge] | [by Ferrazzi](https://github.com/Ferrazzi/FlipperZero_IFTTT_Virtual_Button) | Fixes [by Willy-JL](https://github.com/Flipper-XFW/Xtreme-Firmware/commit/ae321fb5f4c616d3965546926b1b4b446eef8d86) | ![None Badge] |
-| Wifi Deauth v2 for ESP8266 | ![GPIO Badge] | [by Timmotools](https://github.com/Timmotools/flipperzero_esp8266_deautherv2) |  | ![None Badge] |
-| Evil captive portal | ![GPIO Badge] | [by bigbrodude6119](https://github.com/bigbrodude6119/flipper-zero-evil-portal) | WIP -> +2 new features [by leedave](https://github.com/leedave/flipper-zero-evil-portal/tree/leedave/ap_rename) | ![None Badge] |
-| Flashlight | ![GPIO Badge] | [by xMasterX](https://github.com/xMasterX/flipper-flashlight) |  | [![UFW Badge]](https://lab.flipper.net/apps/flashlight) |
-| Pwnagotchi->Flipper interface | ![GPIO Badge] | [by Matt-London](https://github.com/Matt-London/pwnagotchi-flipper) |  | ![None Badge] |
-| Geiger Counter | ![GPIO Badge] | [by nmrr](https://github.com/nmrr/flipperzero-geigercounter) | works with external module! | [![UFW Badge]](https://lab.flipper.net/apps/flipper_geiger) |
-| Oscilloscope | ![GPIO Badge] | [by anfractuosity](https://github.com/anfractuosity/flipperscope) | Fixed furi_bus issues **by @xMasterX** | [![Author Badge]](https://lab.flipper.net/apps/flipperscope) |
-| Control 7-segment display with Flipper Zero | ![GPIO Badge] | [by jamisonderek](https://github.com/jamisonderek/flipper-zero-tutorials/tree/main/gpio) |  | [![UFW Badge]](https://lab.flipper.net/apps/gpio_7segment_output) |
-| GPIO Controller | ![GPIO Badge] | [by Lokno](https://github.com/Lokno/gpio_controller) | `A visual tool to control the general purpose pins of the Flipper Zero` | ![None Badge] |
-| GPIO Reader | ![GPIO Badge] | [by aureli1c](https://github.com/aureli1c/flipperzero_GPIO_read) |  | [![UFW Badge]](https://lab.flipper.net/apps/gpio_reader) |
-| Timelapse (zeitraffer) | ![GPIO Badge] | [by theageoflove](https://github.com/theageoflove/flipperzero-zeitraffer) |  | [![UFW Badge]](https://lab.flipper.net/apps/gpio_timelapse) |
-| GPIO Reader 2 | ![GPIO Badge] | [by biotinker](https://github.com/biotinker/flipperzero-gpioreader) |  | ![None Badge] |
-| Logic analyzer | ![GPIO Badge] | [by g3gg0](https://github.com/g3gg0/flipper-logic_analyzer) | [How to use](https://github.com/g3gg0/flipper-logic_analyzer#readme) | ![None Badge] |
-| LORA Terminal | ![GPIO Badge] | [by aafksab](https://github.com/aafksab/LORA-Term) |  | ![None Badge] |
-| MagSpoof (WIP) | ![GPIO Badge] | [by zacharyweiss](https://github.com/zacharyweiss/magspoof_flipper) | Read mode [by hummusec](https://github.com/hummusec/magspoof_flipper) - + GPIO & Power fixes | ![None Badge] |
-| Mx2125 Dual-Axis Accelerometer | ![GPIO Badge] | [by jamisonderek](https://github.com/jamisonderek/flipper-zero-tutorials/tree/main/gpio) |  | ![None Badge] |
-| MH-Z19 - CO2 sensor | ![GPIO Badge] | [by meshchaninov](https://github.com/meshchaninov/flipper-zero-mh-z19) |  | [![Author Badge]](https://lab.flipper.net/apps/mh_z19) |
-| NRF24 Batch Read/Send (WIP) | ![GPIO Badge] | [by vad7](https://github.com/vad7/nRF24-Batch) |  | ![None Badge] |
-| NRF24 Scanner | ![GPIO Badge] | [by vad7](https://github.com/vad7/nrf24scan) |  | ![None Badge] |
-| Pokemon Trading (for GameBoy) | ![GPIO Badge] | [by EstebanFuentealba](https://github.com/EstebanFuentealba/Flipper-Zero-Game-Boy-Trading-Pokemons) | Updates [by R4g3D](https://github.com/R4g3D/Flipper-Zero-Game-Boy-Pokemon-Trading) | [![Author Badge]](https://lab.flipper.net/apps/pokemon) |
-| Radiation Sensor | ![GPIO Badge] | [by sionyx](https://github.com/sionyx/flipper_radsens) | works with RadSens module | ![None Badge] |
-| RCWL-516 Motion Sensor | ![GPIO Badge] | [by ahmedafe1](https://github.com/ahmedafe1/rcwl_0516-Flipperzero) |  | ![None Badge] |
-| ServoTester | ![GPIO Badge] | [by spin7ion](https://github.com/spin7ion/flipper-servotester) |  | [![UFW Badge]](https://lab.flipper.net/apps/servotester) |
-| ServoTester (2) | ![GPIO Badge] | [by mhasbini](https://github.com/mhasbini/ServoTesterApp/tree/master) |  | ![None Badge] |
-| TAS playback | ![GPIO Badge] | [by rcombs](https://github.com/rcombs/tas-playback) | `This app plays back TAS files for retro video games. Connect the GPIO pins to the console's controller port and select a file to play back.` | ![None Badge] |
-| u-blox GPS | ![GPIO Badge] | [by liamhays](https://github.com/liamhays/ublox) |  | [![Author Badge]](https://lab.flipper.net/apps/ublox) |
-| [USPING] Distance Sensor | ![GPIO Badge] | [by privet971](https://github.com/privet971/FlipperZeroApps/tree/main/usping) |  | ![None Badge] |
-| Wiegand Reader | ![GPIO Badge] | [by jamisonderek](https://github.com/jamisonderek/flipper-zero-tutorials/tree/main/gpio) |  | ![None Badge] |
-| ESP32 Wifi Mapping | ![GPIO Badge] | [by carvilsi](https://github.com/carvilsi/flipper0-wifi-map/tree/main) |  | ![None Badge] |
-| Wii EC Analyser | ![GPIO Badge] | [by csBlueChip](https://github.com/csBlueChip/FlipperZero_WiiEC) |  | ![None Badge] |
-| Wire Tester | ![GPIO Badge] | [by unixispower](https://gitlab.com/unixispower/flipper-wire-tester) |  | ![None Badge] |
-| Atomic Dice Roller | ![GPIO Badge] | [by nmrr](https://github.com/nmrr/flipperzero-atomicdiceroller) |  | ![None Badge] |
-| NRF24 Channel Scanner | ![GPIO Badge] | [by htotoo](https://github.com/htotoo/NRF24ChannelScanner) |  | [![Author Badge]](https://lab.flipper.net/apps/nrf24channelscanner) |
-| Mx2125 - Step Counter | ![GPIO Badge] | [by grugnoymeme](https://github.com/grugnoymeme/flipperzero-stepcounter-fap) |  | ![None Badge] |
-| TEA5767 Radio control | ![GPIO Badge] | [original by victormico](https://github.com/victormico/flipperzero-radio/tree/main) | new version [by coolshrimp](https://coolshrimp/flipperzero-firmware-wPlugins/) | ![None Badge] |
-| Coffee EEPROM | ![GPIO Badge] | [by wh00hw](https://github.com/wh00hw/Coffee-EEPROM-FAP) | read more details in original repo | ![None Badge] |
-| IR Remote | ![IR Badge] | [by Hong5489](https://github.com/Hong5489/ir_remote) | improvements [by friebel](https://github.com/RogueMaster/flipperzero-firmware-wPlugins/pull/535) - Hold Option, RAW support [by d4ve10](https://github.com/d4ve10/ir_remote/tree/infrared_hold_option) | ![None Badge] |
-| IR Intervalometer | ![IR Badge] | [by Nitepone](https://github.com/Nitepone/flipper-intervalometer) |  | [![UFW Badge]](https://lab.flipper.net/apps/sony_intervalometer) |
-| IR Xbox Controller | ![IR Badge] | [by gebeto](https://github.com/gebeto/flipper-xbox-controller) |  | [![Author Badge]](https://lab.flipper.net/apps/xbox_controller) |
-| XRemote | ![IR Badge] | [by kala13x](https://github.com/kala13x/flipper-xremote) | Check out original repo to find usage instructions! | [![Author Badge]](https://lab.flipper.net/apps/flipper_xremote) |
-| R.O.B. Control | ![IR Badge] | [by riney](https://github.com/riney/flip_rob) | Flipper app to control a Nintendo R.O.B./Family Computer Robot | ![None Badge] |
-| BPM Tapper | ![Media Badge] | [by panki27](https://github.com/panki27/bpm-tapper) |  | [![UFW Badge]](https://lab.flipper.net/apps/bpm_tapper) |
-| Flizzer Tracker | ![Media Badge] | [by LTVA1](https://github.com/LTVA1/flizzer_tracker) |  | [![Author Badge]](https://lab.flipper.net/apps/flizzer_tracker) |
-| Music Beeper | ![Media Badge] | [by qqMajiKpp / Haseo](https://github.com/qqmajikpp/) |  | ![None Badge] |
-| Ocarina | ![Media Badge] | [by invalidna-me](https://github.com/invalidna-me/flipperzero-ocarina) |  | [![UFW Badge]](https://lab.flipper.net/apps/ocarina) |
-| Text 2 SAM | ![Media Badge] | [by Round-Pi](https://github.com/Round-Pi/flipperzero-text2sam) | Fixes [by Willy-JL](https://github.com/Flipper-XFW/Xtreme-Firmware/commit/e688f81b53b0138d80de4b609daf1f9fca5be647) | [![UFW Badge]](https://lab.flipper.net/apps/text2sam) |
-| Tuning Fork | ![Media Badge] | [by besya](https://github.com/besya/flipperzero-tuning-fork) | Fixes [by Willy-JL](https://github.com/Flipper-XFW/Xtreme-Firmware/commit/44023851f7349b6ae9ca9f9bd9228d795a7e04c0) | [![UFW Badge]](https://lab.flipper.net/apps/tuning_fork) |
-| USB Midi | ![Media Badge] | [by DrZlo13](https://github.com/DrZlo13/flipper-zero-usb-midi) |  | ![None Badge] |
-| Video Player | ![Media Badge] | [by LTVA1](https://github.com/LTVA1/flipper-zero-video-player) | <- Follow link to download examples and learn how to convert videos | ![None Badge] |
-| Music Tracker | ![Media Badge] | [by DrZlo13](https://github.com/DrZlo13/flipper-zero-music-tracker) |  | [![UFW Badge]](https://lab.flipper.net/apps/zero_tracker) |
-| Mifare Fuzzer | ![NFC Badge] | [by spheeere98](https://github.com/spheeere98/mifare_fuzzer) | Fixed crash on exit | [![UFW Badge]](https://lab.flipper.net/apps/mifare_fuzzer) |
-| Seader | ![NFC Badge] | [by bettse](https://github.com/bettse/seader/tree/main) | `Interface with a SAM from the Flipper Zero over UART` | [![Author Badge]](https://lab.flipper.net/apps/seader) |
-| VB Lab Migration Assistant | ![NFC Badge] | [by GMMan (cyanic)](https://github.com/GMMan/flipperzero-vb-migrate) |  | [![Author Badge]](https://lab.flipper.net/apps/vb_migrate) |
-| RFID Beacon | ![RFID Badge] | [by nmrr](https://github.com/nmrr/flipperzero-rfidbeacon)  | `A letter/number Morse beacon on 125 kHz` | ![None Badge] |
-| EM4100 universal keys generator (for RFID Fuzzer) | ![RFID Badge] | [by Milk-Cool](https://github.com/Milk-Cool/fz-em4100-generator) |  | [![Author Badge]](https://lab.flipper.net/apps/key_generator) |
-| (Q)M100 UHF RFID | ![RFID Badge] | [by frux-c](https://github.com/frux-c/uhf_rfid) | WIP -> (+Added icon by @xMasterX) | ![None Badge] |
-| Enhanced Sub-GHz Chat | ![SubGhz Badge] | [by twisted-pear](https://github.com/twisted-pear/esubghz_chat) |  | ![None Badge] |
-| TPMS Reader | ![SubGhz Badge] | [by wosk](https://github.com/wosk/flipperzero-tpms/tree/main) |  | ![None Badge] |
-| Analog Clock | ![Tools Badge] | [by scrolltex](https://github.com/scrolltex/flipper_analog_clock) |  | [![UFW Badge]](https://lab.flipper.net/apps/analog_clock) |
-| Brainfuck interpreter | ![Tools Badge] | [by nymda](https://github.com/nymda/FlipperZeroBrainfuck) |  | [![UFW Badge]](https://lab.flipper.net/apps/brainfuck) |
-| Ceasar Cipher | ![Tools Badge] | [by panki27](https://github.com/panki27/caesar-cipher) |  | [![UFW Badge]](https://lab.flipper.net/apps/caesar_cipher) |
-| Calculator | ![Tools Badge] | [by n-o-T-I-n-s-a-n-e](https://github.com/n-o-T-I-n-s-a-n-e) |  | [![UFW Badge]](https://lab.flipper.net/apps/calculator) |
-| CLI-GUI Bridge | ![Tools Badge] | [by ranchordo](https://github.com/ranchordo/flipperzero-cli-bridge) | Fixes [by Willy-JL](https://github.com/Willy-JL) | ![None Badge] |
-| Count Down Timer | ![Tools Badge] | [by 0w0mewo](https://github.com/0w0mewo/fpz_cntdown_timer) |  | [![UFW Badge]](https://lab.flipper.net/apps/cntdown_tim) |
-| Counter | ![Tools Badge] | [by Krulknul](https://github.com/Krulknul/dolphin-counter) |  | [![UFW Badge]](https://lab.flipper.net/apps/counter) |
-| DCF77 Transmitter | ![Tools Badge] | [by arha](https://github.com/arha/flipper-dcf77) |  | [![UFW Badge]](https://lab.flipper.net/apps/dcf77) |
-| FlipBIP Crypto Tool | ![Tools Badge] | [by xtruan](https://github.com/xtruan/FlipBIP) |  | [![Author Badge]](https://lab.flipper.net/apps/flipbip) |
-| Flipp Pomodoro Timer | ![Tools Badge] | [by Th3Un1q3](https://github.com/Th3Un1q3/flipp_pomodoro) |  | [![UFW Badge]](https://lab.flipper.net/apps/flipp_pomodoro) |
-| Chronometer | ![Tools Badge] | [by nmrr](https://github.com/nmrr/flipperzero-chronometer) |  | ![None Badge] |
-| HEX Editor | ![Tools Badge] | [by dunaevai135](https://github.com/dunaevai135/flipper-zero-hex_editor) |  | [![UFW Badge]](https://lab.flipper.net/apps/hex_editor) |
-| Multi Counter | ![Tools Badge] | [by JadePossible](https://github.com/JadePossible/Flipper-Multi-Counter) |  | [![Author Badge]](https://lab.flipper.net/apps/multi_counter) |
-| NightStand Clock | ![Tools Badge] | [by nymda](https://github.com/nymda/FlipperNightStand) | Fixes [by Willy-JL](https://github.com/Willy-JL) | ![None Badge] |
-| Password Generator | ![Tools Badge] | [by anakod](https://github.com/anakod/flipper_passgen) | Proper random [by henrygab](https://github.com/anakod/flipper_passgen/pull/6) | [![UFW Badge]](https://lab.flipper.net/apps/passgen) |
-| Pomodoro Timer | ![Tools Badge] | [by sbrin](https://github.com/sbrin/flipperzero_pomodoro) |  | [![UFW Badge]](https://lab.flipper.net/apps/pomodoro_timer) |
-| QR Code | ![Tools Badge] | [by bmatcuk](https://github.com/bmatcuk/flipperzero-qrcode) |  | ![None Badge] |
-| Resistance calculator | ![Tools Badge] | [by instantiator](https://github.com/instantiator/flipper-zero-experimental-apps) |  | [![UFW Badge]](https://lab.flipper.net/apps/resistors) |
-| Simple calendar app | ![Tools Badge] | [by Adiras](https://github.com/Adiras/flipperzero-calendar) |  | ![None Badge] |
-| USB HID Autofire | ![USB Badge] | [by pbek](https://github.com/pbek/usb_hid_autofire) |  | ![None Badge] |
-
-
-#### Catalog links checked at `01 Sep 16:24 GMT +3`
-
---- 
-
-Useful source of files for flipper, also has apps pack:
-## [UberGuidoZ Playground - Large collection of files - Github](https://github.com/UberGuidoZ/Flipper)
-
-[RFID Badge]: https://custom-icon-badges.demolab.com/badge/-RFID-rgb(255,244,147)?style=for-the-badge&logo=fz-rfid&logoColor=black
-[iButton Badge]: https://custom-icon-badges.demolab.com/badge/-iButton-rgb(225,187,166)?style=for-the-badge&logo=fz-ibutton&logoColor=black
-[SubGhz Badge]: https://custom-icon-badges.demolab.com/badge/-Sub--GHz-rgb(165,244,190)?style=for-the-badge&logo=fz-subghz&logoColor=black
-[GPIO Badge]: https://custom-icon-badges.demolab.com/badge/-GPIO-rgb(167,242,234)?style=for-the-badge&logo=fz-gpio&logoColor=black
-[Tools Badge]: https://custom-icon-badges.demolab.com/badge/-Tools-rgb(223,241,89)?style=for-the-badge&logo=fz-tools&logoColor=black
-[Media Badge]: https://custom-icon-badges.demolab.com/badge/-Media-rgb(223,181,255)?style=for-the-badge&logo=fz-media&logoColor=black
-[BT Badge]: https://custom-icon-badges.demolab.com/badge/-BlueTooth-rgb(139,172,255)?style=for-the-badge&logo=fz-bluetooth&logoColor=black
-[NFC Badge]: https://custom-icon-badges.demolab.com/badge/-NFC-rgb(152,206,254)?style=for-the-badge&logo=fz-nfc&logoColor=black
-[USB Badge]: https://custom-icon-badges.demolab.com/badge/-USB-rgb(255,190,233)?style=for-the-badge&logo=fz-badusb&logoColor=black
-[IR Badge]: https://custom-icon-badges.demolab.com/badge/-Infrared-rgb(254,147,140)?style=for-the-badge&logo=fz-infrared&logoColor=black
-[Games Badge]: https://custom-icon-badges.demolab.com/badge/-Games-rgb(255,196,134)?style=for-the-badge&logo=fz-games&logoColor=black
-
-[UFW Badge]: https://img.shields.io/badge/by_UFW-%2314D411?style=flat-square
-[Official Badge]: https://img.shields.io/badge/by_OFW-%23FF8200?style=flat-square
-[Author Badge]: https://img.shields.io/badge/by_author-%23FFFF00?style=flat-square
-[None Badge]: https://img.shields.io/badge/None-%23FF0000?style=flat-square

+ 0 - 0
apps_broken_by_last_refactors/magspoof_flipper/application.fam → application.fam


+ 0 - 674
apps_broken_by_last_refactors/cli_bridge/LICENSE

@@ -1,674 +0,0 @@
-                    GNU GENERAL PUBLIC LICENSE
-                       Version 3, 29 June 2007
-
- Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
-                            Preamble
-
-  The GNU General Public License is a free, copyleft license for
-software and other kinds of works.
-
-  The licenses for most software and other practical works are designed
-to take away your freedom to share and change the works.  By contrast,
-the GNU General Public License is intended to guarantee your freedom to
-share and change all versions of a program--to make sure it remains free
-software for all its users.  We, the Free Software Foundation, use the
-GNU General Public License for most of our software; it applies also to
-any other work released this way by its authors.  You can apply it to
-your programs, too.
-
-  When we speak of free software, we are referring to freedom, not
-price.  Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-them if you wish), that you receive source code or can get it if you
-want it, that you can change the software or use pieces of it in new
-free programs, and that you know you can do these things.
-
-  To protect your rights, we need to prevent others from denying you
-these rights or asking you to surrender the rights.  Therefore, you have
-certain responsibilities if you distribute copies of the software, or if
-you modify it: responsibilities to respect the freedom of others.
-
-  For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must pass on to the recipients the same
-freedoms that you received.  You must make sure that they, too, receive
-or can get the source code.  And you must show them these terms so they
-know their rights.
-
-  Developers that use the GNU GPL protect your rights with two steps:
-(1) assert copyright on the software, and (2) offer you this License
-giving you legal permission to copy, distribute and/or modify it.
-
-  For the developers' and authors' protection, the GPL clearly explains
-that there is no warranty for this free software.  For both users' and
-authors' sake, the GPL requires that modified versions be marked as
-changed, so that their problems will not be attributed erroneously to
-authors of previous versions.
-
-  Some devices are designed to deny users access to install or run
-modified versions of the software inside them, although the manufacturer
-can do so.  This is fundamentally incompatible with the aim of
-protecting users' freedom to change the software.  The systematic
-pattern of such abuse occurs in the area of products for individuals to
-use, which is precisely where it is most unacceptable.  Therefore, we
-have designed this version of the GPL to prohibit the practice for those
-products.  If such problems arise substantially in other domains, we
-stand ready to extend this provision to those domains in future versions
-of the GPL, as needed to protect the freedom of users.
-
-  Finally, every program is threatened constantly by software patents.
-States should not allow patents to restrict development and use of
-software on general-purpose computers, but in those that do, we wish to
-avoid the special danger that patents applied to a free program could
-make it effectively proprietary.  To prevent this, the GPL assures that
-patents cannot be used to render the program non-free.
-
-  The precise terms and conditions for copying, distribution and
-modification follow.
-
-                       TERMS AND CONDITIONS
-
-  0. Definitions.
-
-  "This License" refers to version 3 of the GNU General Public License.
-
-  "Copyright" also means copyright-like laws that apply to other kinds of
-works, such as semiconductor masks.
-
-  "The Program" refers to any copyrightable work licensed under this
-License.  Each licensee is addressed as "you".  "Licensees" and
-"recipients" may be individuals or organizations.
-
-  To "modify" a work means to copy from or adapt all or part of the work
-in a fashion requiring copyright permission, other than the making of an
-exact copy.  The resulting work is called a "modified version" of the
-earlier work or a work "based on" the earlier work.
-
-  A "covered work" means either the unmodified Program or a work based
-on the Program.
-
-  To "propagate" a work means to do anything with it that, without
-permission, would make you directly or secondarily liable for
-infringement under applicable copyright law, except executing it on a
-computer or modifying a private copy.  Propagation includes copying,
-distribution (with or without modification), making available to the
-public, and in some countries other activities as well.
-
-  To "convey" a work means any kind of propagation that enables other
-parties to make or receive copies.  Mere interaction with a user through
-a computer network, with no transfer of a copy, is not conveying.
-
-  An interactive user interface displays "Appropriate Legal Notices"
-to the extent that it includes a convenient and prominently visible
-feature that (1) displays an appropriate copyright notice, and (2)
-tells the user that there is no warranty for the work (except to the
-extent that warranties are provided), that licensees may convey the
-work under this License, and how to view a copy of this License.  If
-the interface presents a list of user commands or options, such as a
-menu, a prominent item in the list meets this criterion.
-
-  1. Source Code.
-
-  The "source code" for a work means the preferred form of the work
-for making modifications to it.  "Object code" means any non-source
-form of a work.
-
-  A "Standard Interface" means an interface that either is an official
-standard defined by a recognized standards body, or, in the case of
-interfaces specified for a particular programming language, one that
-is widely used among developers working in that language.
-
-  The "System Libraries" of an executable work include anything, other
-than the work as a whole, that (a) is included in the normal form of
-packaging a Major Component, but which is not part of that Major
-Component, and (b) serves only to enable use of the work with that
-Major Component, or to implement a Standard Interface for which an
-implementation is available to the public in source code form.  A
-"Major Component", in this context, means a major essential component
-(kernel, window system, and so on) of the specific operating system
-(if any) on which the executable work runs, or a compiler used to
-produce the work, or an object code interpreter used to run it.
-
-  The "Corresponding Source" for a work in object code form means all
-the source code needed to generate, install, and (for an executable
-work) run the object code and to modify the work, including scripts to
-control those activities.  However, it does not include the work's
-System Libraries, or general-purpose tools or generally available free
-programs which are used unmodified in performing those activities but
-which are not part of the work.  For example, Corresponding Source
-includes interface definition files associated with source files for
-the work, and the source code for shared libraries and dynamically
-linked subprograms that the work is specifically designed to require,
-such as by intimate data communication or control flow between those
-subprograms and other parts of the work.
-
-  The Corresponding Source need not include anything that users
-can regenerate automatically from other parts of the Corresponding
-Source.
-
-  The Corresponding Source for a work in source code form is that
-same work.
-
-  2. Basic Permissions.
-
-  All rights granted under this License are granted for the term of
-copyright on the Program, and are irrevocable provided the stated
-conditions are met.  This License explicitly affirms your unlimited
-permission to run the unmodified Program.  The output from running a
-covered work is covered by this License only if the output, given its
-content, constitutes a covered work.  This License acknowledges your
-rights of fair use or other equivalent, as provided by copyright law.
-
-  You may make, run and propagate covered works that you do not
-convey, without conditions so long as your license otherwise remains
-in force.  You may convey covered works to others for the sole purpose
-of having them make modifications exclusively for you, or provide you
-with facilities for running those works, provided that you comply with
-the terms of this License in conveying all material for which you do
-not control copyright.  Those thus making or running the covered works
-for you must do so exclusively on your behalf, under your direction
-and control, on terms that prohibit them from making any copies of
-your copyrighted material outside their relationship with you.
-
-  Conveying under any other circumstances is permitted solely under
-the conditions stated below.  Sublicensing is not allowed; section 10
-makes it unnecessary.
-
-  3. Protecting Users' Legal Rights From Anti-Circumvention Law.
-
-  No covered work shall be deemed part of an effective technological
-measure under any applicable law fulfilling obligations under article
-11 of the WIPO copyright treaty adopted on 20 December 1996, or
-similar laws prohibiting or restricting circumvention of such
-measures.
-
-  When you convey a covered work, you waive any legal power to forbid
-circumvention of technological measures to the extent such circumvention
-is effected by exercising rights under this License with respect to
-the covered work, and you disclaim any intention to limit operation or
-modification of the work as a means of enforcing, against the work's
-users, your or third parties' legal rights to forbid circumvention of
-technological measures.
-
-  4. Conveying Verbatim Copies.
-
-  You may convey verbatim copies of the Program's source code as you
-receive it, in any medium, provided that you conspicuously and
-appropriately publish on each copy an appropriate copyright notice;
-keep intact all notices stating that this License and any
-non-permissive terms added in accord with section 7 apply to the code;
-keep intact all notices of the absence of any warranty; and give all
-recipients a copy of this License along with the Program.
-
-  You may charge any price or no price for each copy that you convey,
-and you may offer support or warranty protection for a fee.
-
-  5. Conveying Modified Source Versions.
-
-  You may convey a work based on the Program, or the modifications to
-produce it from the Program, in the form of source code under the
-terms of section 4, provided that you also meet all of these conditions:
-
-    a) The work must carry prominent notices stating that you modified
-    it, and giving a relevant date.
-
-    b) The work must carry prominent notices stating that it is
-    released under this License and any conditions added under section
-    7.  This requirement modifies the requirement in section 4 to
-    "keep intact all notices".
-
-    c) You must license the entire work, as a whole, under this
-    License to anyone who comes into possession of a copy.  This
-    License will therefore apply, along with any applicable section 7
-    additional terms, to the whole of the work, and all its parts,
-    regardless of how they are packaged.  This License gives no
-    permission to license the work in any other way, but it does not
-    invalidate such permission if you have separately received it.
-
-    d) If the work has interactive user interfaces, each must display
-    Appropriate Legal Notices; however, if the Program has interactive
-    interfaces that do not display Appropriate Legal Notices, your
-    work need not make them do so.
-
-  A compilation of a covered work with other separate and independent
-works, which are not by their nature extensions of the covered work,
-and which are not combined with it such as to form a larger program,
-in or on a volume of a storage or distribution medium, is called an
-"aggregate" if the compilation and its resulting copyright are not
-used to limit the access or legal rights of the compilation's users
-beyond what the individual works permit.  Inclusion of a covered work
-in an aggregate does not cause this License to apply to the other
-parts of the aggregate.
-
-  6. Conveying Non-Source Forms.
-
-  You may convey a covered work in object code form under the terms
-of sections 4 and 5, provided that you also convey the
-machine-readable Corresponding Source under the terms of this License,
-in one of these ways:
-
-    a) Convey the object code in, or embodied in, a physical product
-    (including a physical distribution medium), accompanied by the
-    Corresponding Source fixed on a durable physical medium
-    customarily used for software interchange.
-
-    b) Convey the object code in, or embodied in, a physical product
-    (including a physical distribution medium), accompanied by a
-    written offer, valid for at least three years and valid for as
-    long as you offer spare parts or customer support for that product
-    model, to give anyone who possesses the object code either (1) a
-    copy of the Corresponding Source for all the software in the
-    product that is covered by this License, on a durable physical
-    medium customarily used for software interchange, for a price no
-    more than your reasonable cost of physically performing this
-    conveying of source, or (2) access to copy the
-    Corresponding Source from a network server at no charge.
-
-    c) Convey individual copies of the object code with a copy of the
-    written offer to provide the Corresponding Source.  This
-    alternative is allowed only occasionally and noncommercially, and
-    only if you received the object code with such an offer, in accord
-    with subsection 6b.
-
-    d) Convey the object code by offering access from a designated
-    place (gratis or for a charge), and offer equivalent access to the
-    Corresponding Source in the same way through the same place at no
-    further charge.  You need not require recipients to copy the
-    Corresponding Source along with the object code.  If the place to
-    copy the object code is a network server, the Corresponding Source
-    may be on a different server (operated by you or a third party)
-    that supports equivalent copying facilities, provided you maintain
-    clear directions next to the object code saying where to find the
-    Corresponding Source.  Regardless of what server hosts the
-    Corresponding Source, you remain obligated to ensure that it is
-    available for as long as needed to satisfy these requirements.
-
-    e) Convey the object code using peer-to-peer transmission, provided
-    you inform other peers where the object code and Corresponding
-    Source of the work are being offered to the general public at no
-    charge under subsection 6d.
-
-  A separable portion of the object code, whose source code is excluded
-from the Corresponding Source as a System Library, need not be
-included in conveying the object code work.
-
-  A "User Product" is either (1) a "consumer product", which means any
-tangible personal property which is normally used for personal, family,
-or household purposes, or (2) anything designed or sold for incorporation
-into a dwelling.  In determining whether a product is a consumer product,
-doubtful cases shall be resolved in favor of coverage.  For a particular
-product received by a particular user, "normally used" refers to a
-typical or common use of that class of product, regardless of the status
-of the particular user or of the way in which the particular user
-actually uses, or expects or is expected to use, the product.  A product
-is a consumer product regardless of whether the product has substantial
-commercial, industrial or non-consumer uses, unless such uses represent
-the only significant mode of use of the product.
-
-  "Installation Information" for a User Product means any methods,
-procedures, authorization keys, or other information required to install
-and execute modified versions of a covered work in that User Product from
-a modified version of its Corresponding Source.  The information must
-suffice to ensure that the continued functioning of the modified object
-code is in no case prevented or interfered with solely because
-modification has been made.
-
-  If you convey an object code work under this section in, or with, or
-specifically for use in, a User Product, and the conveying occurs as
-part of a transaction in which the right of possession and use of the
-User Product is transferred to the recipient in perpetuity or for a
-fixed term (regardless of how the transaction is characterized), the
-Corresponding Source conveyed under this section must be accompanied
-by the Installation Information.  But this requirement does not apply
-if neither you nor any third party retains the ability to install
-modified object code on the User Product (for example, the work has
-been installed in ROM).
-
-  The requirement to provide Installation Information does not include a
-requirement to continue to provide support service, warranty, or updates
-for a work that has been modified or installed by the recipient, or for
-the User Product in which it has been modified or installed.  Access to a
-network may be denied when the modification itself materially and
-adversely affects the operation of the network or violates the rules and
-protocols for communication across the network.
-
-  Corresponding Source conveyed, and Installation Information provided,
-in accord with this section must be in a format that is publicly
-documented (and with an implementation available to the public in
-source code form), and must require no special password or key for
-unpacking, reading or copying.
-
-  7. Additional Terms.
-
-  "Additional permissions" are terms that supplement the terms of this
-License by making exceptions from one or more of its conditions.
-Additional permissions that are applicable to the entire Program shall
-be treated as though they were included in this License, to the extent
-that they are valid under applicable law.  If additional permissions
-apply only to part of the Program, that part may be used separately
-under those permissions, but the entire Program remains governed by
-this License without regard to the additional permissions.
-
-  When you convey a copy of a covered work, you may at your option
-remove any additional permissions from that copy, or from any part of
-it.  (Additional permissions may be written to require their own
-removal in certain cases when you modify the work.)  You may place
-additional permissions on material, added by you to a covered work,
-for which you have or can give appropriate copyright permission.
-
-  Notwithstanding any other provision of this License, for material you
-add to a covered work, you may (if authorized by the copyright holders of
-that material) supplement the terms of this License with terms:
-
-    a) Disclaiming warranty or limiting liability differently from the
-    terms of sections 15 and 16 of this License; or
-
-    b) Requiring preservation of specified reasonable legal notices or
-    author attributions in that material or in the Appropriate Legal
-    Notices displayed by works containing it; or
-
-    c) Prohibiting misrepresentation of the origin of that material, or
-    requiring that modified versions of such material be marked in
-    reasonable ways as different from the original version; or
-
-    d) Limiting the use for publicity purposes of names of licensors or
-    authors of the material; or
-
-    e) Declining to grant rights under trademark law for use of some
-    trade names, trademarks, or service marks; or
-
-    f) Requiring indemnification of licensors and authors of that
-    material by anyone who conveys the material (or modified versions of
-    it) with contractual assumptions of liability to the recipient, for
-    any liability that these contractual assumptions directly impose on
-    those licensors and authors.
-
-  All other non-permissive additional terms are considered "further
-restrictions" within the meaning of section 10.  If the Program as you
-received it, or any part of it, contains a notice stating that it is
-governed by this License along with a term that is a further
-restriction, you may remove that term.  If a license document contains
-a further restriction but permits relicensing or conveying under this
-License, you may add to a covered work material governed by the terms
-of that license document, provided that the further restriction does
-not survive such relicensing or conveying.
-
-  If you add terms to a covered work in accord with this section, you
-must place, in the relevant source files, a statement of the
-additional terms that apply to those files, or a notice indicating
-where to find the applicable terms.
-
-  Additional terms, permissive or non-permissive, may be stated in the
-form of a separately written license, or stated as exceptions;
-the above requirements apply either way.
-
-  8. Termination.
-
-  You may not propagate or modify a covered work except as expressly
-provided under this License.  Any attempt otherwise to propagate or
-modify it is void, and will automatically terminate your rights under
-this License (including any patent licenses granted under the third
-paragraph of section 11).
-
-  However, if you cease all violation of this License, then your
-license from a particular copyright holder is reinstated (a)
-provisionally, unless and until the copyright holder explicitly and
-finally terminates your license, and (b) permanently, if the copyright
-holder fails to notify you of the violation by some reasonable means
-prior to 60 days after the cessation.
-
-  Moreover, your license from a particular copyright holder is
-reinstated permanently if the copyright holder notifies you of the
-violation by some reasonable means, this is the first time you have
-received notice of violation of this License (for any work) from that
-copyright holder, and you cure the violation prior to 30 days after
-your receipt of the notice.
-
-  Termination of your rights under this section does not terminate the
-licenses of parties who have received copies or rights from you under
-this License.  If your rights have been terminated and not permanently
-reinstated, you do not qualify to receive new licenses for the same
-material under section 10.
-
-  9. Acceptance Not Required for Having Copies.
-
-  You are not required to accept this License in order to receive or
-run a copy of the Program.  Ancillary propagation of a covered work
-occurring solely as a consequence of using peer-to-peer transmission
-to receive a copy likewise does not require acceptance.  However,
-nothing other than this License grants you permission to propagate or
-modify any covered work.  These actions infringe copyright if you do
-not accept this License.  Therefore, by modifying or propagating a
-covered work, you indicate your acceptance of this License to do so.
-
-  10. Automatic Licensing of Downstream Recipients.
-
-  Each time you convey a covered work, the recipient automatically
-receives a license from the original licensors, to run, modify and
-propagate that work, subject to this License.  You are not responsible
-for enforcing compliance by third parties with this License.
-
-  An "entity transaction" is a transaction transferring control of an
-organization, or substantially all assets of one, or subdividing an
-organization, or merging organizations.  If propagation of a covered
-work results from an entity transaction, each party to that
-transaction who receives a copy of the work also receives whatever
-licenses to the work the party's predecessor in interest had or could
-give under the previous paragraph, plus a right to possession of the
-Corresponding Source of the work from the predecessor in interest, if
-the predecessor has it or can get it with reasonable efforts.
-
-  You may not impose any further restrictions on the exercise of the
-rights granted or affirmed under this License.  For example, you may
-not impose a license fee, royalty, or other charge for exercise of
-rights granted under this License, and you may not initiate litigation
-(including a cross-claim or counterclaim in a lawsuit) alleging that
-any patent claim is infringed by making, using, selling, offering for
-sale, or importing the Program or any portion of it.
-
-  11. Patents.
-
-  A "contributor" is a copyright holder who authorizes use under this
-License of the Program or a work on which the Program is based.  The
-work thus licensed is called the contributor's "contributor version".
-
-  A contributor's "essential patent claims" are all patent claims
-owned or controlled by the contributor, whether already acquired or
-hereafter acquired, that would be infringed by some manner, permitted
-by this License, of making, using, or selling its contributor version,
-but do not include claims that would be infringed only as a
-consequence of further modification of the contributor version.  For
-purposes of this definition, "control" includes the right to grant
-patent sublicenses in a manner consistent with the requirements of
-this License.
-
-  Each contributor grants you a non-exclusive, worldwide, royalty-free
-patent license under the contributor's essential patent claims, to
-make, use, sell, offer for sale, import and otherwise run, modify and
-propagate the contents of its contributor version.
-
-  In the following three paragraphs, a "patent license" is any express
-agreement or commitment, however denominated, not to enforce a patent
-(such as an express permission to practice a patent or covenant not to
-sue for patent infringement).  To "grant" such a patent license to a
-party means to make such an agreement or commitment not to enforce a
-patent against the party.
-
-  If you convey a covered work, knowingly relying on a patent license,
-and the Corresponding Source of the work is not available for anyone
-to copy, free of charge and under the terms of this License, through a
-publicly available network server or other readily accessible means,
-then you must either (1) cause the Corresponding Source to be so
-available, or (2) arrange to deprive yourself of the benefit of the
-patent license for this particular work, or (3) arrange, in a manner
-consistent with the requirements of this License, to extend the patent
-license to downstream recipients.  "Knowingly relying" means you have
-actual knowledge that, but for the patent license, your conveying the
-covered work in a country, or your recipient's use of the covered work
-in a country, would infringe one or more identifiable patents in that
-country that you have reason to believe are valid.
-
-  If, pursuant to or in connection with a single transaction or
-arrangement, you convey, or propagate by procuring conveyance of, a
-covered work, and grant a patent license to some of the parties
-receiving the covered work authorizing them to use, propagate, modify
-or convey a specific copy of the covered work, then the patent license
-you grant is automatically extended to all recipients of the covered
-work and works based on it.
-
-  A patent license is "discriminatory" if it does not include within
-the scope of its coverage, prohibits the exercise of, or is
-conditioned on the non-exercise of one or more of the rights that are
-specifically granted under this License.  You may not convey a covered
-work if you are a party to an arrangement with a third party that is
-in the business of distributing software, under which you make payment
-to the third party based on the extent of your activity of conveying
-the work, and under which the third party grants, to any of the
-parties who would receive the covered work from you, a discriminatory
-patent license (a) in connection with copies of the covered work
-conveyed by you (or copies made from those copies), or (b) primarily
-for and in connection with specific products or compilations that
-contain the covered work, unless you entered into that arrangement,
-or that patent license was granted, prior to 28 March 2007.
-
-  Nothing in this License shall be construed as excluding or limiting
-any implied license or other defenses to infringement that may
-otherwise be available to you under applicable patent law.
-
-  12. No Surrender of Others' Freedom.
-
-  If conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License.  If you cannot convey a
-covered work so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you may
-not convey it at all.  For example, if you agree to terms that obligate you
-to collect a royalty for further conveying from those to whom you convey
-the Program, the only way you could satisfy both those terms and this
-License would be to refrain entirely from conveying the Program.
-
-  13. Use with the GNU Affero General Public License.
-
-  Notwithstanding any other provision of this License, you have
-permission to link or combine any covered work with a work licensed
-under version 3 of the GNU Affero General Public License into a single
-combined work, and to convey the resulting work.  The terms of this
-License will continue to apply to the part which is the covered work,
-but the special requirements of the GNU Affero General Public License,
-section 13, concerning interaction through a network will apply to the
-combination as such.
-
-  14. Revised Versions of this License.
-
-  The Free Software Foundation may publish revised and/or new versions of
-the GNU General Public License from time to time.  Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-  Each version is given a distinguishing version number.  If the
-Program specifies that a certain numbered version of the GNU General
-Public License "or any later version" applies to it, you have the
-option of following the terms and conditions either of that numbered
-version or of any later version published by the Free Software
-Foundation.  If the Program does not specify a version number of the
-GNU General Public License, you may choose any version ever published
-by the Free Software Foundation.
-
-  If the Program specifies that a proxy can decide which future
-versions of the GNU General Public License can be used, that proxy's
-public statement of acceptance of a version permanently authorizes you
-to choose that version for the Program.
-
-  Later license versions may give you additional or different
-permissions.  However, no additional obligations are imposed on any
-author or copyright holder as a result of your choosing to follow a
-later version.
-
-  15. Disclaimer of Warranty.
-
-  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
-APPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
-HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
-OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
-THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
-IS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
-ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
-
-  16. Limitation of Liability.
-
-  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
-THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
-GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
-USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
-DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
-PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
-EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
-SUCH DAMAGES.
-
-  17. Interpretation of Sections 15 and 16.
-
-  If the disclaimer of warranty and limitation of liability provided
-above cannot be given local legal effect according to their terms,
-reviewing courts shall apply local law that most closely approximates
-an absolute waiver of all civil liability in connection with the
-Program, unless a warranty or assumption of liability accompanies a
-copy of the Program in return for a fee.
-
-                     END OF TERMS AND CONDITIONS
-
-            How to Apply These Terms to Your New Programs
-
-  If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
-  To do so, attach the following notices to the program.  It is safest
-to attach them to the start of each source file to most effectively
-state the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
-    <one line to give the program's name and a brief idea of what it does.>
-    Copyright (C) <year>  <name of author>
-
-    This program is free software: you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation, either version 3 of the License, or
-    (at your option) any later version.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with this program.  If not, see <https://www.gnu.org/licenses/>.
-
-Also add information on how to contact you by electronic and paper mail.
-
-  If the program does terminal interaction, make it output a short
-notice like this when it starts in an interactive mode:
-
-    <program>  Copyright (C) <year>  <name of author>
-    This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
-    This is free software, and you are welcome to redistribute it
-    under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License.  Of course, your program's commands
-might be different; for a GUI interface, you would use an "about box".
-
-  You should also get your employer (if you work as a programmer) or school,
-if any, to sign a "copyright disclaimer" for the program, if necessary.
-For more information on this, and how to apply and follow the GNU GPL, see
-<https://www.gnu.org/licenses/>.
-
-  The GNU General Public License does not permit incorporating your program
-into proprietary programs.  If your program is a subroutine library, you
-may consider it more useful to permit linking proprietary applications with
-the library.  If this is what you want to do, use the GNU Lesser General
-Public License instead of this License.  But first, please read
-<https://www.gnu.org/licenses/why-not-lgpl.html>.

+ 0 - 10
apps_broken_by_last_refactors/cli_bridge/application.fam

@@ -1,10 +0,0 @@
-App(
-    appid="cli_gui",
-    name="CLI-GUI Bridge",
-    apptype=FlipperAppType.EXTERNAL,
-    entry_point="cligui_main",
-    requires=["gui", "cli"],
-    stack_size=8 * 1024,
-    fap_icon="cligui.png",
-    fap_category="Tools",
-)

+ 0 - 104
apps_broken_by_last_refactors/cli_bridge/cli_control.c

@@ -1,104 +0,0 @@
-#include "cli_control.h"
-
-#include <cli/cli.h>
-#include <cli/cli_i.h>
-#include <cli/cli_vcp.h>
-#include "cligui_main_i.h"
-#include <FreeRTOS.h>
-
-volatile bool gotCallbackSet = false;
-
-FuriStreamBuffer* tx_stream;
-FuriStreamBuffer* rx_stream;
-static FuriThread* volatile cliThread = NULL;
-static void tx_handler_stdout(const char* buffer, size_t size) {
-    furi_stream_buffer_send(tx_stream, buffer, size, FuriWaitForever);
-}
-static void tx_handler(const uint8_t* buffer, size_t size) {
-    furi_thread_set_stdout_callback(tx_handler_stdout);
-    cliThread = furi_thread_get_current();
-    furi_stream_buffer_send(tx_stream, buffer, size, FuriWaitForever);
-}
-static size_t real_rx_handler(uint8_t* buffer, size_t size, uint32_t timeout) {
-    size_t rx_cnt = 0;
-    while(size > 0) {
-        size_t batch_size = size;
-        if(batch_size > 128) batch_size = 128;
-        size_t len = furi_stream_buffer_receive(rx_stream, buffer, batch_size, timeout);
-        if(len == 0) break;
-        size -= len;
-        buffer += len;
-        rx_cnt += len;
-    }
-    return rx_cnt;
-}
-
-static CliCommand_internal* getInternalCliCommand(Cli* cli, const char* name) {
-    FuriString* target_command = furi_string_alloc();
-    furi_string_set_str(target_command, name);
-    CliCommand_internal* command =
-        CliCommandTree_internal_get(((Cli_internal*)cli)->commands, target_command);
-    furi_string_free(target_command);
-    return command;
-}
-
-static void session_init(void) {
-}
-static void session_deinit(void) {
-}
-static bool session_connected(void) {
-    return true;
-}
-static CliSession session;
-void latch_tx_handler() {
-    Cli* global_cli = furi_record_open(RECORD_CLI);
-
-    CliCommand_internal* help_command = getInternalCliCommand(global_cli, "help");
-    cliThread = help_command->context;
-
-    furi_thread_set_stdout_callback(tx_handler_stdout);
-    if(cliThread != NULL) {
-        ((FuriThread_internal*)cliThread)->output.write_callback = &tx_handler_stdout;
-    }
-
-    rx_stream = furi_stream_buffer_alloc(128, 1);
-    tx_stream = furi_stream_buffer_alloc(128, 1);
-
-    session.tx = &tx_handler;
-    session.rx = &real_rx_handler;
-    session.tx_stdout = &tx_handler_stdout;
-    session.init = &session_init;
-    session.deinit = &session_deinit;
-    session.is_connected = &session_connected;
-    cli_session_close(global_cli);
-    cli_session_open(global_cli, &session);
-    furi_record_close(RECORD_CLI);
-}
-void unlatch_tx_handler(bool persist) {
-    Cli* global_cli = furi_record_open(RECORD_CLI);
-    // Stash cliThread if not null
-    if(cliThread != NULL) {
-        CliCommand_internal* help_command = getInternalCliCommand(global_cli, "help");
-        help_command->context = cliThread;
-    }
-    // Switch to new session
-    if(persist) {
-        // Use dummy debug firmware function as is_connected
-        cli_vcp.is_connected = &furi_hal_version_do_i_belong_here;
-    } else {
-        // Send CTRL-C
-        char eot = 0x03;
-        furi_stream_buffer_send(rx_stream, &eot, 1, FuriWaitForever);
-    }
-    cli_session_open(global_cli, &cli_vcp);
-    furi_record_close(RECORD_CLI);
-    // Unblock waiting rx handler
-    furi_stream_buffer_send(rx_stream, "_", 1, FuriWaitForever);
-    // Reconfigure stdout_callback to cli_vcp
-    if(cliThread != NULL) {
-        ((FuriThread_internal*)cliThread)->output.write_callback = cli_vcp.tx_stdout;
-    }
-    // At this point, all cli_vcp functions should be back.
-    furi_stream_buffer_free(rx_stream);
-    furi_stream_buffer_free(tx_stream);
-}

+ 0 - 8
apps_broken_by_last_refactors/cli_bridge/cli_control.h

@@ -1,8 +0,0 @@
-#pragma once
-
-#include <furi.h>
-#include <furi_hal.h>
-extern void latch_tx_handler();
-extern void unlatch_tx_handler(bool persist);
-extern FuriStreamBuffer* tx_stream;
-extern FuriStreamBuffer* rx_stream;

BIN
apps_broken_by_last_refactors/cli_bridge/cligui.png


+ 0 - 147
apps_broken_by_last_refactors/cli_bridge/cligui_main.c

@@ -1,147 +0,0 @@
-#include "cligui_main_i.h"
-#include "cli_control.h"
-#include "text_input.h"
-#include "console_output.h"
-#include <loader/loader_i.h>
-
-static bool cligui_custom_event_cb(void* context, uint32_t event) {
-    UNUSED(event);
-    CliguiApp* app = context;
-    UNUSED(app);
-    return true;
-}
-static bool cligui_back_event_cb(void* context) {
-    CliguiApp* app = context;
-    UNUSED(app);
-    return true;
-}
-static void cligui_tick_event_cb(void* context) {
-    CliguiApp* app = context;
-    size_t available = furi_stream_buffer_bytes_available(app->data->streams.app_rx);
-    for(size_t i = 0; i < available; i++) {
-        char c = 0;
-        size_t len = furi_stream_buffer_receive(app->data->streams.app_rx, &c, 1, 100);
-        if(len > 0) {
-            furi_string_push_back(app->text_box_store, c);
-        }
-    }
-    if(available > 0) {
-        text_box_set_text(app->text_box, furi_string_get_cstr(app->text_box_store));
-    }
-    // Set input header stuff
-    size_t len = furi_string_size(app->text_box_store);
-    size_t idx = len - 2;
-    while(idx > 0) {
-        if(furi_string_get_char(app->text_box_store, idx) == '\n') {
-            idx++;
-            break;
-        }
-        idx--;
-    }
-    text_input_set_header_text(app->text_input, furi_string_get_cstr(app->text_box_store) + idx);
-    UNUSED(app);
-}
-
-ViewPortInputCallback prev_input_callback;
-volatile bool persistent_exit = false;
-static void input_callback_wrapper(InputEvent* event, void* context) {
-    CliguiApp* app = context;
-    if(event->type == InputTypeLong && event->key == InputKeyBack) {
-        persistent_exit = false;
-        view_dispatcher_stop(app->view_dispatcher);
-    }
-    if(event->type == InputTypeLong && event->key == InputKeyOk) {
-        if(app->data->state == ViewConsoleOutput) {
-            persistent_exit = true;
-            view_dispatcher_stop(app->view_dispatcher);
-        }
-    }
-    if(app->data->state == ViewTextInput) {
-        text_input_input_handler(app, event);
-    } else {
-        console_output_input_handler(app, event);
-    }
-    prev_input_callback(event, app->view_dispatcher);
-}
-
-int32_t cligui_main(void* p) {
-    UNUSED(p);
-
-    // Unlock loader-lock and save app thread
-    FuriThread* temp_save_appthr;
-    Loader* loader = furi_record_open(RECORD_LOADER);
-    temp_save_appthr = loader->app.thread;
-    loader->app.thread = NULL;
-    furi_record_close(RECORD_LOADER);
-
-    CliguiApp* cligui = malloc(sizeof(CliguiApp));
-    cligui->data = malloc(sizeof(CliguiData));
-
-    latch_tx_handler();
-    cligui->data->streams.app_tx = rx_stream;
-    cligui->data->streams.app_rx = tx_stream;
-
-    cligui->gui = furi_record_open(RECORD_GUI);
-    cligui->view_dispatcher = view_dispatcher_alloc();
-    cligui->view_dispatcher_i = (ViewDispatcher_internal*)(cligui->view_dispatcher);
-    prev_input_callback =
-        ((ViewPort_internal*)cligui->view_dispatcher_i->view_port)->input_callback;
-    view_port_input_callback_set(
-        cligui->view_dispatcher_i->view_port, input_callback_wrapper, cligui);
-    view_dispatcher_enable_queue(cligui->view_dispatcher);
-    view_dispatcher_set_event_callback_context(cligui->view_dispatcher, cligui);
-    view_dispatcher_set_custom_event_callback(cligui->view_dispatcher, cligui_custom_event_cb);
-    view_dispatcher_set_navigation_event_callback(cligui->view_dispatcher, cligui_back_event_cb);
-    view_dispatcher_set_tick_event_callback(cligui->view_dispatcher, cligui_tick_event_cb, 100);
-
-    view_dispatcher_attach_to_gui(
-        cligui->view_dispatcher, cligui->gui, ViewDispatcherTypeFullscreen);
-
-    view_dispatcher_send_to_front(cligui->view_dispatcher);
-
-    cligui->text_box = text_box_alloc();
-    view_dispatcher_add_view(
-        cligui->view_dispatcher, ViewConsoleOutput, text_box_get_view(cligui->text_box));
-    cligui->text_box_store = furi_string_alloc();
-    furi_string_reserve(cligui->text_box_store, TEXT_BOX_STORE_SIZE);
-    furi_string_set_char(cligui->text_box_store, 0, 0);
-    text_box_set_text(cligui->text_box, furi_string_get_cstr(cligui->text_box_store));
-    text_box_set_focus(cligui->text_box, TextBoxFocusEnd);
-
-    cligui->text_input = text_input_alloc();
-    text_input_set_result_callback(
-        cligui->text_input,
-        text_input_result_callback,
-        cligui,
-        cligui->text_input_store,
-        TEXT_INPUT_STORE_SIZE,
-        true);
-    view_dispatcher_add_view(
-        cligui->view_dispatcher, ViewTextInput, text_input_get_view(cligui->text_input));
-
-    view_dispatcher_switch_to_view(cligui->view_dispatcher, ViewTextInput);
-    cligui->data->state = ViewTextInput;
-
-    view_dispatcher_run(cligui->view_dispatcher);
-
-    view_dispatcher_remove_view(cligui->view_dispatcher, ViewConsoleOutput);
-    view_dispatcher_remove_view(cligui->view_dispatcher, ViewTextInput);
-    text_box_free(cligui->text_box);
-    furi_string_free(cligui->text_box_store);
-    text_input_free(cligui->text_input);
-    view_dispatcher_free(cligui->view_dispatcher);
-
-    unlatch_tx_handler(persistent_exit);
-
-    furi_record_close(RECORD_GUI);
-
-    free(cligui->data);
-    free(cligui);
-
-    // We restoring previous app thread here, we love kostily and velosipedy, bydlo kod forever!
-    loader = furi_record_open(RECORD_LOADER);
-    loader->app.thread = temp_save_appthr;
-    furi_record_close(RECORD_LOADER);
-
-    return 0;
-}

+ 0 - 41
apps_broken_by_last_refactors/cli_bridge/cligui_main_i.h

@@ -1,41 +0,0 @@
-#pragma once
-
-#include <furi.h>
-#include <furi_hal.h>
-#include <furi_hal_version.h>
-#include <furi_hal_usb_cdc.h>
-#include <furi_hal_usb.h>
-#include <gui/gui.h>
-#include <gui/view_dispatcher.h>
-#include <gui/modules/text_box.h>
-#include <gui/modules/text_input.h>
-#include <m-dict.h>
-#include <loader/loader.h>
-#include "internal_defs.h"
-
-#define TEXT_BOX_STORE_SIZE (4096)
-#define TEXT_INPUT_STORE_SIZE (512)
-
-typedef enum {
-    ViewTextInput,
-    ViewConsoleOutput,
-} CliguiState;
-
-typedef struct {
-    CliguiState state;
-    struct {
-        FuriStreamBuffer* app_tx;
-        FuriStreamBuffer* app_rx;
-    } streams;
-} CliguiData;
-
-typedef struct {
-    CliguiData* data;
-    Gui* gui;
-    TextBox* text_box;
-    FuriString* text_box_store;
-    char text_input_store[TEXT_INPUT_STORE_SIZE + 1];
-    TextInput* text_input;
-    ViewDispatcher* view_dispatcher;
-    ViewDispatcher_internal* view_dispatcher_i;
-} CliguiApp;

+ 0 - 12
apps_broken_by_last_refactors/cli_bridge/console_output.c

@@ -1,12 +0,0 @@
-#include "console_output.h"
-
-void console_output_input_handler(CliguiApp* app, InputEvent* event) {
-    if(event->type == InputTypeShort && (event->key == InputKeyOk || event->key == InputKeyLeft)) {
-        view_dispatcher_switch_to_view(app->view_dispatcher, ViewTextInput);
-        app->data->state = ViewTextInput;
-    }
-    if(event->type == InputTypeShort && event->key == InputKeyBack) {
-        char eot = 0x03;
-        furi_stream_buffer_send(app->data->streams.app_tx, &eot, 1, FuriWaitForever);
-    }
-}

+ 0 - 4
apps_broken_by_last_refactors/cli_bridge/console_output.h

@@ -1,4 +0,0 @@
-#pragma once
-#include "cligui_main_i.h"
-
-extern void console_output_input_handler(CliguiApp*, InputEvent*);

+ 0 - 101
apps_broken_by_last_refactors/cli_bridge/internal_defs.h

@@ -1,101 +0,0 @@
-#pragma once
-#include <furi.h>
-#include <furi_hal.h>
-#include <m-dict.h>
-#include <m-bptree.h>
-#include <m-array.h>
-#include <cli/cli.h>
-#include <gui/gui.h>
-#include <gui/view_dispatcher.h>
-#include <gui/modules/menu.h>
-#include <gui/modules/submenu.h>
-
-typedef struct {
-    FuriThreadStdoutWriteCallback write_callback;
-    FuriString* buffer;
-} FuriThreadStdout_internal;
-
-typedef struct {
-    bool is_service;
-    FuriThreadState state;
-    int32_t ret;
-
-    FuriThreadCallback callback;
-    void* context;
-
-    FuriThreadStateCallback state_callback;
-    void* state_context;
-
-    char* name;
-    configSTACK_DEPTH_TYPE stack_size;
-    FuriThreadPriority priority;
-
-    TaskHandle_t task_handle;
-    bool heap_trace_enabled;
-    size_t heap_size;
-
-    FuriThreadStdout_internal output;
-} FuriThread_internal;
-
-DICT_DEF2(ViewDict, uint32_t, M_DEFAULT_OPLIST, View*, M_PTR_OPLIST)
-typedef struct {
-    FuriMessageQueue* queue;
-    Gui* gui;
-    ViewPort* view_port;
-    ViewDict_t views;
-
-    View* current_view;
-
-    View* ongoing_input_view;
-    uint8_t ongoing_input;
-
-    ViewDispatcherCustomEventCallback custom_event_callback;
-    ViewDispatcherNavigationEventCallback navigation_event_callback;
-    ViewDispatcherTickEventCallback tick_event_callback;
-    uint32_t tick_period;
-    void* event_context;
-} ViewDispatcher_internal;
-
-typedef struct {
-    Gui* gui;
-    FuriMutex* mutex;
-    bool is_enabled;
-    ViewPortOrientation orientation;
-
-    uint8_t width;
-    uint8_t height;
-
-    ViewPortDrawCallback draw_callback;
-    void* draw_callback_context;
-
-    ViewPortInputCallback input_callback;
-    void* input_callback_context;
-} ViewPort_internal;
-
-typedef struct {
-    CliCallback callback;
-    void* context;
-    uint32_t flags;
-} CliCommand_internal;
-
-#define CLI_COMMANDS_TREE_RANK 4
-BPTREE_DEF2(
-    CliCommandTree_internal,
-    CLI_COMMANDS_TREE_RANK,
-    FuriString*,
-    FURI_STRING_OPLIST,
-    CliCommand_internal,
-    M_POD_OPLIST)
-
-#define M_OPL_CliCommandTree_internal_t() BPTREE_OPLIST(CliCommandTree_internal, M_POD_OPLIST)
-
-typedef struct {
-    CliCommandTree_internal_t commands;
-    void* mutex;
-    void* idle_sem;
-    void* last_line;
-    void* line;
-    void* session;
-
-    size_t cursor_position;
-} Cli_internal;

+ 0 - 34
apps_broken_by_last_refactors/cli_bridge/text_input.c

@@ -1,34 +0,0 @@
-#include "text_input.h"
-#include "cligui_main_i.h"
-
-void text_input_result_callback(void* ctx) {
-    CliguiApp* app = ctx;
-    char* data = app->text_input_store;
-    size_t len = strlen(data);
-    for(size_t i = 0; i < len; i++) {
-        if(data[i] >= 0x41 && data[i] <= 0x5A) {
-            // Char is uppercase
-            data[i] += 0x20;
-        }
-    }
-    furi_stream_buffer_send(app->data->streams.app_tx, data, len, FuriWaitForever);
-    furi_stream_buffer_send(app->data->streams.app_tx, "\r\n", 2, FuriWaitForever);
-    data[0] = 0;
-    view_dispatcher_switch_to_view(app->view_dispatcher, ViewConsoleOutput);
-    app->data->state = ViewConsoleOutput;
-}
-
-void text_input_input_handler(CliguiApp* app, InputEvent* event) {
-    if(event->type == InputTypeShort && event->key == InputKeyBack) {
-        // view_dispatcher_switch_to_view(app->view_dispatcher, ViewConsoleOutput);
-        // app->data->state = ViewConsoleOutput;
-        size_t len = strlen(app->text_input_store);
-        app->text_input_store[len] = ' ';
-        app->text_input_store[len + 1] = 0;
-    }
-    if(event->type == InputTypeLong &&
-       (event->key == InputKeyLeft || event->key == InputKeyRight)) {
-        view_dispatcher_switch_to_view(app->view_dispatcher, ViewConsoleOutput);
-        app->data->state = ViewConsoleOutput;
-    }
-}

+ 0 - 5
apps_broken_by_last_refactors/cli_bridge/text_input.h

@@ -1,5 +0,0 @@
-#pragma once
-#include "cligui_main_i.h"
-
-extern void text_input_result_callback(void* ctx);
-extern void text_input_input_handler(CliguiApp*, InputEvent*);

+ 0 - 3
apps_broken_by_last_refactors/esubghz_chat/.gitignore

@@ -1,3 +0,0 @@
-*~
-*.swp
-*.swo

+ 0 - 674
apps_broken_by_last_refactors/esubghz_chat/LICENSE

@@ -1,674 +0,0 @@
-                    GNU GENERAL PUBLIC LICENSE
-                       Version 3, 29 June 2007
-
- Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
-                            Preamble
-
-  The GNU General Public License is a free, copyleft license for
-software and other kinds of works.
-
-  The licenses for most software and other practical works are designed
-to take away your freedom to share and change the works.  By contrast,
-the GNU General Public License is intended to guarantee your freedom to
-share and change all versions of a program--to make sure it remains free
-software for all its users.  We, the Free Software Foundation, use the
-GNU General Public License for most of our software; it applies also to
-any other work released this way by its authors.  You can apply it to
-your programs, too.
-
-  When we speak of free software, we are referring to freedom, not
-price.  Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-them if you wish), that you receive source code or can get it if you
-want it, that you can change the software or use pieces of it in new
-free programs, and that you know you can do these things.
-
-  To protect your rights, we need to prevent others from denying you
-these rights or asking you to surrender the rights.  Therefore, you have
-certain responsibilities if you distribute copies of the software, or if
-you modify it: responsibilities to respect the freedom of others.
-
-  For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must pass on to the recipients the same
-freedoms that you received.  You must make sure that they, too, receive
-or can get the source code.  And you must show them these terms so they
-know their rights.
-
-  Developers that use the GNU GPL protect your rights with two steps:
-(1) assert copyright on the software, and (2) offer you this License
-giving you legal permission to copy, distribute and/or modify it.
-
-  For the developers' and authors' protection, the GPL clearly explains
-that there is no warranty for this free software.  For both users' and
-authors' sake, the GPL requires that modified versions be marked as
-changed, so that their problems will not be attributed erroneously to
-authors of previous versions.
-
-  Some devices are designed to deny users access to install or run
-modified versions of the software inside them, although the manufacturer
-can do so.  This is fundamentally incompatible with the aim of
-protecting users' freedom to change the software.  The systematic
-pattern of such abuse occurs in the area of products for individuals to
-use, which is precisely where it is most unacceptable.  Therefore, we
-have designed this version of the GPL to prohibit the practice for those
-products.  If such problems arise substantially in other domains, we
-stand ready to extend this provision to those domains in future versions
-of the GPL, as needed to protect the freedom of users.
-
-  Finally, every program is threatened constantly by software patents.
-States should not allow patents to restrict development and use of
-software on general-purpose computers, but in those that do, we wish to
-avoid the special danger that patents applied to a free program could
-make it effectively proprietary.  To prevent this, the GPL assures that
-patents cannot be used to render the program non-free.
-
-  The precise terms and conditions for copying, distribution and
-modification follow.
-
-                       TERMS AND CONDITIONS
-
-  0. Definitions.
-
-  "This License" refers to version 3 of the GNU General Public License.
-
-  "Copyright" also means copyright-like laws that apply to other kinds of
-works, such as semiconductor masks.
-
-  "The Program" refers to any copyrightable work licensed under this
-License.  Each licensee is addressed as "you".  "Licensees" and
-"recipients" may be individuals or organizations.
-
-  To "modify" a work means to copy from or adapt all or part of the work
-in a fashion requiring copyright permission, other than the making of an
-exact copy.  The resulting work is called a "modified version" of the
-earlier work or a work "based on" the earlier work.
-
-  A "covered work" means either the unmodified Program or a work based
-on the Program.
-
-  To "propagate" a work means to do anything with it that, without
-permission, would make you directly or secondarily liable for
-infringement under applicable copyright law, except executing it on a
-computer or modifying a private copy.  Propagation includes copying,
-distribution (with or without modification), making available to the
-public, and in some countries other activities as well.
-
-  To "convey" a work means any kind of propagation that enables other
-parties to make or receive copies.  Mere interaction with a user through
-a computer network, with no transfer of a copy, is not conveying.
-
-  An interactive user interface displays "Appropriate Legal Notices"
-to the extent that it includes a convenient and prominently visible
-feature that (1) displays an appropriate copyright notice, and (2)
-tells the user that there is no warranty for the work (except to the
-extent that warranties are provided), that licensees may convey the
-work under this License, and how to view a copy of this License.  If
-the interface presents a list of user commands or options, such as a
-menu, a prominent item in the list meets this criterion.
-
-  1. Source Code.
-
-  The "source code" for a work means the preferred form of the work
-for making modifications to it.  "Object code" means any non-source
-form of a work.
-
-  A "Standard Interface" means an interface that either is an official
-standard defined by a recognized standards body, or, in the case of
-interfaces specified for a particular programming language, one that
-is widely used among developers working in that language.
-
-  The "System Libraries" of an executable work include anything, other
-than the work as a whole, that (a) is included in the normal form of
-packaging a Major Component, but which is not part of that Major
-Component, and (b) serves only to enable use of the work with that
-Major Component, or to implement a Standard Interface for which an
-implementation is available to the public in source code form.  A
-"Major Component", in this context, means a major essential component
-(kernel, window system, and so on) of the specific operating system
-(if any) on which the executable work runs, or a compiler used to
-produce the work, or an object code interpreter used to run it.
-
-  The "Corresponding Source" for a work in object code form means all
-the source code needed to generate, install, and (for an executable
-work) run the object code and to modify the work, including scripts to
-control those activities.  However, it does not include the work's
-System Libraries, or general-purpose tools or generally available free
-programs which are used unmodified in performing those activities but
-which are not part of the work.  For example, Corresponding Source
-includes interface definition files associated with source files for
-the work, and the source code for shared libraries and dynamically
-linked subprograms that the work is specifically designed to require,
-such as by intimate data communication or control flow between those
-subprograms and other parts of the work.
-
-  The Corresponding Source need not include anything that users
-can regenerate automatically from other parts of the Corresponding
-Source.
-
-  The Corresponding Source for a work in source code form is that
-same work.
-
-  2. Basic Permissions.
-
-  All rights granted under this License are granted for the term of
-copyright on the Program, and are irrevocable provided the stated
-conditions are met.  This License explicitly affirms your unlimited
-permission to run the unmodified Program.  The output from running a
-covered work is covered by this License only if the output, given its
-content, constitutes a covered work.  This License acknowledges your
-rights of fair use or other equivalent, as provided by copyright law.
-
-  You may make, run and propagate covered works that you do not
-convey, without conditions so long as your license otherwise remains
-in force.  You may convey covered works to others for the sole purpose
-of having them make modifications exclusively for you, or provide you
-with facilities for running those works, provided that you comply with
-the terms of this License in conveying all material for which you do
-not control copyright.  Those thus making or running the covered works
-for you must do so exclusively on your behalf, under your direction
-and control, on terms that prohibit them from making any copies of
-your copyrighted material outside their relationship with you.
-
-  Conveying under any other circumstances is permitted solely under
-the conditions stated below.  Sublicensing is not allowed; section 10
-makes it unnecessary.
-
-  3. Protecting Users' Legal Rights From Anti-Circumvention Law.
-
-  No covered work shall be deemed part of an effective technological
-measure under any applicable law fulfilling obligations under article
-11 of the WIPO copyright treaty adopted on 20 December 1996, or
-similar laws prohibiting or restricting circumvention of such
-measures.
-
-  When you convey a covered work, you waive any legal power to forbid
-circumvention of technological measures to the extent such circumvention
-is effected by exercising rights under this License with respect to
-the covered work, and you disclaim any intention to limit operation or
-modification of the work as a means of enforcing, against the work's
-users, your or third parties' legal rights to forbid circumvention of
-technological measures.
-
-  4. Conveying Verbatim Copies.
-
-  You may convey verbatim copies of the Program's source code as you
-receive it, in any medium, provided that you conspicuously and
-appropriately publish on each copy an appropriate copyright notice;
-keep intact all notices stating that this License and any
-non-permissive terms added in accord with section 7 apply to the code;
-keep intact all notices of the absence of any warranty; and give all
-recipients a copy of this License along with the Program.
-
-  You may charge any price or no price for each copy that you convey,
-and you may offer support or warranty protection for a fee.
-
-  5. Conveying Modified Source Versions.
-
-  You may convey a work based on the Program, or the modifications to
-produce it from the Program, in the form of source code under the
-terms of section 4, provided that you also meet all of these conditions:
-
-    a) The work must carry prominent notices stating that you modified
-    it, and giving a relevant date.
-
-    b) The work must carry prominent notices stating that it is
-    released under this License and any conditions added under section
-    7.  This requirement modifies the requirement in section 4 to
-    "keep intact all notices".
-
-    c) You must license the entire work, as a whole, under this
-    License to anyone who comes into possession of a copy.  This
-    License will therefore apply, along with any applicable section 7
-    additional terms, to the whole of the work, and all its parts,
-    regardless of how they are packaged.  This License gives no
-    permission to license the work in any other way, but it does not
-    invalidate such permission if you have separately received it.
-
-    d) If the work has interactive user interfaces, each must display
-    Appropriate Legal Notices; however, if the Program has interactive
-    interfaces that do not display Appropriate Legal Notices, your
-    work need not make them do so.
-
-  A compilation of a covered work with other separate and independent
-works, which are not by their nature extensions of the covered work,
-and which are not combined with it such as to form a larger program,
-in or on a volume of a storage or distribution medium, is called an
-"aggregate" if the compilation and its resulting copyright are not
-used to limit the access or legal rights of the compilation's users
-beyond what the individual works permit.  Inclusion of a covered work
-in an aggregate does not cause this License to apply to the other
-parts of the aggregate.
-
-  6. Conveying Non-Source Forms.
-
-  You may convey a covered work in object code form under the terms
-of sections 4 and 5, provided that you also convey the
-machine-readable Corresponding Source under the terms of this License,
-in one of these ways:
-
-    a) Convey the object code in, or embodied in, a physical product
-    (including a physical distribution medium), accompanied by the
-    Corresponding Source fixed on a durable physical medium
-    customarily used for software interchange.
-
-    b) Convey the object code in, or embodied in, a physical product
-    (including a physical distribution medium), accompanied by a
-    written offer, valid for at least three years and valid for as
-    long as you offer spare parts or customer support for that product
-    model, to give anyone who possesses the object code either (1) a
-    copy of the Corresponding Source for all the software in the
-    product that is covered by this License, on a durable physical
-    medium customarily used for software interchange, for a price no
-    more than your reasonable cost of physically performing this
-    conveying of source, or (2) access to copy the
-    Corresponding Source from a network server at no charge.
-
-    c) Convey individual copies of the object code with a copy of the
-    written offer to provide the Corresponding Source.  This
-    alternative is allowed only occasionally and noncommercially, and
-    only if you received the object code with such an offer, in accord
-    with subsection 6b.
-
-    d) Convey the object code by offering access from a designated
-    place (gratis or for a charge), and offer equivalent access to the
-    Corresponding Source in the same way through the same place at no
-    further charge.  You need not require recipients to copy the
-    Corresponding Source along with the object code.  If the place to
-    copy the object code is a network server, the Corresponding Source
-    may be on a different server (operated by you or a third party)
-    that supports equivalent copying facilities, provided you maintain
-    clear directions next to the object code saying where to find the
-    Corresponding Source.  Regardless of what server hosts the
-    Corresponding Source, you remain obligated to ensure that it is
-    available for as long as needed to satisfy these requirements.
-
-    e) Convey the object code using peer-to-peer transmission, provided
-    you inform other peers where the object code and Corresponding
-    Source of the work are being offered to the general public at no
-    charge under subsection 6d.
-
-  A separable portion of the object code, whose source code is excluded
-from the Corresponding Source as a System Library, need not be
-included in conveying the object code work.
-
-  A "User Product" is either (1) a "consumer product", which means any
-tangible personal property which is normally used for personal, family,
-or household purposes, or (2) anything designed or sold for incorporation
-into a dwelling.  In determining whether a product is a consumer product,
-doubtful cases shall be resolved in favor of coverage.  For a particular
-product received by a particular user, "normally used" refers to a
-typical or common use of that class of product, regardless of the status
-of the particular user or of the way in which the particular user
-actually uses, or expects or is expected to use, the product.  A product
-is a consumer product regardless of whether the product has substantial
-commercial, industrial or non-consumer uses, unless such uses represent
-the only significant mode of use of the product.
-
-  "Installation Information" for a User Product means any methods,
-procedures, authorization keys, or other information required to install
-and execute modified versions of a covered work in that User Product from
-a modified version of its Corresponding Source.  The information must
-suffice to ensure that the continued functioning of the modified object
-code is in no case prevented or interfered with solely because
-modification has been made.
-
-  If you convey an object code work under this section in, or with, or
-specifically for use in, a User Product, and the conveying occurs as
-part of a transaction in which the right of possession and use of the
-User Product is transferred to the recipient in perpetuity or for a
-fixed term (regardless of how the transaction is characterized), the
-Corresponding Source conveyed under this section must be accompanied
-by the Installation Information.  But this requirement does not apply
-if neither you nor any third party retains the ability to install
-modified object code on the User Product (for example, the work has
-been installed in ROM).
-
-  The requirement to provide Installation Information does not include a
-requirement to continue to provide support service, warranty, or updates
-for a work that has been modified or installed by the recipient, or for
-the User Product in which it has been modified or installed.  Access to a
-network may be denied when the modification itself materially and
-adversely affects the operation of the network or violates the rules and
-protocols for communication across the network.
-
-  Corresponding Source conveyed, and Installation Information provided,
-in accord with this section must be in a format that is publicly
-documented (and with an implementation available to the public in
-source code form), and must require no special password or key for
-unpacking, reading or copying.
-
-  7. Additional Terms.
-
-  "Additional permissions" are terms that supplement the terms of this
-License by making exceptions from one or more of its conditions.
-Additional permissions that are applicable to the entire Program shall
-be treated as though they were included in this License, to the extent
-that they are valid under applicable law.  If additional permissions
-apply only to part of the Program, that part may be used separately
-under those permissions, but the entire Program remains governed by
-this License without regard to the additional permissions.
-
-  When you convey a copy of a covered work, you may at your option
-remove any additional permissions from that copy, or from any part of
-it.  (Additional permissions may be written to require their own
-removal in certain cases when you modify the work.)  You may place
-additional permissions on material, added by you to a covered work,
-for which you have or can give appropriate copyright permission.
-
-  Notwithstanding any other provision of this License, for material you
-add to a covered work, you may (if authorized by the copyright holders of
-that material) supplement the terms of this License with terms:
-
-    a) Disclaiming warranty or limiting liability differently from the
-    terms of sections 15 and 16 of this License; or
-
-    b) Requiring preservation of specified reasonable legal notices or
-    author attributions in that material or in the Appropriate Legal
-    Notices displayed by works containing it; or
-
-    c) Prohibiting misrepresentation of the origin of that material, or
-    requiring that modified versions of such material be marked in
-    reasonable ways as different from the original version; or
-
-    d) Limiting the use for publicity purposes of names of licensors or
-    authors of the material; or
-
-    e) Declining to grant rights under trademark law for use of some
-    trade names, trademarks, or service marks; or
-
-    f) Requiring indemnification of licensors and authors of that
-    material by anyone who conveys the material (or modified versions of
-    it) with contractual assumptions of liability to the recipient, for
-    any liability that these contractual assumptions directly impose on
-    those licensors and authors.
-
-  All other non-permissive additional terms are considered "further
-restrictions" within the meaning of section 10.  If the Program as you
-received it, or any part of it, contains a notice stating that it is
-governed by this License along with a term that is a further
-restriction, you may remove that term.  If a license document contains
-a further restriction but permits relicensing or conveying under this
-License, you may add to a covered work material governed by the terms
-of that license document, provided that the further restriction does
-not survive such relicensing or conveying.
-
-  If you add terms to a covered work in accord with this section, you
-must place, in the relevant source files, a statement of the
-additional terms that apply to those files, or a notice indicating
-where to find the applicable terms.
-
-  Additional terms, permissive or non-permissive, may be stated in the
-form of a separately written license, or stated as exceptions;
-the above requirements apply either way.
-
-  8. Termination.
-
-  You may not propagate or modify a covered work except as expressly
-provided under this License.  Any attempt otherwise to propagate or
-modify it is void, and will automatically terminate your rights under
-this License (including any patent licenses granted under the third
-paragraph of section 11).
-
-  However, if you cease all violation of this License, then your
-license from a particular copyright holder is reinstated (a)
-provisionally, unless and until the copyright holder explicitly and
-finally terminates your license, and (b) permanently, if the copyright
-holder fails to notify you of the violation by some reasonable means
-prior to 60 days after the cessation.
-
-  Moreover, your license from a particular copyright holder is
-reinstated permanently if the copyright holder notifies you of the
-violation by some reasonable means, this is the first time you have
-received notice of violation of this License (for any work) from that
-copyright holder, and you cure the violation prior to 30 days after
-your receipt of the notice.
-
-  Termination of your rights under this section does not terminate the
-licenses of parties who have received copies or rights from you under
-this License.  If your rights have been terminated and not permanently
-reinstated, you do not qualify to receive new licenses for the same
-material under section 10.
-
-  9. Acceptance Not Required for Having Copies.
-
-  You are not required to accept this License in order to receive or
-run a copy of the Program.  Ancillary propagation of a covered work
-occurring solely as a consequence of using peer-to-peer transmission
-to receive a copy likewise does not require acceptance.  However,
-nothing other than this License grants you permission to propagate or
-modify any covered work.  These actions infringe copyright if you do
-not accept this License.  Therefore, by modifying or propagating a
-covered work, you indicate your acceptance of this License to do so.
-
-  10. Automatic Licensing of Downstream Recipients.
-
-  Each time you convey a covered work, the recipient automatically
-receives a license from the original licensors, to run, modify and
-propagate that work, subject to this License.  You are not responsible
-for enforcing compliance by third parties with this License.
-
-  An "entity transaction" is a transaction transferring control of an
-organization, or substantially all assets of one, or subdividing an
-organization, or merging organizations.  If propagation of a covered
-work results from an entity transaction, each party to that
-transaction who receives a copy of the work also receives whatever
-licenses to the work the party's predecessor in interest had or could
-give under the previous paragraph, plus a right to possession of the
-Corresponding Source of the work from the predecessor in interest, if
-the predecessor has it or can get it with reasonable efforts.
-
-  You may not impose any further restrictions on the exercise of the
-rights granted or affirmed under this License.  For example, you may
-not impose a license fee, royalty, or other charge for exercise of
-rights granted under this License, and you may not initiate litigation
-(including a cross-claim or counterclaim in a lawsuit) alleging that
-any patent claim is infringed by making, using, selling, offering for
-sale, or importing the Program or any portion of it.
-
-  11. Patents.
-
-  A "contributor" is a copyright holder who authorizes use under this
-License of the Program or a work on which the Program is based.  The
-work thus licensed is called the contributor's "contributor version".
-
-  A contributor's "essential patent claims" are all patent claims
-owned or controlled by the contributor, whether already acquired or
-hereafter acquired, that would be infringed by some manner, permitted
-by this License, of making, using, or selling its contributor version,
-but do not include claims that would be infringed only as a
-consequence of further modification of the contributor version.  For
-purposes of this definition, "control" includes the right to grant
-patent sublicenses in a manner consistent with the requirements of
-this License.
-
-  Each contributor grants you a non-exclusive, worldwide, royalty-free
-patent license under the contributor's essential patent claims, to
-make, use, sell, offer for sale, import and otherwise run, modify and
-propagate the contents of its contributor version.
-
-  In the following three paragraphs, a "patent license" is any express
-agreement or commitment, however denominated, not to enforce a patent
-(such as an express permission to practice a patent or covenant not to
-sue for patent infringement).  To "grant" such a patent license to a
-party means to make such an agreement or commitment not to enforce a
-patent against the party.
-
-  If you convey a covered work, knowingly relying on a patent license,
-and the Corresponding Source of the work is not available for anyone
-to copy, free of charge and under the terms of this License, through a
-publicly available network server or other readily accessible means,
-then you must either (1) cause the Corresponding Source to be so
-available, or (2) arrange to deprive yourself of the benefit of the
-patent license for this particular work, or (3) arrange, in a manner
-consistent with the requirements of this License, to extend the patent
-license to downstream recipients.  "Knowingly relying" means you have
-actual knowledge that, but for the patent license, your conveying the
-covered work in a country, or your recipient's use of the covered work
-in a country, would infringe one or more identifiable patents in that
-country that you have reason to believe are valid.
-
-  If, pursuant to or in connection with a single transaction or
-arrangement, you convey, or propagate by procuring conveyance of, a
-covered work, and grant a patent license to some of the parties
-receiving the covered work authorizing them to use, propagate, modify
-or convey a specific copy of the covered work, then the patent license
-you grant is automatically extended to all recipients of the covered
-work and works based on it.
-
-  A patent license is "discriminatory" if it does not include within
-the scope of its coverage, prohibits the exercise of, or is
-conditioned on the non-exercise of one or more of the rights that are
-specifically granted under this License.  You may not convey a covered
-work if you are a party to an arrangement with a third party that is
-in the business of distributing software, under which you make payment
-to the third party based on the extent of your activity of conveying
-the work, and under which the third party grants, to any of the
-parties who would receive the covered work from you, a discriminatory
-patent license (a) in connection with copies of the covered work
-conveyed by you (or copies made from those copies), or (b) primarily
-for and in connection with specific products or compilations that
-contain the covered work, unless you entered into that arrangement,
-or that patent license was granted, prior to 28 March 2007.
-
-  Nothing in this License shall be construed as excluding or limiting
-any implied license or other defenses to infringement that may
-otherwise be available to you under applicable patent law.
-
-  12. No Surrender of Others' Freedom.
-
-  If conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License.  If you cannot convey a
-covered work so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you may
-not convey it at all.  For example, if you agree to terms that obligate you
-to collect a royalty for further conveying from those to whom you convey
-the Program, the only way you could satisfy both those terms and this
-License would be to refrain entirely from conveying the Program.
-
-  13. Use with the GNU Affero General Public License.
-
-  Notwithstanding any other provision of this License, you have
-permission to link or combine any covered work with a work licensed
-under version 3 of the GNU Affero General Public License into a single
-combined work, and to convey the resulting work.  The terms of this
-License will continue to apply to the part which is the covered work,
-but the special requirements of the GNU Affero General Public License,
-section 13, concerning interaction through a network will apply to the
-combination as such.
-
-  14. Revised Versions of this License.
-
-  The Free Software Foundation may publish revised and/or new versions of
-the GNU General Public License from time to time.  Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-  Each version is given a distinguishing version number.  If the
-Program specifies that a certain numbered version of the GNU General
-Public License "or any later version" applies to it, you have the
-option of following the terms and conditions either of that numbered
-version or of any later version published by the Free Software
-Foundation.  If the Program does not specify a version number of the
-GNU General Public License, you may choose any version ever published
-by the Free Software Foundation.
-
-  If the Program specifies that a proxy can decide which future
-versions of the GNU General Public License can be used, that proxy's
-public statement of acceptance of a version permanently authorizes you
-to choose that version for the Program.
-
-  Later license versions may give you additional or different
-permissions.  However, no additional obligations are imposed on any
-author or copyright holder as a result of your choosing to follow a
-later version.
-
-  15. Disclaimer of Warranty.
-
-  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
-APPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
-HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
-OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
-THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
-IS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
-ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
-
-  16. Limitation of Liability.
-
-  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
-THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
-GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
-USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
-DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
-PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
-EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
-SUCH DAMAGES.
-
-  17. Interpretation of Sections 15 and 16.
-
-  If the disclaimer of warranty and limitation of liability provided
-above cannot be given local legal effect according to their terms,
-reviewing courts shall apply local law that most closely approximates
-an absolute waiver of all civil liability in connection with the
-Program, unless a warranty or assumption of liability accompanies a
-copy of the Program in return for a fee.
-
-                     END OF TERMS AND CONDITIONS
-
-            How to Apply These Terms to Your New Programs
-
-  If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
-  To do so, attach the following notices to the program.  It is safest
-to attach them to the start of each source file to most effectively
-state the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
-    <one line to give the program's name and a brief idea of what it does.>
-    Copyright (C) <year>  <name of author>
-
-    This program is free software: you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation, either version 3 of the License, or
-    (at your option) any later version.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with this program.  If not, see <https://www.gnu.org/licenses/>.
-
-Also add information on how to contact you by electronic and paper mail.
-
-  If the program does terminal interaction, make it output a short
-notice like this when it starts in an interactive mode:
-
-    <program>  Copyright (C) <year>  <name of author>
-    This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
-    This is free software, and you are welcome to redistribute it
-    under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License.  Of course, your program's commands
-might be different; for a GUI interface, you would use an "about box".
-
-  You should also get your employer (if you work as a programmer) or school,
-if any, to sign a "copyright disclaimer" for the program, if necessary.
-For more information on this, and how to apply and follow the GNU GPL, see
-<https://www.gnu.org/licenses/>.
-
-  The GNU General Public License does not permit incorporating your program
-into proprietary programs.  If your program is a subroutine library, you
-may consider it more useful to permit linking proprietary applications with
-the library.  If this is what you want to do, use the GNU Lesser General
-Public License instead of this License.  But first, please read
-<https://www.gnu.org/licenses/why-not-lgpl.html>.

+ 0 - 97
apps_broken_by_last_refactors/esubghz_chat/README.md

@@ -1,97 +0,0 @@
-# Enhanced Sub-GHz Chat
-
-This is a plugin for the Flipper Zero that reimplements the Sub-GHz chat
-feature that is available on the CLI. In addition it allows for basic
-encryption of messages.
-
-The plugin has been tested on the official firmware (version 0.89.0) and on
-Unleashed (version unlshd-062). Currently it does not work properly on
-unlshd-061.
-
-## Warning
-
-This plugin is in the early stages of development. It will inevitably have
-bugs. You have been warned.
-
-## Usage
-
-Once opened the plugin will ask for the method of deriving the key. If
-"No encryption" is selected, the encryption is disabled. If "Generate Key" is
-selected, a random key is generated. Otherwise, the plugin will ask for the
-selected input method. Currently a password and a hex key, as well as reading
-the key from another Flipper via NFC are supported.
-
-On the next screen the plugin will ask for a frequency to operate on which must
-be entered in HZ.
-
-Finally the a message can be input. After the message is confirmed, the plugin
-will switch to the chat view, where sent and received messages are displayed.
-To view the chat view without entering a message, enter nothing. To go back to
-entering a message press the back button.
-
-In the chat view the keyboard can be locked by pressing and holding the OK
-button for a few seconds. To unlock the keyboard again quickly press the back
-button three times. By pressing the Right button the key display is opened.
-Here the currently used key is displayed in hex. This can be used to input the
-same key on another flipper. There is also an option to share the current key
-via NFC in the key display.
-
-Pressing the back button when entering the frequency, when selecting the method
-for deriving the key or when entering a message will terminate the plugin.
-
-## Interoperability
-
-When encryption is disabled, the plugin can interoperate with the Sub-GHz chat
-available on the Flipper's CLI. However, the CLI sends a sequence of escape
-characters that are not interpreted by this plugin and will be displayed in the
-chat view.
-
-## Encryption
-
-Messages are encrypted using 256 bit AES in GCM mode. Each message gets its own
-random IV. On reception the tag generated by GCM is verified and the message
-discarded if it doesn't match.
-
-A simple mechanism to prevent replay attacks is implemented. Each time the app
-enters an encrypted chat an ID is generated by SHA-256 hashing the Flipper's
-name with the current system ticks. Each message is prefixed with this ID and a
-counter. A receiving Flipper will check if the counter on a received message is
-higher than the last counter received with this ID. If it is not, the message
-is discarded and an error is displayed. ID and counter are included in the GCM
-tag's computation and are therefore authenticated with the used key.
-
-If a password is used, the key for the encryption is derived from the password
-by applying SHA-256 to the password once.
-
-Note that deriving the key with SHA-256 means that the security of your
-messages depends entirely on the strength of the password. The plugin does not
-use an elaborate key derivation function (KDF) to strengthen the password. A
-weak passwords means weak encryption.
-
-Furthermore, the key is the same among all participants. That means that each
-user with the key can impersonate every other user.
-
-The same key is used for all messages. This means that no forward-secrecy is
-provided. If the key is compromised, all previous messages are compromised as
-well.
-
-If you do not understand the implications of the caveats mentioned here, do not
-expect to gain any security by using encryption.
-
-## Acknowledgements
-
-The implementations of AES and GCM are taken directly from
-https://github.com/mko-x/SharedAES-GCM. They were released to the public domain
-by Markus Kosmal.
-
-The app icon was made by [xMasterX](https://github.com/xMasterX). The icon for
-the hexadecimal key input was taken from [QtRoS](https://github.com/QtRoS) hex
-viewer app, which can be found here:
-https://github.com/QtRoS/flipper-zero-hex-viewer. Other icons and graphics were
-taken from the Flipper Zero firmware.
-
-The icons used in the key input method menu were picked by
-[Willy-JL](https://github.com/Willy-JL).
-
-Support for the external radio was also contributed by
-[xMasterX](https://github.com/xMasterX).

+ 0 - 15
apps_broken_by_last_refactors/esubghz_chat/application.fam

@@ -1,15 +0,0 @@
-App(
-    appid="esubghz_chat",
-    name="Enhanced Sub-Ghz Chat",
-    apptype=FlipperAppType.EXTERNAL,
-    entry_point="esubghz_chat",
-    requires=[
-        "gui",
-        "subghz",
-    ],
-    stack_size=8 * 1024,
-    fap_category="Sub-GHz",
-    fap_icon="assets/chat_10px.png",
-    fap_icon_assets="assets",
-    fap_icon_assets_symbol="esubghz_chat",
-)

BIN
apps_broken_by_last_refactors/esubghz_chat/assets/Cry_dolph_55x52.png


BIN
apps_broken_by_last_refactors/esubghz_chat/assets/Loading_24.png


BIN
apps_broken_by_last_refactors/esubghz_chat/assets/NFC_dolphin_emulation_47x61.png


BIN
apps_broken_by_last_refactors/esubghz_chat/assets/NFC_manual_60x50.png


BIN
apps_broken_by_last_refactors/esubghz_chat/assets/Nfc_14px.png


BIN
apps_broken_by_last_refactors/esubghz_chat/assets/Pin_back_arrow_10x8.png


BIN
apps_broken_by_last_refactors/esubghz_chat/assets/WarningDolphin_45x42.png


BIN
apps_broken_by_last_refactors/esubghz_chat/assets/chat_10px.png


BIN
apps_broken_by_last_refactors/esubghz_chat/assets/chat_14px.png


BIN
apps_broken_by_last_refactors/esubghz_chat/assets/hex_14px.png


BIN
apps_broken_by_last_refactors/esubghz_chat/assets/keyboard_14px.png


BIN
apps_broken_by_last_refactors/esubghz_chat/assets/u2f_14px.png


+ 0 - 21
apps_broken_by_last_refactors/esubghz_chat/bgloader_api.h

@@ -1,21 +0,0 @@
-#include <furi.h>
-#include <flipper_application/flipper_application.h>
-
-#define APP_BASE_ARGS "run_in_background"
-
-typedef enum {
-	BGLoaderMessageType_AppReattached,
-	BGLoaderMessageType_LoaderBackground,
-	BGLoaderMessageType_LoaderExit,
-} BGLoaderMessageType;
-
-typedef struct {
-	BGLoaderMessageType type;
-} BGLoaderMessage;
-
-typedef struct {
-	FlipperApplication *fap;
-	FuriThread *thread;
-	FuriMessageQueue *to_app;
-	FuriMessageQueue *to_loader;
-} BGLoaderApp;

+ 0 - 483
apps_broken_by_last_refactors/esubghz_chat/crypto/aes.c

@@ -1,483 +0,0 @@
-/******************************************************************************
-*
-* THIS SOURCE CODE IS HEREBY PLACED INTO THE PUBLIC DOMAIN FOR THE GOOD OF ALL
-*
-* This is a simple and straightforward implementation of the AES Rijndael
-* 128-bit block cipher designed by Vincent Rijmen and Joan Daemen. The focus
-* of this work was correctness & accuracy.  It is written in 'C' without any
-* particular focus upon optimization or speed. It should be endian (memory
-* byte order) neutral since the few places that care are handled explicitly.
-*
-* This implementation of Rijndael was created by Steven M. Gibson of GRC.com.
-*
-* It is intended for general purpose use, but was written in support of GRC's
-* reference implementation of the SQRL (Secure Quick Reliable Login) client.
-*
-* See:    http://csrc.nist.gov/archive/aes/rijndael/wsdindex.html
-*
-* NO COPYRIGHT IS CLAIMED IN THIS WORK, HOWEVER, NEITHER IS ANY WARRANTY MADE
-* REGARDING ITS FITNESS FOR ANY PARTICULAR PURPOSE. USE IT AT YOUR OWN RISK.
-*
-*******************************************************************************/
-
-#include "aes.h"
-
-static int aes_tables_inited = 0;   // run-once flag for performing key
-                                    // expasion table generation (see below)
-/*
- *  The following static local tables must be filled-in before the first use of
- *  the GCM or AES ciphers. They are used for the AES key expansion/scheduling
- *  and once built are read-only and thread safe. The "gcm_initialize" function
- *  must be called once during system initialization to populate these arrays
- *  for subsequent use by the AES key scheduler. If they have not been built
- *  before attempted use, an error will be returned to the caller.
- *
- *  NOTE: GCM Encryption/Decryption does NOT REQUIRE AES decryption. Since
- *  GCM uses AES in counter-mode, where the AES cipher output is XORed with
- *  the GCM input, we ONLY NEED AES encryption.  Thus, to save space AES
- *  decryption is typically disabled by setting AES_DECRYPTION to 0 in aes.h.
- */
-                            // We always need our forward tables
-static uchar FSb[256];      // Forward substitution box (FSb)
-static uint32_t FT0[256];   // Forward key schedule assembly tables
-static uint32_t FT1[256];
-static uint32_t FT2[256];
-static uint32_t FT3[256];
-
-#if AES_DECRYPTION          // We ONLY need reverse for decryption
-static uchar RSb[256];      // Reverse substitution box (RSb)
-static uint32_t RT0[256];   // Reverse key schedule assembly tables
-static uint32_t RT1[256];
-static uint32_t RT2[256];
-static uint32_t RT3[256];
-#endif                      /* AES_DECRYPTION */
-
-static uint32_t RCON[10];   // AES round constants
-
-/* 
- * Platform Endianness Neutralizing Load and Store Macro definitions
- * AES wants platform-neutral Little Endian (LE) byte ordering
- */
-#define GET_UINT32_LE(n,b,i) {                  \
-    (n) = ( (uint32_t) (b)[(i)    ]       )     \
-        | ( (uint32_t) (b)[(i) + 1] <<  8 )     \
-        | ( (uint32_t) (b)[(i) + 2] << 16 )     \
-        | ( (uint32_t) (b)[(i) + 3] << 24 ); }
-
-#define PUT_UINT32_LE(n,b,i) {                  \
-    (b)[(i)    ] = (uchar) ( (n)       );       \
-    (b)[(i) + 1] = (uchar) ( (n) >>  8 );       \
-    (b)[(i) + 2] = (uchar) ( (n) >> 16 );       \
-    (b)[(i) + 3] = (uchar) ( (n) >> 24 ); }
-
-/*
- *  AES forward and reverse encryption round processing macros
- */
-#define AES_FROUND(X0,X1,X2,X3,Y0,Y1,Y2,Y3)     \
-{                                               \
-    X0 = *RK++ ^ FT0[ ( Y0       ) & 0xFF ] ^   \
-                 FT1[ ( Y1 >>  8 ) & 0xFF ] ^   \
-                 FT2[ ( Y2 >> 16 ) & 0xFF ] ^   \
-                 FT3[ ( Y3 >> 24 ) & 0xFF ];    \
-                                                \
-    X1 = *RK++ ^ FT0[ ( Y1       ) & 0xFF ] ^   \
-                 FT1[ ( Y2 >>  8 ) & 0xFF ] ^   \
-                 FT2[ ( Y3 >> 16 ) & 0xFF ] ^   \
-                 FT3[ ( Y0 >> 24 ) & 0xFF ];    \
-                                                \
-    X2 = *RK++ ^ FT0[ ( Y2       ) & 0xFF ] ^   \
-                 FT1[ ( Y3 >>  8 ) & 0xFF ] ^   \
-                 FT2[ ( Y0 >> 16 ) & 0xFF ] ^   \
-                 FT3[ ( Y1 >> 24 ) & 0xFF ];    \
-                                                \
-    X3 = *RK++ ^ FT0[ ( Y3       ) & 0xFF ] ^   \
-                 FT1[ ( Y0 >>  8 ) & 0xFF ] ^   \
-                 FT2[ ( Y1 >> 16 ) & 0xFF ] ^   \
-                 FT3[ ( Y2 >> 24 ) & 0xFF ];    \
-}
-
-#define AES_RROUND(X0,X1,X2,X3,Y0,Y1,Y2,Y3)     \
-{                                               \
-    X0 = *RK++ ^ RT0[ ( Y0       ) & 0xFF ] ^   \
-                 RT1[ ( Y3 >>  8 ) & 0xFF ] ^   \
-                 RT2[ ( Y2 >> 16 ) & 0xFF ] ^   \
-                 RT3[ ( Y1 >> 24 ) & 0xFF ];    \
-                                                \
-    X1 = *RK++ ^ RT0[ ( Y1       ) & 0xFF ] ^   \
-                 RT1[ ( Y0 >>  8 ) & 0xFF ] ^   \
-                 RT2[ ( Y3 >> 16 ) & 0xFF ] ^   \
-                 RT3[ ( Y2 >> 24 ) & 0xFF ];    \
-                                                \
-    X2 = *RK++ ^ RT0[ ( Y2       ) & 0xFF ] ^   \
-                 RT1[ ( Y1 >>  8 ) & 0xFF ] ^   \
-                 RT2[ ( Y0 >> 16 ) & 0xFF ] ^   \
-                 RT3[ ( Y3 >> 24 ) & 0xFF ];    \
-                                                \
-    X3 = *RK++ ^ RT0[ ( Y3       ) & 0xFF ] ^   \
-                 RT1[ ( Y2 >>  8 ) & 0xFF ] ^   \
-                 RT2[ ( Y1 >> 16 ) & 0xFF ] ^   \
-                 RT3[ ( Y0 >> 24 ) & 0xFF ];    \
-}
-
-/*
- *  These macros improve the readability of the key
- *  generation initialization code by collapsing
- *  repetitive common operations into logical pieces.
- */
-#define ROTL8(x) ( ( x << 8 ) & 0xFFFFFFFF ) | ( x >> 24 )
-#define XTIME(x) ( ( x << 1 ) ^ ( ( x & 0x80 ) ? 0x1B : 0x00 ) )
-#define MUL(x,y) ( ( x && y ) ? pow[(log[x]+log[y]) % 255] : 0 )
-#define MIX(x,y) { y = ( (y << 1) | (y >> 7) ) & 0xFF; x ^= y; }
-#define CPY128   { *RK++ = *SK++; *RK++ = *SK++; \
-                   *RK++ = *SK++; *RK++ = *SK++; }
-
-/******************************************************************************
- *
- *  AES_INIT_KEYGEN_TABLES
- *
- *  Fills the AES key expansion tables allocated above with their static
- *  data. This is not "per key" data, but static system-wide read-only
- *  table data. THIS FUNCTION IS NOT THREAD SAFE. It must be called once
- *  at system initialization to setup the tables for all subsequent use.
- *
- ******************************************************************************/
-void aes_init_keygen_tables( void )
-{
-    int i, x, y, z;     // general purpose iteration and computation locals
-    int pow[256];
-    int log[256];
-
-    if (aes_tables_inited) return;
-
-    // fill the 'pow' and 'log' tables over GF(2^8)
-    for( i = 0, x = 1; i < 256; i++ )   {
-        pow[i] = x;
-        log[x] = i;
-        x = ( x ^ XTIME( x ) ) & 0xFF;
-    }
-    // compute the round constants
-    for( i = 0, x = 1; i < 10; i++ )    {
-        RCON[i] = (uint32_t) x;
-        x = XTIME( x ) & 0xFF;
-    }
-    // fill the forward and reverse substitution boxes
-    FSb[0x00] = 0x63;
-#if AES_DECRYPTION  // whether AES decryption is supported
-    RSb[0x63] = 0x00;
-#endif /* AES_DECRYPTION */
-
-    for( i = 1; i < 256; i++ )          {
-        x = y = pow[255 - log[i]];
-        MIX(x,y);
-        MIX(x,y);
-        MIX(x,y);
-        MIX(x,y); 
-        FSb[i] = (uchar) ( x ^= 0x63 );
-#if AES_DECRYPTION  // whether AES decryption is supported
-        RSb[x] = (uchar) i;
-#endif /* AES_DECRYPTION */
-
-    }
-    // generate the forward and reverse key expansion tables
-    for( i = 0; i < 256; i++ )          {
-        x = FSb[i];
-        y = XTIME( x ) & 0xFF;
-        z =  ( y ^ x ) & 0xFF;
-
-        FT0[i] = ( (uint32_t) y       ) ^ ( (uint32_t) x <<  8 ) ^
-                 ( (uint32_t) x << 16 ) ^ ( (uint32_t) z << 24 );
-
-        FT1[i] = ROTL8( FT0[i] );
-        FT2[i] = ROTL8( FT1[i] );
-        FT3[i] = ROTL8( FT2[i] );
-
-#if AES_DECRYPTION  // whether AES decryption is supported
-        x = RSb[i];
-
-        RT0[i] = ( (uint32_t) MUL( 0x0E, x )       ) ^
-                 ( (uint32_t) MUL( 0x09, x ) <<  8 ) ^
-                 ( (uint32_t) MUL( 0x0D, x ) << 16 ) ^
-                 ( (uint32_t) MUL( 0x0B, x ) << 24 );
-
-        RT1[i] = ROTL8( RT0[i] );
-        RT2[i] = ROTL8( RT1[i] );
-        RT3[i] = ROTL8( RT2[i] );
-#endif /* AES_DECRYPTION */
-    }
-    aes_tables_inited = 1;  // flag that the tables have been generated
-}                           // to permit subsequent use of the AES cipher
-
-/******************************************************************************
- *
- *  AES_SET_ENCRYPTION_KEY
- *
- *  This is called by 'aes_setkey' when we're establishing a key for
- *  subsequent encryption.  We give it a pointer to the encryption
- *  context, a pointer to the key, and the key's length in bytes.
- *  Valid lengths are: 16, 24 or 32 bytes (128, 192, 256 bits).
- *
- ******************************************************************************/
-int aes_set_encryption_key( aes_context *ctx,
-                            const uchar *key,
-                            uint keysize )
-{
-    uint i;                 // general purpose iteration local
-    uint32_t *RK = ctx->rk; // initialize our RoundKey buffer pointer
-
-    for( i = 0; i < (keysize >> 2); i++ ) {
-        GET_UINT32_LE( RK[i], key, i << 2 );
-    }
-
-    switch( ctx->rounds )
-    {
-        case 10:
-            for( i = 0; i < 10; i++, RK += 4 ) {
-                RK[4]  = RK[0] ^ RCON[i] ^
-                ( (uint32_t) FSb[ ( RK[3] >>  8 ) & 0xFF ]       ) ^
-                ( (uint32_t) FSb[ ( RK[3] >> 16 ) & 0xFF ] <<  8 ) ^
-                ( (uint32_t) FSb[ ( RK[3] >> 24 ) & 0xFF ] << 16 ) ^
-                ( (uint32_t) FSb[ ( RK[3]       ) & 0xFF ] << 24 );
-
-                RK[5]  = RK[1] ^ RK[4];
-                RK[6]  = RK[2] ^ RK[5];
-                RK[7]  = RK[3] ^ RK[6];
-            }
-            break;
-
-        case 12:
-            for( i = 0; i < 8; i++, RK += 6 ) {
-                RK[6]  = RK[0] ^ RCON[i] ^
-                ( (uint32_t) FSb[ ( RK[5] >>  8 ) & 0xFF ]       ) ^
-                ( (uint32_t) FSb[ ( RK[5] >> 16 ) & 0xFF ] <<  8 ) ^
-                ( (uint32_t) FSb[ ( RK[5] >> 24 ) & 0xFF ] << 16 ) ^
-                ( (uint32_t) FSb[ ( RK[5]       ) & 0xFF ] << 24 );
-
-                RK[7]  = RK[1] ^ RK[6];
-                RK[8]  = RK[2] ^ RK[7];
-                RK[9]  = RK[3] ^ RK[8];
-                RK[10] = RK[4] ^ RK[9];
-                RK[11] = RK[5] ^ RK[10];
-            }
-            break;
-
-        case 14:
-            for( i = 0; i < 7; i++, RK += 8 ) {
-                RK[8]  = RK[0] ^ RCON[i] ^
-                ( (uint32_t) FSb[ ( RK[7] >>  8 ) & 0xFF ]       ) ^
-                ( (uint32_t) FSb[ ( RK[7] >> 16 ) & 0xFF ] <<  8 ) ^
-                ( (uint32_t) FSb[ ( RK[7] >> 24 ) & 0xFF ] << 16 ) ^
-                ( (uint32_t) FSb[ ( RK[7]       ) & 0xFF ] << 24 );
-
-                RK[9]  = RK[1] ^ RK[8];
-                RK[10] = RK[2] ^ RK[9];
-                RK[11] = RK[3] ^ RK[10];
-
-                RK[12] = RK[4] ^
-                ( (uint32_t) FSb[ ( RK[11]       ) & 0xFF ]       ) ^
-                ( (uint32_t) FSb[ ( RK[11] >>  8 ) & 0xFF ] <<  8 ) ^
-                ( (uint32_t) FSb[ ( RK[11] >> 16 ) & 0xFF ] << 16 ) ^
-                ( (uint32_t) FSb[ ( RK[11] >> 24 ) & 0xFF ] << 24 );
-
-                RK[13] = RK[5] ^ RK[12];
-                RK[14] = RK[6] ^ RK[13];
-                RK[15] = RK[7] ^ RK[14];
-            }
-            break;
-
-	default:
-	    return -1;
-    }
-    return( 0 );
-}
-
-#if AES_DECRYPTION  // whether AES decryption is supported
-
-/******************************************************************************
- *
- *  AES_SET_DECRYPTION_KEY
- *
- *  This is called by 'aes_setkey' when we're establishing a
- *  key for subsequent decryption.  We give it a pointer to
- *  the encryption context, a pointer to the key, and the key's
- *  length in bits. Valid lengths are: 128, 192, or 256 bits.
- *
- ******************************************************************************/
-int aes_set_decryption_key( aes_context *ctx,
-                            const uchar *key,
-                            uint keysize )
-{
-    int i, j;
-    aes_context cty;            // a calling aes context for set_encryption_key
-    uint32_t *RK = ctx->rk;     // initialize our RoundKey buffer pointer
-    uint32_t *SK;
-    int ret;
-
-    cty.rounds = ctx->rounds;   // initialize our local aes context
-    cty.rk = cty.buf;           // round count and key buf pointer
-
-    if (( ret = aes_set_encryption_key( &cty, key, keysize )) != 0 )
-        return( ret );
-
-    SK = cty.rk + cty.rounds * 4;
-
-    CPY128  // copy a 128-bit block from *SK to *RK
-
-    for( i = ctx->rounds - 1, SK -= 8; i > 0; i--, SK -= 8 ) {
-        for( j = 0; j < 4; j++, SK++ ) {
-            *RK++ = RT0[ FSb[ ( *SK       ) & 0xFF ] ] ^
-                    RT1[ FSb[ ( *SK >>  8 ) & 0xFF ] ] ^
-                    RT2[ FSb[ ( *SK >> 16 ) & 0xFF ] ] ^
-                    RT3[ FSb[ ( *SK >> 24 ) & 0xFF ] ];
-        }
-    }
-    CPY128  // copy a 128-bit block from *SK to *RK
-    memset( &cty, 0, sizeof( aes_context ) );   // clear local aes context
-    return( 0 );
-}
-
-#endif /* AES_DECRYPTION */
-
-/******************************************************************************
- *
- *  AES_SETKEY
- *
- *  Invoked to establish the key schedule for subsequent encryption/decryption
- *
- ******************************************************************************/
-int aes_setkey( aes_context *ctx,   // AES context provided by our caller
-                int mode,           // ENCRYPT or DECRYPT flag
-                const uchar *key,   // pointer to the key
-                uint keysize )      // key length in bytes
-{
-    // since table initialization is not thread safe, we could either add
-    // system-specific mutexes and init the AES key generation tables on
-    // demand, or ask the developer to simply call "gcm_initialize" once during
-    // application startup before threading begins. That's what we choose.
-    if( !aes_tables_inited ) return ( -1 );  // fail the call when not inited.
-    
-    ctx->mode = mode;       // capture the key type we're creating
-    ctx->rk = ctx->buf;     // initialize our round key pointer
-
-    switch( keysize )       // set the rounds count based upon the keysize
-    {
-        case 16: ctx->rounds = 10; break;   // 16-byte, 128-bit key
-        case 24: ctx->rounds = 12; break;   // 24-byte, 192-bit key
-        case 32: ctx->rounds = 14; break;   // 32-byte, 256-bit key
-	default: return(-1);
-    }
-
-#if AES_DECRYPTION
-    if( mode == DECRYPT )   // expand our key for encryption or decryption
-        return( aes_set_decryption_key( ctx, key, keysize ) );
-    else     /* ENCRYPT */
-#endif /* AES_DECRYPTION */
-        return( aes_set_encryption_key( ctx, key, keysize ) );
-}
-
-/******************************************************************************
- *
- *  AES_CIPHER
- *
- *  Perform AES encryption and decryption.
- *  The AES context will have been setup with the encryption mode
- *  and all keying information appropriate for the task.
- *
- ******************************************************************************/
-int aes_cipher( aes_context *ctx,
-                    const uchar input[16],
-                    uchar output[16] )
-{
-    int i;
-    uint32_t *RK, X0, X1, X2, X3, Y0, Y1, Y2, Y3;   // general purpose locals
-
-    RK = ctx->rk;
-
-    GET_UINT32_LE( X0, input,  0 ); X0 ^= *RK++;    // load our 128-bit
-    GET_UINT32_LE( X1, input,  4 ); X1 ^= *RK++;    // input buffer in a storage
-    GET_UINT32_LE( X2, input,  8 ); X2 ^= *RK++;    // memory endian-neutral way
-    GET_UINT32_LE( X3, input, 12 ); X3 ^= *RK++;
-
-#if AES_DECRYPTION  // whether AES decryption is supported
-
-    if( ctx->mode == DECRYPT )
-    {
-        for( i = (ctx->rounds >> 1) - 1; i > 0; i-- )
-        {
-            AES_RROUND( Y0, Y1, Y2, Y3, X0, X1, X2, X3 );
-            AES_RROUND( X0, X1, X2, X3, Y0, Y1, Y2, Y3 );
-        }
-
-        AES_RROUND( Y0, Y1, Y2, Y3, X0, X1, X2, X3 );
-
-        X0 = *RK++ ^ \
-                ( (uint32_t) RSb[ ( Y0       ) & 0xFF ]       ) ^
-                ( (uint32_t) RSb[ ( Y3 >>  8 ) & 0xFF ] <<  8 ) ^
-                ( (uint32_t) RSb[ ( Y2 >> 16 ) & 0xFF ] << 16 ) ^
-                ( (uint32_t) RSb[ ( Y1 >> 24 ) & 0xFF ] << 24 );
-
-        X1 = *RK++ ^ \
-                ( (uint32_t) RSb[ ( Y1       ) & 0xFF ]       ) ^
-                ( (uint32_t) RSb[ ( Y0 >>  8 ) & 0xFF ] <<  8 ) ^
-                ( (uint32_t) RSb[ ( Y3 >> 16 ) & 0xFF ] << 16 ) ^
-                ( (uint32_t) RSb[ ( Y2 >> 24 ) & 0xFF ] << 24 );
-
-        X2 = *RK++ ^ \
-                ( (uint32_t) RSb[ ( Y2       ) & 0xFF ]       ) ^
-                ( (uint32_t) RSb[ ( Y1 >>  8 ) & 0xFF ] <<  8 ) ^
-                ( (uint32_t) RSb[ ( Y0 >> 16 ) & 0xFF ] << 16 ) ^
-                ( (uint32_t) RSb[ ( Y3 >> 24 ) & 0xFF ] << 24 );
-
-        X3 = *RK++ ^ \
-                ( (uint32_t) RSb[ ( Y3       ) & 0xFF ]       ) ^
-                ( (uint32_t) RSb[ ( Y2 >>  8 ) & 0xFF ] <<  8 ) ^
-                ( (uint32_t) RSb[ ( Y1 >> 16 ) & 0xFF ] << 16 ) ^
-                ( (uint32_t) RSb[ ( Y0 >> 24 ) & 0xFF ] << 24 );
-    }
-    else /* ENCRYPT */
-    {
-#endif /* AES_DECRYPTION */
-
-        for( i = (ctx->rounds >> 1) - 1; i > 0; i-- )
-        {
-            AES_FROUND( Y0, Y1, Y2, Y3, X0, X1, X2, X3 );
-            AES_FROUND( X0, X1, X2, X3, Y0, Y1, Y2, Y3 );
-        }
-
-        AES_FROUND( Y0, Y1, Y2, Y3, X0, X1, X2, X3 );
-
-        X0 = *RK++ ^ \
-                ( (uint32_t) FSb[ ( Y0       ) & 0xFF ]       ) ^
-                ( (uint32_t) FSb[ ( Y1 >>  8 ) & 0xFF ] <<  8 ) ^
-                ( (uint32_t) FSb[ ( Y2 >> 16 ) & 0xFF ] << 16 ) ^
-                ( (uint32_t) FSb[ ( Y3 >> 24 ) & 0xFF ] << 24 );
-
-        X1 = *RK++ ^ \
-                ( (uint32_t) FSb[ ( Y1       ) & 0xFF ]       ) ^
-                ( (uint32_t) FSb[ ( Y2 >>  8 ) & 0xFF ] <<  8 ) ^
-                ( (uint32_t) FSb[ ( Y3 >> 16 ) & 0xFF ] << 16 ) ^
-                ( (uint32_t) FSb[ ( Y0 >> 24 ) & 0xFF ] << 24 );
-
-        X2 = *RK++ ^ \
-                ( (uint32_t) FSb[ ( Y2       ) & 0xFF ]       ) ^
-                ( (uint32_t) FSb[ ( Y3 >>  8 ) & 0xFF ] <<  8 ) ^
-                ( (uint32_t) FSb[ ( Y0 >> 16 ) & 0xFF ] << 16 ) ^
-                ( (uint32_t) FSb[ ( Y1 >> 24 ) & 0xFF ] << 24 );
-
-        X3 = *RK++ ^ \
-                ( (uint32_t) FSb[ ( Y3       ) & 0xFF ]       ) ^
-                ( (uint32_t) FSb[ ( Y0 >>  8 ) & 0xFF ] <<  8 ) ^
-                ( (uint32_t) FSb[ ( Y1 >> 16 ) & 0xFF ] << 16 ) ^
-                ( (uint32_t) FSb[ ( Y2 >> 24 ) & 0xFF ] << 24 );
-
-#if AES_DECRYPTION  // whether AES decryption is supported
-    }
-#endif /* AES_DECRYPTION */
-
-    PUT_UINT32_LE( X0, output,  0 );
-    PUT_UINT32_LE( X1, output,  4 );
-    PUT_UINT32_LE( X2, output,  8 );
-    PUT_UINT32_LE( X3, output, 12 );
-
-    return( 0 );
-}
-/* end of aes.c */

+ 0 - 81
apps_broken_by_last_refactors/esubghz_chat/crypto/aes.h

@@ -1,81 +0,0 @@
-/******************************************************************************
-*
-* THIS SOURCE CODE IS HEREBY PLACED INTO THE PUBLIC DOMAIN FOR THE GOOD OF ALL
-*
-* This is a simple and straightforward implementation of the AES Rijndael
-* 128-bit block cipher designed by Vincent Rijmen and Joan Daemen. The focus
-* of this work was correctness & accuracy.  It is written in 'C' without any
-* particular focus upon optimization or speed. It should be endian (memory
-* byte order) neutral since the few places that care are handled explicitly.
-*
-* This implementation of Rijndael was created by Steven M. Gibson of GRC.com.
-*
-* It is intended for general purpose use, but was written in support of GRC's
-* reference implementation of the SQRL (Secure Quick Reliable Login) client.
-*
-* See:    http://csrc.nist.gov/archive/aes/rijndael/wsdindex.html
-*
-* NO COPYRIGHT IS CLAIMED IN THIS WORK, HOWEVER, NEITHER IS ANY WARRANTY MADE
-* REGARDING ITS FITNESS FOR ANY PARTICULAR PURPOSE. USE IT AT YOUR OWN RISK.
-*
-*******************************************************************************/
-
-#ifndef AES_HEADER
-#define AES_HEADER
-
-/******************************************************************************/
-#define AES_DECRYPTION  0       // whether AES decryption is supported
-/******************************************************************************/
-
-#include <string.h>
-
-#define ENCRYPT         1       // specify whether we're encrypting
-#define DECRYPT         0       // or decrypting
-
-#if defined(_MSC_VER)
-    #include <basetsd.h>
-    typedef UINT32 uint32_t;
-#else
-    #include <inttypes.h>
-#endif
-
-typedef unsigned char uchar;    // add some convienent shorter types
-typedef unsigned int uint;
-
-
-/******************************************************************************
- *  AES_INIT_KEYGEN_TABLES : MUST be called once before any AES use
- ******************************************************************************/
-void aes_init_keygen_tables( void );
-
-
-/******************************************************************************
- *  AES_CONTEXT : cipher context / holds inter-call data
- ******************************************************************************/
-typedef struct {
-    int mode;           // 1 for Encryption, 0 for Decryption
-    int rounds;         // keysize-based rounds count
-    uint32_t *rk;       // pointer to current round key
-    uint32_t buf[68];   // key expansion buffer
-} aes_context;
-
-
-/******************************************************************************
- *  AES_SETKEY : called to expand the key for encryption or decryption
- ******************************************************************************/
-int aes_setkey( aes_context *ctx,       // pointer to context
-                int mode,               // 1 or 0 for Encrypt/Decrypt
-                const uchar *key,       // AES input key
-                uint keysize );         // size in bytes (must be 16, 24, 32 for
-		                        // 128, 192 or 256-bit keys respectively)
-                                        // returns 0 for success
-
-/******************************************************************************
- *  AES_CIPHER : called to encrypt or decrypt ONE 128-bit block of data
- ******************************************************************************/
-int aes_cipher( aes_context *ctx,       // pointer to context
-                const uchar input[16],  // 128-bit block to en/decipher
-                uchar output[16] );     // 128-bit output result block
-                                        // returns 0 for success
-
-#endif /* AES_HEADER */

+ 0 - 511
apps_broken_by_last_refactors/esubghz_chat/crypto/gcm.c

@@ -1,511 +0,0 @@
-/******************************************************************************
-*
-* THIS SOURCE CODE IS HEREBY PLACED INTO THE PUBLIC DOMAIN FOR THE GOOD OF ALL
-*
-* This is a simple and straightforward implementation of AES-GCM authenticated
-* encryption. The focus of this work was correctness & accuracy. It is written
-* in straight 'C' without any particular focus upon optimization or speed. It
-* should be endian (memory byte order) neutral since the few places that care
-* are handled explicitly.
-*
-* This implementation of AES-GCM was created by Steven M. Gibson of GRC.com.
-*
-* It is intended for general purpose use, but was written in support of GRC's
-* reference implementation of the SQRL (Secure Quick Reliable Login) client.
-*
-* See:    http://csrc.nist.gov/publications/nistpubs/800-38D/SP-800-38D.pdf
-*         http://csrc.nist.gov/groups/ST/toolkit/BCM/documents/proposedmodes/
-*         gcm/gcm-revised-spec.pdf
-*
-* NO COPYRIGHT IS CLAIMED IN THIS WORK, HOWEVER, NEITHER IS ANY WARRANTY MADE
-* REGARDING ITS FITNESS FOR ANY PARTICULAR PURPOSE. USE IT AT YOUR OWN RISK.
-*
-*******************************************************************************/
-
-#include "gcm.h"
-#include "aes.h"
-
-/******************************************************************************
- *                      ==== IMPLEMENTATION WARNING ====
- *
- *  This code was developed for use within SQRL's fixed environmnent. Thus, it
- *  is somewhat less "general purpose" than it would be if it were designed as
- *  a general purpose AES-GCM library. Specifically, it bothers with almost NO
- *  error checking on parameter limits, buffer bounds, etc. It assumes that it
- *  is being invoked by its author or by someone who understands the values it
- *  expects to receive. Its behavior will be undefined otherwise.
- *
- *  All functions that might fail are defined to return 'ints' to indicate a
- *  problem. Most do not do so now. But this allows for error propagation out
- *  of internal functions if robust error checking should ever be desired.
- *
- ******************************************************************************/
-
-/* Calculating the "GHASH"
- *
- * There are many ways of calculating the so-called GHASH in software, each with
- * a traditional size vs performance tradeoff.  The GHASH (Galois field hash) is
- * an intriguing construction which takes two 128-bit strings (also the cipher's
- * block size and the fundamental operation size for the system) and hashes them
- * into a third 128-bit result.
- *
- * Many implementation solutions have been worked out that use large precomputed
- * table lookups in place of more time consuming bit fiddling, and this approach
- * can be scaled easily upward or downward as needed to change the time/space
- * tradeoff. It's been studied extensively and there's a solid body of theory and
- * practice.  For example, without using any lookup tables an implementation
- * might obtain 119 cycles per byte throughput, whereas using a simple, though
- * large, key-specific 64 kbyte 8-bit lookup table the performance jumps to 13
- * cycles per byte.
- *
- * And Intel's processors have, since 2010, included an instruction which does
- * the entire 128x128->128 bit job in just several 64x64->128 bit pieces.
- *
- * Since SQRL is interactive, and only processing a few 128-bit blocks, I've
- * settled upon a relatively slower but appealing small-table compromise which
- * folds a bunch of not only time consuming but also bit twiddling into a simple
- * 16-entry table which is attributed to Victor Shoup's 1996 work while at
- * Bellcore: "On Fast and Provably Secure MessageAuthentication Based on
- * Universal Hashing."  See: http://www.shoup.net/papers/macs.pdf
- * See, also section 4.1 of the "gcm-revised-spec" cited above.
- */
-
-/*
- *  This 16-entry table of pre-computed constants is used by the
- *  GHASH multiplier to improve over a strictly table-free but
- *  significantly slower 128x128 bit multiple within GF(2^128).
- */
-static const uint64_t last4[16] = {
-    0x0000, 0x1c20, 0x3840, 0x2460, 0x7080, 0x6ca0, 0x48c0, 0x54e0,
-    0xe100, 0xfd20, 0xd940, 0xc560, 0x9180, 0x8da0, 0xa9c0, 0xb5e0  };
-
-/*
- * Platform Endianness Neutralizing Load and Store Macro definitions
- * GCM wants platform-neutral Big Endian (BE) byte ordering
- */
-#define GET_UINT32_BE(n,b,i) {                      \
-    (n) = ( (uint32_t) (b)[(i)    ] << 24 )         \
-        | ( (uint32_t) (b)[(i) + 1] << 16 )         \
-        | ( (uint32_t) (b)[(i) + 2] <<  8 )         \
-        | ( (uint32_t) (b)[(i) + 3]       ); }
-
-#define PUT_UINT32_BE(n,b,i) {                      \
-    (b)[(i)    ] = (uchar) ( (n) >> 24 );   \
-    (b)[(i) + 1] = (uchar) ( (n) >> 16 );   \
-    (b)[(i) + 2] = (uchar) ( (n) >>  8 );   \
-    (b)[(i) + 3] = (uchar) ( (n)       ); }
-
-
-/******************************************************************************
- *
- *  GCM_INITIALIZE
- *
- *  Must be called once to initialize the GCM library.
- *
- *  At present, this only calls the AES keygen table generator, which expands
- *  the AES keying tables for use. This is NOT A THREAD-SAFE function, so it
- *  MUST be called during system initialization before a multi-threading
- *  environment is running.
- *
- ******************************************************************************/
-int gcm_initialize( void )
-{
-    aes_init_keygen_tables();
-    return( 0 );
-}
-
-
-/******************************************************************************
- *
- *  GCM_MULT
- *
- *  Performs a GHASH operation on the 128-bit input vector 'x', setting
- *  the 128-bit output vector to 'x' times H using our precomputed tables.
- *  'x' and 'output' are seen as elements of GCM's GF(2^128) Galois field.
- *
- ******************************************************************************/
-static void gcm_mult( gcm_context *ctx,     // pointer to established context
-                      const uchar x[16],    // pointer to 128-bit input vector
-                      uchar output[16] )    // pointer to 128-bit output vector
-{
-    int i;
-    uchar lo, hi, rem;
-    uint64_t zh, zl;
-
-    lo = (uchar)( x[15] & 0x0f );
-    hi = (uchar)( x[15] >> 4 );
-    zh = ctx->HH[lo];
-    zl = ctx->HL[lo];
-
-    for( i = 15; i >= 0; i-- ) {
-        lo = (uchar) ( x[i] & 0x0f );
-        hi = (uchar) ( x[i] >> 4 );
-
-        if( i != 15 ) {
-            rem = (uchar) ( zl & 0x0f );
-            zl = ( zh << 60 ) | ( zl >> 4 );
-            zh = ( zh >> 4 );
-            zh ^= (uint64_t) last4[rem] << 48;
-            zh ^= ctx->HH[lo];
-            zl ^= ctx->HL[lo];
-        }
-        rem = (uchar) ( zl & 0x0f );
-        zl = ( zh << 60 ) | ( zl >> 4 );
-        zh = ( zh >> 4 );
-        zh ^= (uint64_t) last4[rem] << 48;
-        zh ^= ctx->HH[hi];
-        zl ^= ctx->HL[hi];
-    }
-    PUT_UINT32_BE( zh >> 32, output, 0 );
-    PUT_UINT32_BE( zh, output, 4 );
-    PUT_UINT32_BE( zl >> 32, output, 8 );
-    PUT_UINT32_BE( zl, output, 12 );
-}
-
-
-/******************************************************************************
- *
- *  GCM_SETKEY
- *
- *  This is called to set the AES-GCM key. It initializes the AES key
- *  and populates the gcm context's pre-calculated HTables.
- *
- ******************************************************************************/
-int gcm_setkey( gcm_context *ctx,   // pointer to caller-provided gcm context
-                const uchar *key,   // pointer to the AES encryption key
-                const uint keysize) // size in bytes (must be 16, 24, 32 for
-		                    // 128, 192 or 256-bit keys respectively)
-{
-    int ret, i, j;
-    uint64_t hi, lo;
-    uint64_t vl, vh;
-    unsigned char h[16];
-
-    memset( ctx, 0, sizeof(gcm_context) );  // zero caller-provided GCM context
-    memset( h, 0, 16 );                     // initialize the block to encrypt
-
-    // encrypt the null 128-bit block to generate a key-based value
-    // which is then used to initialize our GHASH lookup tables
-    if(( ret = aes_setkey( &ctx->aes_ctx, ENCRYPT, key, keysize )) != 0 )
-        return( ret );
-    if(( ret = aes_cipher( &ctx->aes_ctx, h, h )) != 0 )
-        return( ret );
-
-    GET_UINT32_BE( hi, h,  0  );    // pack h as two 64-bit ints, big-endian
-    GET_UINT32_BE( lo, h,  4  );
-    vh = (uint64_t) hi << 32 | lo;
-
-    GET_UINT32_BE( hi, h,  8  );
-    GET_UINT32_BE( lo, h,  12 );
-    vl = (uint64_t) hi << 32 | lo;
-
-    ctx->HL[8] = vl;                // 8 = 1000 corresponds to 1 in GF(2^128)
-    ctx->HH[8] = vh;
-    ctx->HH[0] = 0;                 // 0 corresponds to 0 in GF(2^128)
-    ctx->HL[0] = 0;
-
-    for( i = 4; i > 0; i >>= 1 ) {
-        uint32_t T = (uint32_t) ( vl & 1 ) * 0xe1000000U;
-        vl  = ( vh << 63 ) | ( vl >> 1 );
-        vh  = ( vh >> 1 ) ^ ( (uint64_t) T << 32);
-        ctx->HL[i] = vl;
-        ctx->HH[i] = vh;
-    }
-    for (i = 2; i < 16; i <<= 1 ) {
-        uint64_t *HiL = ctx->HL + i, *HiH = ctx->HH + i;
-        vh = *HiH;
-        vl = *HiL;
-        for( j = 1; j < i; j++ ) {
-            HiH[j] = vh ^ ctx->HH[j];
-            HiL[j] = vl ^ ctx->HL[j];
-        }
-    }
-    return( 0 );
-}
-
-
-/******************************************************************************
- *
- *    GCM processing occurs four phases: SETKEY, START, UPDATE and FINISH.
- *
- *  SETKEY: 
- *  
- *   START: Sets the Encryption/Decryption mode.
- *          Accepts the initialization vector and additional data.
- *
- *  UPDATE: Encrypts or decrypts the plaintext or ciphertext.
- *
- *  FINISH: Performs a final GHASH to generate the authentication tag.
- *
- ******************************************************************************
- *
- *  GCM_START
- *
- *  Given a user-provided GCM context, this initializes it, sets the encryption
- *  mode, and preprocesses the initialization vector and additional AEAD data.
- *
- ******************************************************************************/
-int gcm_start( gcm_context *ctx,    // pointer to user-provided GCM context
-               int mode,            // GCM_ENCRYPT or GCM_DECRYPT
-               const uchar *iv,     // pointer to initialization vector
-               size_t iv_len,       // IV length in bytes (should == 12)
-               const uchar *add,    // ptr to additional AEAD data (NULL if none)
-               size_t add_len )     // length of additional AEAD data (bytes)
-{
-    int ret;            // our error return if the AES encrypt fails
-    uchar work_buf[16]; // XOR source built from provided IV if len != 16
-    const uchar *p;     // general purpose array pointer
-    size_t use_len;     // byte count to process, up to 16 bytes
-    size_t i;           // local loop iterator
-
-    // since the context might be reused under the same key
-    // we zero the working buffers for this next new process
-    memset( ctx->y,   0x00, sizeof(ctx->y  ) );
-    memset( ctx->buf, 0x00, sizeof(ctx->buf) );
-    ctx->len = 0;
-    ctx->add_len = 0;
-
-    ctx->mode = mode;               // set the GCM encryption/decryption mode
-    ctx->aes_ctx.mode = ENCRYPT;    // GCM *always* runs AES in ENCRYPTION mode
-
-    if( iv_len == 12 ) {                // GCM natively uses a 12-byte, 96-bit IV
-        memcpy( ctx->y, iv, iv_len );   // copy the IV to the top of the 'y' buff
-        ctx->y[15] = 1;                 // start "counting" from 1 (not 0)
-    }
-    else    // if we don't have a 12-byte IV, we GHASH whatever we've been given
-    {   
-        memset( work_buf, 0x00, 16 );               // clear the working buffer
-        PUT_UINT32_BE( iv_len * 8, work_buf, 12 );  // place the IV into buffer
-
-        p = iv;
-        while( iv_len > 0 ) {
-            use_len = ( iv_len < 16 ) ? iv_len : 16;
-            for( i = 0; i < use_len; i++ ) ctx->y[i] ^= p[i];
-            gcm_mult( ctx, ctx->y, ctx->y );
-            iv_len -= use_len;
-            p += use_len;
-        }
-        for( i = 0; i < 16; i++ ) ctx->y[i] ^= work_buf[i];
-        gcm_mult( ctx, ctx->y, ctx->y );
-    }
-    if( ( ret = aes_cipher( &ctx->aes_ctx, ctx->y, ctx->base_ectr ) ) != 0 )
-        return( ret );
-
-    ctx->add_len = add_len;
-    p = add;
-    while( add_len > 0 ) {
-        use_len = ( add_len < 16 ) ? add_len : 16;
-        for( i = 0; i < use_len; i++ ) ctx->buf[i] ^= p[i];
-        gcm_mult( ctx, ctx->buf, ctx->buf );
-        add_len -= use_len;
-        p += use_len;
-    }
-    return( 0 );
-}
-
-/******************************************************************************
- *
- *  GCM_UPDATE
- *
- *  This is called once or more to process bulk plaintext or ciphertext data.
- *  We give this some number of bytes of input and it returns the same number
- *  of output bytes. If called multiple times (which is fine) all but the final
- *  invocation MUST be called with length mod 16 == 0. (Only the final call can
- *  have a partial block length of < 128 bits.)
- *
- ******************************************************************************/
-int gcm_update( gcm_context *ctx,       // pointer to user-provided GCM context
-                size_t length,          // length, in bytes, of data to process
-                const uchar *input,     // pointer to source data
-                uchar *output )         // pointer to destination data
-{
-    int ret;            // our error return if the AES encrypt fails
-    uchar ectr[16];     // counter-mode cipher output for XORing
-    size_t use_len;     // byte count to process, up to 16 bytes
-    size_t i;           // local loop iterator
-
-    ctx->len += length; // bump the GCM context's running length count
-
-    while( length > 0 ) {
-        // clamp the length to process at 16 bytes
-        use_len = ( length < 16 ) ? length : 16;
-
-        // increment the context's 128-bit IV||Counter 'y' vector
-        for( i = 16; i > 12; i-- ) if( ++ctx->y[i - 1] != 0 ) break;
-
-        // encrypt the context's 'y' vector under the established key
-        if( ( ret = aes_cipher( &ctx->aes_ctx, ctx->y, ectr ) ) != 0 )
-            return( ret );
-
-        // encrypt or decrypt the input to the output
-        if( ctx->mode == ENCRYPT )  
-        {
-             for( i = 0; i < use_len; i++ ) {
-                // XOR the cipher's ouptut vector (ectr) with our input
-                output[i] = (uchar) ( ectr[i] ^ input[i] );
-                // now we mix in our data into the authentication hash.
-                // if we're ENcrypting we XOR in the post-XOR (output) 
-                // results, but if we're DEcrypting we XOR in the input 
-                // data
-                ctx->buf[i] ^= output[i];
-            }
-        }
-            else                        
-        {
-            for( i = 0; i < use_len; i++ ) {
-                // but if we're DEcrypting we XOR in the input data first, 
-                // i.e. before saving to ouput data, otherwise if the input 
-                // and output buffer are the same (inplace decryption) we 
-                // would not get the correct auth tag
-
-       	        ctx->buf[i] ^= input[i];
-
-                // XOR the cipher's ouptut vector (ectr) with our input
-                output[i] = (uchar) ( ectr[i] ^ input[i] );
-             }
-        }
-        gcm_mult( ctx, ctx->buf, ctx->buf );    // perform a GHASH operation
-
-        length -= use_len;  // drop the remaining byte count to process
-        input  += use_len;  // bump our input pointer forward
-        output += use_len;  // bump our output pointer forward
-    }
-    return( 0 );
-}
-
-/******************************************************************************
- *
- *  GCM_FINISH
- *
- *  This is called once after all calls to GCM_UPDATE to finalize the GCM.
- *  It performs the final GHASH to produce the resulting authentication TAG.
- *
- ******************************************************************************/
-int gcm_finish( gcm_context *ctx,   // pointer to user-provided GCM context
-                uchar *tag,         // pointer to buffer which receives the tag
-                size_t tag_len )    // length, in bytes, of the tag-receiving buf
-{
-    uchar work_buf[16];
-    uint64_t orig_len     = ctx->len * 8;
-    uint64_t orig_add_len = ctx->add_len * 8;
-    size_t i;
-
-    if( tag_len != 0 ) memcpy( tag, ctx->base_ectr, tag_len );
-
-    if( orig_len || orig_add_len ) {
-        memset( work_buf, 0x00, 16 );
-
-        PUT_UINT32_BE( ( orig_add_len >> 32 ), work_buf, 0  );
-        PUT_UINT32_BE( ( orig_add_len       ), work_buf, 4  );
-        PUT_UINT32_BE( ( orig_len     >> 32 ), work_buf, 8  );
-        PUT_UINT32_BE( ( orig_len           ), work_buf, 12 );
-
-        for( i = 0; i < 16; i++ ) ctx->buf[i] ^= work_buf[i];
-        gcm_mult( ctx, ctx->buf, ctx->buf );
-        for( i = 0; i < tag_len; i++ ) tag[i] ^= ctx->buf[i];
-    }
-    return( 0 );
-}
-
-
-/******************************************************************************
- *
- *  GCM_CRYPT_AND_TAG
- *
- *  This either encrypts or decrypts the user-provided data and, either
- *  way, generates an authentication tag of the requested length. It must be
- *  called with a GCM context whose key has already been set with GCM_SETKEY.
- *
- *  The user would typically call this explicitly to ENCRYPT a buffer of data
- *  and optional associated data, and produce its an authentication tag.
- *
- *  To reverse the process the user would typically call the companion
- *  GCM_AUTH_DECRYPT function to decrypt data and verify a user-provided
- *  authentication tag.  The GCM_AUTH_DECRYPT function calls this function
- *  to perform its decryption and tag generation, which it then compares.
- *
- ******************************************************************************/
-int gcm_crypt_and_tag(
-        gcm_context *ctx,       // gcm context with key already setup
-        int mode,               // cipher direction: GCM_ENCRYPT or GCM_DECRYPT
-        const uchar *iv,        // pointer to the 12-byte initialization vector
-        size_t iv_len,          // byte length if the IV. should always be 12
-        const uchar *add,       // pointer to the non-ciphered additional data
-        size_t add_len,         // byte length of the additional AEAD data
-        const uchar *input,     // pointer to the cipher data source
-        uchar *output,          // pointer to the cipher data destination
-        size_t length,          // byte length of the cipher data
-        uchar *tag,             // pointer to the tag to be generated
-        size_t tag_len )        // byte length of the tag to be generated
-{   /*
-       assuming that the caller has already invoked gcm_setkey to
-       prepare the gcm context with the keying material, we simply
-       invoke each of the three GCM sub-functions in turn...
-    */
-    gcm_start  ( ctx, mode, iv, iv_len, add, add_len );
-    gcm_update ( ctx, length, input, output );
-    gcm_finish ( ctx, tag, tag_len );
-    return( 0 );
-}
-
-
-/******************************************************************************
- *
- *  GCM_AUTH_DECRYPT
- *
- *  This DECRYPTS a user-provided data buffer with optional associated data.
- *  It then verifies a user-supplied authentication tag against the tag just
- *  re-created during decryption to verify that the data has not been altered.
- *
- *  This function calls GCM_CRYPT_AND_TAG (above) to perform the decryption
- *  and authentication tag generation.
- *
- ******************************************************************************/
-int gcm_auth_decrypt(
-        gcm_context *ctx,       // gcm context with key already setup
-        const uchar *iv,        // pointer to the 12-byte initialization vector
-        size_t iv_len,          // byte length if the IV. should always be 12
-        const uchar *add,       // pointer to the non-ciphered additional data
-        size_t add_len,         // byte length of the additional AEAD data
-        const uchar *input,     // pointer to the cipher data source
-        uchar *output,          // pointer to the cipher data destination
-        size_t length,          // byte length of the cipher data
-        const uchar *tag,       // pointer to the tag to be authenticated
-        size_t tag_len )        // byte length of the tag <= 16
-{
-    uchar check_tag[16];        // the tag generated and returned by decryption
-    int diff;                   // an ORed flag to detect authentication errors
-    size_t i;                   // our local iterator
-    /*
-       we use GCM_DECRYPT_AND_TAG (above) to perform our decryption
-       (which is an identical XORing to reverse the previous one)
-       and also to re-generate the matching authentication tag
-    */
-    gcm_crypt_and_tag(  ctx, DECRYPT, iv, iv_len, add, add_len,
-                        input, output, length, check_tag, tag_len );
-
-    // now we verify the authentication tag in 'constant time'
-    for( diff = 0, i = 0; i < tag_len; i++ )
-        diff |= tag[i] ^ check_tag[i];
-
-    if( diff != 0 ) {                   // see whether any bits differed?
-        memset( output, 0, length );    // if so... wipe the output data
-        return( GCM_AUTH_FAILURE );     // return GCM_AUTH_FAILURE
-    }
-    return( 0 );
-}
-
-/******************************************************************************
- *
- *  GCM_ZERO_CTX
- *
- *  The GCM context contains both the GCM context and the AES context.
- *  This includes keying and key-related material which is security-
- *  sensitive, so it MUST be zeroed after use. This function does that.
- *
- ******************************************************************************/
-void gcm_zero_ctx( gcm_context *ctx )
-{
-    // zero the context originally provided to us
-    memset( ctx, 0, sizeof( gcm_context ) );
-}

+ 0 - 187
apps_broken_by_last_refactors/esubghz_chat/crypto/gcm.h

@@ -1,187 +0,0 @@
-/******************************************************************************
-*
-* THIS SOURCE CODE IS HEREBY PLACED INTO THE PUBLIC DOMAIN FOR THE GOOD OF ALL
-*
-* This is a simple and straightforward implementation of AES-GCM authenticated
-* encryption. The focus of this work was correctness & accuracy. It is written
-* in straight 'C' without any particular focus upon optimization or speed. It
-* should be endian (memory byte order) neutral since the few places that care
-* are handled explicitly.
-*
-* This implementation of AES-GCM was created by Steven M. Gibson of GRC.com.
-*
-* It is intended for general purpose use, but was written in support of GRC's
-* reference implementation of the SQRL (Secure Quick Reliable Login) client.
-*
-* See:    http://csrc.nist.gov/publications/nistpubs/800-38D/SP-800-38D.pdf
-*         http://csrc.nist.gov/groups/ST/toolkit/BCM/documents/proposedmodes/ \
-*         gcm/gcm-revised-spec.pdf
-*
-* NO COPYRIGHT IS CLAIMED IN THIS WORK, HOWEVER, NEITHER IS ANY WARRANTY MADE
-* REGARDING ITS FITNESS FOR ANY PARTICULAR PURPOSE. USE IT AT YOUR OWN RISK.
-*
-*******************************************************************************/
-#ifndef GCM_HEADER
-#define GCM_HEADER
-
-#define GCM_AUTH_FAILURE    0x55555555  // authentication failure
-
-#include "aes.h"                        // gcm_context includes aes_context
-
-#if defined(_MSC_VER)
-    #include <basetsd.h>
-    typedef unsigned int size_t;// use the right type for length declarations
-    typedef UINT32 uint32_t;
-    typedef UINT64 uint64_t;
-#else
-    #include <stdint.h>
-#endif
-
-
-/******************************************************************************
- *  GCM_CONTEXT : GCM context / holds keytables, instance data, and AES ctx
- ******************************************************************************/
-typedef struct {
-    int mode;               // cipher direction: encrypt/decrypt
-    uint64_t len;           // cipher data length processed so far
-    uint64_t add_len;       // total add data length
-    uint64_t HL[16];        // precalculated lo-half HTable
-    uint64_t HH[16];        // precalculated hi-half HTable
-    uchar base_ectr[16];    // first counter-mode cipher output for tag
-    uchar y[16];            // the current cipher-input IV|Counter value
-    uchar buf[16];          // buf working value
-    aes_context aes_ctx;    // cipher context used
-} gcm_context;
-
-
-/******************************************************************************
- *  GCM_CONTEXT : MUST be called once before ANY use of this library
- ******************************************************************************/
-int gcm_initialize( void );
-
-
-/******************************************************************************
- *  GCM_SETKEY : sets the GCM (and AES) keying material for use
- ******************************************************************************/
-int gcm_setkey( gcm_context *ctx,   // caller-provided context ptr
-                const uchar *key,   // pointer to cipher key
-                const uint keysize  // size in bytes (must be 16, 24, 32 for
-		                    // 128, 192 or 256-bit keys respectively)
-); // returns 0 for success
-
-
-/******************************************************************************
- *
- *  GCM_CRYPT_AND_TAG
- *
- *  This either encrypts or decrypts the user-provided data and, either
- *  way, generates an authentication tag of the requested length. It must be
- *  called with a GCM context whose key has already been set with GCM_SETKEY.
- *
- *  The user would typically call this explicitly to ENCRYPT a buffer of data
- *  and optional associated data, and produce its an authentication tag.
- *
- *  To reverse the process the user would typically call the companion
- *  GCM_AUTH_DECRYPT function to decrypt data and verify a user-provided
- *  authentication tag.  The GCM_AUTH_DECRYPT function calls this function
- *  to perform its decryption and tag generation, which it then compares.
- *
- ******************************************************************************/
-int gcm_crypt_and_tag(
-        gcm_context *ctx,       // gcm context with key already setup
-        int mode,               // cipher direction: ENCRYPT (1) or DECRYPT (0)
-        const uchar *iv,        // pointer to the 12-byte initialization vector
-        size_t iv_len,          // byte length if the IV. should always be 12
-        const uchar *add,       // pointer to the non-ciphered additional data
-        size_t add_len,         // byte length of the additional AEAD data
-        const uchar *input,     // pointer to the cipher data source
-        uchar *output,          // pointer to the cipher data destination
-        size_t length,          // byte length of the cipher data
-        uchar *tag,             // pointer to the tag to be generated
-        size_t tag_len );       // byte length of the tag to be generated
-
-
-/******************************************************************************
- *
- *  GCM_AUTH_DECRYPT
- *
- *  This DECRYPTS a user-provided data buffer with optional associated data.
- *  It then verifies a user-supplied authentication tag against the tag just
- *  re-created during decryption to verify that the data has not been altered.
- *
- *  This function calls GCM_CRYPT_AND_TAG (above) to perform the decryption
- *  and authentication tag generation.
- *
- ******************************************************************************/
-int gcm_auth_decrypt(
-        gcm_context *ctx,       // gcm context with key already setup
-        const uchar *iv,        // pointer to the 12-byte initialization vector
-        size_t iv_len,          // byte length if the IV. should always be 12
-        const uchar *add,       // pointer to the non-ciphered additional data
-        size_t add_len,         // byte length of the additional AEAD data
-        const uchar *input,     // pointer to the cipher data source
-        uchar *output,          // pointer to the cipher data destination
-        size_t length,          // byte length of the cipher data
-        const uchar *tag,       // pointer to the tag to be authenticated
-        size_t tag_len );       // byte length of the tag <= 16
-
-
-/******************************************************************************
- *
- *  GCM_START
- *
- *  Given a user-provided GCM context, this initializes it, sets the encryption
- *  mode, and preprocesses the initialization vector and additional AEAD data.
- *
- ******************************************************************************/
-int gcm_start( gcm_context *ctx,    // pointer to user-provided GCM context
-               int mode,            // ENCRYPT (1) or DECRYPT (0)
-               const uchar *iv,     // pointer to initialization vector
-               size_t iv_len,       // IV length in bytes (should == 12)
-               const uchar *add,    // pointer to additional AEAD data (NULL if none)
-               size_t add_len );    // length of additional AEAD data (bytes)
-
-
-/******************************************************************************
- *
- *  GCM_UPDATE
- *
- *  This is called once or more to process bulk plaintext or ciphertext data.
- *  We give this some number of bytes of input and it returns the same number
- *  of output bytes. If called multiple times (which is fine) all but the final
- *  invocation MUST be called with length mod 16 == 0. (Only the final call can
- *  have a partial block length of < 128 bits.)
- *
- ******************************************************************************/
-int gcm_update( gcm_context *ctx,       // pointer to user-provided GCM context
-                size_t length,          // length, in bytes, of data to process
-                const uchar *input,     // pointer to source data
-                uchar *output );        // pointer to destination data
-
-
-/******************************************************************************
- *
- *  GCM_FINISH
- *
- *  This is called once after all calls to GCM_UPDATE to finalize the GCM.
- *  It performs the final GHASH to produce the resulting authentication TAG.
- *
- ******************************************************************************/
-int gcm_finish( gcm_context *ctx,   // pointer to user-provided GCM context
-                uchar *tag,         // ptr to tag buffer - NULL if tag_len = 0
-                size_t tag_len );   // length, in bytes, of the tag-receiving buf
-
-
-/******************************************************************************
- *
- *  GCM_ZERO_CTX
- *
- *  The GCM context contains both the GCM context and the AES context.
- *  This includes keying and key-related material which is security-
- *  sensitive, so it MUST be zeroed after use. This function does that.
- *
- ******************************************************************************/
-void gcm_zero_ctx( gcm_context *ctx );
-
-
-#endif /* GCM_HEADER */

+ 0 - 229
apps_broken_by_last_refactors/esubghz_chat/crypto_wrapper.c

@@ -1,229 +0,0 @@
-#include <furi_hal.h>
-#include <lib/mlib/m-dict.h>
-#include <toolbox/sha256.h>
-
-#ifndef FURI_HAL_CRYPTO_ADVANCED_AVAIL
-#include "crypto/gcm.h"
-#endif /* FURI_HAL_CRYPTO_ADVANCED_AVAIL */
-
-#include "crypto_wrapper.h"
-
-DICT_DEF2(ESubGhzChatReplayDict, uint64_t, uint32_t)
-
-struct ESugGhzChatCryptoCtx {
-	uint8_t key[KEY_BITS / 8];
-#ifndef FURI_HAL_CRYPTO_ADVANCED_AVAIL
-	gcm_context gcm_ctx;
-#endif /* FURI_HAL_CRYPTO_ADVANCED_AVAIL */
-	ESubGhzChatReplayDict_t replay_dict;
-	uint64_t run_id;
-	uint32_t counter;
-};
-
-struct ESubGhzChatCryptoMsg {
-	uint64_t run_id;
-	uint32_t counter;
-	uint8_t iv[IV_BYTES];
-	uint8_t tag[TAG_BYTES];
-	uint8_t data[0];
-} __attribute__ ((packed));
-
-void crypto_init(void)
-{
-#ifndef FURI_HAL_CRYPTO_ADVANCED_AVAIL
-	/* init the GCM and AES tables */
-	gcm_initialize();
-#endif /* FURI_HAL_CRYPTO_ADVANCED_AVAIL */
-}
-
-void crypto_explicit_bzero(void *s, size_t len)
-{
-	memset(s, 0, len);
-	asm volatile("" ::: "memory");
-}
-
-ESubGhzChatCryptoCtx *crypto_ctx_alloc(void)
-{
-	ESubGhzChatCryptoCtx *ret = malloc(sizeof(ESubGhzChatCryptoCtx));
-
-	if (ret != NULL) {
-		memset(ret, 0, sizeof(ESubGhzChatCryptoCtx));
-		ESubGhzChatReplayDict_init(ret->replay_dict);
-		ret->run_id = 0;
-		ret->counter = 1;
-	}
-
-	return ret;
-}
-
-void crypto_ctx_free(ESubGhzChatCryptoCtx *ctx)
-{
-	crypto_ctx_clear(ctx);
-	ESubGhzChatReplayDict_clear(ctx->replay_dict);
-	free(ctx);
-}
-
-void crypto_ctx_clear(ESubGhzChatCryptoCtx *ctx)
-{
-	crypto_explicit_bzero(ctx->key, sizeof(ctx->key));
-#ifndef FURI_HAL_CRYPTO_ADVANCED_AVAIL
-	crypto_explicit_bzero(&(ctx->gcm_ctx), sizeof(ctx->gcm_ctx));
-#endif /* FURI_HAL_CRYPTO_ADVANCED_AVAIL */
-	ESubGhzChatReplayDict_reset(ctx->replay_dict);
-	ctx->run_id = 0;
-	ctx->counter = 1;
-}
-
-static uint64_t crypto_calc_run_id(FuriString *flipper_name, uint32_t tick)
-{
-	const char *fn = furi_string_get_cstr(flipper_name);
-	size_t fn_len = strlen(fn);
-
-	uint8_t h_in[fn_len + sizeof(uint32_t)];
-	memcpy(h_in, fn, fn_len);
-	memcpy(h_in + fn_len, &tick, sizeof(uint32_t));
-
-	uint8_t h_out[256];
-	sha256(h_in, fn_len + sizeof(uint32_t), h_out);
-
-	uint64_t run_id;
-	memcpy(&run_id, h_out, sizeof(uint64_t));
-
-	return run_id;
-}
-
-bool crypto_ctx_set_key(ESubGhzChatCryptoCtx *ctx, const uint8_t *key,
-		FuriString *flipper_name, uint32_t tick)
-{
-	ctx->run_id = crypto_calc_run_id(flipper_name, tick);
-	ctx->counter = 1;
-
-	memcpy(ctx->key, key, KEY_BITS / 8);
-#ifdef FURI_HAL_CRYPTO_ADVANCED_AVAIL
-	return true;
-#else /* FURI_HAL_CRYPTO_ADVANCED_AVAIL */
-	return (gcm_setkey(&(ctx->gcm_ctx), key, KEY_BITS / 8) == 0);
-#endif /* FURI_HAL_CRYPTO_ADVANCED_AVAIL */
-}
-
-void crypto_ctx_get_key(ESubGhzChatCryptoCtx *ctx, uint8_t *key)
-{
-	memcpy(key, ctx->key, KEY_BITS / 8);
-}
-
-bool crypto_ctx_decrypt(ESubGhzChatCryptoCtx *ctx, uint8_t *in, size_t in_len,
-		uint8_t *out)
-{
-	if (in_len < MSG_OVERHEAD + 1) {
-		return false;
-	}
-
-	struct ESubGhzChatCryptoMsg *msg = (struct ESubGhzChatCryptoMsg *) in;
-
-	// check if message is stale, if yes, discard
-	uint32_t *counter = ESubGhzChatReplayDict_get(ctx->replay_dict,
-			msg->run_id);
-	if (counter != NULL) {
-		if (*counter >= __ntohl(msg->counter)) {
-			return false;
-		}
-	}
-
-	// decrypt and auth message
-#ifdef FURI_HAL_CRYPTO_ADVANCED_AVAIL
-	bool ret = (furi_hal_crypto_gcm_decrypt_and_verify(ctx->key,
-			msg->iv,
-			(uint8_t *) msg, RUN_ID_BYTES + COUNTER_BYTES,
-			msg->data, out,
-			in_len - MSG_OVERHEAD,
-			msg->tag) == FuriHalCryptoGCMStateOk);
-#else /* FURI_HAL_CRYPTO_ADVANCED_AVAIL */
-	bool ret = (gcm_auth_decrypt(&(ctx->gcm_ctx),
-			msg->iv, IV_BYTES,
-			(uint8_t *) msg, RUN_ID_BYTES + COUNTER_BYTES,
-			msg->data, out,
-			in_len - MSG_OVERHEAD,
-			msg->tag, TAG_BYTES) == 0);
-#endif /* FURI_HAL_CRYPTO_ADVANCED_AVAIL */
-
-	// if auth was successful update replay dict
-	if (ret) {
-		ESubGhzChatReplayDict_set_at(ctx->replay_dict, msg->run_id,
-				__ntohl(msg->counter));
-	}
-
-	return ret;
-}
-
-bool crypto_ctx_encrypt(ESubGhzChatCryptoCtx *ctx, uint8_t *in, size_t in_len,
-		uint8_t *out)
-{
-	struct ESubGhzChatCryptoMsg *msg = (struct ESubGhzChatCryptoMsg *) out;
-
-	// fill message header
-	msg->run_id = ctx->run_id;
-	msg->counter = __htonl(ctx->counter);
-	furi_hal_random_fill_buf(msg->iv, IV_BYTES);
-
-	// encrypt message and store tag in header
-#ifdef FURI_HAL_CRYPTO_ADVANCED_AVAIL
-	bool ret = (furi_hal_crypto_gcm_encrypt_and_tag(ctx->key,
-			msg->iv,
-			(uint8_t *) msg, RUN_ID_BYTES + COUNTER_BYTES,
-			in, msg->data,
-			in_len,
-			msg->tag) == FuriHalCryptoGCMStateOk);
-#else /* FURI_HAL_CRYPTO_ADVANCED_AVAIL */
-	bool ret = (gcm_crypt_and_tag(&(ctx->gcm_ctx), ENCRYPT,
-			msg->iv, IV_BYTES,
-			(uint8_t *) msg, RUN_ID_BYTES + COUNTER_BYTES,
-			in, msg->data,
-			in_len,
-			msg->tag, TAG_BYTES) == 0);
-#endif /* FURI_HAL_CRYPTO_ADVANCED_AVAIL */
-
-	// update replay dict and increase internal counter
-	if (ret) {
-		ESubGhzChatReplayDict_set_at(ctx->replay_dict, ctx->run_id,
-				ctx->counter);
-		ctx->counter++;
-	}
-
-	return ret;
-}
-
-size_t crypto_ctx_dump_replay_dict(ESubGhzChatCryptoCtx *ctx,
-		CryptoCtxReplayDictWriter writer, void *writer_ctx)
-{
-	size_t ret = 0;
-	ESubGhzChatReplayDict_it_t i;
-
-	for (ESubGhzChatReplayDict_it(i, ctx->replay_dict);
-			!ESubGhzChatReplayDict_end_p(i);
-			ESubGhzChatReplayDict_next(i), ret++) {
-		ESubGhzChatReplayDict_itref_t *ref =
-			ESubGhzChatReplayDict_ref(i);
-		if (!writer(ref->key, ref->value, writer_ctx)) {
-			break;
-		}
-	}
-
-	return ret;
-}
-
-size_t crypto_ctx_read_replay_dict(ESubGhzChatCryptoCtx *ctx,
-		CryptoCtxReplayDictReader reader, void *reader_ctx)
-{
-	size_t ret = 0;
-
-	uint64_t run_id;
-	uint32_t counter;
-
-	while (reader(&run_id, &counter, reader_ctx)) {
-		ESubGhzChatReplayDict_set_at(ctx->replay_dict, run_id,
-				counter);
-		ret++;
-	}
-
-	return ret;
-}

+ 0 - 48
apps_broken_by_last_refactors/esubghz_chat/crypto_wrapper.h

@@ -1,48 +0,0 @@
-#pragma once
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define RUN_ID_BYTES (sizeof(uint64_t))
-#define COUNTER_BYTES (sizeof(uint32_t))
-#define KEY_BITS 256
-#define IV_BYTES 12
-#define TAG_BYTES 16
-
-#define MSG_OVERHEAD (RUN_ID_BYTES + COUNTER_BYTES + IV_BYTES + TAG_BYTES)
-
-typedef struct ESugGhzChatCryptoCtx ESubGhzChatCryptoCtx;
-
-void crypto_init(void);
-
-/* Function to clear sensitive memory. */
-void crypto_explicit_bzero(void *s, size_t len);
-
-ESubGhzChatCryptoCtx *crypto_ctx_alloc(void);
-void crypto_ctx_free(ESubGhzChatCryptoCtx *ctx);
-
-void crypto_ctx_clear(ESubGhzChatCryptoCtx *ctx);
-
-bool crypto_ctx_set_key(ESubGhzChatCryptoCtx *ctx, const uint8_t *key,
-		FuriString *flipper_name, uint32_t tick);
-void crypto_ctx_get_key(ESubGhzChatCryptoCtx *ctx, uint8_t *key);
-
-bool crypto_ctx_decrypt(ESubGhzChatCryptoCtx *ctx, uint8_t *in, size_t in_len,
-		uint8_t *out);
-bool crypto_ctx_encrypt(ESubGhzChatCryptoCtx *ctx, uint8_t *in, size_t in_len,
-		uint8_t *out);
-
-typedef bool (*CryptoCtxReplayDictWriter)(uint64_t run_id, uint32_t counter,
-		void *context);
-typedef bool (*CryptoCtxReplayDictReader)(uint64_t *run_id, uint32_t *counter,
-		void *context);
-
-size_t crypto_ctx_dump_replay_dict(ESubGhzChatCryptoCtx *ctx,
-		CryptoCtxReplayDictWriter writer, void *writer_ctx);
-size_t crypto_ctx_read_replay_dict(ESubGhzChatCryptoCtx *ctx,
-		CryptoCtxReplayDictReader reader, void *reader_ctx);
-
-#ifdef __cplusplus
-}
-#endif

+ 0 - 874
apps_broken_by_last_refactors/esubghz_chat/esubghz_chat.c

@@ -1,874 +0,0 @@
-#include <furi_hal.h>
-#include <gui/elements.h>
-#include <gui/gui.h>
-
-#include "helpers/radio_device_loader.h"
-#include "esubghz_chat_i.h"
-
-#include "bgloader_api.h"
-
-#define CHAT_LEAVE_DELAY 10
-#define TICK_INTERVAL 50
-#define MESSAGE_COMPLETION_TIMEOUT 500
-
-#define KBD_UNLOCK_CNT 3
-#define KBD_UNLOCK_TIMEOUT 1000
-
-/* Callback for RX events from the Sub-GHz worker. Records the current ticks as
- * the time of the last reception. */
-static void have_read_cb(void* context)
-{
-	furi_assert(context);
-	ESubGhzChatState* state = context;
-
-	state->last_time_rx_data = furi_get_tick();
-}
-
-/* Sets the header for the chat input field depending on whether or not a
- * message preview exists. */
-void set_chat_input_header(ESubGhzChatState *state)
-{
-	if (strlen(state->msg_preview) == 0) {
-		text_input_set_header_text(state->text_input, "Message");
-	} else {
-		text_input_set_header_text(state->text_input,
-				state->msg_preview);
-	}
-}
-
-/* Appends the latest message to the chat box and prepares the message preview.
- */
-void append_msg(ESubGhzChatState *state, const char *msg)
-{
-	/* append message to text box */
-	furi_string_cat_printf(state->chat_box_store, "\n%s", msg);
-
-	/* prepare message preview */
-	strncpy(state->msg_preview, msg, MSG_PREVIEW_SIZE);
-	state->msg_preview[MSG_PREVIEW_SIZE] = 0;
-	set_chat_input_header(state);
-
-	/* reset text box contents and focus */
-	text_box_set_text(state->chat_box,
-			furi_string_get_cstr(state->chat_box_store));
-	text_box_set_focus(state->chat_box, TextBoxFocusEnd);
-}
-
-/* Decrypts a message for post_rx(). */
-static bool post_rx_decrypt(ESubGhzChatState *state, size_t rx_size)
-{
-	bool ret = crypto_ctx_decrypt(state->crypto_ctx,
-			state->rx_buffer, rx_size,
-			(uint8_t*) state->rx_str_buffer);
-
-	if (ret) {
-		state->rx_str_buffer[rx_size - (MSG_OVERHEAD)] = 0;
-	} else {
-		state->rx_str_buffer[0] = 0;
-	}
-
-	return ret;
-}
-
-/* Post RX handler, decrypts received messages and calls append_msg(). */
-static void post_rx(ESubGhzChatState *state, size_t rx_size)
-{
-	furi_assert(state);
-
-	if (rx_size == 0) {
-		return;
-	}
-
-	furi_check(rx_size <= RX_TX_BUFFER_SIZE);
-
-	/* decrypt if necessary */
-	if (!state->encrypted) {
-		memcpy(state->rx_str_buffer, state->rx_buffer, rx_size);
-		state->rx_str_buffer[rx_size] = 0;
-
-		/* remove trailing newline if it is there, for compat with CLI
-		 * Sub-GHz chat */
-		if (state->rx_str_buffer[rx_size - 1] == '\n') {
-			state->rx_str_buffer[rx_size - 1] = 0;
-		}
-	} else {
-		/* if decryption fails output an error message */
-		if (!post_rx_decrypt(state, rx_size)) {
-			strcpy(state->rx_str_buffer, "ERR: Decryption failed!");
-		}
-	}
-
-	/* append message to text box and prepare message preview */
-	append_msg(state, state->rx_str_buffer);
-
-	/* send notification (make the flipper vibrate) */
-	notification_message(state->notification, &sequence_single_vibro);
-}
-
-/* Reads the message from msg_input, encrypts it if necessary and then
- * transmits it. */
-void tx_msg_input(ESubGhzChatState *state)
-{
-	/* encrypt message if necessary */
-	size_t msg_len = strlen(furi_string_get_cstr(state->msg_input));
-	size_t tx_size = msg_len;
-	if (state->encrypted) {
-		tx_size += MSG_OVERHEAD;
-		furi_check(tx_size <= sizeof(state->tx_buffer));
-
-		crypto_ctx_encrypt(state->crypto_ctx,
-				(uint8_t *)
-				furi_string_get_cstr(state->msg_input),
-				msg_len,
-				state->tx_buffer);
-	} else {
-		tx_size += 2;
-		furi_check(tx_size <= sizeof(state->tx_buffer));
-		memcpy(state->tx_buffer,
-				furi_string_get_cstr(state->msg_input),
-				msg_len);
-
-		/* append \r\n for compat with Sub-GHz CLI chat */
-		state->tx_buffer[msg_len] = '\r';
-		state->tx_buffer[msg_len + 1] = '\n';
-	}
-
-	/* transmit */
-	subghz_tx_rx_worker_write(state->subghz_worker, state->tx_buffer,
-			tx_size);
-}
-
-/* Displays information on frequency, encryption and radio type in the text
- * box. Also clears the text input buffer to remove the password and starts the
- * Sub-GHz worker. After starting the worker a join message is transmitted. */
-void enter_chat(ESubGhzChatState *state)
-{
-	furi_string_cat_printf(state->chat_box_store, "Frequency: %lu",
-			state->frequency);
-
-	furi_string_cat_printf(state->chat_box_store, "\nEncrypted: %s",
-			(state->encrypted ? "yes" : "no"));
-
-	subghz_tx_rx_worker_start(state->subghz_worker, state->subghz_device,
-			state->frequency);
-
-	if (strcmp(state->subghz_device->name, "cc1101_ext") == 0) {
-		furi_string_cat_printf(state->chat_box_store,
-				"\nRadio: External");
-	} else {
-		furi_string_cat_printf(state->chat_box_store,
-				"\nRadio: Internal");
-	}
-
-
-	/* concatenate the name prefix and join message */
-	furi_string_set(state->msg_input, state->name_prefix);
-	furi_string_cat_str(state->msg_input, " joined chat.");
-
-	/* encrypt and transmit message */
-	tx_msg_input(state);
-
-	/* clear message input buffer */
-	furi_string_set_char(state->msg_input, 0, 0);
-}
-
-/* Sends a leave message */
-void exit_chat(ESubGhzChatState *state)
-{
-	/* concatenate the name prefix and leave message */
-	furi_string_set(state->msg_input, state->name_prefix);
-	furi_string_cat_str(state->msg_input, " left chat.");
-
-	/* encrypt and transmit message */
-	tx_msg_input(state);
-
-	/* clear message input buffer */
-	furi_string_set_char(state->msg_input, 0, 0);
-
-	/* wait for leave message to be delivered */
-	furi_delay_ms(CHAT_LEAVE_DELAY);
-}
-
-/* Whether or not to display the locked message. */
-static bool kbd_lock_msg_display(ESubGhzChatState *state)
-{
-	return (state->kbd_lock_msg_ticks != 0);
-}
-
-/* Whether or not to hide the locked message again. */
-static bool kbd_lock_msg_reset_timeout(ESubGhzChatState *state)
-{
-	if (state->kbd_lock_msg_ticks == 0) {
-		return false;
-	}
-
-	if (furi_get_tick() - state->kbd_lock_msg_ticks > KBD_UNLOCK_TIMEOUT) {
-		return true;
-	}
-
-	return false;
-}
-
-/* Resets the timeout for the locked message and turns off the backlight if
- * specified. */
-static void kbd_lock_msg_reset(ESubGhzChatState *state, bool backlight_off)
-{
-	state->kbd_lock_msg_ticks = 0;
-	state->kbd_lock_count = 0;
-
-	if (backlight_off) {
-		notification_message(state->notification,
-				&sequence_display_backlight_off);
-	}
-}
-
-/* Locks the keyboard. */
-static void kbd_lock(ESubGhzChatState *state)
-{
-	state->kbd_locked = true;
-	kbd_lock_msg_reset(state, true);
-}
-
-/* Unlocks the keyboard. */
-static void kbd_unlock(ESubGhzChatState *state)
-{
-	state->kbd_locked = false;
-	kbd_lock_msg_reset(state, false);
-}
-
-/* Custom event callback for view dispatcher. Just calls scene manager. */
-static bool esubghz_chat_custom_event_callback(void* context, uint32_t event)
-{
-	FURI_LOG_T(APPLICATION_NAME, "esubghz_chat_custom_event_callback");
-	furi_assert(context);
-	ESubGhzChatState* state = context;
-	return scene_manager_handle_custom_event(state->scene_manager, event);
-}
-
-/* Navigation event callback for view dispatcher. Just calls scene manager. */
-static bool esubghz_chat_navigation_event_callback(void* context)
-{
-	FURI_LOG_T(APPLICATION_NAME, "esubghz_chat_navigation_event_callback");
-	furi_assert(context);
-	ESubGhzChatState* state = context;
-	return scene_manager_handle_back_event(state->scene_manager);
-}
-
-static void esubghz_chat_check_messages(ESubGhzChatState *state)
-{
-	/* if the maximum message size was reached or the
-	 * MESSAGE_COMPLETION_TIMEOUT has expired, retrieve a message and call
-	 * post_rx() */
-	size_t avail = 0;
-	while ((avail = subghz_tx_rx_worker_available(state->subghz_worker)) >
-			0) {
-		volatile uint32_t since_last_rx = furi_get_tick() -
-			state->last_time_rx_data;
-		if (avail < RX_TX_BUFFER_SIZE && since_last_rx <
-				MESSAGE_COMPLETION_TIMEOUT) {
-			break;
-		}
-
-		size_t rx_size = subghz_tx_rx_worker_read(state->subghz_worker,
-				state->rx_buffer, RX_TX_BUFFER_SIZE);
-		post_rx(state, rx_size);
-	}
-}
-
-/* Tick event callback for view dispatcher. Called every TICK_INTERVAL. Resets
- * the locked message if necessary. Retrieves a received message from the
- * Sub-GHz worker and calls post_rx(). Then calls the scene manager. */
-static void esubghz_chat_tick_event_callback(void* context)
-{
-	FURI_LOG_T(APPLICATION_NAME, "esubghz_chat_tick_event_callback");
-
-	furi_assert(context);
-	ESubGhzChatState* state = context;
-
-	/* reset locked message if necessary */
-	if (kbd_lock_msg_reset_timeout(state)) {
-		kbd_lock_msg_reset(state, true);
-	}
-
-	esubghz_chat_check_messages(state);
-
-	/* call scene manager */
-	scene_manager_handle_tick_event(state->scene_manager);
-}
-
-/* Hooks into the view port's draw callback to overlay the keyboard locked
- * message. */
-static void esubghz_hooked_draw_callback(Canvas* canvas, void* context)
-{
-	FURI_LOG_T(APPLICATION_NAME, "esubghz_hooked_draw_callback");
-
-	furi_assert(canvas);
-
-	furi_assert(context);
-	ESubGhzChatState* state = context;
-
-	/* call original callback */
-	state->orig_draw_cb(canvas, state->view_dispatcher);
-
-	/* display if the keyboard is locked */
-	if (state->kbd_locked) {
-		canvas_set_font(canvas, FontPrimary);
-		elements_multiline_text_framed(canvas, 42, 30, "Locked");
-	}
-
-	/* display the unlock message if necessary */
-	if (kbd_lock_msg_display(state)) {
-		canvas_set_font(canvas, FontSecondary);
-		elements_bold_rounded_frame(canvas, 14, 8, 99, 48);
-		elements_multiline_text(canvas, 65, 26, "To unlock\npress:");
-		canvas_draw_icon(canvas, 65, 42, &I_Pin_back_arrow_10x8);
-		canvas_draw_icon(canvas, 80, 42, &I_Pin_back_arrow_10x8);
-		canvas_draw_icon(canvas, 95, 42, &I_Pin_back_arrow_10x8);
-		canvas_draw_icon(canvas, 16, 13, &I_WarningDolphin_45x42);
-	}
-}
-
-/* Hooks into the view port's input callback to handle the user locking the
- * keyboard. */
-static void esubghz_hooked_input_callback(InputEvent* event, void* context)
-{
-	FURI_LOG_T(APPLICATION_NAME, "esubghz_hooked_input_callback");
-
-	furi_assert(event);
-
-	furi_assert(context);
-	ESubGhzChatState* state = context;
-
-	/* if the keyboard is locked no key presses are forwarded */
-	if (state->kbd_locked) {
-		/* key has been pressed, display the unlock message and
-		 * initiate the timer */
-		if (state->kbd_lock_count == 0) {
-			state->kbd_lock_msg_ticks = furi_get_tick();
-		}
-
-		/* back button has been pressed, increase the lock counter */
-		if (event->key == InputKeyBack && event->type ==
-				InputTypeShort) {
-			state->kbd_lock_count++;
-		}
-
-		/* unlock the keyboard */
-		if (state->kbd_lock_count >= KBD_UNLOCK_CNT) {
-			kbd_unlock(state);
-		}
-
-		/* do not handle the event */
-		return;
-	}
-
-	/* handle long press of back key to exit for real */
-	if (event->key == InputKeyBack) {
-		if (state->view_dispatcher->current_view ==
-				text_input_get_view(state->text_input)) {
-			if (event->type == InputTypeLong) {
-				state->exit_for_real = true;
-				view_dispatcher_stop(state->view_dispatcher);
-				return;
-			}
-		}
-	}
-
-	if (event->key == InputKeyOk) {
-		/* if we are in the chat view and no input is ongoing, allow
-		 * locking */
-		if (state->view_dispatcher->current_view ==
-				text_box_get_view(state->chat_box) &&
-				!(state->kbd_ok_input_ongoing)) {
-			/* lock keyboard upon long press of Ok button */
-			if (event->type == InputTypeLong) {
-				kbd_lock(state);
-			}
-
-			/* do not handle any Ok key events to prevent blocking
-			 * of other keys */
-			return;
-		}
-
-		/* handle ongoing inputs when changing to chat view */
-		if (event->type == InputTypePress) {
-			state->kbd_ok_input_ongoing = true;
-		} else if (event->type == InputTypeRelease) {
-			state->kbd_ok_input_ongoing = false;
-		}
-	}
-
-	if (event->key == InputKeyLeft) {
-		/* if we are in the chat view and no input is ongoing, allow
-		 * switching to msg input */
-		if (state->view_dispatcher->current_view ==
-				text_box_get_view(state->chat_box) &&
-				!(state->kbd_left_input_ongoing)) {
-			/* go to msg input upon short press of Left button */
-			if (event->type == InputTypeShort) {
-				view_dispatcher_send_custom_event(state->view_dispatcher,
-						ESubGhzChatEvent_GotoMsgInput);
-			}
-
-			/* do not handle any Left key events to prevent
-			 * blocking of other keys */
-			return;
-		}
-
-		/* handle ongoing inputs when changing to chat view */
-		if (event->type == InputTypePress) {
-			state->kbd_left_input_ongoing = true;
-		} else if (event->type == InputTypeRelease) {
-			state->kbd_left_input_ongoing = false;
-		}
-	}
-
-	if (event->key == InputKeyRight) {
-		/* if we are in the chat view and no input is ongoing, allow
-		 * switching to key display */
-		if (state->view_dispatcher->current_view ==
-				text_box_get_view(state->chat_box) &&
-				!(state->kbd_right_input_ongoing)) {
-			/* go to key display upon short press of Right button
-			 */
-			if (event->type == InputTypeShort) {
-				view_dispatcher_send_custom_event(state->view_dispatcher,
-						ESubGhzChatEvent_GotoKeyDisplay);
-			}
-
-			/* do not handle any Right key events to prevent
-			 * blocking of other keys */
-			return;
-		}
-
-		/* handle ongoing inputs when changing to chat view */
-		if (event->type == InputTypePress) {
-			state->kbd_right_input_ongoing = true;
-		} else if (event->type == InputTypeRelease) {
-			state->kbd_right_input_ongoing = false;
-		}
-	}
-
-	/* call original callback */
-	state->orig_input_cb(event, state->view_dispatcher);
-}
-
-static const char *esubghz_get_bgloader_app_path(const char *args)
-{
-	size_t base_args_len = strlen(APP_BASE_ARGS);
-
-	return (args + base_args_len + 1);
-}
-
-static bool esubghz_run_with_bgloader(const char *args)
-{
-	size_t base_args_len = strlen(APP_BASE_ARGS);
-
-	if (args == NULL) {
-		return false;
-	}
-
-	if (strncmp(args, APP_BASE_ARGS, base_args_len) != 0) {
-		return false;
-	}
-
-	if (strlen(args) < base_args_len + 2) {
-		return false;
-	}
-
-	if (args[base_args_len] != ':') {
-		return false;
-	}
-
-	const char *app_path = esubghz_get_bgloader_app_path(args);
-	return furi_record_exists(app_path);
-}
-
-static void esubghz_attach_to_gui(ESubGhzChatState *state)
-{
-	Gui *gui = furi_record_open(RECORD_GUI);
-	view_dispatcher_attach_to_gui(state->view_dispatcher, gui,
-			ViewDispatcherTypeFullscreen);
-}
-
-static void esubghz_detach_from_gui(ESubGhzChatState *state)
-{
-	gui_remove_view_port(state->view_dispatcher->gui,
-			state->view_dispatcher->view_port);
-	state->view_dispatcher->gui = NULL;
-	furi_record_close(RECORD_GUI);
-}
-
-static void esubghz_bgloader_loop(ESubGhzChatState *state, const char
-		*bg_app_path)
-{
-	while (true) {
-		view_dispatcher_run(state->view_dispatcher);
-		
-		if (state->exit_for_real) {
-			/* exit for real */
-			break;
-		}
-		
-		BGLoaderApp *bg_app = furi_record_open(bg_app_path);
-		
-		/* signal loader that we're ready to go to background */
-		BGLoaderMessage msg;
-		msg.type = BGLoaderMessageType_LoaderBackground;
-		furi_check(furi_message_queue_put(bg_app->to_loader, &msg,
-					FuriWaitForever) == FuriStatusOk);
-		
-		esubghz_detach_from_gui(state);
-
-		while (true) {
-			/* wait for loader to wake us up again */
-			if (furi_message_queue_get(bg_app->to_app, &msg,
-						TICK_INTERVAL) != FuriStatusOk)
-			{
-				/* check for messages on timeout */
-				esubghz_chat_check_messages(state);
-				continue;
-			}
-			if (msg.type == BGLoaderMessageType_AppReattached) {
-				break;
-			} else {
-				furi_check(0);
-			}
-		}
-		
-		furi_record_close(bg_app_path);
-		
-		esubghz_attach_to_gui(state);
-        }
-}
-
-static bool helper_strings_alloc(ESubGhzChatState *state)
-{
-	furi_assert(state);
-
-	state->name_prefix = furi_string_alloc();
-	if (state->name_prefix == NULL) {
-		return false;
-	}
-
-	state->msg_input = furi_string_alloc();
-	if (state->msg_input == NULL) {
-		furi_string_free(state->name_prefix);
-		return false;
-	}
-
-	return true;
-}
-
-static void helper_strings_free(ESubGhzChatState *state)
-{
-	furi_assert(state);
-
-	furi_string_free(state->name_prefix);
-	furi_string_free(state->msg_input);
-}
-
-static bool chat_box_alloc(ESubGhzChatState *state)
-{
-	furi_assert(state);
-
-	state->chat_box = text_box_alloc();
-	if (state->chat_box == NULL) {
-		return false;
-	}
-
-	state->chat_box_store = furi_string_alloc();
-	if (state->chat_box_store == NULL) {
-		text_box_free(state->chat_box);
-		return false;
-	}
-
-	furi_string_reserve(state->chat_box_store, CHAT_BOX_STORE_SIZE);
-	furi_string_set_char(state->chat_box_store, 0, 0);
-	text_box_set_text(state->chat_box,
-			furi_string_get_cstr(state->chat_box_store));
-	text_box_set_focus(state->chat_box, TextBoxFocusEnd);
-
-	return true;
-}
-
-static void chat_box_free(ESubGhzChatState *state)
-{
-	furi_assert(state);
-
-	text_box_free(state->chat_box);
-	furi_string_free(state->chat_box_store);
-}
-
-int32_t esubghz_chat(const char *args)
-{
-	/* init the crypto system */
-	crypto_init();
-
-	int32_t err = -1;
-
-	FURI_LOG_I(APPLICATION_NAME, "Starting...");
-
-	/* allocate necessary structs and buffers */
-
-	ESubGhzChatState *state = malloc(sizeof(ESubGhzChatState));
-	if (state == NULL) {
-		goto err_alloc;
-	}
-	memset(state, 0, sizeof(*state));
-
-	state->scene_manager = scene_manager_alloc(
-			&esubghz_chat_scene_event_handlers, state);
-	if (state->scene_manager == NULL) {
-		goto err_alloc_sm;
-	}
-
-	state->view_dispatcher = view_dispatcher_alloc();
-	if (state->view_dispatcher == NULL) {
-		goto err_alloc_vd;
-	}
-
-	if (!helper_strings_alloc(state)) {
-		goto err_alloc_hs;
-	}
-
-	state->menu = menu_alloc();
-	if (state->menu == NULL) {
-		goto err_alloc_menu;
-	}
-
-	state->text_input = text_input_alloc();
-	if (state->text_input == NULL) {
-		goto err_alloc_ti;
-	}
-
-	state->hex_key_input = byte_input_alloc();
-	if (state->hex_key_input == NULL) {
-		goto err_alloc_hki;
-	}
-
-	if (!chat_box_alloc(state)) {
-		goto err_alloc_cb;
-	}
-
-	state->key_display = dialog_ex_alloc();
-	if (state->key_display == NULL) {
-		goto err_alloc_kd;
-	}
-
-	state->nfc_popup = popup_alloc();
-	if (state->nfc_popup == NULL) {
-		goto err_alloc_np;
-	}
-
-	state->subghz_worker = subghz_tx_rx_worker_alloc();
-	if (state->subghz_worker == NULL) {
-		goto err_alloc_worker;
-	}
-
-	state->nfc_worker = nfc_worker_alloc();
-	if (state->nfc_worker == NULL) {
-		goto err_alloc_nworker;
-	}
-
-	state->nfc_dev_data = malloc(sizeof(NfcDeviceData));
-	if (state->nfc_dev_data == NULL) {
-		goto err_alloc_ndevdata;
-	}
-	memset(state->nfc_dev_data, 0, sizeof(NfcDeviceData));
-
-	state->crypto_ctx = crypto_ctx_alloc();
-	if (state->crypto_ctx == NULL) {
-		goto err_alloc_crypto;
-	}
-
-	/* set the default frequency */
-	state->frequency = DEFAULT_FREQ;
-
-	/* in the first few views there is no background support */
-	state->exit_for_real = true;
-
-	/* set the have_read callback of the Sub-GHz worker */
-	subghz_tx_rx_worker_set_callback_have_read(state->subghz_worker,
-			have_read_cb, state);
-
-	/* enter suppress charge mode */
-	furi_hal_power_suppress_charge_enter();
-
-	/* init internal device */
-	subghz_devices_init();
-
-	state->subghz_device = radio_device_loader_set(state->subghz_device,
-			SubGhzRadioDeviceTypeExternalCC1101);
-
-	subghz_devices_reset(state->subghz_device);
-	subghz_devices_idle(state->subghz_device);
-
-	/* set chat name prefix */
-	furi_string_printf(state->name_prefix, "%s",
-			furi_hal_version_get_name_ptr());
-
-	/* get notification record, we use this to make the flipper vibrate */
-	/* no error handling here, don't know how */
-	state->notification = furi_record_open(RECORD_NOTIFICATION);
-
-	/* hook into the view port's draw and input callbacks */
-	state->orig_draw_cb = state->view_dispatcher->view_port->draw_callback;
-	state->orig_input_cb = state->view_dispatcher->view_port->input_callback;
-	view_port_draw_callback_set(state->view_dispatcher->view_port,
-			esubghz_hooked_draw_callback, state);
-	view_port_input_callback_set(state->view_dispatcher->view_port,
-			esubghz_hooked_input_callback, state);
-
-	view_dispatcher_enable_queue(state->view_dispatcher);
-
-	/* set callbacks for view dispatcher */
-	view_dispatcher_set_event_callback_context(state->view_dispatcher, state);
-	view_dispatcher_set_custom_event_callback(
-			state->view_dispatcher,
-			esubghz_chat_custom_event_callback);
-	view_dispatcher_set_navigation_event_callback(
-			state->view_dispatcher,
-			esubghz_chat_navigation_event_callback);
-	view_dispatcher_set_tick_event_callback(
-			state->view_dispatcher,
-			esubghz_chat_tick_event_callback,
-			TICK_INTERVAL);
-
-	/* add our two views to the view dispatcher */
-	view_dispatcher_add_view(state->view_dispatcher, ESubGhzChatView_Menu,
-			menu_get_view(state->menu));
-	view_dispatcher_add_view(state->view_dispatcher, ESubGhzChatView_Input,
-			text_input_get_view(state->text_input));
-	view_dispatcher_add_view(state->view_dispatcher, ESubGhzChatView_HexKeyInput,
-			byte_input_get_view(state->hex_key_input));
-	view_dispatcher_add_view(state->view_dispatcher, ESubGhzChatView_ChatBox,
-			text_box_get_view(state->chat_box));
-	view_dispatcher_add_view(state->view_dispatcher, ESubGhzChatView_KeyDisplay,
-			dialog_ex_get_view(state->key_display));
-	view_dispatcher_add_view(state->view_dispatcher, ESubGhzChatView_NfcPopup,
-			popup_get_view(state->nfc_popup));
-
-	/* get the GUI record and attach the view dispatcher to the GUI */
-	/* no error handling here, don't know how */
-	Gui *gui = furi_record_open(RECORD_GUI);
-	view_dispatcher_attach_to_gui(state->view_dispatcher, gui,
-			ViewDispatcherTypeFullscreen);
-
-	/* switch to the key menu scene */
-	scene_manager_next_scene(state->scene_manager, ESubGhzChatScene_KeyMenu);
-
-	/* run the view dispatcher, this call only returns when we close the
-	 * application */
-	if (!esubghz_run_with_bgloader(args)) {
-		view_dispatcher_run(state->view_dispatcher);
-	} else {
-		const char *bg_app_path = esubghz_get_bgloader_app_path(args);
-		esubghz_bgloader_loop(state, bg_app_path);
-	}
-
-	/* if it is running, stop the Sub-GHz worker */
-	if (subghz_tx_rx_worker_is_running(state->subghz_worker)) {
-		exit_chat(state);
-		subghz_tx_rx_worker_stop(state->subghz_worker);
-	}
-
-	/* if it is running, stop the NFC worker */
-	nfc_worker_stop(state->nfc_worker);
-
-	err = 0;
-
-	/* close GUI record */
-	furi_record_close(RECORD_GUI);
-
-	/* remove our two views from the view dispatcher */
-	view_dispatcher_remove_view(state->view_dispatcher,
-			ESubGhzChatView_Menu);
-	view_dispatcher_remove_view(state->view_dispatcher,
-			ESubGhzChatView_Input);
-	view_dispatcher_remove_view(state->view_dispatcher,
-			ESubGhzChatView_HexKeyInput);
-	view_dispatcher_remove_view(state->view_dispatcher,
-			ESubGhzChatView_ChatBox);
-	view_dispatcher_remove_view(state->view_dispatcher,
-			ESubGhzChatView_KeyDisplay);
-	view_dispatcher_remove_view(state->view_dispatcher,
-			ESubGhzChatView_NfcPopup);
-
-	/* close notification record */
-	furi_record_close(RECORD_NOTIFICATION);
-
-	/* clear the key and potential password */
-	crypto_explicit_bzero(state->text_input_store,
-			sizeof(state->text_input_store));
-	crypto_explicit_bzero(state->hex_key_input_store,
-			sizeof(state->hex_key_input_store));
-	crypto_explicit_bzero(state->key_hex_str, sizeof(state->key_hex_str));
-	crypto_ctx_clear(state->crypto_ctx);
-
-	/* clear nfc data */
-	if (state->nfc_dev_data->parsed_data != NULL) {
-		furi_string_free(state->nfc_dev_data->parsed_data);
-	}
-	crypto_explicit_bzero(state->nfc_dev_data, sizeof(NfcDeviceData));
-
-	/* deinit devices */
-	radio_device_loader_end(state->subghz_device);
-
-	subghz_devices_deinit();
-
-	/* exit suppress charge mode */
-	furi_hal_power_suppress_charge_exit();
-
-	/* free everything we allocated */
-
-	crypto_ctx_free(state->crypto_ctx);
-
-err_alloc_crypto:
-	free(state->nfc_dev_data);
-
-err_alloc_ndevdata:
-	nfc_worker_free(state->nfc_worker);
-
-err_alloc_nworker:
-	subghz_tx_rx_worker_free(state->subghz_worker);
-
-err_alloc_worker:
-	popup_free(state->nfc_popup);
-
-err_alloc_np:
-	dialog_ex_free(state->key_display);
-
-err_alloc_kd:
-	chat_box_free(state);
-
-err_alloc_cb:
-	byte_input_free(state->hex_key_input);
-
-err_alloc_hki:
-	text_input_free(state->text_input);
-
-err_alloc_ti:
-	menu_free(state->menu);
-
-err_alloc_menu:
-	helper_strings_free(state);
-
-err_alloc_hs:
-	view_dispatcher_free(state->view_dispatcher);
-
-err_alloc_vd:
-	scene_manager_free(state->scene_manager);
-
-err_alloc_sm:
-	free(state);
-
-err_alloc:
-	if (err != 0) {
-		FURI_LOG_E(APPLICATION_NAME, "Failed to launch (alloc error)!");
-	} else {
-		FURI_LOG_I(APPLICATION_NAME, "Clean exit.");
-	}
-
-	return err;
-}

+ 0 - 126
apps_broken_by_last_refactors/esubghz_chat/esubghz_chat_i.h

@@ -1,126 +0,0 @@
-#pragma once
-
-#include <furi.h>
-#include <gui/view_dispatcher_i.h>
-#include <gui/view_port_i.h>
-#include <gui/scene_manager.h>
-#include <gui/modules/byte_input.h>
-#include <gui/modules/dialog_ex.h>
-#include <gui/modules/menu.h>
-#include <gui/modules/popup.h>
-#include <gui/modules/text_box.h>
-#include <gui/modules/text_input.h>
-#include <notification/notification_messages.h>
-#include <lib/nfc/nfc_worker.h>
-#include <lib/subghz/subghz_tx_rx_worker.h>
-#include <toolbox/sha256.h>
-
-#include "crypto_wrapper.h"
-#include "scenes/esubghz_chat_scene.h"
-
-#include "esubghz_chat_icons.h"
-
-#define APPLICATION_NAME "ESubGhzChat"
-
-#define DEFAULT_FREQ 433920000
-
-#define KEY_READ_POPUP_MS 3000
-
-#define RX_TX_BUFFER_SIZE 1024
-
-#define CHAT_BOX_STORE_SIZE 4096
-#define TEXT_INPUT_STORE_SIZE 256
-#define MSG_PREVIEW_SIZE 32
-
-#define KEY_HEX_STR_SIZE ((KEY_BITS / 8) * 3)
-
-typedef struct {
-	SceneManager *scene_manager;
-	ViewDispatcher *view_dispatcher;
-	NotificationApp *notification;
-
-	// UI elements
-	Menu *menu;
-	TextBox *chat_box;
-	FuriString *chat_box_store;
-	TextInput *text_input;
-	char text_input_store[TEXT_INPUT_STORE_SIZE + 1];
-	ByteInput *hex_key_input;
-	uint8_t hex_key_input_store[KEY_BITS / 8];
-	DialogEx *key_display;
-	char key_hex_str[KEY_HEX_STR_SIZE + 1];
-	Popup *nfc_popup;
-
-	// for Sub-GHz
-	uint32_t frequency;
-	SubGhzTxRxWorker *subghz_worker;
-	const SubGhzDevice *subghz_device;
-
-	// for NFC
-	NfcWorker *nfc_worker;
-	NfcDeviceData *nfc_dev_data;
-
-	// message assembly before TX
-	FuriString *name_prefix;
-	FuriString *msg_input;
-
-	// message preview
-	char msg_preview[MSG_PREVIEW_SIZE + 1];
-
-	// encryption
-	bool encrypted;
-	ESubGhzChatCryptoCtx *crypto_ctx;
-
-	// RX and TX buffers
-	uint8_t rx_buffer[RX_TX_BUFFER_SIZE];
-	uint8_t tx_buffer[RX_TX_BUFFER_SIZE];
-	char rx_str_buffer[RX_TX_BUFFER_SIZE + 1];
-	volatile uint32_t last_time_rx_data;
-
-	// for locking
-	ViewPortDrawCallback orig_draw_cb;
-	ViewPortInputCallback orig_input_cb;
-	bool kbd_locked;
-	uint32_t kbd_lock_msg_ticks;
-	uint8_t kbd_lock_count;
-
-	// for ongoing inputs
-	bool kbd_ok_input_ongoing;
-	bool kbd_left_input_ongoing;
-	bool kbd_right_input_ongoing;
-
-	// for background support
-	bool exit_for_real;
-} ESubGhzChatState;
-
-typedef enum {
-	ESubGhzChatEvent_FreqEntered,
-	ESubGhzChatEvent_KeyMenuNoEncryption,
-	ESubGhzChatEvent_KeyMenuPassword,
-	ESubGhzChatEvent_KeyMenuHexKey,
-	ESubGhzChatEvent_KeyMenuGenKey,
-	ESubGhzChatEvent_KeyMenuReadKeyFromNfc,
-	ESubGhzChatEvent_KeyReadPopupFailed,
-	ESubGhzChatEvent_KeyReadPopupSucceeded,
-	ESubGhzChatEvent_PassEntered,
-	ESubGhzChatEvent_HexKeyEntered,
-	ESubGhzChatEvent_MsgEntered,
-	ESubGhzChatEvent_GotoMsgInput,
-	ESubGhzChatEvent_GotoKeyDisplay,
-	ESubGhzChatEvent_KeyDisplayBack,
-	ESubGhzChatEvent_KeyDisplayShare,
-} ESubGhzChatEvent;
-
-typedef enum {
-	ESubGhzChatView_Menu,
-	ESubGhzChatView_Input,
-	ESubGhzChatView_HexKeyInput,
-	ESubGhzChatView_ChatBox,
-	ESubGhzChatView_KeyDisplay,
-	ESubGhzChatView_NfcPopup,
-} ESubGhzChatView;
-
-void set_chat_input_header(ESubGhzChatState *state);
-void append_msg(ESubGhzChatState *state, const char *msg);
-void tx_msg_input(ESubGhzChatState *state);
-void enter_chat(ESubGhzChatState *state);

+ 0 - 25
apps_broken_by_last_refactors/esubghz_chat/helpers/nfc_helpers.h

@@ -1,25 +0,0 @@
-#pragma once
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define NFC_MAX_BYTES 256
-#define NFC_CONFIG_PAGES 4
-
-struct FreqNfcEntry {
-	uint32_t frequency;
-	uint32_t unused1;
-	uint32_t unused2;
-	uint32_t unused3;
-} __attribute__ ((packed));
-
-struct ReplayDictNfcEntry {
-	uint64_t run_id;
-	uint32_t counter;
-	uint32_t unused;
-} __attribute__ ((packed));
-
-#ifdef __cplusplus
-}
-#endif

+ 0 - 65
apps_broken_by_last_refactors/esubghz_chat/helpers/radio_device_loader.c

@@ -1,65 +0,0 @@
-#include "radio_device_loader.h"
-
-#include <applications/drivers/subghz/cc1101_ext/cc1101_ext_interconnect.h>
-#include <lib/subghz/devices/cc1101_int/cc1101_int_interconnect.h>
-
-static void radio_device_loader_power_on() {
-    uint8_t attempts = 0;
-    while(!furi_hal_power_is_otg_enabled() && attempts++ < 5) {
-        furi_hal_power_enable_otg();
-        //CC1101 power-up time
-        furi_delay_ms(10);
-    }
-}
-
-static void radio_device_loader_power_off() {
-    if(furi_hal_power_is_otg_enabled()) furi_hal_power_disable_otg();
-}
-
-bool radio_device_loader_is_connect_external(const char* name) {
-    bool is_connect = false;
-    bool is_otg_enabled = furi_hal_power_is_otg_enabled();
-
-    if(!is_otg_enabled) {
-        radio_device_loader_power_on();
-    }
-
-    const SubGhzDevice* device = subghz_devices_get_by_name(name);
-    if(device) {
-        is_connect = subghz_devices_is_connect(device);
-    }
-
-    if(!is_otg_enabled) {
-        radio_device_loader_power_off();
-    }
-    return is_connect;
-}
-
-const SubGhzDevice* radio_device_loader_set(
-    const SubGhzDevice* current_radio_device,
-    SubGhzRadioDeviceType radio_device_type) {
-    const SubGhzDevice* radio_device;
-
-    if(radio_device_type == SubGhzRadioDeviceTypeExternalCC1101 &&
-       radio_device_loader_is_connect_external(SUBGHZ_DEVICE_CC1101_EXT_NAME)) {
-        radio_device_loader_power_on();
-        radio_device = subghz_devices_get_by_name(SUBGHZ_DEVICE_CC1101_EXT_NAME);
-        subghz_devices_begin(radio_device);
-    } else if(current_radio_device == NULL) {
-        radio_device = subghz_devices_get_by_name(SUBGHZ_DEVICE_CC1101_INT_NAME);
-    } else {
-        radio_device_loader_end(current_radio_device);
-        radio_device = subghz_devices_get_by_name(SUBGHZ_DEVICE_CC1101_INT_NAME);
-    }
-
-    return radio_device;
-}
-
-void radio_device_loader_end(const SubGhzDevice* radio_device) {
-    furi_assert(radio_device);
-    radio_device_loader_power_off();
-    // Code below is not used (and will cause crash) since its called from tx_rx worker end!
-    //if(radio_device != subghz_devices_get_by_name(SUBGHZ_DEVICE_CC1101_INT_NAME)) {
-    //    subghz_devices_end(radio_device);
-    //}
-}

+ 0 - 15
apps_broken_by_last_refactors/esubghz_chat/helpers/radio_device_loader.h

@@ -1,15 +0,0 @@
-#pragma once
-
-#include <lib/subghz/devices/devices.h>
-
-/** SubGhzRadioDeviceType */
-typedef enum {
-    SubGhzRadioDeviceTypeInternal,
-    SubGhzRadioDeviceTypeExternalCC1101,
-} SubGhzRadioDeviceType;
-
-const SubGhzDevice* radio_device_loader_set(
-    const SubGhzDevice* current_radio_device,
-    SubGhzRadioDeviceType radio_device_type);
-
-void radio_device_loader_end(const SubGhzDevice* radio_device);

+ 0 - 67
apps_broken_by_last_refactors/esubghz_chat/scenes/esubghz_chat_chat_box.c

@@ -1,67 +0,0 @@
-#include "../esubghz_chat_i.h"
-
-/* Prepares the text box scene. */
-void scene_on_enter_chat_box(void* context)
-{
-	FURI_LOG_T(APPLICATION_NAME, "scene_on_enter_chat_box");
-
-	furi_assert(context);
-	ESubGhzChatState* state = context;
-
-	text_box_reset(state->chat_box);
-	text_box_set_text(state->chat_box,
-			furi_string_get_cstr(state->chat_box_store));
-	text_box_set_focus(state->chat_box, TextBoxFocusEnd);
-
-	view_dispatcher_switch_to_view(state->view_dispatcher, ESubGhzChatView_ChatBox);
-}
-
-/* Handles scene manager events for the text box scene. */
-bool scene_on_event_chat_box(void* context, SceneManagerEvent event)
-{
-	FURI_LOG_T(APPLICATION_NAME, "scene_on_event_chat_box");
-
-	furi_assert(context);
-	ESubGhzChatState* state = context;
-
-	bool consumed = false;
-
-	switch(event.type) {
-	case SceneManagerEventTypeCustom:
-		switch(event.event) {
-		/* switch to message input scene */
-		case ESubGhzChatEvent_GotoMsgInput:
-			if (!scene_manager_previous_scene(
-						state->scene_manager)) {
-				/* error condition, exit for real */
-				state->exit_for_real = true;
-				view_dispatcher_stop(state->view_dispatcher);
-			}
-			consumed = true;
-			break;
-		case ESubGhzChatEvent_GotoKeyDisplay:
-			scene_manager_next_scene(state->scene_manager,
-					ESubGhzChatScene_KeyDisplay);
-			consumed = true;
-			break;
-		}
-		break;
-
-	default:
-		consumed = false;
-		break;
-	}
-
-	return consumed;
-}
-
-/* Cleans up the text box scene. */
-void scene_on_exit_chat_box(void* context)
-{
-	FURI_LOG_T(APPLICATION_NAME, "scene_on_exit_chat_box");
-
-	furi_assert(context);
-	ESubGhzChatState* state = context;
-
-	text_box_reset(state->chat_box);
-}

+ 0 - 118
apps_broken_by_last_refactors/esubghz_chat/scenes/esubghz_chat_chat_input.c

@@ -1,118 +0,0 @@
-#include "../esubghz_chat_i.h"
-
-/* If no message was entred this simply emits a MsgEntered event to the scene
- * manager to switch to the text box. If a message was entered it is appended
- * to the name string. The result is encrypted, if encryption is enabled, and
- * then copied into the TX buffer. The contents of the TX buffer are then
- * transmitted. The sent message is appended to the text box and a MsgEntered
- * event is sent to the scene manager to switch to the text box view. */
-static bool chat_input_validator(const char *text, FuriString *error,
-		void *context)
-{
-	UNUSED(error);
-
-	furi_assert(context);
-	ESubGhzChatState* state = context;
-
-	/* no message, just switch to the text box view */
-	if (strlen(text) == 0) {
-		view_dispatcher_send_custom_event(state->view_dispatcher,
-				ESubGhzChatEvent_MsgEntered);
-		return true;
-	}
-
-	/* concatenate the name prefix and the actual message */
-	furi_string_set(state->msg_input, state->name_prefix);
-	furi_string_cat_str(state->msg_input, ": ");
-	furi_string_cat_str(state->msg_input, text);
-
-	/* append the message to the chat box and prepare message preview */
-	append_msg(state, furi_string_get_cstr(state->msg_input));
-
-	/* encrypt and transmit message */
-	tx_msg_input(state);
-
-	/* clear message input buffer */
-	furi_string_set_char(state->msg_input, 0, 0);
-
-	/* switch to text box view */
-	view_dispatcher_send_custom_event(state->view_dispatcher,
-			ESubGhzChatEvent_MsgEntered);
-
-	return true;
-}
-
-/* Prepares the message input scene. */
-void scene_on_enter_chat_input(void* context)
-{
-	FURI_LOG_T(APPLICATION_NAME, "scene_on_enter_chat_input");
-
-	furi_assert(context);
-	ESubGhzChatState* state = context;
-
-	state->text_input_store[0] = 0;
-	text_input_reset(state->text_input);
-	/* use validator for scene change to get around minimum length
-	 * requirement */
-	text_input_set_result_callback(
-			state->text_input,
-			NULL,
-			NULL,
-			state->text_input_store,
-			sizeof(state->text_input_store),
-			true);
-	text_input_set_validator(
-			state->text_input,
-			chat_input_validator,
-			state);
-	set_chat_input_header(state);
-
-	view_dispatcher_switch_to_view(state->view_dispatcher, ESubGhzChatView_Input);
-}
-
-/* Handles scene manager events for the message input scene. */
-bool scene_on_event_chat_input(void* context, SceneManagerEvent event)
-{
-	FURI_LOG_T(APPLICATION_NAME, "scene_on_event_chat_input");
-
-	furi_assert(context);
-	ESubGhzChatState* state = context;
-
-	bool consumed = false;
-
-	switch(event.type) {
-	case SceneManagerEventTypeCustom:
-		switch(event.event) {
-		/* switch to text box scene */
-		case ESubGhzChatEvent_MsgEntered:
-			scene_manager_next_scene(state->scene_manager,
-					ESubGhzChatScene_ChatBox);
-			consumed = true;
-			break;
-		}
-		break;
-
-	case SceneManagerEventTypeBack:
-		/* stop the application if the user presses back here */
-		view_dispatcher_stop(state->view_dispatcher);
-		consumed = true;
-		break;
-
-	default:
-		consumed = false;
-		break;
-	}
-
-	return consumed;
-}
-
-/* Cleans up the password input scene. */
-void scene_on_exit_chat_input(void* context)
-{
-	FURI_LOG_T(APPLICATION_NAME, "scene_on_exit_chat_input");
-
-	furi_assert(context);
-	ESubGhzChatState* state = context;
-
-	text_input_reset(state->text_input);
-}

+ 0 - 128
apps_broken_by_last_refactors/esubghz_chat/scenes/esubghz_chat_freq_input.c

@@ -1,128 +0,0 @@
-#include "../esubghz_chat_i.h"
-
-/* Sends FreqEntered event to scene manager and enters the chat. */
-static void freq_input_cb(void *context)
-{
-	furi_assert(context);
-	ESubGhzChatState* state = context;
-
-	enter_chat(state);
-
-	/* starting from here running in background is supported */
-	state->exit_for_real = false;
-
-	view_dispatcher_send_custom_event(state->view_dispatcher,
-			ESubGhzChatEvent_FreqEntered);
-}
-
-/* Validates the entered frequency. */
-static bool freq_input_validator(const char *text, FuriString *error,
-		void *context)
-{
-	furi_assert(text);
-	furi_assert(error);
-
-	furi_assert(context);
-	ESubGhzChatState* state = context;
-
-        int ret = sscanf(text, "%lu", &(state->frequency));
-	if (ret != 1) {
-		furi_string_printf(error, "Please enter\nfrequency\nin Hz!");
-		return false;
-	}
-
-	if (!subghz_devices_is_frequency_valid(state->subghz_device,
-				state->frequency)) {
-		furi_string_printf(error, "Frequency\n%lu\n is invalid!",
-				state->frequency);
-		return false;
-	}
-
-#ifdef FW_ORIGIN_Official
-	if (!furi_hal_region_is_frequency_allowed(state->frequency)) {
-#else /* FW_ORIGIN_Official */
-	if (!furi_hal_subghz_is_tx_allowed(state->frequency)) {
-#endif /* FW_ORIGIN_Official */
-		furi_string_printf(error, "TX forbidden\non frequency\n%lu!",
-				state->frequency);
-		return false;
-	}
-
-	return true;
-}
-
-/* Prepares the frequency input scene. */
-void scene_on_enter_freq_input(void* context)
-{
-	FURI_LOG_T(APPLICATION_NAME, "scene_on_enter_freq_input");
-
-	furi_assert(context);
-	ESubGhzChatState* state = context;
-
-	snprintf(state->text_input_store, TEXT_INPUT_STORE_SIZE, "%lu",
-			state->frequency);
-	text_input_reset(state->text_input);
-	text_input_set_result_callback(
-			state->text_input,
-			freq_input_cb,
-			state,
-			state->text_input_store,
-			sizeof(state->text_input_store),
-			true);
-	text_input_set_validator(
-			state->text_input,
-			freq_input_validator,
-			state);
-	text_input_set_header_text(
-			state->text_input,
-			"Frequency");
-
-	view_dispatcher_switch_to_view(state->view_dispatcher, ESubGhzChatView_Input);
-}
-
-/* Handles scene manager events for the frequency input scene. */
-bool scene_on_event_freq_input(void* context, SceneManagerEvent event)
-{
-	FURI_LOG_T(APPLICATION_NAME, "scene_on_event_freq_input");
-
-	furi_assert(context);
-	ESubGhzChatState* state = context;
-
-	bool consumed = false;
-
-	switch(event.type) {
-	case SceneManagerEventTypeCustom:
-		switch(event.event) {
-		/* switch to message input scene */
-		case ESubGhzChatEvent_FreqEntered:
-			scene_manager_next_scene(state->scene_manager,
-					ESubGhzChatScene_ChatInput);
-			consumed = true;
-			break;
-		}
-		break;
-
-	case SceneManagerEventTypeBack:
-		/* stop the application if the user presses back here */
-		view_dispatcher_stop(state->view_dispatcher);
-		consumed = true;
-		break;
-
-	default:
-		consumed = false;
-		break;
-	}
-
-	return consumed;
-}
-
-/* Cleans up the frequency input scene. */
-void scene_on_exit_freq_input(void* context)
-{
-	FURI_LOG_T(APPLICATION_NAME, "scene_on_exit_freq_input");
-
-	furi_assert(context);
-	ESubGhzChatState* state = context;
-
-	text_input_reset(state->text_input);
-}

+ 0 - 89
apps_broken_by_last_refactors/esubghz_chat/scenes/esubghz_chat_hex_key_input.c

@@ -1,89 +0,0 @@
-#include "../esubghz_chat_i.h"
-
-/* Sets the entered bytes as the key and sends a HexKeyEntered event to the
- * scene manager. */
-static void hex_key_input_cb(void* context)
-{
-	furi_assert(context);
-	ESubGhzChatState* state = context;
-
-	/* initiate the crypto context */
-	bool ret = crypto_ctx_set_key(state->crypto_ctx,
-			state->hex_key_input_store, state->name_prefix,
-			furi_get_tick());
-
-	/* cleanup */
-	crypto_explicit_bzero(state->hex_key_input_store,
-			sizeof(state->hex_key_input_store));
-
-	if (!ret) {
-		crypto_ctx_clear(state->crypto_ctx);
-		return;
-	}
-
-	state->encrypted = true;
-
-	view_dispatcher_send_custom_event(state->view_dispatcher,
-			ESubGhzChatEvent_HexKeyEntered);
-}
-
-/* Prepares the hex key input scene. */
-void scene_on_enter_hex_key_input(void* context)
-{
-	FURI_LOG_T(APPLICATION_NAME, "scene_on_enter_hex_key_input");
-
-	furi_assert(context);
-	ESubGhzChatState* state = context;
-
-	byte_input_set_result_callback(state->hex_key_input,
-			hex_key_input_cb,
-			NULL,
-			state,
-			state->hex_key_input_store,
-			sizeof(state->hex_key_input_store));
-
-	view_dispatcher_switch_to_view(state->view_dispatcher,
-			ESubGhzChatView_HexKeyInput);
-}
-
-/* Handles scene manager events for the hex key input scene. */
-bool scene_on_event_hex_key_input(void* context, SceneManagerEvent event)
-{
-	FURI_LOG_T(APPLICATION_NAME, "scene_on_event_hex_key_input");
-
-	furi_assert(context);
-	ESubGhzChatState* state = context;
-
-	bool consumed = false;
-
-	switch(event.type) {
-	case SceneManagerEventTypeCustom:
-		switch(event.event) {
-		/* switch to frequency input scene */
-		case ESubGhzChatEvent_HexKeyEntered:
-			scene_manager_next_scene(state->scene_manager,
-					ESubGhzChatScene_FreqInput);
-			consumed = true;
-			break;
-		}
-		break;
-
-	default:
-		consumed = false;
-		break;
-	}
-
-	return consumed;
-}
-
-/* Cleans up the hex key input scene. */
-void scene_on_exit_hex_key_input(void* context)
-{
-	FURI_LOG_T(APPLICATION_NAME, "scene_on_exit_hex_key_input");
-
-	furi_assert(context);
-	ESubGhzChatState* state = context;
-
-	crypto_explicit_bzero(state->hex_key_input_store,
-			sizeof(state->hex_key_input_store));
-}

+ 0 - 130
apps_broken_by_last_refactors/esubghz_chat/scenes/esubghz_chat_key_display.c

@@ -1,130 +0,0 @@
-#include "../esubghz_chat_i.h"
-
-void key_display_result_cb(DialogExResult result, void* context)
-{
-	furi_assert(context);
-	ESubGhzChatState* state = context;
-
-	switch(result) {
-	case DialogExResultLeft:
-		view_dispatcher_send_custom_event(state->view_dispatcher,
-				ESubGhzChatEvent_KeyDisplayBack);
-		break;
-
-	case DialogExResultCenter:
-		if (state->encrypted) {
-			view_dispatcher_send_custom_event(state->view_dispatcher,
-					ESubGhzChatEvent_KeyDisplayShare);
-		}
-		break;
-
-	default:
-		break;
-	}
-}
-
-/* Prepares the key display scene. */
-void scene_on_enter_key_display(void* context)
-{
-	FURI_LOG_T(APPLICATION_NAME, "scene_on_enter_key_display");
-
-	furi_assert(context);
-	ESubGhzChatState* state = context;
-
-	if (state->encrypted) {
-		uint8_t key[KEY_BITS / 8];
-		crypto_ctx_get_key(state->crypto_ctx, key);
-		snprintf(state->key_hex_str, KEY_HEX_STR_SIZE,
-				"%02hX%02hX%02hX%02hX"
-				"%02hX%02hX%02hX%02hX\n"
-				"%02hX%02hX%02hX%02hX"
-				"%02hX%02hX%02hX%02hX\n"
-				"%02hX%02hX%02hX%02hX"
-				"%02hX%02hX%02hX%02hX\n"
-				"%02hX%02hX%02hX%02hX"
-				"%02hX%02hX%02hX%02hX",
-				key[0], key[1], key[2], key[3],
-				key[4], key[5], key[6], key[7],
-				key[8], key[9], key[10], key[11],
-				key[12], key[13], key[14], key[15],
-				key[16], key[17], key[18], key[19],
-				key[20], key[21], key[22], key[23],
-				key[24], key[25], key[26], key[27],
-				key[28], key[29], key[30], key[31]);
-		crypto_explicit_bzero(key, sizeof(key));
-	} else {
-		strcpy(state->key_hex_str, "No Key");
-	}
-
-	dialog_ex_reset(state->key_display);
-
-	dialog_ex_set_text(state->key_display, state->key_hex_str, 64, 2,
-			AlignCenter, AlignTop);
-
-	dialog_ex_set_icon(state->key_display, 0, 0, NULL);
-
-	dialog_ex_set_left_button_text(state->key_display, "Back");
-
-	if (state->encrypted) {
-		dialog_ex_set_center_button_text(state->key_display, "Share");
-	}
-
-	dialog_ex_set_result_callback(state->key_display,
-			key_display_result_cb);
-	dialog_ex_set_context(state->key_display, state);
-
-	view_dispatcher_switch_to_view(state->view_dispatcher, ESubGhzChatView_KeyDisplay);
-}
-
-/* Handles scene manager events for the key display scene. */
-bool scene_on_event_key_display(void* context, SceneManagerEvent event)
-{
-	FURI_LOG_T(APPLICATION_NAME, "scene_on_event_key_display");
-
-	furi_assert(context);
-	ESubGhzChatState* state = context;
-
-	bool consumed = false;
-
-	switch(event.type) {
-	case SceneManagerEventTypeCustom:
-		switch(event.event) {
-		/* switch to message input scene */
-		case ESubGhzChatEvent_KeyDisplayBack:
-			if (!scene_manager_previous_scene(
-						state->scene_manager)) {
-				/* error condition, exit for real */
-				state->exit_for_real = true;
-				view_dispatcher_stop(state->view_dispatcher);
-			}
-			consumed = true;
-			break;
-
-		/* open key sharing popup */
-		case ESubGhzChatEvent_KeyDisplayShare:
-			scene_manager_next_scene(state->scene_manager,
-					ESubGhzChatScene_KeySharePopup);
-			consumed = true;
-			break;
-		}
-		break;
-
-	default:
-		consumed = false;
-		break;
-	}
-
-	return consumed;
-}
-
-/* Cleans up the key display scene. */
-void scene_on_exit_key_display(void* context)
-{
-	FURI_LOG_T(APPLICATION_NAME, "scene_on_exit_key_display");
-
-	furi_assert(context);
-	ESubGhzChatState* state = context;
-
-	dialog_ex_reset(state->key_display);
-	crypto_explicit_bzero(state->key_hex_str, sizeof(state->key_hex_str));
-}

+ 0 - 196
apps_broken_by_last_refactors/esubghz_chat/scenes/esubghz_chat_key_menu.c

@@ -1,196 +0,0 @@
-#include "../esubghz_chat_i.h"
-
-typedef enum {
-	ESubGhzChatKeyMenuItems_NoEncryption,
-	ESubGhzChatKeyMenuItems_Password,
-	ESubGhzChatKeyMenuItems_HexKey,
-	ESubGhzChatKeyMenuItems_GenKey,
-	ESubGhzChatKeyMenuItems_ReadKeyFromNfc,
-} ESubGhzChatKeyMenuItems;
-
-static void key_menu_cb(void* context, uint32_t index)
-{
-	furi_assert(context);
-	ESubGhzChatState* state = context;
-
-	uint8_t key[KEY_BITS / 8];
-
-	switch(index) {
-	case ESubGhzChatKeyMenuItems_NoEncryption:
-		state->encrypted = false;
-
-		view_dispatcher_send_custom_event(state->view_dispatcher,
-				ESubGhzChatEvent_KeyMenuNoEncryption);
-		break;
-
-	case ESubGhzChatKeyMenuItems_Password:
-		view_dispatcher_send_custom_event(state->view_dispatcher,
-				ESubGhzChatEvent_KeyMenuPassword);
-		break;
-
-	case ESubGhzChatKeyMenuItems_HexKey:
-		view_dispatcher_send_custom_event(state->view_dispatcher,
-				ESubGhzChatEvent_KeyMenuHexKey);
-		break;
-
-	case ESubGhzChatKeyMenuItems_GenKey:
-		/* generate a random key */
-		furi_hal_random_fill_buf(key, KEY_BITS / 8);
-
-		/* initiate the crypto context */
-		bool ret = crypto_ctx_set_key(state->crypto_ctx, key,
-				state->name_prefix, furi_get_tick());
-
-		/* cleanup */
-		crypto_explicit_bzero(key, sizeof(key));
-
-		if (!ret) {
-			crypto_ctx_clear(state->crypto_ctx);
-			return;
-		}
-
-		/* set encrypted flag and enter the chat */
-		state->encrypted = true;
-
-		view_dispatcher_send_custom_event(state->view_dispatcher,
-				ESubGhzChatEvent_KeyMenuGenKey);
-		break;
-
-	case ESubGhzChatKeyMenuItems_ReadKeyFromNfc:
-		view_dispatcher_send_custom_event(state->view_dispatcher,
-				ESubGhzChatEvent_KeyMenuReadKeyFromNfc);
-		break;
-
-	default:
-		break;
-	}
-}
-
-/* Prepares the key menu scene. */
-void scene_on_enter_key_menu(void* context)
-{
-	FURI_LOG_T(APPLICATION_NAME, "scene_on_enter_key_menu");
-
-	furi_assert(context);
-	ESubGhzChatState* state = context;
-
-	menu_reset(state->menu);
-
-	/* clear the crypto CTX in case we got back from password or hex key
-	 * input */
-	crypto_ctx_clear(state->crypto_ctx);
-
-	menu_add_item(
-		state->menu,
-		"No encryption",
-		&I_chat_14px,
-		ESubGhzChatKeyMenuItems_NoEncryption,
-		key_menu_cb,
-		state
-	);
-	menu_add_item(
-		state->menu,
-		"Password",
-		&I_keyboard_14px,
-		ESubGhzChatKeyMenuItems_Password,
-		key_menu_cb,
-		state
-	);
-	menu_add_item(
-		state->menu,
-		"Hex Key",
-		&I_hex_14px,
-		ESubGhzChatKeyMenuItems_HexKey,
-		key_menu_cb,
-		state
-	);
-	menu_add_item(
-		state->menu,
-		"Generate Key",
-		&I_u2f_14px,
-		ESubGhzChatKeyMenuItems_GenKey,
-		key_menu_cb,
-		state
-	);
-	menu_add_item(
-		state->menu,
-		"Read Key from NFC",
-		&I_Nfc_14px,
-		ESubGhzChatKeyMenuItems_ReadKeyFromNfc,
-		key_menu_cb,
-		state
-	);
-
-	view_dispatcher_switch_to_view(state->view_dispatcher, ESubGhzChatView_Menu);
-}
-
-/* Handles scene manager events for the key menu scene. */
-bool scene_on_event_key_menu(void* context, SceneManagerEvent event)
-{
-	FURI_LOG_T(APPLICATION_NAME, "scene_on_event_key_menu");
-
-	furi_assert(context);
-	ESubGhzChatState* state = context;
-
-	bool consumed = false;
-
-	switch(event.type) {
-	case SceneManagerEventTypeCustom:
-		switch(event.event) {
-		/* switch to frequency input scene */
-		case ESubGhzChatEvent_KeyMenuNoEncryption:
-		case ESubGhzChatEvent_KeyMenuGenKey:
-			scene_manager_next_scene(state->scene_manager,
-					ESubGhzChatScene_FreqInput);
-			consumed = true;
-			break;
-
-		/* switch to password input scene */
-		case ESubGhzChatEvent_KeyMenuPassword:
-			scene_manager_next_scene(state->scene_manager,
-					ESubGhzChatScene_PassInput);
-			consumed = true;
-			break;
-
-		/* switch to hex key input scene */
-		case ESubGhzChatEvent_KeyMenuHexKey:
-			scene_manager_next_scene(state->scene_manager,
-					ESubGhzChatScene_HexKeyInput);
-			consumed = true;
-			break;
-
-		/* switch to hex key read scene */
-		case ESubGhzChatEvent_KeyMenuReadKeyFromNfc:
-			scene_manager_next_scene(state->scene_manager,
-					ESubGhzChatScene_KeyReadPopup);
-			consumed = true;
-			break;
-		}
-
-		break;
-
-	case SceneManagerEventTypeBack:
-		/* stop the application if the user presses back here */
-		view_dispatcher_stop(state->view_dispatcher);
-		consumed = true;
-		break;
-
-	default:
-		consumed = false;
-		break;
-	}
-
-	return consumed;
-}
-
-/* Cleans up the key menu scene. */
-void scene_on_exit_key_menu(void* context)
-{
-	FURI_LOG_T(APPLICATION_NAME, "scene_on_exit_key_menu");
-
-	furi_assert(context);
-	ESubGhzChatState* state = context;
-
-	menu_reset(state->menu);
-}
-

+ 0 - 303
apps_broken_by_last_refactors/esubghz_chat/scenes/esubghz_chat_key_read_popup.c

@@ -1,303 +0,0 @@
-#include "../esubghz_chat_i.h"
-#include "../helpers/nfc_helpers.h"
-
-typedef enum {
-	KeyReadPopupState_Idle,
-	KeyReadPopupState_Detecting,
-	KeyReadPopupState_Reading,
-	KeyReadPopupState_Fail,
-	KeyReadPopupState_Success,
-} KeyReadPopupState;
-
-static bool read_worker_cb(NfcWorkerEvent event, void* context)
-{
-	furi_assert(context);
-	ESubGhzChatState* state = context;
-
-	view_dispatcher_send_custom_event(state->view_dispatcher, event);
-
-	return true;
-}
-
-static void key_read_popup_timeout_cb(void* context)
-{
-	furi_assert(context);
-	ESubGhzChatState* state = context;
-
-	uint32_t cur_state = scene_manager_get_scene_state(
-			state->scene_manager, ESubGhzChatScene_KeyReadPopup);
-
-	/* done displaying our failure */
-	if (cur_state == KeyReadPopupState_Fail) {
-		view_dispatcher_send_custom_event(state->view_dispatcher,
-				ESubGhzChatEvent_KeyReadPopupFailed);
-	/* done displaying our success */
-	} else if (cur_state == KeyReadPopupState_Success) {
-		view_dispatcher_send_custom_event(state->view_dispatcher,
-				ESubGhzChatEvent_KeyReadPopupSucceeded);
-	}
-}
-
-struct ReplayDictNfcReaderContext {
-	uint8_t *cur;
-	uint8_t *max;
-};
-
-static bool replay_dict_nfc_reader(uint64_t *run_id, uint32_t *counter, void
-		*context)
-{
-	struct ReplayDictNfcReaderContext *ctx = (struct
-			ReplayDictNfcReaderContext *) context;
-
-	if (ctx->cur + sizeof(struct ReplayDictNfcEntry) > ctx->max) {
-		return false;
-	}
-
-	struct ReplayDictNfcEntry *entry = (struct ReplayDictNfcEntry *)
-		ctx->cur;
-	*run_id = entry->run_id;
-	*counter = __ntohl(entry->counter);
-
-	ctx->cur += sizeof(struct ReplayDictNfcEntry);
-
-	return true;
-}
-
-static bool key_read_popup_handle_key_read(ESubGhzChatState *state)
-{
-	NfcDeviceData *dev_data = state->nfc_dev_data;
-
-	/* check for config pages */
-	if (dev_data->mf_ul_data.data_read < NFC_CONFIG_PAGES * 4) {
-		return false;
-	}
-
-	size_t data_read = dev_data->mf_ul_data.data_read - (NFC_CONFIG_PAGES *
-			4);
-
-	/* check if key was transmitted */
-	if (data_read < KEY_BITS / 8) {
-		return false;
-	}
-
-	/* initiate the crypto context */
-	bool ret = crypto_ctx_set_key(state->crypto_ctx,
-			dev_data->mf_ul_data.data, state->name_prefix,
-			furi_get_tick());
-
-	/* cleanup */
-	crypto_explicit_bzero(dev_data->mf_ul_data.data, KEY_BITS / 8);
-
-	if (!ret) {
-		crypto_ctx_clear(state->crypto_ctx);
-		return false;
-	}
-
-	/* read the frequency */
-	if (data_read >= (KEY_BITS / 8) + sizeof(struct FreqNfcEntry)) {
-		struct FreqNfcEntry *freq_entry = (struct FreqNfcEntry *)
-			(dev_data->mf_ul_data.data + (KEY_BITS / 8));
-		state->frequency = __ntohl(freq_entry->frequency);
-	}
-
-	/* read the replay dict */
-	struct ReplayDictNfcReaderContext rd_ctx = {
-		.cur = dev_data->mf_ul_data.data + (KEY_BITS / 8) +
-			sizeof(struct FreqNfcEntry),
-		.max = dev_data->mf_ul_data.data + (data_read < NFC_MAX_BYTES ?
-				data_read : NFC_MAX_BYTES)
-	};
-
-	crypto_ctx_read_replay_dict(state->crypto_ctx, replay_dict_nfc_reader,
-			&rd_ctx);
-
-	/* set encrypted flag */
-	state->encrypted = true;
-
-	return true;
-}
-
-static void key_read_popup_set_state(ESubGhzChatState *state, KeyReadPopupState
-		new_state)
-{
-	uint32_t cur_state = scene_manager_get_scene_state(
-			state->scene_manager, ESubGhzChatScene_KeyReadPopup);
-	if (cur_state == new_state) {
-		return;
-	}
-
-	if (new_state == KeyReadPopupState_Detecting) {
-		popup_reset(state->nfc_popup);
-		popup_disable_timeout(state->nfc_popup);
-		popup_set_text(state->nfc_popup, "Tap Flipper\n to sender", 97,
-				24, AlignCenter, AlignTop);
-		popup_set_icon(state->nfc_popup, 0, 8, &I_NFC_manual_60x50);
-		notification_message(state->notification,
-				&sequence_blink_start_cyan);
-	} else if (new_state == KeyReadPopupState_Reading) {
-		popup_reset(state->nfc_popup);
-		popup_disable_timeout(state->nfc_popup);
-		popup_set_header(state->nfc_popup, "Reading key\nDon't "
-				"move...", 85, 24, AlignCenter, AlignTop);
-		popup_set_icon(state->nfc_popup, 12, 23, &I_Loading_24);
-		notification_message(state->notification,
-				&sequence_blink_start_yellow);
-	} else if (new_state == KeyReadPopupState_Fail) {
-		nfc_worker_stop(state->nfc_worker);
-
-		popup_reset(state->nfc_popup);
-		popup_set_header(state->nfc_popup, "Failure!", 64, 2,
-				AlignCenter, AlignTop);
-		popup_set_text(state->nfc_popup, "Failed\nto read\nkey.", 78,
-				16, AlignLeft, AlignTop);
-		popup_set_icon(state->nfc_popup, 21, 13, &I_Cry_dolph_55x52);
-
-		popup_set_timeout(state->nfc_popup, KEY_READ_POPUP_MS);
-		popup_set_context(state->nfc_popup, state);
-		popup_set_callback(state->nfc_popup,
-				key_read_popup_timeout_cb);
-		popup_enable_timeout(state->nfc_popup);
-
-		notification_message(state->notification,
-				&sequence_blink_stop);
-	} else if (new_state == KeyReadPopupState_Success) {
-		nfc_worker_stop(state->nfc_worker);
-
-		popup_reset(state->nfc_popup);
-		popup_set_header(state->nfc_popup, "Key\nread!", 13, 22,
-				AlignLeft, AlignBottom);
-		popup_set_icon(state->nfc_popup, 32, 5, &I_DolphinNice_96x59);
-
-		popup_set_timeout(state->nfc_popup, KEY_READ_POPUP_MS);
-		popup_set_context(state->nfc_popup, state);
-		popup_set_callback(state->nfc_popup,
-				key_read_popup_timeout_cb);
-		popup_enable_timeout(state->nfc_popup);
-
-		notification_message(state->notification, &sequence_success);
-		notification_message(state->notification,
-				&sequence_blink_stop);
-	}
-
-	scene_manager_set_scene_state(state->scene_manager,
-			ESubGhzChatScene_KeyReadPopup, new_state);
-
-	view_dispatcher_switch_to_view(state->view_dispatcher,
-			ESubGhzChatView_NfcPopup);
-}
-
-/* Prepares the key share read scene. */
-void scene_on_enter_key_read_popup(void* context)
-{
-	FURI_LOG_T(APPLICATION_NAME, "scene_on_enter_key_read_popup");
-
-	furi_assert(context);
-	ESubGhzChatState* state = context;
-
-	key_read_popup_set_state(state, KeyReadPopupState_Detecting);
-
-	state->nfc_dev_data->parsed_data = furi_string_alloc();
-	if (state->nfc_dev_data->parsed_data == NULL) {
-		/* can't do anything here, crash */
-		furi_check(0);
-	}
-
-	nfc_worker_start(state->nfc_worker, NfcWorkerStateRead,
-			state->nfc_dev_data, read_worker_cb, state);
-}
-
-/* Handles scene manager events for the key read popup scene. */
-bool scene_on_event_key_read_popup(void* context, SceneManagerEvent event)
-{
-	FURI_LOG_T(APPLICATION_NAME, "scene_on_event_key_read_popup");
-
-	furi_assert(context);
-	ESubGhzChatState* state = context;
-
-	bool consumed = false;
-
-	switch(event.type) {
-	case SceneManagerEventTypeCustom:
-		switch(event.event) {
-		/* card detected */
-		case NfcWorkerEventCardDetected:
-			key_read_popup_set_state(state,
-					KeyReadPopupState_Reading);
-			consumed = true;
-			break;
-
-		/* no card detected */
-		case NfcWorkerEventNoCardDetected:
-			key_read_popup_set_state(state,
-					KeyReadPopupState_Detecting);
-			consumed = true;
-			break;
-
-		/* key probably read */
-		case NfcWorkerEventReadMfUltralight:
-			if (key_read_popup_handle_key_read(state)) {
-				key_read_popup_set_state(state,
-						KeyReadPopupState_Success);
-			} else {
-				key_read_popup_set_state(state,
-						KeyReadPopupState_Fail);
-			}
-			consumed = true;
-			break;
-
-		/* close the popup and go back */
-		case ESubGhzChatEvent_KeyReadPopupFailed:
-			if (!scene_manager_previous_scene(
-						state->scene_manager)) {
-				view_dispatcher_stop(state->view_dispatcher);
-			}
-			consumed = true;
-			break;
-
-		/* success, go to frequency input */
-		case ESubGhzChatEvent_KeyReadPopupSucceeded:
-			scene_manager_next_scene(state->scene_manager,
-					ESubGhzChatScene_FreqInput);
-			consumed = true;
-			break;
-
-		/* something else happend, treat as failure */
-		default:
-			key_read_popup_set_state(state,
-					KeyReadPopupState_Fail);
-			consumed = true;
-			break;
-		}
-
-		break;
-
-	default:
-		consumed = false;
-		break;
-	}
-
-	return consumed;
-}
-
-/* Cleans up the key read popup scene. */
-void scene_on_exit_key_read_popup(void* context)
-{
-	FURI_LOG_T(APPLICATION_NAME, "scene_on_exit_key_read_popup");
-
-	furi_assert(context);
-	ESubGhzChatState* state = context;
-
-	popup_reset(state->nfc_popup);
-	scene_manager_set_scene_state(state->scene_manager,
-			ESubGhzChatScene_KeyReadPopup, KeyReadPopupState_Idle);
-
-	notification_message(state->notification, &sequence_blink_stop);
-
-	nfc_worker_stop(state->nfc_worker);
-
-	crypto_explicit_bzero(state->nfc_dev_data->mf_ul_data.data, KEY_BITS / 8);
-	if (state->nfc_dev_data->parsed_data != NULL) {
-		furi_string_free(state->nfc_dev_data->parsed_data);
-	}
-	memset(state->nfc_dev_data, 0, sizeof(NfcDeviceData));
-}

+ 0 - 140
apps_broken_by_last_refactors/esubghz_chat/scenes/esubghz_chat_key_share_popup.c

@@ -1,140 +0,0 @@
-#include "../esubghz_chat_i.h"
-#include "../helpers/nfc_helpers.h"
-
-struct ReplayDictNfcWriterContext {
-	uint8_t *cur;
-	uint8_t *max;
-};
-
-static bool replay_dict_nfc_writer(uint64_t run_id, uint32_t counter, void
-		*context)
-{
-	struct ReplayDictNfcWriterContext *ctx = (struct
-			ReplayDictNfcWriterContext *) context;
-
-	struct ReplayDictNfcEntry entry = {
-		.run_id = run_id,
-		.counter = __htonl(counter),
-		.unused = 0
-	};
-
-	if (ctx->cur + sizeof(entry) > ctx->max) {
-		return false;
-	}
-
-	memcpy(ctx->cur, &entry, sizeof(entry));
-	ctx->cur += sizeof(entry);
-
-	return true;
-}
-
-static void prepare_nfc_dev_data(ESubGhzChatState *state)
-{
-	NfcDeviceData *dev_data = state->nfc_dev_data;
-
-	dev_data->protocol = NfcDeviceProtocolMifareUl;
-	furi_hal_random_fill_buf(dev_data->nfc_data.uid, 7);
-	dev_data->nfc_data.uid_len = 7;
-	dev_data->nfc_data.atqa[0] = 0x44;
-	dev_data->nfc_data.atqa[1] = 0x00;
-	dev_data->nfc_data.sak = 0x00;
-
-	dev_data->mf_ul_data.type = MfUltralightTypeNTAG215;
-	dev_data->mf_ul_data.version.header = 0x00;
-	dev_data->mf_ul_data.version.vendor_id = 0x04;
-	dev_data->mf_ul_data.version.prod_type = 0x04;
-	dev_data->mf_ul_data.version.prod_subtype = 0x02;
-	dev_data->mf_ul_data.version.prod_ver_major = 0x01;
-	dev_data->mf_ul_data.version.prod_ver_minor = 0x00;
-	dev_data->mf_ul_data.version.storage_size = 0x11;
-	dev_data->mf_ul_data.version.protocol_type = 0x03;
-
-	size_t data_written = 0;
-
-	/* write key */
-	crypto_ctx_get_key(state->crypto_ctx, dev_data->mf_ul_data.data);
-	data_written += (KEY_BITS / 8);
-
-	/* write frequency */
-	struct FreqNfcEntry *freq_entry = (struct FreqNfcEntry *)
-		(dev_data->mf_ul_data.data + data_written);
-	freq_entry->frequency = __htonl(state->frequency);
-	freq_entry->unused1 = 0;
-	freq_entry->unused2 = 0;
-	freq_entry->unused3 = 0;
-	data_written += sizeof(struct FreqNfcEntry);
-
-	/* write the replay dict */
-	struct ReplayDictNfcWriterContext wr_ctx = {
-		.cur = dev_data->mf_ul_data.data + data_written,
-		.max = dev_data->mf_ul_data.data + NFC_MAX_BYTES
-	};
-
-	size_t n_entries = crypto_ctx_dump_replay_dict(state->crypto_ctx,
-			replay_dict_nfc_writer, &wr_ctx);
-	data_written += n_entries * sizeof(struct ReplayDictNfcEntry);
-
-	/* calculate size of data, add 16 for config pages */
-	dev_data->mf_ul_data.data_size = data_written + (NFC_CONFIG_PAGES * 4);
-}
-
-/* Prepares the key share popup scene. */
-void scene_on_enter_key_share_popup(void* context)
-{
-	FURI_LOG_T(APPLICATION_NAME, "scene_on_enter_key_share_popup");
-
-	furi_assert(context);
-	ESubGhzChatState* state = context;
-
-	popup_reset(state->nfc_popup);
-
-	popup_disable_timeout(state->nfc_popup);
-
-	popup_set_header(state->nfc_popup, "Sharing...", 67, 13, AlignLeft,
-			AlignTop);
-	popup_set_icon(state->nfc_popup, 0, 3, &I_NFC_dolphin_emulation_47x61);
-	popup_set_text(state->nfc_popup, "Sharing\nKey via\nNFC", 90, 28,
-			AlignCenter, AlignTop);
-
-	prepare_nfc_dev_data(state);
-	nfc_worker_start(state->nfc_worker, NfcWorkerStateMfUltralightEmulate,
-			state->nfc_dev_data, NULL, NULL);
-
-	notification_message(state->notification,
-			&sequence_blink_start_magenta);
-
-	view_dispatcher_switch_to_view(state->view_dispatcher,
-			ESubGhzChatView_NfcPopup);
-}
-
-/* Handles scene manager events for the key share popup scene. */
-bool scene_on_event_key_share_popup(void* context, SceneManagerEvent event)
-{
-	FURI_LOG_T(APPLICATION_NAME, "scene_on_event_key_share_popup");
-
-	furi_assert(context);
-	ESubGhzChatState* state = context;
-
-	UNUSED(state);
-	UNUSED(event);
-
-	return false;
-}
-
-/* Cleans up the key share popup scene. */
-void scene_on_exit_key_share_popup(void* context)
-{
-	FURI_LOG_T(APPLICATION_NAME, "scene_on_exit_key_share_popup");
-
-	furi_assert(context);
-	ESubGhzChatState* state = context;
-
-	popup_reset(state->nfc_popup);
-
-	notification_message(state->notification, &sequence_blink_stop);
-
-	nfc_worker_stop(state->nfc_worker);
-
-	crypto_explicit_bzero(state->nfc_dev_data->mf_ul_data.data, KEY_BITS / 8);
-	memset(state->nfc_dev_data, 0, sizeof(NfcDeviceData));
-}

+ 0 - 125
apps_broken_by_last_refactors/esubghz_chat/scenes/esubghz_chat_pass_input.c

@@ -1,125 +0,0 @@
-#include "../esubghz_chat_i.h"
-
-/* Sends PassEntered event to scene manager. */
-static void pass_input_cb(void *context)
-{
-	furi_assert(context);
-	ESubGhzChatState* state = context;
-
-	crypto_explicit_bzero(state->text_input_store,
-			sizeof(state->text_input_store));
-
-	view_dispatcher_send_custom_event(state->view_dispatcher,
-			ESubGhzChatEvent_PassEntered);
-}
-
-/* If a password was entered this derives a key from the password using a
- * single pass of SHA256 and initiates the AES-GCM context for encryption. If
- * the initiation fails, the password is rejected. */
-static bool pass_input_validator(const char *text, FuriString *error,
-		void *context)
-{
-	furi_assert(text);
-	furi_assert(error);
-
-	furi_assert(context);
-	ESubGhzChatState* state = context;
-
-	if (strlen(text) == 0) {
-		furi_string_printf(error, "Enter a\npassword!");
-		return false;
-	}
-
-	unsigned char key[KEY_BITS / 8];
-
-	/* derive a key from the password */
-	sha256((unsigned char *) text, strlen(text), key);
-
-	/* initiate the crypto context */
-	bool ret = crypto_ctx_set_key(state->crypto_ctx, key,
-			state->name_prefix, furi_get_tick());
-
-	/* cleanup */
-	crypto_explicit_bzero(key, sizeof(key));
-
-	if (!ret) {
-		crypto_ctx_clear(state->crypto_ctx);
-		furi_string_printf(error, "Failed to\nset key!");
-		return false;
-	}
-
-	state->encrypted = true;
-
-	return true;
-}
-
-/* Prepares the password input scene. */
-void scene_on_enter_pass_input(void* context)
-{
-	FURI_LOG_T(APPLICATION_NAME, "scene_on_enter_pass_input");
-
-	furi_assert(context);
-	ESubGhzChatState* state = context;
-
-	state->text_input_store[0] = 0;
-	text_input_reset(state->text_input);
-	text_input_set_result_callback(
-			state->text_input,
-			pass_input_cb,
-			state,
-			state->text_input_store,
-			sizeof(state->text_input_store),
-			true);
-	text_input_set_validator(
-			state->text_input,
-			pass_input_validator,
-			state);
-	text_input_set_header_text(
-			state->text_input,
-			"Password");
-
-	view_dispatcher_switch_to_view(state->view_dispatcher, ESubGhzChatView_Input);
-}
-
-/* Handles scene manager events for the password input scene. */
-bool scene_on_event_pass_input(void* context, SceneManagerEvent event)
-{
-	FURI_LOG_T(APPLICATION_NAME, "scene_on_event_pass_input");
-
-	furi_assert(context);
-	ESubGhzChatState* state = context;
-
-	bool consumed = false;
-
-	switch(event.type) {
-	case SceneManagerEventTypeCustom:
-		switch(event.event) {
-		/* switch to frequency input scene */
-		case ESubGhzChatEvent_PassEntered:
-			scene_manager_next_scene(state->scene_manager,
-					ESubGhzChatScene_FreqInput);
-			consumed = true;
-			break;
-		}
-		break;
-
-	default:
-		consumed = false;
-		break;
-	}
-
-	return consumed;
-}
-
-/* Cleans up the password input scene. */
-void scene_on_exit_pass_input(void* context)
-{
-	FURI_LOG_T(APPLICATION_NAME, "scene_on_exit_pass_input");
-
-	furi_assert(context);
-	ESubGhzChatState* state = context;
-
-	text_input_reset(state->text_input);
-	crypto_explicit_bzero(state->text_input_store,
-			sizeof(state->text_input_store));
-}

+ 0 - 30
apps_broken_by_last_refactors/esubghz_chat/scenes/esubghz_chat_scene.c

@@ -1,30 +0,0 @@
-#include "esubghz_chat_scene.h"
-
-// Generate scene on_enter handlers array
-#define ADD_SCENE(prefix, name, id) scene_on_enter_##name,
-void (*const esubghz_chat_scene_on_enter_handlers[])(void*) = {
-#include "esubghz_chat_scene_config.h"
-};
-#undef ADD_SCENE
-
-// Generate scene on_event handlers array
-#define ADD_SCENE(prefix, name, id) scene_on_event_##name,
-bool (*const esubghz_chat_scene_on_event_handlers[])(void* context, SceneManagerEvent event) = {
-#include "esubghz_chat_scene_config.h"
-};
-#undef ADD_SCENE
-
-// Generate scene on_exit handlers array
-#define ADD_SCENE(prefix, name, id) scene_on_exit_##name,
-void (*const esubghz_chat_scene_on_exit_handlers[])(void* context) = {
-#include "esubghz_chat_scene_config.h"
-};
-#undef ADD_SCENE
-
-// Initialize scene handlers configuration structure
-const SceneManagerHandlers esubghz_chat_scene_event_handlers = {
-    .on_enter_handlers = esubghz_chat_scene_on_enter_handlers,
-    .on_event_handlers = esubghz_chat_scene_on_event_handlers,
-    .on_exit_handlers = esubghz_chat_scene_on_exit_handlers,
-    .scene_num = ESubGhzChatScene_MAX,
-};

+ 0 - 29
apps_broken_by_last_refactors/esubghz_chat/scenes/esubghz_chat_scene.h

@@ -1,29 +0,0 @@
-#pragma once
-
-#include <gui/scene_manager.h>
-
-// Generate scene id and total number
-#define ADD_SCENE(prefix, name, id) ESubGhzChatScene_##id,
-typedef enum {
-#include "esubghz_chat_scene_config.h"
-	ESubGhzChatScene_MAX
-} ESubGhzChatScene;
-#undef ADD_SCENE
-
-extern const SceneManagerHandlers esubghz_chat_scene_event_handlers;
-
-// Generate scene on_enter handlers declaration
-#define ADD_SCENE(prefix, name, id) void scene_on_enter_##name(void*);
-#include "esubghz_chat_scene_config.h"
-#undef ADD_SCENE
-
-// Generate scene on_event handlers declaration
-#define ADD_SCENE(prefix, name, id) \
-	bool scene_on_event_##name(void* context, SceneManagerEvent event);
-#include "esubghz_chat_scene_config.h"
-#undef ADD_SCENE
-
-// Generate scene on_exit handlers declaration
-#define ADD_SCENE(prefix, name, id) void scene_on_exit_##name(void* context);
-#include "esubghz_chat_scene_config.h"
-#undef ADD_SCENE

+ 0 - 9
apps_broken_by_last_refactors/esubghz_chat/scenes/esubghz_chat_scene_config.h

@@ -1,9 +0,0 @@
-ADD_SCENE(esubghz_chat, freq_input, FreqInput)
-ADD_SCENE(esubghz_chat, key_menu, KeyMenu)
-ADD_SCENE(esubghz_chat, pass_input, PassInput)
-ADD_SCENE(esubghz_chat, hex_key_input, HexKeyInput)
-ADD_SCENE(esubghz_chat, key_read_popup, KeyReadPopup)
-ADD_SCENE(esubghz_chat, chat_input, ChatInput)
-ADD_SCENE(esubghz_chat, chat_box, ChatBox)
-ADD_SCENE(esubghz_chat, key_display, KeyDisplay)
-ADD_SCENE(esubghz_chat, key_share_popup, KeySharePopup)

+ 0 - 1
apps_broken_by_last_refactors/flipperzero_vb_migrate/.github/FUNDING.yml

@@ -1 +0,0 @@
-ko_fi: caralynx

+ 0 - 12
apps_broken_by_last_refactors/flipperzero_vb_migrate/.github/workflows/build-fap.yml

@@ -1,12 +0,0 @@
-name: Build FAP
-on: [push]
-
-jobs:
-  build:
-    if: ${{ false }}
-    runs-on: ubuntu-latest
-    steps:
-      - name: Checkout
-        uses: actions/checkout@v3
-      - name: Build
-        uses: oleksiikutuzov/flipperzero-ufbt-action@v1

+ 0 - 8
apps_broken_by_last_refactors/flipperzero_vb_migrate/CHANGES.md

@@ -1,8 +0,0 @@
-# v1.2
-Updated for API 39.1
-
-# v1.1
-Updated data directory path and built for API 26.3
-
-# v1.0 Release to the Web
-Brand new UI, support for all VBs

+ 0 - 674
apps_broken_by_last_refactors/flipperzero_vb_migrate/LICENSE

@@ -1,674 +0,0 @@
-                    GNU GENERAL PUBLIC LICENSE
-                       Version 3, 29 June 2007
-
- Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
-                            Preamble
-
-  The GNU General Public License is a free, copyleft license for
-software and other kinds of works.
-
-  The licenses for most software and other practical works are designed
-to take away your freedom to share and change the works.  By contrast,
-the GNU General Public License is intended to guarantee your freedom to
-share and change all versions of a program--to make sure it remains free
-software for all its users.  We, the Free Software Foundation, use the
-GNU General Public License for most of our software; it applies also to
-any other work released this way by its authors.  You can apply it to
-your programs, too.
-
-  When we speak of free software, we are referring to freedom, not
-price.  Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-them if you wish), that you receive source code or can get it if you
-want it, that you can change the software or use pieces of it in new
-free programs, and that you know you can do these things.
-
-  To protect your rights, we need to prevent others from denying you
-these rights or asking you to surrender the rights.  Therefore, you have
-certain responsibilities if you distribute copies of the software, or if
-you modify it: responsibilities to respect the freedom of others.
-
-  For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must pass on to the recipients the same
-freedoms that you received.  You must make sure that they, too, receive
-or can get the source code.  And you must show them these terms so they
-know their rights.
-
-  Developers that use the GNU GPL protect your rights with two steps:
-(1) assert copyright on the software, and (2) offer you this License
-giving you legal permission to copy, distribute and/or modify it.
-
-  For the developers' and authors' protection, the GPL clearly explains
-that there is no warranty for this free software.  For both users' and
-authors' sake, the GPL requires that modified versions be marked as
-changed, so that their problems will not be attributed erroneously to
-authors of previous versions.
-
-  Some devices are designed to deny users access to install or run
-modified versions of the software inside them, although the manufacturer
-can do so.  This is fundamentally incompatible with the aim of
-protecting users' freedom to change the software.  The systematic
-pattern of such abuse occurs in the area of products for individuals to
-use, which is precisely where it is most unacceptable.  Therefore, we
-have designed this version of the GPL to prohibit the practice for those
-products.  If such problems arise substantially in other domains, we
-stand ready to extend this provision to those domains in future versions
-of the GPL, as needed to protect the freedom of users.
-
-  Finally, every program is threatened constantly by software patents.
-States should not allow patents to restrict development and use of
-software on general-purpose computers, but in those that do, we wish to
-avoid the special danger that patents applied to a free program could
-make it effectively proprietary.  To prevent this, the GPL assures that
-patents cannot be used to render the program non-free.
-
-  The precise terms and conditions for copying, distribution and
-modification follow.
-
-                       TERMS AND CONDITIONS
-
-  0. Definitions.
-
-  "This License" refers to version 3 of the GNU General Public License.
-
-  "Copyright" also means copyright-like laws that apply to other kinds of
-works, such as semiconductor masks.
-
-  "The Program" refers to any copyrightable work licensed under this
-License.  Each licensee is addressed as "you".  "Licensees" and
-"recipients" may be individuals or organizations.
-
-  To "modify" a work means to copy from or adapt all or part of the work
-in a fashion requiring copyright permission, other than the making of an
-exact copy.  The resulting work is called a "modified version" of the
-earlier work or a work "based on" the earlier work.
-
-  A "covered work" means either the unmodified Program or a work based
-on the Program.
-
-  To "propagate" a work means to do anything with it that, without
-permission, would make you directly or secondarily liable for
-infringement under applicable copyright law, except executing it on a
-computer or modifying a private copy.  Propagation includes copying,
-distribution (with or without modification), making available to the
-public, and in some countries other activities as well.
-
-  To "convey" a work means any kind of propagation that enables other
-parties to make or receive copies.  Mere interaction with a user through
-a computer network, with no transfer of a copy, is not conveying.
-
-  An interactive user interface displays "Appropriate Legal Notices"
-to the extent that it includes a convenient and prominently visible
-feature that (1) displays an appropriate copyright notice, and (2)
-tells the user that there is no warranty for the work (except to the
-extent that warranties are provided), that licensees may convey the
-work under this License, and how to view a copy of this License.  If
-the interface presents a list of user commands or options, such as a
-menu, a prominent item in the list meets this criterion.
-
-  1. Source Code.
-
-  The "source code" for a work means the preferred form of the work
-for making modifications to it.  "Object code" means any non-source
-form of a work.
-
-  A "Standard Interface" means an interface that either is an official
-standard defined by a recognized standards body, or, in the case of
-interfaces specified for a particular programming language, one that
-is widely used among developers working in that language.
-
-  The "System Libraries" of an executable work include anything, other
-than the work as a whole, that (a) is included in the normal form of
-packaging a Major Component, but which is not part of that Major
-Component, and (b) serves only to enable use of the work with that
-Major Component, or to implement a Standard Interface for which an
-implementation is available to the public in source code form.  A
-"Major Component", in this context, means a major essential component
-(kernel, window system, and so on) of the specific operating system
-(if any) on which the executable work runs, or a compiler used to
-produce the work, or an object code interpreter used to run it.
-
-  The "Corresponding Source" for a work in object code form means all
-the source code needed to generate, install, and (for an executable
-work) run the object code and to modify the work, including scripts to
-control those activities.  However, it does not include the work's
-System Libraries, or general-purpose tools or generally available free
-programs which are used unmodified in performing those activities but
-which are not part of the work.  For example, Corresponding Source
-includes interface definition files associated with source files for
-the work, and the source code for shared libraries and dynamically
-linked subprograms that the work is specifically designed to require,
-such as by intimate data communication or control flow between those
-subprograms and other parts of the work.
-
-  The Corresponding Source need not include anything that users
-can regenerate automatically from other parts of the Corresponding
-Source.
-
-  The Corresponding Source for a work in source code form is that
-same work.
-
-  2. Basic Permissions.
-
-  All rights granted under this License are granted for the term of
-copyright on the Program, and are irrevocable provided the stated
-conditions are met.  This License explicitly affirms your unlimited
-permission to run the unmodified Program.  The output from running a
-covered work is covered by this License only if the output, given its
-content, constitutes a covered work.  This License acknowledges your
-rights of fair use or other equivalent, as provided by copyright law.
-
-  You may make, run and propagate covered works that you do not
-convey, without conditions so long as your license otherwise remains
-in force.  You may convey covered works to others for the sole purpose
-of having them make modifications exclusively for you, or provide you
-with facilities for running those works, provided that you comply with
-the terms of this License in conveying all material for which you do
-not control copyright.  Those thus making or running the covered works
-for you must do so exclusively on your behalf, under your direction
-and control, on terms that prohibit them from making any copies of
-your copyrighted material outside their relationship with you.
-
-  Conveying under any other circumstances is permitted solely under
-the conditions stated below.  Sublicensing is not allowed; section 10
-makes it unnecessary.
-
-  3. Protecting Users' Legal Rights From Anti-Circumvention Law.
-
-  No covered work shall be deemed part of an effective technological
-measure under any applicable law fulfilling obligations under article
-11 of the WIPO copyright treaty adopted on 20 December 1996, or
-similar laws prohibiting or restricting circumvention of such
-measures.
-
-  When you convey a covered work, you waive any legal power to forbid
-circumvention of technological measures to the extent such circumvention
-is effected by exercising rights under this License with respect to
-the covered work, and you disclaim any intention to limit operation or
-modification of the work as a means of enforcing, against the work's
-users, your or third parties' legal rights to forbid circumvention of
-technological measures.
-
-  4. Conveying Verbatim Copies.
-
-  You may convey verbatim copies of the Program's source code as you
-receive it, in any medium, provided that you conspicuously and
-appropriately publish on each copy an appropriate copyright notice;
-keep intact all notices stating that this License and any
-non-permissive terms added in accord with section 7 apply to the code;
-keep intact all notices of the absence of any warranty; and give all
-recipients a copy of this License along with the Program.
-
-  You may charge any price or no price for each copy that you convey,
-and you may offer support or warranty protection for a fee.
-
-  5. Conveying Modified Source Versions.
-
-  You may convey a work based on the Program, or the modifications to
-produce it from the Program, in the form of source code under the
-terms of section 4, provided that you also meet all of these conditions:
-
-    a) The work must carry prominent notices stating that you modified
-    it, and giving a relevant date.
-
-    b) The work must carry prominent notices stating that it is
-    released under this License and any conditions added under section
-    7.  This requirement modifies the requirement in section 4 to
-    "keep intact all notices".
-
-    c) You must license the entire work, as a whole, under this
-    License to anyone who comes into possession of a copy.  This
-    License will therefore apply, along with any applicable section 7
-    additional terms, to the whole of the work, and all its parts,
-    regardless of how they are packaged.  This License gives no
-    permission to license the work in any other way, but it does not
-    invalidate such permission if you have separately received it.
-
-    d) If the work has interactive user interfaces, each must display
-    Appropriate Legal Notices; however, if the Program has interactive
-    interfaces that do not display Appropriate Legal Notices, your
-    work need not make them do so.
-
-  A compilation of a covered work with other separate and independent
-works, which are not by their nature extensions of the covered work,
-and which are not combined with it such as to form a larger program,
-in or on a volume of a storage or distribution medium, is called an
-"aggregate" if the compilation and its resulting copyright are not
-used to limit the access or legal rights of the compilation's users
-beyond what the individual works permit.  Inclusion of a covered work
-in an aggregate does not cause this License to apply to the other
-parts of the aggregate.
-
-  6. Conveying Non-Source Forms.
-
-  You may convey a covered work in object code form under the terms
-of sections 4 and 5, provided that you also convey the
-machine-readable Corresponding Source under the terms of this License,
-in one of these ways:
-
-    a) Convey the object code in, or embodied in, a physical product
-    (including a physical distribution medium), accompanied by the
-    Corresponding Source fixed on a durable physical medium
-    customarily used for software interchange.
-
-    b) Convey the object code in, or embodied in, a physical product
-    (including a physical distribution medium), accompanied by a
-    written offer, valid for at least three years and valid for as
-    long as you offer spare parts or customer support for that product
-    model, to give anyone who possesses the object code either (1) a
-    copy of the Corresponding Source for all the software in the
-    product that is covered by this License, on a durable physical
-    medium customarily used for software interchange, for a price no
-    more than your reasonable cost of physically performing this
-    conveying of source, or (2) access to copy the
-    Corresponding Source from a network server at no charge.
-
-    c) Convey individual copies of the object code with a copy of the
-    written offer to provide the Corresponding Source.  This
-    alternative is allowed only occasionally and noncommercially, and
-    only if you received the object code with such an offer, in accord
-    with subsection 6b.
-
-    d) Convey the object code by offering access from a designated
-    place (gratis or for a charge), and offer equivalent access to the
-    Corresponding Source in the same way through the same place at no
-    further charge.  You need not require recipients to copy the
-    Corresponding Source along with the object code.  If the place to
-    copy the object code is a network server, the Corresponding Source
-    may be on a different server (operated by you or a third party)
-    that supports equivalent copying facilities, provided you maintain
-    clear directions next to the object code saying where to find the
-    Corresponding Source.  Regardless of what server hosts the
-    Corresponding Source, you remain obligated to ensure that it is
-    available for as long as needed to satisfy these requirements.
-
-    e) Convey the object code using peer-to-peer transmission, provided
-    you inform other peers where the object code and Corresponding
-    Source of the work are being offered to the general public at no
-    charge under subsection 6d.
-
-  A separable portion of the object code, whose source code is excluded
-from the Corresponding Source as a System Library, need not be
-included in conveying the object code work.
-
-  A "User Product" is either (1) a "consumer product", which means any
-tangible personal property which is normally used for personal, family,
-or household purposes, or (2) anything designed or sold for incorporation
-into a dwelling.  In determining whether a product is a consumer product,
-doubtful cases shall be resolved in favor of coverage.  For a particular
-product received by a particular user, "normally used" refers to a
-typical or common use of that class of product, regardless of the status
-of the particular user or of the way in which the particular user
-actually uses, or expects or is expected to use, the product.  A product
-is a consumer product regardless of whether the product has substantial
-commercial, industrial or non-consumer uses, unless such uses represent
-the only significant mode of use of the product.
-
-  "Installation Information" for a User Product means any methods,
-procedures, authorization keys, or other information required to install
-and execute modified versions of a covered work in that User Product from
-a modified version of its Corresponding Source.  The information must
-suffice to ensure that the continued functioning of the modified object
-code is in no case prevented or interfered with solely because
-modification has been made.
-
-  If you convey an object code work under this section in, or with, or
-specifically for use in, a User Product, and the conveying occurs as
-part of a transaction in which the right of possession and use of the
-User Product is transferred to the recipient in perpetuity or for a
-fixed term (regardless of how the transaction is characterized), the
-Corresponding Source conveyed under this section must be accompanied
-by the Installation Information.  But this requirement does not apply
-if neither you nor any third party retains the ability to install
-modified object code on the User Product (for example, the work has
-been installed in ROM).
-
-  The requirement to provide Installation Information does not include a
-requirement to continue to provide support service, warranty, or updates
-for a work that has been modified or installed by the recipient, or for
-the User Product in which it has been modified or installed.  Access to a
-network may be denied when the modification itself materially and
-adversely affects the operation of the network or violates the rules and
-protocols for communication across the network.
-
-  Corresponding Source conveyed, and Installation Information provided,
-in accord with this section must be in a format that is publicly
-documented (and with an implementation available to the public in
-source code form), and must require no special password or key for
-unpacking, reading or copying.
-
-  7. Additional Terms.
-
-  "Additional permissions" are terms that supplement the terms of this
-License by making exceptions from one or more of its conditions.
-Additional permissions that are applicable to the entire Program shall
-be treated as though they were included in this License, to the extent
-that they are valid under applicable law.  If additional permissions
-apply only to part of the Program, that part may be used separately
-under those permissions, but the entire Program remains governed by
-this License without regard to the additional permissions.
-
-  When you convey a copy of a covered work, you may at your option
-remove any additional permissions from that copy, or from any part of
-it.  (Additional permissions may be written to require their own
-removal in certain cases when you modify the work.)  You may place
-additional permissions on material, added by you to a covered work,
-for which you have or can give appropriate copyright permission.
-
-  Notwithstanding any other provision of this License, for material you
-add to a covered work, you may (if authorized by the copyright holders of
-that material) supplement the terms of this License with terms:
-
-    a) Disclaiming warranty or limiting liability differently from the
-    terms of sections 15 and 16 of this License; or
-
-    b) Requiring preservation of specified reasonable legal notices or
-    author attributions in that material or in the Appropriate Legal
-    Notices displayed by works containing it; or
-
-    c) Prohibiting misrepresentation of the origin of that material, or
-    requiring that modified versions of such material be marked in
-    reasonable ways as different from the original version; or
-
-    d) Limiting the use for publicity purposes of names of licensors or
-    authors of the material; or
-
-    e) Declining to grant rights under trademark law for use of some
-    trade names, trademarks, or service marks; or
-
-    f) Requiring indemnification of licensors and authors of that
-    material by anyone who conveys the material (or modified versions of
-    it) with contractual assumptions of liability to the recipient, for
-    any liability that these contractual assumptions directly impose on
-    those licensors and authors.
-
-  All other non-permissive additional terms are considered "further
-restrictions" within the meaning of section 10.  If the Program as you
-received it, or any part of it, contains a notice stating that it is
-governed by this License along with a term that is a further
-restriction, you may remove that term.  If a license document contains
-a further restriction but permits relicensing or conveying under this
-License, you may add to a covered work material governed by the terms
-of that license document, provided that the further restriction does
-not survive such relicensing or conveying.
-
-  If you add terms to a covered work in accord with this section, you
-must place, in the relevant source files, a statement of the
-additional terms that apply to those files, or a notice indicating
-where to find the applicable terms.
-
-  Additional terms, permissive or non-permissive, may be stated in the
-form of a separately written license, or stated as exceptions;
-the above requirements apply either way.
-
-  8. Termination.
-
-  You may not propagate or modify a covered work except as expressly
-provided under this License.  Any attempt otherwise to propagate or
-modify it is void, and will automatically terminate your rights under
-this License (including any patent licenses granted under the third
-paragraph of section 11).
-
-  However, if you cease all violation of this License, then your
-license from a particular copyright holder is reinstated (a)
-provisionally, unless and until the copyright holder explicitly and
-finally terminates your license, and (b) permanently, if the copyright
-holder fails to notify you of the violation by some reasonable means
-prior to 60 days after the cessation.
-
-  Moreover, your license from a particular copyright holder is
-reinstated permanently if the copyright holder notifies you of the
-violation by some reasonable means, this is the first time you have
-received notice of violation of this License (for any work) from that
-copyright holder, and you cure the violation prior to 30 days after
-your receipt of the notice.
-
-  Termination of your rights under this section does not terminate the
-licenses of parties who have received copies or rights from you under
-this License.  If your rights have been terminated and not permanently
-reinstated, you do not qualify to receive new licenses for the same
-material under section 10.
-
-  9. Acceptance Not Required for Having Copies.
-
-  You are not required to accept this License in order to receive or
-run a copy of the Program.  Ancillary propagation of a covered work
-occurring solely as a consequence of using peer-to-peer transmission
-to receive a copy likewise does not require acceptance.  However,
-nothing other than this License grants you permission to propagate or
-modify any covered work.  These actions infringe copyright if you do
-not accept this License.  Therefore, by modifying or propagating a
-covered work, you indicate your acceptance of this License to do so.
-
-  10. Automatic Licensing of Downstream Recipients.
-
-  Each time you convey a covered work, the recipient automatically
-receives a license from the original licensors, to run, modify and
-propagate that work, subject to this License.  You are not responsible
-for enforcing compliance by third parties with this License.
-
-  An "entity transaction" is a transaction transferring control of an
-organization, or substantially all assets of one, or subdividing an
-organization, or merging organizations.  If propagation of a covered
-work results from an entity transaction, each party to that
-transaction who receives a copy of the work also receives whatever
-licenses to the work the party's predecessor in interest had or could
-give under the previous paragraph, plus a right to possession of the
-Corresponding Source of the work from the predecessor in interest, if
-the predecessor has it or can get it with reasonable efforts.
-
-  You may not impose any further restrictions on the exercise of the
-rights granted or affirmed under this License.  For example, you may
-not impose a license fee, royalty, or other charge for exercise of
-rights granted under this License, and you may not initiate litigation
-(including a cross-claim or counterclaim in a lawsuit) alleging that
-any patent claim is infringed by making, using, selling, offering for
-sale, or importing the Program or any portion of it.
-
-  11. Patents.
-
-  A "contributor" is a copyright holder who authorizes use under this
-License of the Program or a work on which the Program is based.  The
-work thus licensed is called the contributor's "contributor version".
-
-  A contributor's "essential patent claims" are all patent claims
-owned or controlled by the contributor, whether already acquired or
-hereafter acquired, that would be infringed by some manner, permitted
-by this License, of making, using, or selling its contributor version,
-but do not include claims that would be infringed only as a
-consequence of further modification of the contributor version.  For
-purposes of this definition, "control" includes the right to grant
-patent sublicenses in a manner consistent with the requirements of
-this License.
-
-  Each contributor grants you a non-exclusive, worldwide, royalty-free
-patent license under the contributor's essential patent claims, to
-make, use, sell, offer for sale, import and otherwise run, modify and
-propagate the contents of its contributor version.
-
-  In the following three paragraphs, a "patent license" is any express
-agreement or commitment, however denominated, not to enforce a patent
-(such as an express permission to practice a patent or covenant not to
-sue for patent infringement).  To "grant" such a patent license to a
-party means to make such an agreement or commitment not to enforce a
-patent against the party.
-
-  If you convey a covered work, knowingly relying on a patent license,
-and the Corresponding Source of the work is not available for anyone
-to copy, free of charge and under the terms of this License, through a
-publicly available network server or other readily accessible means,
-then you must either (1) cause the Corresponding Source to be so
-available, or (2) arrange to deprive yourself of the benefit of the
-patent license for this particular work, or (3) arrange, in a manner
-consistent with the requirements of this License, to extend the patent
-license to downstream recipients.  "Knowingly relying" means you have
-actual knowledge that, but for the patent license, your conveying the
-covered work in a country, or your recipient's use of the covered work
-in a country, would infringe one or more identifiable patents in that
-country that you have reason to believe are valid.
-
-  If, pursuant to or in connection with a single transaction or
-arrangement, you convey, or propagate by procuring conveyance of, a
-covered work, and grant a patent license to some of the parties
-receiving the covered work authorizing them to use, propagate, modify
-or convey a specific copy of the covered work, then the patent license
-you grant is automatically extended to all recipients of the covered
-work and works based on it.
-
-  A patent license is "discriminatory" if it does not include within
-the scope of its coverage, prohibits the exercise of, or is
-conditioned on the non-exercise of one or more of the rights that are
-specifically granted under this License.  You may not convey a covered
-work if you are a party to an arrangement with a third party that is
-in the business of distributing software, under which you make payment
-to the third party based on the extent of your activity of conveying
-the work, and under which the third party grants, to any of the
-parties who would receive the covered work from you, a discriminatory
-patent license (a) in connection with copies of the covered work
-conveyed by you (or copies made from those copies), or (b) primarily
-for and in connection with specific products or compilations that
-contain the covered work, unless you entered into that arrangement,
-or that patent license was granted, prior to 28 March 2007.
-
-  Nothing in this License shall be construed as excluding or limiting
-any implied license or other defenses to infringement that may
-otherwise be available to you under applicable patent law.
-
-  12. No Surrender of Others' Freedom.
-
-  If conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License.  If you cannot convey a
-covered work so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you may
-not convey it at all.  For example, if you agree to terms that obligate you
-to collect a royalty for further conveying from those to whom you convey
-the Program, the only way you could satisfy both those terms and this
-License would be to refrain entirely from conveying the Program.
-
-  13. Use with the GNU Affero General Public License.
-
-  Notwithstanding any other provision of this License, you have
-permission to link or combine any covered work with a work licensed
-under version 3 of the GNU Affero General Public License into a single
-combined work, and to convey the resulting work.  The terms of this
-License will continue to apply to the part which is the covered work,
-but the special requirements of the GNU Affero General Public License,
-section 13, concerning interaction through a network will apply to the
-combination as such.
-
-  14. Revised Versions of this License.
-
-  The Free Software Foundation may publish revised and/or new versions of
-the GNU General Public License from time to time.  Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-  Each version is given a distinguishing version number.  If the
-Program specifies that a certain numbered version of the GNU General
-Public License "or any later version" applies to it, you have the
-option of following the terms and conditions either of that numbered
-version or of any later version published by the Free Software
-Foundation.  If the Program does not specify a version number of the
-GNU General Public License, you may choose any version ever published
-by the Free Software Foundation.
-
-  If the Program specifies that a proxy can decide which future
-versions of the GNU General Public License can be used, that proxy's
-public statement of acceptance of a version permanently authorizes you
-to choose that version for the Program.
-
-  Later license versions may give you additional or different
-permissions.  However, no additional obligations are imposed on any
-author or copyright holder as a result of your choosing to follow a
-later version.
-
-  15. Disclaimer of Warranty.
-
-  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
-APPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
-HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
-OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
-THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
-IS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
-ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
-
-  16. Limitation of Liability.
-
-  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
-THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
-GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
-USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
-DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
-PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
-EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
-SUCH DAMAGES.
-
-  17. Interpretation of Sections 15 and 16.
-
-  If the disclaimer of warranty and limitation of liability provided
-above cannot be given local legal effect according to their terms,
-reviewing courts shall apply local law that most closely approximates
-an absolute waiver of all civil liability in connection with the
-Program, unless a warranty or assumption of liability accompanies a
-copy of the Program in return for a fee.
-
-                     END OF TERMS AND CONDITIONS
-
-            How to Apply These Terms to Your New Programs
-
-  If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
-  To do so, attach the following notices to the program.  It is safest
-to attach them to the start of each source file to most effectively
-state the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
-    <one line to give the program's name and a brief idea of what it does.>
-    Copyright (C) <year>  <name of author>
-
-    This program is free software: you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation, either version 3 of the License, or
-    (at your option) any later version.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with this program.  If not, see <https://www.gnu.org/licenses/>.
-
-Also add information on how to contact you by electronic and paper mail.
-
-  If the program does terminal interaction, make it output a short
-notice like this when it starts in an interactive mode:
-
-    <program>  Copyright (C) <year>  <name of author>
-    This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
-    This is free software, and you are welcome to redistribute it
-    under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License.  Of course, your program's commands
-might be different; for a GUI interface, you would use an "about box".
-
-  You should also get your employer (if you work as a programmer) or school,
-if any, to sign a "copyright disclaimer" for the program, if necessary.
-For more information on this, and how to apply and follow the GNU GPL, see
-<https://www.gnu.org/licenses/>.
-
-  The GNU General Public License does not permit incorporating your program
-into proprietary programs.  If your program is a subroutine library, you
-may consider it more useful to permit linking proprietary applications with
-the library.  If this is what you want to do, use the GNU Lesser General
-Public License instead of this License.  But first, please read
-<https://www.gnu.org/licenses/why-not-lgpl.html>.

+ 0 - 178
apps_broken_by_last_refactors/flipperzero_vb_migrate/README.md

@@ -1,178 +0,0 @@
-VB Lab Migration Assistant for Flipper Zero
-===========================================
-
-This app is designed to make transferring your characters from VB Lab and VBC
-Lab more convenient.
-
-[![ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/C0C81P4PX)
-
-Background
-----------
-The Vital Bracelet Arena app is going to be the new companion app for the Vital
-Bracelet series of fitness bracelet toys, however the app does not support
-account linking from VB Lab and VBC Lab, and requires you to transfer characters
-one by one from those apps through your Vital Bracelet. Because the Vital
-Bracelet can only hold at most two characters at a time and requires inserting
-Dim/VBM to complete the transfer, transferring all of your characters may take a
-significant amount of time. The VB Lab Migration Assistant is designed to make
-this process faster by allowing you to store an unlimited amount of characters
-on the Flipper and to bypass the Dim loading process, therefore allowing you to
-transfer your characters without having to flip back and forth between the apps
-or wasting time loading data that will never be used.
-
-Usage
------
-
-### Update notes
-
-As of Flipper Zero firmware version 0.79.1, application data is stored in a
-dedicated folder. As of app version 1.1, application data is stored in
-`app_data/vb_migrate` under the SD card. If you have used a previous version of
-this app, please move the `vb_migrate` folder on your card into the `app_data`
-folder to resume access to previously registered VBs.
-
-### 1. Register Vital Bracelet
-
-Registering your Vital Bracelet to the Flipper creates template data used for
-emulating the VB using the Flipper.
-
-- Select "Register Vital Bracelet" from Migration Assistant's main menu.
-- If you have an active character on your Vital Bracelet, **transfer it to VB
-  Lab/Arena**. The active character slot on the VB has to be empty to avoid
-  issues when transferring character from VB Lab/Arena to the Flipper. Press the
-  right key on Flipper.
-
-If using VB Lab:
-- If there is an active character in VB Lab, put it in storage.
-- On VB Lab's "Scan" page, tap "Vital Bracelet -> App". Press the right key on
-  Flipper.
-
-If using VB Arena:
-- Select the device type matching your VB and any franchise.
-- Tap the "Send" button. Press the right key on Flipper.
-
-- Tap the Flipper to your Vital Bracelet. You do not have to put the VB in scan
-   mode. When Flipper finishes reading, it will beep.
-- On VB Lab, tap "Send", or on VB Arena, tap "Transfer Data", and tap the
-  Flipper to your phone. VB Lab/Arena will give you an error message. This is
-  normal, and you can dismiss it. The Flipper will beep. Wait for it to switch
-  to the next screen.
-- Tap the Flipper to the original Vital Bracelet again. The Flipper will beep
-  when it's finished reading.
-- Name the Vital Bracelet and select "Save".
-
-The Vital Bracelet info will show after saving.
-
-### 2. Select Vital Bracelet, Vital Bracelet Info
-
-Use the "Select Vital Bracelet" menu to load a previously registered VB. After
-loading, you will see information about this Vital Bracelet:
-
-- Registered name
-- Vital Bracelet type
-- Number of characters captured
-
-Press the right key to see a menu of options you can use with the registered VB.
-
-### Spoof Version
-
-Vital Bracelet Arena splits Vital Bracelet and Vital Hero Digimon into
-mutually-exclusive categories, and currently transferring VBM characters from
-VBDM has not been tested, so if you want to transfer between categories, you can
-select the Vital Bracelet version to spoof to change the VB type and force the
-app to perform transfers between categories.
-
-Note that spoofing a Vital Bracelet Characters from a non-VBC registration and
-vice versa will not work because different encryption keys are used.
-
-### Unlink Account
-
-This option unsets the account flag in the NFC data so the character is not
-bound to any particular account, and you can transfer it to a different Vital
-Bracelet that is using a different account when using VB Arena.
-
-If enabled when transferring from app, the flag will be unset on the capture and
-will still be unset when transferring to app. If enabled when transferring to
-app, the flag will be unset on all transfers, regardless whether the flag was
-set when captured.
-
-Note that VB Lab may still complain because it also uses character ID embedded
-in character data to check whether the character belongs to the current account.
-
-### 3. Transfer App > Flipper
-
-Use this mode to transfer characters from VB Lab to Flipper.
-
-- An instructions screen is displayed. Press right key to continue.
-
-If using VB Lab:
-- On your VB Lab app, wake up the character you want to send (if you have not
-  already).
-- Go to the "Scan" screen, and tap "App -> Vital Bracelet". Select "Check Dim
-  Card". If prompted to send Special Missions or items, tap "No".
-
-If using VB Arena:
-- Select the device and franchise for the character you want to transfer.
-- Tap the "Assign" button.
-- Press and hold on the character you want to transfer.
-- Tap the "Send" button.
-- Tap "OK".
-- Tap "Check Card".
-
-- Tap the Flipper to your phone. Release when VB Lab indicates to do so, and
-  wait for Flipper to beep.
-- Tap "Check Dim/Card Installation" on VB Lab/Arena, and tap Flipper to your
-  phone. Flipper will beep.
-- Tap "Send" on VB Lab, or "Transfer Data" on VB Arena, and tap Flipper to your
-  phone. Hold it there until VB Lab/Arena shows the transfer animation. Flipper
-  will beep after it has received the character.
-- Tap "OK" on VB Lab/Arena. Flipper will have automatically reloaded the
-  template so you can repeat the above again to transfer more characters.
-- When you are done transferring characters, press the left key on Flipper to
-  exit the transfer mode.
-
-Note if you have previously transferred characters to Flipper, the new
-characters you transfer will be put at the end of the sequence of characters
-when transferring from Flipper to app.
-
-### 4. Transfer Flipper > App
-
-Use this mode to transfer characters from Flipper to VB Lab.
-
-- An instructions screen is displayed. Press right key to continue.
-
-If using VB Lab:
-- If there is an active character in VB Lab, put it in storage.
-- On VB Lab's "Scan" page, tap "Vital Bracelet -> App".
-- Tap "Send".
-
-If using VB Arena:
-- Select the device type matching your VB and any franchise.
-- Tap the "Send" button.
-- Tap the "Transfer Data" button.
-
-- Tap your Flipper to your phone, and hold until VB Lab/Arena shows the
-- transfer animation. Flipper will beep when it detected the transfer and will
-- load the next character.
-- Repeat the above until all of your characters have been transferred.
-- If you want to skip a certain character, press the right key to skip and load
-- the next character.
-- You will see the "Transfers complete" screen on Flipper when all characters
-- have been transferred. Press the right key to return to the menu.
-
-### 5. Clear Captures
-
-If you are doing transfers in batches, you can clear the currently captured
-characters so you do not have to skip them when transferring to app. Check the
-details, and press the right key to confirm deletion.
-
-### 6. Delete Vital Bracelet
-
-If you want to unregister the Vital Bracelet, you can use this option to delete
-its captures and remove it from the "Select Vital Bracelet" list. Check the
-details, and press the right key to confirm deletion.
-
-Credits
--------
-
-Graphics by [Aderek](https://twitter.com/AderekArt)

+ 0 - 25
apps_broken_by_last_refactors/flipperzero_vb_migrate/README_catalog.md

@@ -1,25 +0,0 @@
-# VB Lab Migration Assistant for Flipper Zero
-
-This app is designed to make transferring your characters from VB Lab and VBC
-Lab more convenient.
-
-Send me a Ko-fi if you found this useful: https://ko-fi.com/C0C81P4PX
-
-## Background
-The Vital Bracelet Arena app is going to be the new companion app for the Vital
-Bracelet series of fitness bracelet toys, however the app does not support
-account linking from VB Lab and VBC Lab, and requires you to transfer characters
-one by one from those apps through your Vital Bracelet. Because the Vital
-Bracelet can only hold at most two characters at a time and requires inserting
-Dim/VBM to complete the transfer, transferring all of your characters may take a
-significant amount of time. The VB Lab Migration Assistant is designed to make
-this process faster by allowing you to store an unlimited amount of characters
-on the Flipper and to bypass the Dim loading process, therefore allowing you to
-transfer your characters without having to flip back and forth between the apps
-or wasting time loading data that will never be used.
-
-## Usage
-See README.md in source repository: https://github.com/GMMan/flipperzero-vb-migrate/blob/master/README.md
-
-## Credits
-Graphics by Aderek: https://twitter.com/AderekArt

+ 0 - 34
apps_broken_by_last_refactors/flipperzero_vb_migrate/application.fam

@@ -1,34 +0,0 @@
-# SPDX-License-Identifier: GPL-3.0-or-later
-#
-# VB Lab Migration Assistant for Flipper Zero
-# Copyright (C) 2022  cyanic
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <https://www.gnu.org/licenses/>.
-
-App(
-    appid="vb_migrate",
-    name="VB Migration Assistant",
-    apptype=FlipperAppType.EXTERNAL,
-    entry_point="vb_migrate_app",
-    requires=["gui", "dialogs", "notification", "storage"],
-    stack_size=2 * 1024,
-    fap_version=(1,2),
-    fap_libs=[],
-    fap_icon="vb_migrate_10px.png",
-    fap_category="NFC",
-    fap_description="Makes transferring characters with VB Lab less cumbersome",
-    fap_author="cyanic",
-    fap_weburl="https://github.com/GMMan/flipperzero-vb-migrate",
-    fap_icon_assets="icons",
-)

+ 0 - 481
apps_broken_by_last_refactors/flipperzero_vb_migrate/gui/modules/file_select.c

@@ -1,481 +0,0 @@
-#include "file_select.h"
-#include <gui/elements.h>
-#include <storage/storage.h>
-
-#define FILENAME_COUNT 4
-
-struct FileSelect {
-    // public
-    View* view;
-    Storage* fs_api;
-    const char* path;
-    const char* extension;
-
-    bool init_completed;
-
-    FileSelectCallback callback;
-    void* context;
-
-    char* buffer;
-    uint8_t buffer_size;
-};
-
-typedef struct {
-    FuriString* filename[FILENAME_COUNT];
-    uint8_t position;
-
-    uint16_t first_file_index;
-    uint16_t file_count;
-
-} FileSelectModel;
-
-bool file_select_fill_strings(FileSelect* file_select);
-bool file_select_fill_count(FileSelect* file_select);
-static bool file_select_init_inner(FileSelect* file_select);
-
-static void file_select_draw_callback(Canvas* canvas, void* _model) {
-    FileSelectModel* model = _model;
-
-    FuriString* string_buff;
-    const uint8_t item_height = 16;
-    const uint8_t item_width = 123;
-    const uint8_t text_max_width = 115;
-
-    canvas_clear(canvas);
-    canvas_set_font(canvas, FontSecondary);
-
-    if(model->file_count) {
-        for(uint8_t i = 0; i < MIN(FILENAME_COUNT, model->file_count); i++) {
-            if(i == model->position) {
-                canvas_set_color(canvas, ColorBlack);
-                canvas_draw_box(canvas, 0, (i * item_height) + 1, item_width, item_height - 2);
-
-                canvas_set_color(canvas, ColorWhite);
-                canvas_draw_dot(canvas, 0, (i * item_height) + 1);
-                canvas_draw_dot(canvas, 0, (i * item_height) + item_height - 2);
-                canvas_draw_dot(canvas, item_width - 1, (i * item_height) + 1);
-                canvas_draw_dot(canvas, item_width - 1, (i * item_height) + item_height - 2);
-            } else {
-                canvas_set_color(canvas, ColorBlack);
-            }
-
-            string_buff = furi_string_alloc_set(model->filename[i]);
-            elements_string_fit_width(canvas, string_buff, text_max_width);
-            canvas_draw_str(
-                canvas, 6, (i * item_height) + item_height - 4, furi_string_get_cstr(string_buff));
-
-            furi_string_free(string_buff);
-        }
-    } else {
-        canvas_draw_str(canvas, 6, item_height, "Empty folder");
-    }
-    elements_scrollbar(canvas, model->first_file_index + model->position, model->file_count);
-}
-
-static bool file_select_input_callback(InputEvent* event, void* context) {
-    FileSelect* file_select = (FileSelect*)context;
-    bool consumed = false;
-
-    if((event->type == InputTypeShort) | (event->type == InputTypeRepeat)) {
-        if(!file_select->init_completed) {
-            if(!file_select_init_inner(file_select)) {
-                file_select->callback(false, file_select->context);
-            }
-        } else if(event->key == InputKeyUp) {
-            with_view_model(
-                file_select->view,
-                FileSelectModel * model,
-                {
-                    if(model->position == 0) {
-                        if(model->first_file_index == 0) {
-                            // wrap
-                            int16_t max_first_file_index = model->file_count - FILENAME_COUNT;
-                            model->position = MIN(FILENAME_COUNT - 1, model->file_count - 1);
-                            model->first_file_index =
-                                max_first_file_index < 0 ? 0 : max_first_file_index;
-                        } else {
-                            model->first_file_index--;
-                        }
-                    } else if(model->position == 1) {
-                        if(model->first_file_index == 0) {
-                            model->position--;
-                        } else {
-                            model->first_file_index--;
-                        }
-                    } else {
-                        model->position--;
-                    }
-                },
-                true);
-            consumed = true;
-            if(!file_select_fill_strings(file_select)) {
-                file_select->callback(false, file_select->context);
-            }
-        } else if(event->key == InputKeyDown) {
-            with_view_model(
-                file_select->view,
-                FileSelectModel * model,
-                {
-                    uint16_t max_first_file_index = model->file_count > FILENAME_COUNT ?
-                                                        model->file_count - FILENAME_COUNT :
-                                                        0;
-
-                    if(model->position >= MIN(FILENAME_COUNT - 1, model->file_count - 1)) {
-                        if(model->first_file_index >= max_first_file_index) {
-                            // wrap
-                            model->position = 0;
-                            model->first_file_index = 0;
-                        } else {
-                            model->first_file_index++;
-                        }
-                    } else if(model->position >= (FILENAME_COUNT - 2)) {
-                        if(model->first_file_index >= max_first_file_index) {
-                            model->position++;
-                        } else {
-                            model->first_file_index++;
-                        }
-                    } else {
-                        model->position++;
-                    }
-                },
-                true);
-            consumed = true;
-            if(!file_select_fill_strings(file_select)) {
-                file_select->callback(false, file_select->context);
-            }
-        } else if(event->key == InputKeyOk) {
-            if(file_select->callback != NULL) {
-                size_t files = 0;
-                if(file_select->buffer) {
-                    with_view_model(
-                        file_select->view,
-                        FileSelectModel * model,
-                        {
-                            files = model->file_count;
-                            strlcpy(
-                                file_select->buffer,
-                                furi_string_get_cstr(model->filename[model->position]),
-                                file_select->buffer_size);
-                        },
-                        false);
-                };
-                if(files > 0) {
-                    file_select->callback(true, file_select->context);
-                }
-            }
-            consumed = true;
-        }
-    }
-
-    return consumed;
-}
-
-static bool file_select_init_inner(FileSelect* file_select) {
-    bool result = false;
-    if(file_select->path && file_select->extension && file_select->fs_api) {
-        if(file_select_fill_count(file_select)) {
-            if(file_select_fill_strings(file_select)) {
-                file_select->init_completed = true;
-                result = true;
-            }
-        }
-    }
-
-    return result;
-}
-
-FileSelect* file_select_alloc() {
-    FileSelect* file_select = malloc(sizeof(FileSelect));
-    file_select->view = view_alloc();
-    file_select->fs_api = furi_record_open("storage");
-
-    view_set_context(file_select->view, file_select);
-    view_allocate_model(file_select->view, ViewModelTypeLockFree, sizeof(FileSelectModel));
-    view_set_draw_callback(file_select->view, file_select_draw_callback);
-    view_set_input_callback(file_select->view, file_select_input_callback);
-
-    with_view_model(
-        file_select->view,
-        FileSelectModel * model,
-        {
-            for(uint8_t i = 0; i < FILENAME_COUNT; i++) {
-                model->filename[i] = furi_string_alloc();
-            }
-
-            model->first_file_index = 0;
-            model->file_count = 0;
-        },
-        false);
-
-    return file_select;
-}
-
-void file_select_free(FileSelect* file_select) {
-    furi_assert(file_select);
-    with_view_model(
-        file_select->view,
-        FileSelectModel * model,
-        {
-            for(uint8_t i = 0; i < FILENAME_COUNT; i++) {
-                furi_string_free(model->filename[i]);
-            }
-        },
-        false);
-    view_free(file_select->view);
-    free(file_select);
-    furi_record_close("storage");
-}
-
-View* file_select_get_view(FileSelect* file_select) {
-    furi_assert(file_select);
-    return file_select->view;
-}
-
-void file_select_set_callback(FileSelect* file_select, FileSelectCallback callback, void* context) {
-    file_select->context = context;
-    file_select->callback = callback;
-}
-
-void file_select_set_filter(FileSelect* file_select, const char* path, const char* extension) {
-    furi_assert(file_select);
-    file_select->path = path;
-    file_select->extension = extension;
-}
-
-void file_select_set_result_buffer(FileSelect* file_select, char* buffer, uint8_t buffer_size) {
-    file_select->buffer = buffer;
-    file_select->buffer_size = buffer_size;
-
-    if(file_select->buffer) {
-        strlcpy(file_select->buffer, "", file_select->buffer_size);
-    }
-}
-
-bool file_select_init(FileSelect* file_select) {
-    if(!file_select_init_inner(file_select)) {
-        file_select->callback(false, file_select->context);
-        return false;
-    } else {
-        return true;
-    }
-}
-
-static bool filter_file(FileSelect* file_select, FileInfo* file_info, char* name) {
-    bool result = false;
-
-    if((file_info->flags & FSF_DIRECTORY)) {
-        if(strcmp(file_select->extension, "*") == 0) {
-            result = true;
-        } else if(strstr(name, file_select->extension) != NULL) {
-            result = true;
-        }
-    }
-
-    return result;
-}
-
-bool file_select_fill_strings(FileSelect* file_select) {
-    furi_assert(file_select);
-    furi_assert(file_select->fs_api);
-    furi_assert(file_select->path);
-    furi_assert(file_select->extension);
-
-    FileInfo file_info;
-    File* directory = storage_file_alloc(file_select->fs_api);
-
-    uint8_t string_counter = 0;
-    uint16_t file_counter = 0;
-    const uint8_t name_length = 100;
-    char* name = malloc(name_length);
-    uint16_t first_file_index = 0;
-
-    with_view_model(
-        file_select->view,
-        FileSelectModel * model,
-        { first_file_index = model->first_file_index; },
-        false);
-
-    if(!storage_dir_open(directory, file_select->path)) {
-        storage_dir_close(directory);
-        storage_file_free(directory);
-        free(name);
-        return true;
-    }
-
-    while(1) {
-        if(!storage_dir_read(directory, &file_info, name, name_length)) {
-            break;
-        }
-
-        if(storage_file_get_error(directory) == FSE_OK) {
-            if(filter_file(file_select, &file_info, name)) {
-                if(file_counter >= first_file_index) {
-                    with_view_model(
-                        file_select->view,
-                        FileSelectModel * model,
-                        {
-                            furi_string_set(model->filename[string_counter], name);
-
-                            if(strcmp(file_select->extension, "*") != 0) {
-                                furi_string_replace_all_str(
-                                    model->filename[string_counter], file_select->extension, "");
-                            }
-                        },
-                        true);
-                    string_counter++;
-
-                    if(string_counter >= FILENAME_COUNT) {
-                        break;
-                    }
-                }
-                file_counter++;
-            }
-        } else {
-            storage_dir_close(directory);
-            storage_file_free(directory);
-            free(name);
-            return false;
-        }
-    }
-
-    storage_dir_close(directory);
-    storage_file_free(directory);
-    free(name);
-    return true;
-}
-
-bool file_select_fill_count(FileSelect* file_select) {
-    furi_assert(file_select);
-    furi_assert(file_select->fs_api);
-    furi_assert(file_select->path);
-    furi_assert(file_select->extension);
-
-    FileInfo file_info;
-    File* directory = storage_file_alloc(file_select->fs_api);
-
-    uint16_t file_counter = 0;
-    const uint8_t name_length = 100;
-    char* name = malloc(name_length);
-
-    if(!storage_dir_open(directory, file_select->path)) {
-        storage_dir_close(directory);
-        storage_file_free(directory);
-        free(name);
-        return true;
-    }
-
-    while(1) {
-        if(!storage_dir_read(directory, &file_info, name, name_length)) {
-            break;
-        }
-
-        if(storage_file_get_error(directory) == FSE_OK) {
-            if(filter_file(file_select, &file_info, name)) {
-                file_counter++;
-            }
-        } else {
-            storage_dir_close(directory);
-            storage_file_free(directory);
-            free(name);
-            return false;
-        }
-    }
-
-    with_view_model(
-        file_select->view, FileSelectModel * model, { model->file_count = file_counter; }, false);
-
-    storage_dir_close(directory);
-    storage_file_free(directory);
-    free(name);
-    return true;
-}
-
-void file_select_set_selected_file_internal(FileSelect* file_select, const char* filename) {
-    furi_assert(file_select);
-    furi_assert(filename);
-    furi_assert(file_select->fs_api);
-    furi_assert(file_select->path);
-    furi_assert(file_select->extension);
-
-    if(strlen(filename) == 0) return;
-
-    FileInfo file_info;
-    File* directory = storage_file_alloc(file_select->fs_api);
-
-    const uint8_t name_length = 100;
-    char* name = malloc(name_length);
-    uint16_t file_position = 0;
-    bool file_found = false;
-
-    FuriString* filename_str = furi_string_alloc_set_str(filename);
-    if(strcmp(file_select->extension, "*") != 0) {
-        furi_string_cat_str(filename_str, file_select->extension);
-    }
-
-    if(!storage_dir_open(directory, file_select->path)) {
-        furi_string_free(filename_str);
-        storage_dir_close(directory);
-        storage_file_free(directory);
-        free(name);
-        return;
-    }
-
-    while(1) {
-        if(!storage_dir_read(directory, &file_info, name, name_length)) {
-            break;
-        }
-
-        if(storage_file_get_error(directory) == FSE_OK) {
-            if(filter_file(file_select, &file_info, name)) {
-                if(strcmp(furi_string_get_cstr(filename_str), name) == 0) {
-                    file_found = true;
-                    break;
-                }
-
-                file_position++;
-            }
-        } else {
-            furi_string_free(filename_str);
-            storage_dir_close(directory);
-            storage_file_free(directory);
-            free(name);
-            return;
-        }
-    }
-
-    if(file_found) {
-        with_view_model(
-            file_select->view,
-            FileSelectModel * model,
-            {
-                uint16_t max_first_file_index =
-                    model->file_count > FILENAME_COUNT ? model->file_count - FILENAME_COUNT : 0;
-
-                model->first_file_index = file_position;
-
-                if(model->first_file_index > 0) {
-                    model->first_file_index -= 1;
-                }
-
-                if(model->first_file_index >= max_first_file_index) {
-                    model->first_file_index = max_first_file_index;
-                }
-
-                model->position = file_position - model->first_file_index;
-            },
-            true);
-    }
-
-    furi_string_free(filename_str);
-    storage_dir_close(directory);
-    storage_file_free(directory);
-    free(name);
-}
-
-void file_select_set_selected_file(FileSelect* file_select, const char* filename) {
-    file_select_set_selected_file_internal(file_select, filename);
-
-    if(!file_select_fill_strings(file_select)) {
-        file_select->callback(false, file_select->context);
-    }
-}

+ 0 - 31
apps_broken_by_last_refactors/flipperzero_vb_migrate/gui/modules/file_select.h

@@ -1,31 +0,0 @@
-/**
- * @file file_select.h
- * GUI: FileSelect view module API
- */
-
-#pragma once
-
-#include <gui/view.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef struct FileSelect FileSelect;
-
-typedef void (*FileSelectCallback)(bool result, void* context);
-
-FileSelect* file_select_alloc();
-
-void file_select_free(FileSelect* file_select);
-View* file_select_get_view(FileSelect* file_select);
-
-void file_select_set_callback(FileSelect* file_select, FileSelectCallback callback, void* context);
-void file_select_set_filter(FileSelect* file_select, const char* path, const char* extension);
-void file_select_set_result_buffer(FileSelect* file_select, char* buffer, uint8_t buffer_size);
-bool file_select_init(FileSelect* file_select);
-void file_select_set_selected_file(FileSelect* file_select, const char* filename);
-
-#ifdef __cplusplus
-}
-#endif

+ 0 - 419
apps_broken_by_last_refactors/flipperzero_vb_migrate/gui/modules/variable_item_list_ex.c

@@ -1,419 +0,0 @@
-#include "variable_item_list_ex.h"
-#include "gui/canvas.h"
-#include <m-array.h>
-#include <furi.h>
-#include <gui/elements.h>
-#include <stdint.h>
-
-struct VariableItemEx {
-    const char* label;
-    uint8_t current_value_index;
-    FuriString* current_value_text;
-    uint8_t values_count;
-    VariableItemExChangeCallback change_callback;
-    void* context;
-    int32_t callback_index;
-};
-
-ARRAY_DEF(VariableItemExArray, VariableItemEx, M_POD_OPLIST);
-
-struct VariableItemListEx {
-    View* view;
-    VariableItemListExEnterCallback callback;
-    void* context;
-};
-
-typedef struct {
-    VariableItemExArray_t items;
-    uint8_t position;
-    uint8_t window_position;
-} VariableItemListExModel;
-
-static void variable_item_list_ex_process_up(VariableItemListEx* variable_item_list);
-static void variable_item_list_ex_process_down(VariableItemListEx* variable_item_list);
-static void variable_item_list_ex_process_left(VariableItemListEx* variable_item_list);
-static void variable_item_list_ex_process_right(VariableItemListEx* variable_item_list);
-static void variable_item_list_ex_process_ok(VariableItemListEx* variable_item_list);
-
-static void variable_item_list_ex_draw_callback(Canvas* canvas, void* _model) {
-    VariableItemListExModel* model = _model;
-
-    const uint8_t item_height = 16;
-    const uint8_t item_width = 123;
-
-    canvas_clear(canvas);
-
-    uint8_t position = 0;
-    VariableItemExArray_it_t it;
-
-    canvas_set_font(canvas, FontSecondary);
-    for(VariableItemExArray_it(it, model->items); !VariableItemExArray_end_p(it);
-        VariableItemExArray_next(it)) {
-        uint8_t item_position = position - model->window_position;
-        uint8_t items_on_screen = 4;
-        uint8_t y_offset = 0;
-
-        if(item_position < items_on_screen) {
-            const VariableItemEx* item = VariableItemExArray_cref(it);
-            uint8_t item_y = y_offset + (item_position * item_height);
-            uint8_t item_text_y = item_y + item_height - 4;
-
-            if(position == model->position) {
-                canvas_set_color(canvas, ColorBlack);
-                elements_slightly_rounded_box(canvas, 0, item_y + 1, item_width, item_height - 2);
-                canvas_set_color(canvas, ColorWhite);
-            } else {
-                canvas_set_color(canvas, ColorBlack);
-            }
-
-            canvas_draw_str(canvas, 6, item_text_y, item->label);
-
-            if(item->current_value_index > 0) {
-                canvas_draw_str(canvas, 73, item_text_y, "<");
-            }
-
-            canvas_draw_str_aligned(
-                canvas,
-                (115 + 73) / 2 + 1,
-                item_text_y,
-                AlignCenter,
-                AlignBottom,
-                furi_string_get_cstr(item->current_value_text));
-
-            if(item->current_value_index < (item->values_count - 1)) {
-                canvas_draw_str(canvas, 115, item_text_y, ">");
-            }
-        }
-
-        position++;
-    }
-
-    elements_scrollbar(canvas, model->position, VariableItemExArray_size(model->items));
-}
-
-void variable_item_list_ex_set_selected_item(VariableItemListEx* variable_item_list, uint8_t index) {
-    with_view_model(
-        variable_item_list->view,
-        VariableItemListExModel * model,
-        {
-            uint8_t position = index;
-            if(position >= VariableItemExArray_size(model->items)) {
-                position = 0;
-            }
-
-            model->position = position;
-            model->window_position = position;
-
-            if(model->window_position > 0) {
-                model->window_position -= 1;
-            }
-
-            if(VariableItemExArray_size(model->items) <= 4) {
-                model->window_position = 0;
-            } else {
-                if(model->window_position >= (VariableItemExArray_size(model->items) - 4)) {
-                    model->window_position = (VariableItemExArray_size(model->items) - 4);
-                }
-            }
-        },
-        true);
-}
-
-uint8_t variable_item_list_ex_get_selected_item_index(VariableItemListEx* variable_item_list) {
-    VariableItemListExModel* model = view_get_model(variable_item_list->view);
-    uint8_t idx = model->position;
-    view_commit_model(variable_item_list->view, false);
-    return idx;
-}
-
-static bool variable_item_list_ex_input_callback(InputEvent* event, void* context) {
-    VariableItemListEx* variable_item_list = context;
-    furi_assert(variable_item_list);
-    bool consumed = false;
-
-    if(event->type == InputTypeShort) {
-        switch(event->key) {
-        case InputKeyUp:
-            consumed = true;
-            variable_item_list_ex_process_up(variable_item_list);
-            break;
-        case InputKeyDown:
-            consumed = true;
-            variable_item_list_ex_process_down(variable_item_list);
-            break;
-        case InputKeyLeft:
-            consumed = true;
-            variable_item_list_ex_process_left(variable_item_list);
-            break;
-        case InputKeyRight:
-            consumed = true;
-            variable_item_list_ex_process_right(variable_item_list);
-            break;
-        case InputKeyOk:
-            variable_item_list_ex_process_ok(variable_item_list);
-            break;
-        default:
-            break;
-        }
-    } else if(event->type == InputTypeRepeat) {
-        switch(event->key) {
-        case InputKeyUp:
-            consumed = true;
-            variable_item_list_ex_process_up(variable_item_list);
-            break;
-        case InputKeyDown:
-            consumed = true;
-            variable_item_list_ex_process_down(variable_item_list);
-            break;
-        case InputKeyLeft:
-            consumed = true;
-            variable_item_list_ex_process_left(variable_item_list);
-            break;
-        case InputKeyRight:
-            consumed = true;
-            variable_item_list_ex_process_right(variable_item_list);
-            break;
-        default:
-            break;
-        }
-    }
-
-    return consumed;
-}
-
-void variable_item_list_ex_process_up(VariableItemListEx* variable_item_list) {
-    with_view_model(
-        variable_item_list->view,
-        VariableItemListExModel * model,
-        {
-            uint8_t items_on_screen = 4;
-            if(model->position > 0) {
-                model->position--;
-                if(((model->position - model->window_position) < 1) &&
-                   model->window_position > 0) {
-                    model->window_position--;
-                }
-            } else {
-                model->position = VariableItemExArray_size(model->items) - 1;
-                if(model->position > (items_on_screen - 1)) {
-                    model->window_position = model->position - (items_on_screen - 1);
-                }
-            }
-        },
-        true);
-}
-
-void variable_item_list_ex_process_down(VariableItemListEx* variable_item_list) {
-    with_view_model(
-        variable_item_list->view,
-        VariableItemListExModel * model,
-        {
-            uint8_t items_on_screen = 4;
-            if(model->position < (VariableItemExArray_size(model->items) - 1)) {
-                model->position++;
-                if((model->position - model->window_position) > (items_on_screen - 2) &&
-                   model->window_position <
-                       (VariableItemExArray_size(model->items) - items_on_screen)) {
-                    model->window_position++;
-                }
-            } else {
-                model->position = 0;
-                model->window_position = 0;
-            }
-        },
-        true);
-}
-
-VariableItemEx* variable_item_list_ex_get_selected_item(VariableItemListExModel* model) {
-    VariableItemEx* item = NULL;
-
-    VariableItemExArray_it_t it;
-    uint8_t position = 0;
-    for(VariableItemExArray_it(it, model->items); !VariableItemExArray_end_p(it);
-        VariableItemExArray_next(it)) {
-        if(position == model->position) {
-            break;
-        }
-        position++;
-    }
-
-    item = VariableItemExArray_ref(it);
-
-    furi_assert(item);
-    return item;
-}
-
-void variable_item_list_ex_process_left(VariableItemListEx* variable_item_list) {
-    with_view_model(
-        variable_item_list->view,
-        VariableItemListExModel * model,
-        {
-            VariableItemEx* item = variable_item_list_ex_get_selected_item(model);
-            if(item->current_value_index > 0) {
-                item->current_value_index--;
-                if(item->change_callback) {
-                    item->change_callback(item);
-                }
-            }
-        },
-        true);
-}
-
-void variable_item_list_ex_process_right(VariableItemListEx* variable_item_list) {
-    with_view_model(
-        variable_item_list->view,
-        VariableItemListExModel * model,
-        {
-            VariableItemEx* item = variable_item_list_ex_get_selected_item(model);
-            if(item->current_value_index < (item->values_count - 1)) {
-                item->current_value_index++;
-                if(item->change_callback) {
-                    item->change_callback(item);
-                }
-            }
-        },
-        true);
-}
-
-void variable_item_list_ex_process_ok(VariableItemListEx* variable_item_list) {
-    with_view_model(
-        variable_item_list->view,
-        VariableItemListExModel * model,
-        {
-            if(variable_item_list->callback) {
-                const VariableItemEx* variable_item =
-                    VariableItemExArray_cget(model->items, model->position);
-                variable_item_list->callback(
-                    variable_item_list->context, variable_item->callback_index);
-            }
-        },
-        false);
-}
-
-VariableItemListEx* variable_item_list_ex_alloc() {
-    VariableItemListEx* variable_item_list = malloc(sizeof(VariableItemListEx));
-    variable_item_list->view = view_alloc();
-    view_set_context(variable_item_list->view, variable_item_list);
-    view_allocate_model(
-        variable_item_list->view, ViewModelTypeLocking, sizeof(VariableItemListExModel));
-    view_set_draw_callback(variable_item_list->view, variable_item_list_ex_draw_callback);
-    view_set_input_callback(variable_item_list->view, variable_item_list_ex_input_callback);
-
-    with_view_model(
-        variable_item_list->view,
-        VariableItemListExModel * model,
-        {
-            VariableItemExArray_init(model->items);
-            model->position = 0;
-            model->window_position = 0;
-        },
-        true);
-
-    return variable_item_list;
-}
-
-void variable_item_list_ex_free(VariableItemListEx* variable_item_list) {
-    furi_assert(variable_item_list);
-
-    with_view_model(
-        variable_item_list->view,
-        VariableItemListExModel * model,
-        {
-            VariableItemExArray_it_t it;
-            for(VariableItemExArray_it(it, model->items); !VariableItemExArray_end_p(it);
-                VariableItemExArray_next(it)) {
-                furi_string_free(VariableItemExArray_ref(it)->current_value_text);
-            }
-            VariableItemExArray_clear(model->items);
-        },
-        false);
-    view_free(variable_item_list->view);
-    free(variable_item_list);
-}
-
-void variable_item_list_ex_reset(VariableItemListEx* variable_item_list) {
-    furi_assert(variable_item_list);
-
-    with_view_model(
-        variable_item_list->view,
-        VariableItemListExModel * model,
-        {
-            VariableItemExArray_it_t it;
-            for(VariableItemExArray_it(it, model->items); !VariableItemExArray_end_p(it);
-                VariableItemExArray_next(it)) {
-                furi_string_free(VariableItemExArray_ref(it)->current_value_text);
-            }
-            VariableItemExArray_reset(model->items);
-        },
-        false);
-}
-
-View* variable_item_list_ex_get_view(VariableItemListEx* variable_item_list) {
-    furi_assert(variable_item_list);
-    return variable_item_list->view;
-}
-
-VariableItemEx* variable_item_list_ex_add(
-    VariableItemListEx* variable_item_list,
-    const char* label,
-    uint8_t values_count,
-    VariableItemExChangeCallback change_callback,
-    void* context,
-    int32_t callback_index) {
-    VariableItemEx* item = NULL;
-    furi_assert(label);
-    furi_assert(variable_item_list);
-
-    with_view_model(
-        variable_item_list->view,
-        VariableItemListExModel * model,
-        {
-            item = VariableItemExArray_push_new(model->items);
-            item->label = label;
-            item->values_count = values_count;
-            item->change_callback = change_callback;
-            item->context = context;
-            item->current_value_index = 0;
-            item->current_value_text = furi_string_alloc();
-            item->callback_index = callback_index;
-        },
-        true);
-
-    return item;
-}
-
-void variable_item_list_ex_set_enter_callback(
-    VariableItemListEx* variable_item_list,
-    VariableItemListExEnterCallback callback,
-    void* context) {
-    furi_assert(callback);
-    with_view_model(
-        variable_item_list->view,
-        VariableItemListExModel * model,
-        {
-            UNUSED(model);
-            variable_item_list->callback = callback;
-            variable_item_list->context = context;
-        },
-        false);
-}
-
-void variable_item_ex_set_current_value_index(VariableItemEx* item, uint8_t current_value_index) {
-    item->current_value_index = current_value_index;
-}
-
-void variable_item_ex_set_values_count(VariableItemEx* item, uint8_t values_count) {
-    item->values_count = values_count;
-}
-
-void variable_item_ex_set_current_value_text(VariableItemEx* item, const char* current_value_text) {
-    furi_string_set(item->current_value_text, current_value_text);
-}
-
-uint8_t variable_item_ex_get_current_value_index(VariableItemEx* item) {
-    return item->current_value_index;
-}
-
-void* variable_item_ex_get_context(VariableItemEx* item) {
-    return item->context;
-}

+ 0 - 117
apps_broken_by_last_refactors/flipperzero_vb_migrate/gui/modules/variable_item_list_ex.h

@@ -1,117 +0,0 @@
-/**
- * @file variable_item_list.h
- * GUI: VariableItemList view module API
- */
-
-#pragma once
-
-#include <gui/view.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef struct VariableItemListEx VariableItemListEx;
-typedef struct VariableItemEx VariableItemEx;
-typedef void (*VariableItemExChangeCallback)(VariableItemEx* item);
-typedef void (*VariableItemListExEnterCallback)(void* context, uint32_t index);
-
-/** Allocate and initialize VariableItemList
- *
- * @return     VariableItemList*
- */
-VariableItemListEx* variable_item_list_ex_alloc();
-
-/** Deinitialize and free VariableItemList
- *
- * @param      variable_item_list  VariableItemList instance
- */
-void variable_item_list_ex_free(VariableItemListEx* variable_item_list);
-
-/** Clear all elements from list
- *
- * @param      variable_item_list  VariableItemList instance
- */
-void variable_item_list_ex_reset(VariableItemListEx* variable_item_list);
-
-/** Get VariableItemList View instance
- *
- * @param      variable_item_list  VariableItemList instance
- *
- * @return     View instance
- */
-View* variable_item_list_ex_get_view(VariableItemListEx* variable_item_list);
-
-/** Add item to VariableItemList
- *
- * @param      variable_item_list  VariableItemList instance
- * @param      label               item name
- * @param      values_count        item values count
- * @param      change_callback     called on value change in gui
- * @param      context             item context
- *
- * @return     VariableItemEx* item instance
- */
-VariableItemEx* variable_item_list_ex_add(
-    VariableItemListEx* variable_item_list,
-    const char* label,
-    uint8_t values_count,
-    VariableItemExChangeCallback change_callback,
-    void* context,
-    int32_t callback_index);
-
-/** Set enter callback
- *
- * @param      variable_item_list  VariableItemList instance
- * @param      callback            VariableItemListEnterCallback instance
- * @param      context             pointer to context
- */
-void variable_item_list_ex_set_enter_callback(
-    VariableItemListEx* variable_item_list,
-    VariableItemListExEnterCallback callback,
-    void* context);
-
-void variable_item_list_ex_set_selected_item(VariableItemListEx* variable_item_list, uint8_t index);
-
-uint8_t variable_item_list_ex_get_selected_item_index(VariableItemListEx* variable_item_list);
-
-/** Set item current selected index
- *
- * @param      item                 VariableItemEx* instance
- * @param      current_value_index  The current value index
- */
-void variable_item_ex_set_current_value_index(VariableItemEx* item, uint8_t current_value_index);
-
-/** Set number of values for item
- *
- * @param      item                 VariableItemEx* instance
- * @param      values_count         The new values count
- */
-void variable_item_ex_set_values_count(VariableItemEx* item, uint8_t values_count);
-
-/** Set item current selected text
- *
- * @param      item                VariableItemEx* instance
- * @param      current_value_text  The current value text
- */
-void variable_item_ex_set_current_value_text(VariableItemEx* item, const char* current_value_text);
-
-/** Get item current selected index
- *
- * @param      item  VariableItemEx* instance
- *
- * @return     uint8_t current selected index
- */
-uint8_t variable_item_ex_get_current_value_index(VariableItemEx* item);
-
-/** Get item context
- *
- * @param      item  VariableItemEx* instance
- *
- * @return     void* item context
- */
-void* variable_item_ex_get_context(VariableItemEx* item);
-
-#ifdef __cplusplus
-}
-#endif

BIN
apps_broken_by_last_refactors/flipperzero_vb_migrate/icons/AppInteract_32x27.png


BIN
apps_broken_by_last_refactors/flipperzero_vb_migrate/icons/Background_128x64.png


BIN
apps_broken_by_last_refactors/flipperzero_vb_migrate/icons/CommComplete_32x20.png


BIN
apps_broken_by_last_refactors/flipperzero_vb_migrate/icons/CommReady_32x27.png


BIN
apps_broken_by_last_refactors/flipperzero_vb_migrate/icons/CommReturn_10x8.png


BIN
apps_broken_by_last_refactors/flipperzero_vb_migrate/icons/CommVB_32x20.png


BIN
apps_broken_by_last_refactors/flipperzero_vb_migrate/icons/CommWave_12x8.png


BIN
apps_broken_by_last_refactors/flipperzero_vb_migrate/icons/Comm_32x20.png


BIN
apps_broken_by_last_refactors/flipperzero_vb_migrate/icons/Delete_32x20.png


BIN
apps_broken_by_last_refactors/flipperzero_vb_migrate/icons/LeftButtonBg_54x15.png


BIN
apps_broken_by_last_refactors/flipperzero_vb_migrate/icons/PulsemonLeftStand_14x16.png


BIN
apps_broken_by_last_refactors/flipperzero_vb_migrate/icons/PulsemonLeftWait_15x15.png


BIN
apps_broken_by_last_refactors/flipperzero_vb_migrate/icons/PulsemonRightHappy_14x16.png


BIN
apps_broken_by_last_refactors/flipperzero_vb_migrate/icons/PulsemonRightSad_15x15.png


BIN
apps_broken_by_last_refactors/flipperzero_vb_migrate/icons/PulsemonRightWaiting_15x16.png


BIN
apps_broken_by_last_refactors/flipperzero_vb_migrate/icons/RightButtonBg_54x15.png


BIN
apps_broken_by_last_refactors/flipperzero_vb_migrate/icons/TextClearCaptures_49x13.png


BIN
apps_broken_by_last_refactors/flipperzero_vb_migrate/icons/TextCleared_47x6.png


BIN
apps_broken_by_last_refactors/flipperzero_vb_migrate/icons/TextDeleteVb_49x13.png


BIN
apps_broken_by_last_refactors/flipperzero_vb_migrate/icons/TextDeleted_46x6.png


BIN
apps_broken_by_last_refactors/flipperzero_vb_migrate/icons/TextErrLoadCapture_65x13.png


BIN
apps_broken_by_last_refactors/flipperzero_vb_migrate/icons/TextErrLoadTemplate_69x13.png


BIN
apps_broken_by_last_refactors/flipperzero_vb_migrate/icons/TextErrReadFailed_71x20.png


BIN
apps_broken_by_last_refactors/flipperzero_vb_migrate/icons/TextErrRegisterDifferentTag_47x20.png


BIN
apps_broken_by_last_refactors/flipperzero_vb_migrate/icons/TextErrSaveCapture_65x13.png


BIN
apps_broken_by_last_refactors/flipperzero_vb_migrate/icons/TextRegister1_71x20.png


BIN
apps_broken_by_last_refactors/flipperzero_vb_migrate/icons/TextRegisterErrNotVb_71x20.png


برخی فایل ها در این مقایسه diff نمایش داده نمی شوند زیرا تعداد فایل ها بسیار زیاد است