MX 2 лет назад
Родитель
Сommit
cdb3eb0d5c
100 измененных файлов с 3 добавлено и 9270 удалено
  1. 0 134
      .drone.yml
  2. 3 2
      .gitignore
  3. 0 6
      .gitmodules
  4. 0 7
      CHANGELOG.md
  5. 0 0
      README.md
  6. 0 269
      ReadMe.md
  7. 0 0
      application.fam
  8. 0 674
      apps_broken_by_last_refactors/cli_bridge/LICENSE
  9. 0 10
      apps_broken_by_last_refactors/cli_bridge/application.fam
  10. 0 104
      apps_broken_by_last_refactors/cli_bridge/cli_control.c
  11. 0 8
      apps_broken_by_last_refactors/cli_bridge/cli_control.h
  12. BIN
      apps_broken_by_last_refactors/cli_bridge/cligui.png
  13. 0 147
      apps_broken_by_last_refactors/cli_bridge/cligui_main.c
  14. 0 41
      apps_broken_by_last_refactors/cli_bridge/cligui_main_i.h
  15. 0 12
      apps_broken_by_last_refactors/cli_bridge/console_output.c
  16. 0 4
      apps_broken_by_last_refactors/cli_bridge/console_output.h
  17. 0 101
      apps_broken_by_last_refactors/cli_bridge/internal_defs.h
  18. 0 34
      apps_broken_by_last_refactors/cli_bridge/text_input.c
  19. 0 5
      apps_broken_by_last_refactors/cli_bridge/text_input.h
  20. 0 3
      apps_broken_by_last_refactors/esubghz_chat/.gitignore
  21. 0 674
      apps_broken_by_last_refactors/esubghz_chat/LICENSE
  22. 0 1
      apps_broken_by_last_refactors/flipperzero_vb_migrate/.github/FUNDING.yml
  23. 0 12
      apps_broken_by_last_refactors/flipperzero_vb_migrate/.github/workflows/build-fap.yml
  24. 0 8
      apps_broken_by_last_refactors/flipperzero_vb_migrate/CHANGES.md
  25. 0 674
      apps_broken_by_last_refactors/flipperzero_vb_migrate/LICENSE
  26. 0 178
      apps_broken_by_last_refactors/flipperzero_vb_migrate/README.md
  27. 0 25
      apps_broken_by_last_refactors/flipperzero_vb_migrate/README_catalog.md
  28. 0 34
      apps_broken_by_last_refactors/flipperzero_vb_migrate/application.fam
  29. 0 481
      apps_broken_by_last_refactors/flipperzero_vb_migrate/gui/modules/file_select.c
  30. 0 31
      apps_broken_by_last_refactors/flipperzero_vb_migrate/gui/modules/file_select.h
  31. 0 419
      apps_broken_by_last_refactors/flipperzero_vb_migrate/gui/modules/variable_item_list_ex.c
  32. 0 117
      apps_broken_by_last_refactors/flipperzero_vb_migrate/gui/modules/variable_item_list_ex.h
  33. BIN
      apps_broken_by_last_refactors/flipperzero_vb_migrate/icons/AppInteract_32x27.png
  34. BIN
      apps_broken_by_last_refactors/flipperzero_vb_migrate/icons/Background_128x64.png
  35. BIN
      apps_broken_by_last_refactors/flipperzero_vb_migrate/icons/CommComplete_32x20.png
  36. BIN
      apps_broken_by_last_refactors/flipperzero_vb_migrate/icons/CommReady_32x27.png
  37. BIN
      apps_broken_by_last_refactors/flipperzero_vb_migrate/icons/CommReturn_10x8.png
  38. BIN
      apps_broken_by_last_refactors/flipperzero_vb_migrate/icons/CommVB_32x20.png
  39. BIN
      apps_broken_by_last_refactors/flipperzero_vb_migrate/icons/CommWave_12x8.png
  40. BIN
      apps_broken_by_last_refactors/flipperzero_vb_migrate/icons/Comm_32x20.png
  41. BIN
      apps_broken_by_last_refactors/flipperzero_vb_migrate/icons/Delete_32x20.png
  42. BIN
      apps_broken_by_last_refactors/flipperzero_vb_migrate/icons/LeftButtonBg_54x15.png
  43. BIN
      apps_broken_by_last_refactors/flipperzero_vb_migrate/icons/PulsemonLeftStand_14x16.png
  44. BIN
      apps_broken_by_last_refactors/flipperzero_vb_migrate/icons/PulsemonLeftWait_15x15.png
  45. BIN
      apps_broken_by_last_refactors/flipperzero_vb_migrate/icons/PulsemonRightHappy_14x16.png
  46. BIN
      apps_broken_by_last_refactors/flipperzero_vb_migrate/icons/PulsemonRightSad_15x15.png
  47. BIN
      apps_broken_by_last_refactors/flipperzero_vb_migrate/icons/PulsemonRightWaiting_15x16.png
  48. BIN
      apps_broken_by_last_refactors/flipperzero_vb_migrate/icons/RightButtonBg_54x15.png
  49. BIN
      apps_broken_by_last_refactors/flipperzero_vb_migrate/icons/TextClearCaptures_49x13.png
  50. BIN
      apps_broken_by_last_refactors/flipperzero_vb_migrate/icons/TextCleared_47x6.png
  51. BIN
      apps_broken_by_last_refactors/flipperzero_vb_migrate/icons/TextDeleteVb_49x13.png
  52. BIN
      apps_broken_by_last_refactors/flipperzero_vb_migrate/icons/TextDeleted_46x6.png
  53. BIN
      apps_broken_by_last_refactors/flipperzero_vb_migrate/icons/TextErrLoadCapture_65x13.png
  54. BIN
      apps_broken_by_last_refactors/flipperzero_vb_migrate/icons/TextErrLoadTemplate_69x13.png
  55. BIN
      apps_broken_by_last_refactors/flipperzero_vb_migrate/icons/TextErrReadFailed_71x20.png
  56. BIN
      apps_broken_by_last_refactors/flipperzero_vb_migrate/icons/TextErrRegisterDifferentTag_47x20.png
  57. BIN
      apps_broken_by_last_refactors/flipperzero_vb_migrate/icons/TextErrSaveCapture_65x13.png
  58. BIN
      apps_broken_by_last_refactors/flipperzero_vb_migrate/icons/TextRegister1_71x20.png
  59. BIN
      apps_broken_by_last_refactors/flipperzero_vb_migrate/icons/TextRegisterErrNotVb_71x20.png
  60. BIN
      apps_broken_by_last_refactors/flipperzero_vb_migrate/icons/TextRegisterTapAgain_67x20.png
  61. BIN
      apps_broken_by_last_refactors/flipperzero_vb_migrate/icons/TextSaved_30x6.png
  62. BIN
      apps_broken_by_last_refactors/flipperzero_vb_migrate/icons/TextTapApp_56x27.png
  63. BIN
      apps_broken_by_last_refactors/flipperzero_vb_migrate/icons/TextTransferCaptured_97x13.png
  64. BIN
      apps_broken_by_last_refactors/flipperzero_vb_migrate/icons/TextTransferDimCheck_70x20.png
  65. BIN
      apps_broken_by_last_refactors/flipperzero_vb_migrate/icons/TextTransferSecondDimCheck_71x20.png
  66. BIN
      apps_broken_by_last_refactors/flipperzero_vb_migrate/icons/TextTransfersDone_51x13.png
  67. BIN
      apps_broken_by_last_refactors/flipperzero_vb_migrate/icons/WrongDevice_32x27.png
  68. 0 71
      apps_broken_by_last_refactors/flipperzero_vb_migrate/lib/nfc/helpers/nfc_debug_log.c
  69. 0 17
      apps_broken_by_last_refactors/flipperzero_vb_migrate/lib/nfc/helpers/nfc_debug_log.h
  70. 0 130
      apps_broken_by_last_refactors/flipperzero_vb_migrate/lib/nfc/helpers/nfc_debug_pcap.c
  71. 0 17
      apps_broken_by_last_refactors/flipperzero_vb_migrate/lib/nfc/helpers/nfc_debug_pcap.h
  72. 0 193
      apps_broken_by_last_refactors/flipperzero_vb_migrate/lib/nfc/helpers/reader_analyzer.c
  73. 0 35
      apps_broken_by_last_refactors/flipperzero_vb_migrate/lib/nfc/helpers/reader_analyzer.h
  74. 0 49
      apps_broken_by_last_refactors/flipperzero_vb_migrate/lib/nfc/nfc_types.c
  75. 0 9
      apps_broken_by_last_refactors/flipperzero_vb_migrate/lib/nfc/nfc_types.h
  76. 0 385
      apps_broken_by_last_refactors/flipperzero_vb_migrate/lib/nfc/nfc_worker.c
  77. 0 64
      apps_broken_by_last_refactors/flipperzero_vb_migrate/lib/nfc/nfc_worker.h
  78. 0 42
      apps_broken_by_last_refactors/flipperzero_vb_migrate/lib/nfc/nfc_worker_i.h
  79. 0 11
      apps_broken_by_last_refactors/flipperzero_vb_migrate/lib/nfc/protocols/mifare_common.c
  80. 0 10
      apps_broken_by_last_refactors/flipperzero_vb_migrate/lib/nfc/protocols/mifare_common.h
  81. 0 1889
      apps_broken_by_last_refactors/flipperzero_vb_migrate/lib/nfc/protocols/mifare_ultralight.c
  82. 0 70
      apps_broken_by_last_refactors/flipperzero_vb_migrate/lib/nfc/protocols/nfc_util.c
  83. 0 142
      apps_broken_by_last_refactors/flipperzero_vb_migrate/lib/nfc/protocols/nfca.c
  84. 0 48
      apps_broken_by_last_refactors/flipperzero_vb_migrate/scenes/vb_migrate_scene.c
  85. 0 47
      apps_broken_by_last_refactors/flipperzero_vb_migrate/scenes/vb_migrate_scene.h
  86. 0 57
      apps_broken_by_last_refactors/flipperzero_vb_migrate/scenes/vb_migrate_scene_about.c
  87. 0 33
      apps_broken_by_last_refactors/flipperzero_vb_migrate/scenes/vb_migrate_scene_config.h
  88. 0 78
      apps_broken_by_last_refactors/flipperzero_vb_migrate/scenes/vb_migrate_scene_delete.c
  89. 0 87
      apps_broken_by_last_refactors/flipperzero_vb_migrate/scenes/vb_migrate_scene_delete_captures.c
  90. 0 68
      apps_broken_by_last_refactors/flipperzero_vb_migrate/scenes/vb_migrate_scene_delete_captures_success.c
  91. 0 65
      apps_broken_by_last_refactors/flipperzero_vb_migrate/scenes/vb_migrate_scene_delete_success.c
  92. 0 184
      apps_broken_by_last_refactors/flipperzero_vb_migrate/scenes/vb_migrate_scene_dev_menu.c
  93. 0 370
      apps_broken_by_last_refactors/flipperzero_vb_migrate/scenes/vb_migrate_scene_from_app.c
  94. 0 85
      apps_broken_by_last_refactors/flipperzero_vb_migrate/scenes/vb_migrate_scene_info.c
  95. 0 61
      apps_broken_by_last_refactors/flipperzero_vb_migrate/scenes/vb_migrate_scene_load.c
  96. 0 78
      apps_broken_by_last_refactors/flipperzero_vb_migrate/scenes/vb_migrate_scene_main_menu.c
  97. 0 420
      apps_broken_by_last_refactors/flipperzero_vb_migrate/scenes/vb_migrate_scene_register.c
  98. 0 119
      apps_broken_by_last_refactors/flipperzero_vb_migrate/scenes/vb_migrate_scene_register_save.c
  99. 0 64
      apps_broken_by_last_refactors/flipperzero_vb_migrate/scenes/vb_migrate_scene_save_success.c
  100. 0 57
      apps_broken_by_last_refactors/flipperzero_vb_migrate/scenes/vb_migrate_scene_select.c

+ 0 - 134
.drone.yml

@@ -1,134 +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/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
-      - mkdir dist/f7-C/f7-update-local/resources
-      - tar xf dist/f7-C/f7-update-local/resources.tar -C dist/f7-C/f7-update-local/resources
-      - mv dist/f7-C/f7-update-local/resources/apps/* artifacts-base/
-      - mv dist/f7-C/f7-update-local/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/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
-      - mkdir dist/f7-C/f7-update-local/resources
-      - tar xf dist/f7-C/f7-update-local/resources.tar -C dist/f7-C/f7-update-local/resources
-      - mv dist/f7-C/f7-update-local/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

+ 3 - 2
.gitignore

@@ -1,2 +1,3 @@
-
-.DS_Store
+*~
+*.swp
+*.swo

+ 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
-

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


+ 0 - 269
ReadMe.md

@@ -1,269 +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 `22 Nov 01:37 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) | Better decoder by htotoo | [![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) & [noiob](https://github.com/noiob) |  | [![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] |
-| Bluetooth remote Keynote for Kodi | ![GPIO Badge] | [by coded-with-claws](https://github.com/coded-with-claws/flipperzero-tools) | read more details in original repo | ![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) |
-| Игра «Виселица» («Балда») | ![Games Badge] | [by bolknote](https://github.com/bolknote/Flipper-Zero-Hangman-Game) |  | ![None Badge] |
-| City Bloxx | ![Games Badge] | [by Milk-Cool](https://github.com/Milk-Cool/fz-citybloxx) |  | ![None Badge] |
-| 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) + Fixed and modded [by Willy-JL](https://github.com/Flipper-XFW/Xtreme-Firmware/tree/dev/applications/external/evil_portal) | ![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] |
-| WHC CH32V003 debugger/flasher | ![GPIO Badge] | [by sukvojte](https://github.com/sukvojte/wch_swio_flasher) | read more details in original repo | ![None Badge] |
-| NRF24 Sniffer MS | ![GPIO Badge] | [by coded-with-claws](https://github.com/coded-with-claws/flipperzero-tools) | read more details in original repo | ![None Badge] |
-| NRF24 Mouse Jacker MS | ![GPIO Badge] | [by coded-with-claws](https://github.com/coded-with-claws/flipperzero-tools) | read more details in original repo | ![None Badge] |
-| SD-SPI | ![GPIO Badge] | [by Gl1tchub](https://github.com/Gl1tchub/Flipperzero-SD-SPI) | 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] |
-| ShapShup | ![SubGhz Badge] | [by derskythe](https://github.com/derskythe/flipperzero-shapshup) | RAW files preview (+fixed app exit) | ![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] |
-| USB Consumer Control | ![USB Badge] | [by WithSecureLabs](https://github.com/WithSecureLabs/usb-consumer-control/tree/main) |  | ![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/esubghz_chat/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 - 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


BIN
apps_broken_by_last_refactors/flipperzero_vb_migrate/icons/TextRegisterTapAgain_67x20.png


BIN
apps_broken_by_last_refactors/flipperzero_vb_migrate/icons/TextSaved_30x6.png


BIN
apps_broken_by_last_refactors/flipperzero_vb_migrate/icons/TextTapApp_56x27.png


BIN
apps_broken_by_last_refactors/flipperzero_vb_migrate/icons/TextTransferCaptured_97x13.png


BIN
apps_broken_by_last_refactors/flipperzero_vb_migrate/icons/TextTransferDimCheck_70x20.png


BIN
apps_broken_by_last_refactors/flipperzero_vb_migrate/icons/TextTransferSecondDimCheck_71x20.png


BIN
apps_broken_by_last_refactors/flipperzero_vb_migrate/icons/TextTransfersDone_51x13.png


BIN
apps_broken_by_last_refactors/flipperzero_vb_migrate/icons/WrongDevice_32x27.png


+ 0 - 71
apps_broken_by_last_refactors/flipperzero_vb_migrate/lib/nfc/helpers/nfc_debug_log.c

@@ -1,71 +0,0 @@
-#include "nfc_debug_log.h"
-
-#include <storage/storage.h>
-#include <stream/buffered_file_stream.h>
-
-#define TAG "NfcDebugLog"
-
-#define NFC_DEBUG_PCAP_FILENAME EXT_PATH("nfc/debug.txt")
-
-struct NfcDebugLog {
-    Stream* file_stream;
-    FuriString* data_str;
-};
-
-NfcDebugLog* nfc_debug_log_alloc() {
-    NfcDebugLog* instance = malloc(sizeof(NfcDebugLog));
-
-    Storage* storage = furi_record_open(RECORD_STORAGE);
-    instance->file_stream = buffered_file_stream_alloc(storage);
-
-    if(!buffered_file_stream_open(
-           instance->file_stream, NFC_DEBUG_PCAP_FILENAME, FSAM_WRITE, FSOM_OPEN_APPEND)) {
-        buffered_file_stream_close(instance->file_stream);
-        stream_free(instance->file_stream);
-        instance->file_stream = NULL;
-    }
-
-    if(!instance->file_stream) {
-        free(instance);
-        instance = NULL;
-    } else {
-        instance->data_str = furi_string_alloc();
-    }
-    furi_record_close(RECORD_STORAGE);
-
-    return instance;
-}
-
-void nfc_debug_log_free(NfcDebugLog* instance) {
-    furi_assert(instance);
-    furi_assert(instance->file_stream);
-    furi_assert(instance->data_str);
-
-    buffered_file_stream_close(instance->file_stream);
-    stream_free(instance->file_stream);
-    furi_string_free(instance->data_str);
-
-    free(instance);
-}
-
-void nfc_debug_log_process_data(
-    NfcDebugLog* instance,
-    uint8_t* data,
-    uint16_t len,
-    bool reader_to_tag,
-    bool crc_dropped) {
-    furi_assert(instance);
-    furi_assert(instance->file_stream);
-    furi_assert(instance->data_str);
-    furi_assert(data);
-    UNUSED(crc_dropped);
-
-    furi_string_printf(instance->data_str, "%lu %c:", furi_get_tick(), reader_to_tag ? 'R' : 'T');
-    uint16_t data_len = len;
-    for(size_t i = 0; i < data_len; i++) {
-        furi_string_cat_printf(instance->data_str, " %02x", data[i]);
-    }
-    furi_string_push_back(instance->data_str, '\n');
-
-    stream_write_string(instance->file_stream, instance->data_str);
-}

+ 0 - 17
apps_broken_by_last_refactors/flipperzero_vb_migrate/lib/nfc/helpers/nfc_debug_log.h

@@ -1,17 +0,0 @@
-#pragma once
-
-#include <stdint.h>
-#include <stdbool.h>
-
-typedef struct NfcDebugLog NfcDebugLog;
-
-NfcDebugLog* nfc_debug_log_alloc();
-
-void nfc_debug_log_free(NfcDebugLog* instance);
-
-void nfc_debug_log_process_data(
-    NfcDebugLog* instance,
-    uint8_t* data,
-    uint16_t len,
-    bool reader_to_tag,
-    bool crc_dropped);

+ 0 - 130
apps_broken_by_last_refactors/flipperzero_vb_migrate/lib/nfc/helpers/nfc_debug_pcap.c

@@ -1,130 +0,0 @@
-#include "nfc_debug_pcap.h"
-
-#include <storage/storage.h>
-#include <stream/buffered_file_stream.h>
-#include <furi_hal_nfc.h>
-#include <furi_hal_rtc.h>
-
-#define TAG "NfcDebugPcap"
-
-#define PCAP_MAGIC 0xa1b2c3d4
-#define PCAP_MAJOR 2
-#define PCAP_MINOR 4
-#define DLT_ISO_14443 264
-
-#define DATA_PICC_TO_PCD 0xFF
-#define DATA_PCD_TO_PICC 0xFE
-#define DATA_PICC_TO_PCD_CRC_DROPPED 0xFB
-#define DATA_PCD_TO_PICC_CRC_DROPPED 0xFA
-
-#define NFC_DEBUG_PCAP_FILENAME EXT_PATH("nfc/debug.pcap")
-
-struct NfcDebugPcap {
-    Stream* file_stream;
-};
-
-static Stream* nfc_debug_pcap_open(Storage* storage) {
-    Stream* stream = NULL;
-    stream = buffered_file_stream_alloc(storage);
-    if(!buffered_file_stream_open(stream, NFC_DEBUG_PCAP_FILENAME, FSAM_WRITE, FSOM_OPEN_APPEND)) {
-        buffered_file_stream_close(stream);
-        stream_free(stream);
-        stream = NULL;
-    } else {
-        if(!stream_tell(stream)) {
-            struct {
-                uint32_t magic;
-                uint16_t major, minor;
-                uint32_t reserved[2];
-                uint32_t snaplen;
-                uint32_t link_type;
-            } __attribute__((__packed__)) pcap_hdr = {
-                .magic = PCAP_MAGIC,
-                .major = PCAP_MAJOR,
-                .minor = PCAP_MINOR,
-                .snaplen = FURI_HAL_NFC_DATA_BUFF_SIZE,
-                .link_type = DLT_ISO_14443,
-            };
-            if(stream_write(stream, (uint8_t*)&pcap_hdr, sizeof(pcap_hdr)) != sizeof(pcap_hdr)) {
-                FURI_LOG_E(TAG, "Failed to write pcap header");
-                buffered_file_stream_close(stream);
-                stream_free(stream);
-                stream = NULL;
-            }
-        }
-    }
-    return stream;
-}
-
-NfcDebugPcap* nfc_debug_pcap_alloc() {
-    NfcDebugPcap* instance = malloc(sizeof(NfcDebugPcap));
-
-    Storage* storage = furi_record_open(RECORD_STORAGE);
-    instance->file_stream = nfc_debug_pcap_open(storage);
-    if(!instance->file_stream) {
-        free(instance);
-        instance = NULL;
-    }
-    furi_record_close(RECORD_STORAGE);
-
-    return instance;
-}
-
-void nfc_debug_pcap_free(NfcDebugPcap* instance) {
-    furi_assert(instance);
-    furi_assert(instance->file_stream);
-
-    buffered_file_stream_close(instance->file_stream);
-    stream_free(instance->file_stream);
-
-    free(instance);
-}
-
-void nfc_debug_pcap_process_data(
-    NfcDebugPcap* instance,
-    uint8_t* data,
-    uint16_t len,
-    bool reader_to_tag,
-    bool crc_dropped) {
-    furi_assert(instance);
-    furi_assert(data);
-    FuriHalRtcDateTime datetime;
-    furi_hal_rtc_get_datetime(&datetime);
-
-    uint8_t event = 0;
-    if(reader_to_tag) {
-        if(crc_dropped) {
-            event = DATA_PCD_TO_PICC_CRC_DROPPED;
-        } else {
-            event = DATA_PCD_TO_PICC;
-        }
-    } else {
-        if(crc_dropped) {
-            event = DATA_PICC_TO_PCD_CRC_DROPPED;
-        } else {
-            event = DATA_PICC_TO_PCD;
-        }
-    }
-
-    struct {
-        // https://wiki.wireshark.org/Development/LibpcapFileFormat#record-packet-header
-        uint32_t ts_sec;
-        uint32_t ts_usec;
-        uint32_t incl_len;
-        uint32_t orig_len;
-        // https://www.kaiser.cx/posts/pcap-iso14443/#_packet_data
-        uint8_t version;
-        uint8_t event;
-        uint16_t len;
-    } __attribute__((__packed__)) pkt_hdr = {
-        .ts_sec = furi_hal_rtc_datetime_to_timestamp(&datetime),
-        .ts_usec = 0,
-        .incl_len = len + 4,
-        .orig_len = len + 4,
-        .version = 0,
-        .event = event,
-        .len = len << 8 | len >> 8,
-    };
-    stream_write(instance->file_stream, (uint8_t*)&pkt_hdr, sizeof(pkt_hdr));
-    stream_write(instance->file_stream, data, len);
-}

+ 0 - 17
apps_broken_by_last_refactors/flipperzero_vb_migrate/lib/nfc/helpers/nfc_debug_pcap.h

@@ -1,17 +0,0 @@
-#pragma once
-
-#include <stdint.h>
-#include <stdbool.h>
-
-typedef struct NfcDebugPcap NfcDebugPcap;
-
-NfcDebugPcap* nfc_debug_pcap_alloc();
-
-void nfc_debug_pcap_free(NfcDebugPcap* instance);
-
-void nfc_debug_pcap_process_data(
-    NfcDebugPcap* instance,
-    uint8_t* data,
-    uint16_t len,
-    bool reader_to_tag,
-    bool crc_dropped);

+ 0 - 193
apps_broken_by_last_refactors/flipperzero_vb_migrate/lib/nfc/helpers/reader_analyzer.c

@@ -1,193 +0,0 @@
-#include "reader_analyzer.h"
-#include <lib/nfc/protocols/nfc_util.h>
-#include <lib/nfc/protocols/mifare_classic.h>
-#include <m-array.h>
-
-#include "nfc_debug_pcap.h"
-#include "nfc_debug_log.h"
-
-#define TAG "ReaderAnalyzer"
-
-#define READER_ANALYZER_MAX_BUFF_SIZE (1024)
-
-typedef struct {
-    bool reader_to_tag;
-    bool crc_dropped;
-    uint16_t len;
-} ReaderAnalyzerHeader;
-
-typedef enum {
-    ReaderAnalyzerNfcDataMfClassic,
-} ReaderAnalyzerNfcData;
-
-struct ReaderAnalyzer {
-    bool alive;
-    FuriStreamBuffer* stream;
-    FuriThread* thread;
-
-    ReaderAnalyzerParseDataCallback callback;
-    void* context;
-
-    ReaderAnalyzerMode mode;
-    NfcDebugLog* debug_log;
-    NfcDebugPcap* pcap;
-};
-
-void reader_analyzer_parse(ReaderAnalyzer* instance, uint8_t* buffer, size_t size) {
-    if(size < sizeof(ReaderAnalyzerHeader)) return;
-
-    size_t bytes_i = 0;
-    while(bytes_i < size) {
-        ReaderAnalyzerHeader* header = (ReaderAnalyzerHeader*)&buffer[bytes_i];
-        uint16_t len = header->len;
-        if(bytes_i + len > size) break;
-        bytes_i += sizeof(ReaderAnalyzerHeader);
-        if(instance->pcap) {
-            nfc_debug_pcap_process_data(
-                instance->pcap, &buffer[bytes_i], len, header->reader_to_tag, header->crc_dropped);
-        }
-        if(instance->debug_log) {
-            nfc_debug_log_process_data(
-                instance->debug_log,
-                &buffer[bytes_i],
-                len,
-                header->reader_to_tag,
-                header->crc_dropped);
-        }
-        bytes_i += len;
-    }
-}
-
-int32_t reader_analyzer_thread(void* context) {
-    ReaderAnalyzer* reader_analyzer = context;
-    uint8_t buffer[READER_ANALYZER_MAX_BUFF_SIZE] = {};
-
-    while(reader_analyzer->alive || !furi_stream_buffer_is_empty(reader_analyzer->stream)) {
-        size_t ret = furi_stream_buffer_receive(
-            reader_analyzer->stream, buffer, READER_ANALYZER_MAX_BUFF_SIZE, 50);
-        if(ret) {
-            reader_analyzer_parse(reader_analyzer, buffer, ret);
-        }
-    }
-
-    return 0;
-}
-
-ReaderAnalyzer* reader_analyzer_alloc() {
-    ReaderAnalyzer* instance = malloc(sizeof(ReaderAnalyzer));
-
-    instance->alive = false;
-    instance->stream =
-        furi_stream_buffer_alloc(READER_ANALYZER_MAX_BUFF_SIZE, sizeof(ReaderAnalyzerHeader));
-
-    instance->thread =
-        furi_thread_alloc_ex("ReaderAnalyzerWorker", 2048, reader_analyzer_thread, instance);
-    furi_thread_set_priority(instance->thread, FuriThreadPriorityLow);
-
-    return instance;
-}
-
-void reader_analyzer_start(ReaderAnalyzer* instance, ReaderAnalyzerMode mode) {
-    furi_assert(instance);
-
-    furi_stream_buffer_reset(instance->stream);
-    if(mode & ReaderAnalyzerModeDebugLog) {
-        instance->debug_log = nfc_debug_log_alloc();
-    }
-    if(mode & ReaderAnalyzerModeDebugPcap) {
-        instance->pcap = nfc_debug_pcap_alloc();
-    }
-
-    instance->alive = true;
-    furi_thread_start(instance->thread);
-}
-
-void reader_analyzer_stop(ReaderAnalyzer* instance) {
-    furi_assert(instance);
-
-    instance->alive = false;
-    furi_thread_join(instance->thread);
-
-    if(instance->debug_log) {
-        nfc_debug_log_free(instance->debug_log);
-        instance->debug_log = NULL;
-    }
-    if(instance->pcap) {
-        nfc_debug_pcap_free(instance->pcap);
-        instance->pcap = NULL;
-    }
-}
-
-void reader_analyzer_free(ReaderAnalyzer* instance) {
-    furi_assert(instance);
-
-    reader_analyzer_stop(instance);
-    furi_thread_free(instance->thread);
-    furi_stream_buffer_free(instance->stream);
-    free(instance);
-}
-
-void reader_analyzer_set_callback(
-    ReaderAnalyzer* instance,
-    ReaderAnalyzerParseDataCallback callback,
-    void* context) {
-    furi_assert(instance);
-    furi_assert(callback);
-
-    instance->callback = callback;
-    instance->context = context;
-}
-
-static void reader_analyzer_write(
-    ReaderAnalyzer* instance,
-    uint8_t* data,
-    uint16_t len,
-    bool reader_to_tag,
-    bool crc_dropped) {
-    ReaderAnalyzerHeader header = {
-        .reader_to_tag = reader_to_tag, .crc_dropped = crc_dropped, .len = len};
-    size_t data_sent = 0;
-    data_sent = furi_stream_buffer_send(
-        instance->stream, &header, sizeof(ReaderAnalyzerHeader), FuriWaitForever);
-    if(data_sent != sizeof(ReaderAnalyzerHeader)) {
-        FURI_LOG_W(TAG, "Sent %zu out of %zu bytes", data_sent, sizeof(ReaderAnalyzerHeader));
-    }
-    data_sent = furi_stream_buffer_send(instance->stream, data, len, FuriWaitForever);
-    if(data_sent != len) {
-        FURI_LOG_W(TAG, "Sent %zu out of %u bytes", data_sent, len);
-    }
-}
-
-static void
-    reader_analyzer_write_rx(uint8_t* data, uint16_t bits, bool crc_dropped, void* context) {
-    UNUSED(crc_dropped);
-    ReaderAnalyzer* reader_analyzer = context;
-    uint16_t bytes = bits < 8 ? 1 : bits / 8;
-    reader_analyzer_write(reader_analyzer, data, bytes, false, crc_dropped);
-}
-
-static void
-    reader_analyzer_write_tx(uint8_t* data, uint16_t bits, bool crc_dropped, void* context) {
-    UNUSED(crc_dropped);
-    ReaderAnalyzer* reader_analyzer = context;
-    uint16_t bytes = bits < 8 ? 1 : bits / 8;
-    reader_analyzer_write(reader_analyzer, data, bytes, true, crc_dropped);
-}
-
-void reader_analyzer_prepare_tx_rx(
-    ReaderAnalyzer* instance,
-    FuriHalNfcTxRxContext* tx_rx,
-    bool is_picc) {
-    furi_assert(instance);
-    furi_assert(tx_rx);
-
-    if(is_picc) {
-        tx_rx->sniff_tx = reader_analyzer_write_rx;
-        tx_rx->sniff_rx = reader_analyzer_write_tx;
-    } else {
-        tx_rx->sniff_rx = reader_analyzer_write_rx;
-        tx_rx->sniff_tx = reader_analyzer_write_tx;
-    }
-
-    tx_rx->sniff_context = instance;
-}

+ 0 - 35
apps_broken_by_last_refactors/flipperzero_vb_migrate/lib/nfc/helpers/reader_analyzer.h

@@ -1,35 +0,0 @@
-#pragma once
-
-#include <stdint.h>
-#include <lib/nfc/nfc_device.h>
-
-typedef enum {
-    ReaderAnalyzerModeDebugLog = 0x01,
-    ReaderAnalyzerModeDebugPcap = 0x04,
-} ReaderAnalyzerMode;
-
-typedef enum {
-    ReaderAnalyzerEventMfkeyCollected,
-} ReaderAnalyzerEvent;
-
-typedef struct ReaderAnalyzer ReaderAnalyzer;
-
-typedef void (*ReaderAnalyzerParseDataCallback)(ReaderAnalyzerEvent event, void* context);
-
-ReaderAnalyzer* reader_analyzer_alloc();
-
-void reader_analyzer_free(ReaderAnalyzer* instance);
-
-void reader_analyzer_set_callback(
-    ReaderAnalyzer* instance,
-    ReaderAnalyzerParseDataCallback callback,
-    void* context);
-
-void reader_analyzer_start(ReaderAnalyzer* instance, ReaderAnalyzerMode mode);
-
-void reader_analyzer_stop(ReaderAnalyzer* instance);
-
-void reader_analyzer_prepare_tx_rx(
-    ReaderAnalyzer* instance,
-    FuriHalNfcTxRxContext* tx_rx,
-    bool is_picc);

+ 0 - 49
apps_broken_by_last_refactors/flipperzero_vb_migrate/lib/nfc/nfc_types.c

@@ -1,49 +0,0 @@
-#include "nfc_types.h"
-
-const char* nfc_get_dev_type(FuriHalNfcType type) {
-    if(type == FuriHalNfcTypeA) {
-        return "NFC-A";
-    } else if(type == FuriHalNfcTypeB) {
-        return "NFC-B";
-    } else if(type == FuriHalNfcTypeF) {
-        return "NFC-F";
-    } else if(type == FuriHalNfcTypeV) {
-        return "NFC-V";
-    } else {
-        return "Unknown";
-    }
-}
-
-const char* nfc_guess_protocol(NfcProtocol protocol) {
-    if(protocol == NfcDeviceProtocolMifareUl) {
-        return "Mifare Ultral/NTAG";
-    } else {
-        return "Unrecognized";
-    }
-}
-
-const char* nfc_mf_ul_type(MfUltralightType type, bool full_name) {
-    if(type == MfUltralightTypeNTAG213) {
-        return "NTAG213";
-    } else if(type == MfUltralightTypeNTAG215) {
-        return "NTAG215";
-    } else if(type == MfUltralightTypeNTAG216) {
-        return "NTAG216";
-    } else if(type == MfUltralightTypeNTAGI2C1K) {
-        return "NTAG I2C 1K";
-    } else if(type == MfUltralightTypeNTAGI2C2K) {
-        return "NTAG I2C 2K";
-    } else if(type == MfUltralightTypeNTAGI2CPlus1K) {
-        return "NTAG I2C Plus 1K";
-    } else if(type == MfUltralightTypeNTAGI2CPlus2K) {
-        return "NTAG I2C Plus 2K";
-    } else if(type == MfUltralightTypeNTAG203) {
-        return "NTAG203";
-    } else if(type == MfUltralightTypeUL11 && full_name) {
-        return "Mifare Ultralight 11";
-    } else if(type == MfUltralightTypeUL21 && full_name) {
-        return "Mifare Ultralight 21";
-    } else {
-        return "Mifare Ultralight";
-    }
-}

+ 0 - 9
apps_broken_by_last_refactors/flipperzero_vb_migrate/lib/nfc/nfc_types.h

@@ -1,9 +0,0 @@
-#pragma once
-
-#include "nfc_device.h"
-
-const char* nfc_get_dev_type(FuriHalNfcType type);
-
-const char* nfc_guess_protocol(NfcProtocol protocol);
-
-const char* nfc_mf_ul_type(MfUltralightType type, bool full_name);

+ 0 - 385
apps_broken_by_last_refactors/flipperzero_vb_migrate/lib/nfc/nfc_worker.c

@@ -1,385 +0,0 @@
-#include "nfc_worker_i.h"
-#include <furi_hal.h>
-
-#include <platform.h>
-
-#define TAG "NfcWorker"
-
-/***************************** NFC Worker API *******************************/
-
-NfcWorker* nfc_worker_alloc() {
-    NfcWorker* nfc_worker = malloc(sizeof(NfcWorker));
-
-    // Worker thread attributes
-    nfc_worker->thread = furi_thread_alloc_ex("NfcWorker", 8192, nfc_worker_task, nfc_worker);
-
-    nfc_worker->callback = NULL;
-    nfc_worker->context = NULL;
-    nfc_worker->storage = furi_record_open(RECORD_STORAGE);
-
-    // Initialize rfal
-    while(furi_hal_nfc_is_busy()) {
-        furi_delay_ms(10);
-    }
-    nfc_worker_change_state(nfc_worker, NfcWorkerStateReady);
-
-    nfc_worker->reader_analyzer = reader_analyzer_alloc(nfc_worker->storage);
-
-    return nfc_worker;
-}
-
-void nfc_worker_free(NfcWorker* nfc_worker) {
-    furi_assert(nfc_worker);
-
-    furi_thread_free(nfc_worker->thread);
-
-    furi_record_close(RECORD_STORAGE);
-
-    reader_analyzer_free(nfc_worker->reader_analyzer);
-
-    free(nfc_worker);
-}
-
-NfcWorkerState nfc_worker_get_state(NfcWorker* nfc_worker) {
-    return nfc_worker->state;
-}
-
-void nfc_worker_start(
-    NfcWorker* nfc_worker,
-    NfcWorkerState state,
-    NfcDeviceData* dev_data,
-    NfcWorkerCallback callback,
-    void* context) {
-    furi_assert(nfc_worker);
-    furi_assert(dev_data);
-    while(furi_hal_nfc_is_busy()) {
-        furi_delay_ms(10);
-    }
-    // XXX: These functions are not exported, and trying to link them separately causes
-    // catastrophic issues. They weren't here before, so we'll pretend they're not
-    // necessary.
-    // furi_hal_nfc_deinit();
-    // furi_hal_nfc_init();
-
-    nfc_worker->callback = callback;
-    nfc_worker->context = context;
-    nfc_worker->dev_data = dev_data;
-    nfc_worker_change_state(nfc_worker, state);
-    furi_thread_start(nfc_worker->thread);
-}
-
-void nfc_worker_stop(NfcWorker* nfc_worker) {
-    furi_assert(nfc_worker);
-    furi_assert(nfc_worker->thread);
-    if(furi_thread_get_state(nfc_worker->thread) != FuriThreadStateStopped) {
-        furi_hal_nfc_stop();
-        nfc_worker_change_state(nfc_worker, NfcWorkerStateStop);
-        furi_thread_join(nfc_worker->thread);
-    }
-}
-
-void nfc_worker_change_state(NfcWorker* nfc_worker, NfcWorkerState state) {
-    nfc_worker->state = state;
-}
-
-/***************************** NFC Worker Thread *******************************/
-
-int32_t nfc_worker_task(void* context) {
-    NfcWorker* nfc_worker = context;
-
-    furi_hal_nfc_exit_sleep();
-
-    if(nfc_worker->state == NfcWorkerStateRead) {
-        if(nfc_worker->dev_data->read_mode == NfcReadModeAuto) {
-            nfc_worker_read(nfc_worker);
-        } else {
-            nfc_worker_read_type(nfc_worker);
-        }
-    } else if(nfc_worker->state == NfcWorkerStateUidEmulate) {
-        nfc_worker_emulate_uid(nfc_worker);
-    } else if(nfc_worker->state == NfcWorkerStateMfUltralightEmulate) {
-        nfc_worker_emulate_mf_ultralight(nfc_worker);
-    } else if(nfc_worker->state == NfcWorkerStateReadMfUltralightReadAuth) {
-        nfc_worker_mf_ultralight_read_auth(nfc_worker);
-    }
-    furi_hal_nfc_sleep();
-    nfc_worker_change_state(nfc_worker, NfcWorkerStateReady);
-
-    return 0;
-}
-
-static bool nfc_worker_read_mf_ultralight(NfcWorker* nfc_worker, FuriHalNfcTxRxContext* tx_rx) {
-    bool read_success = false;
-    MfUltralightReader reader = {};
-    MfUltralightData data = {};
-
-    if(furi_hal_rtc_is_flag_set(FuriHalRtcFlagDebug)) {
-        reader_analyzer_prepare_tx_rx(nfc_worker->reader_analyzer, tx_rx, false);
-        reader_analyzer_start(nfc_worker->reader_analyzer, ReaderAnalyzerModeDebugLog);
-    }
-
-    do {
-        // Otherwise, try to read as usual
-        if(!furi_hal_nfc_detect(&nfc_worker->dev_data->nfc_data, 200)) break;
-        if(!mf_ul_read_card(tx_rx, &reader, &data)) break;
-        // Copy data
-        nfc_worker->dev_data->mf_ul_data = data;
-        read_success = true;
-    } while(false);
-
-    if(furi_hal_rtc_is_flag_set(FuriHalRtcFlagDebug)) {
-        reader_analyzer_stop(nfc_worker->reader_analyzer);
-    }
-
-    return read_success;
-}
-
-static bool nfc_worker_read_nfca(NfcWorker* nfc_worker, FuriHalNfcTxRxContext* tx_rx) {
-    FuriHalNfcDevData* nfc_data = &nfc_worker->dev_data->nfc_data;
-
-    bool card_read = false;
-    furi_hal_nfc_sleep();
-    if(mf_ul_check_card_type(nfc_data->atqa[0], nfc_data->atqa[1], nfc_data->sak)) {
-        FURI_LOG_I(TAG, "Mifare Ultralight / NTAG detected");
-        nfc_worker->dev_data->protocol = NfcDeviceProtocolMifareUl;
-        card_read = nfc_worker_read_mf_ultralight(nfc_worker, tx_rx);
-    } else {
-        nfc_worker->dev_data->protocol = NfcDeviceProtocolUnknown;
-        card_read = true;
-    }
-
-    return card_read;
-}
-
-void nfc_worker_read(NfcWorker* nfc_worker) {
-    furi_assert(nfc_worker);
-    furi_assert(nfc_worker->callback);
-
-    nfc_device_data_clear(nfc_worker->dev_data);
-    NfcDeviceData* dev_data = nfc_worker->dev_data;
-    FuriHalNfcDevData* nfc_data = &nfc_worker->dev_data->nfc_data;
-    FuriHalNfcTxRxContext tx_rx = {};
-    NfcWorkerEvent event = 0;
-    bool card_not_detected_notified = false;
-
-    while(nfc_worker->state == NfcWorkerStateRead) {
-        if(furi_hal_nfc_detect(nfc_data, 300)) {
-            // Process first found device
-            nfc_worker->callback(NfcWorkerEventCardDetected, nfc_worker->context);
-            card_not_detected_notified = false;
-            if(nfc_data->type == FuriHalNfcTypeA) {
-                if(nfc_worker_read_nfca(nfc_worker, &tx_rx)) {
-                    if(dev_data->protocol == NfcDeviceProtocolMifareUl) {
-                        event = NfcWorkerEventReadMfUltralight;
-                        break;
-                    } else if(dev_data->protocol == NfcDeviceProtocolUnknown) {
-                        event = NfcWorkerEventReadUidNfcA;
-                        break;
-                    }
-                }
-            } else if(nfc_data->type == FuriHalNfcTypeB) {
-                event = NfcWorkerEventReadUidNfcB;
-                break;
-            } else if(nfc_data->type == FuriHalNfcTypeF) {
-                event = NfcWorkerEventReadUidNfcF;
-                break;
-            } else if(nfc_data->type == FuriHalNfcTypeV) {
-                event = NfcWorkerEventReadUidNfcV;
-                break;
-            }
-        } else {
-            if(!card_not_detected_notified) {
-                nfc_worker->callback(NfcWorkerEventNoCardDetected, nfc_worker->context);
-                card_not_detected_notified = true;
-            }
-        }
-        furi_hal_nfc_sleep();
-        furi_delay_ms(100);
-    }
-    // Notify caller and exit
-    if(event > NfcWorkerEventReserved) {
-        nfc_worker->callback(event, nfc_worker->context);
-    }
-}
-
-void nfc_worker_read_type(NfcWorker* nfc_worker) {
-    furi_assert(nfc_worker);
-    furi_assert(nfc_worker->callback);
-
-    NfcReadMode read_mode = nfc_worker->dev_data->read_mode;
-    nfc_device_data_clear(nfc_worker->dev_data);
-    FuriHalNfcDevData* nfc_data = &nfc_worker->dev_data->nfc_data;
-    FuriHalNfcTxRxContext tx_rx = {};
-    NfcWorkerEvent event = 0;
-    bool card_not_detected_notified = false;
-
-    while(nfc_worker->state == NfcWorkerStateRead) {
-        if(furi_hal_nfc_detect(nfc_data, 300)) {
-            FURI_LOG_D(TAG, "Card detected");
-            furi_hal_nfc_sleep();
-            // Process first found device
-            nfc_worker->callback(NfcWorkerEventCardDetected, nfc_worker->context);
-            card_not_detected_notified = false;
-            if(nfc_data->type == FuriHalNfcTypeA) {
-                if(read_mode == NfcReadModeMfUltralight) {
-                    FURI_LOG_I(TAG, "Mifare Ultralight / NTAG");
-                    nfc_worker->dev_data->protocol = NfcDeviceProtocolMifareUl;
-                    if(nfc_worker_read_mf_ultralight(nfc_worker, &tx_rx)) {
-                        event = NfcWorkerEventReadMfUltralight;
-                        break;
-                    }
-                } else if(read_mode == NfcReadModeNFCA) {
-                    nfc_worker->dev_data->protocol = NfcDeviceProtocolUnknown;
-                    event = NfcWorkerEventReadUidNfcA;
-                    break;
-                }
-            }
-        } else {
-            if(!card_not_detected_notified) {
-                nfc_worker->callback(NfcWorkerEventNoCardDetected, nfc_worker->context);
-                card_not_detected_notified = true;
-            }
-        }
-        furi_hal_nfc_sleep();
-        furi_delay_ms(100);
-    }
-    // Notify caller and exit
-    if(event > NfcWorkerEventReserved) {
-        nfc_worker->callback(event, nfc_worker->context);
-    }
-}
-
-void nfc_worker_emulate_uid(NfcWorker* nfc_worker) {
-    FuriHalNfcTxRxContext tx_rx = {};
-    FuriHalNfcDevData* data = &nfc_worker->dev_data->nfc_data;
-    NfcReaderRequestData* reader_data = &nfc_worker->dev_data->reader_data;
-
-    // TODO add support for RATS
-    // Need to save ATS to support ISO-14443A-4 emulation
-
-    while(nfc_worker->state == NfcWorkerStateUidEmulate) {
-        if(furi_hal_nfc_listen(data->uid, data->uid_len, data->atqa, data->sak, false, 100)) {
-            if(furi_hal_nfc_tx_rx(&tx_rx, 100)) {
-                reader_data->size = tx_rx.rx_bits / 8;
-                if(reader_data->size > 0) {
-                    memcpy(reader_data->data, tx_rx.rx_data, reader_data->size);
-                    if(nfc_worker->callback) {
-                        nfc_worker->callback(NfcWorkerEventSuccess, nfc_worker->context);
-                    }
-                }
-            } else {
-                FURI_LOG_E(TAG, "Failed to get reader commands");
-            }
-        }
-    }
-}
-
-void nfc_worker_mf_ultralight_auth_received_callback(MfUltralightAuth auth, void* context) {
-    furi_assert(context);
-
-    NfcWorker* nfc_worker = context;
-    nfc_worker->dev_data->mf_ul_auth = auth;
-    if(nfc_worker->callback) {
-        nfc_worker->callback(NfcWorkerEventMfUltralightPwdAuth, nfc_worker->context);
-    }
-}
-
-void nfc_worker_emulate_mf_ultralight(NfcWorker* nfc_worker) {
-    FuriHalNfcDevData* nfc_data = &nfc_worker->dev_data->nfc_data;
-    MfUltralightEmulator emulator = {};
-    mf_ul_prepare_emulation(&emulator, &nfc_worker->dev_data->mf_ul_data);
-
-    // TODO rework with reader analyzer
-    emulator.auth_received_callback = nfc_worker_mf_ultralight_auth_received_callback;
-    emulator.context = nfc_worker;
-
-    while(nfc_worker->state == NfcWorkerStateMfUltralightEmulate) {
-        mf_ul_reset_emulation(&emulator, true);
-        furi_hal_nfc_emulate_nfca(
-            nfc_data->uid,
-            nfc_data->uid_len,
-            nfc_data->atqa,
-            nfc_data->sak,
-            mf_ul_prepare_emulation_response,
-            &emulator,
-            5000);
-        // Check if data was modified
-        if(emulator.data_changed) {
-            nfc_worker->dev_data->mf_ul_data = emulator.data;
-            if(nfc_worker->callback) {
-                nfc_worker->callback(NfcWorkerEventSuccess, nfc_worker->context);
-            }
-            emulator.data_changed = false;
-        }
-    }
-}
-
-void nfc_worker_mf_ultralight_read_auth(NfcWorker* nfc_worker) {
-    furi_assert(nfc_worker);
-    furi_assert(nfc_worker->callback);
-
-    MfUltralightData* data = &nfc_worker->dev_data->mf_ul_data;
-    FuriHalNfcDevData* nfc_data = &nfc_worker->dev_data->nfc_data;
-    FuriHalNfcTxRxContext tx_rx = {};
-    MfUltralightReader reader = {};
-    mf_ul_reset(data);
-
-    if(furi_hal_rtc_is_flag_set(FuriHalRtcFlagDebug)) {
-        reader_analyzer_prepare_tx_rx(nfc_worker->reader_analyzer, &tx_rx, true);
-        reader_analyzer_start(nfc_worker->reader_analyzer, ReaderAnalyzerModeDebugLog);
-    }
-
-    uint32_t key = 0;
-    uint16_t pack = 0;
-    while(nfc_worker->state == NfcWorkerStateReadMfUltralightReadAuth) {
-        furi_hal_nfc_sleep();
-        if(furi_hal_nfc_detect(nfc_data, 300) && nfc_data->type == FuriHalNfcTypeA) {
-            if(mf_ul_check_card_type(nfc_data->atqa[0], nfc_data->atqa[1], nfc_data->sak)) {
-                nfc_worker->callback(NfcWorkerEventCardDetected, nfc_worker->context);
-                if(data->auth_method == MfUltralightAuthMethodManual ||
-                   data->auth_method == MfUltralightAuthMethodAuto) {
-                    nfc_worker->callback(NfcWorkerEventMfUltralightPassKey, nfc_worker->context);
-                    key = nfc_util_bytes2num(data->auth_key, 4);
-                } else {
-                    FURI_LOG_E(TAG, "Incorrect auth method");
-                    break;
-                }
-
-                data->auth_success = mf_ultralight_authenticate(&tx_rx, key, &pack);
-
-                if(!data->auth_success) {
-                    // Reset card
-                    furi_hal_nfc_sleep();
-                    if(!furi_hal_nfc_activate_nfca(300, NULL)) {
-                        nfc_worker->callback(NfcWorkerEventFail, nfc_worker->context);
-                        break;
-                    }
-                }
-
-                mf_ul_read_card(&tx_rx, &reader, data);
-                if(data->auth_success) {
-                    MfUltralightConfigPages* config_pages = mf_ultralight_get_config_pages(data);
-                    if(config_pages != NULL) {
-                        config_pages->auth_data.pwd.value = REVERSE_BYTES_U32(key);
-                        config_pages->auth_data.pack.value = pack;
-                    }
-                    nfc_worker->callback(NfcWorkerEventSuccess, nfc_worker->context);
-                    break;
-                } else {
-                    nfc_worker->callback(NfcWorkerEventFail, nfc_worker->context);
-                    break;
-                }
-            } else {
-                nfc_worker->callback(NfcWorkerEventWrongCardDetected, nfc_worker->context);
-                furi_delay_ms(10);
-            }
-        } else {
-            nfc_worker->callback(NfcWorkerEventNoCardDetected, nfc_worker->context);
-            furi_delay_ms(10);
-        }
-    }
-
-    if(furi_hal_rtc_is_flag_set(FuriHalRtcFlagDebug)) {
-        reader_analyzer_stop(nfc_worker->reader_analyzer);
-    }
-}

+ 0 - 64
apps_broken_by_last_refactors/flipperzero_vb_migrate/lib/nfc/nfc_worker.h

@@ -1,64 +0,0 @@
-#pragma once
-
-#include <lib/nfc/nfc_device.h>
-
-typedef struct NfcWorker NfcWorker;
-
-typedef enum {
-    // Init states
-    NfcWorkerStateNone,
-    NfcWorkerStateReady,
-    // Main worker states
-    NfcWorkerStateRead,
-    NfcWorkerStateUidEmulate,
-    NfcWorkerStateMfUltralightEmulate,
-    NfcWorkerStateReadMfUltralightReadAuth,
-    // Debug
-    NfcWorkerStateField,
-    // Transition
-    NfcWorkerStateStop,
-} NfcWorkerState;
-
-typedef enum {
-    // Reserve first 50 events for application events
-    NfcWorkerEventReserved = 50,
-
-    // Nfc read events
-    NfcWorkerEventReadUidNfcB,
-    NfcWorkerEventReadUidNfcV,
-    NfcWorkerEventReadUidNfcF,
-    NfcWorkerEventReadUidNfcA,
-    NfcWorkerEventReadMfUltralight,
-
-    // Nfc worker common events
-    NfcWorkerEventSuccess,
-    NfcWorkerEventFail,
-    NfcWorkerEventAborted,
-    NfcWorkerEventCardDetected,
-    NfcWorkerEventNoCardDetected,
-    NfcWorkerEventWrongCardDetected,
-
-    // Write Mifare Classic events
-    NfcWorkerEventWrongCard,
-
-    // Mifare Ultralight events
-    NfcWorkerEventMfUltralightPassKey, // NFC worker requesting manual key
-    NfcWorkerEventMfUltralightPwdAuth, // Reader sent auth command
-} NfcWorkerEvent;
-
-typedef bool (*NfcWorkerCallback)(NfcWorkerEvent event, void* context);
-
-NfcWorker* nfc_worker_alloc();
-
-NfcWorkerState nfc_worker_get_state(NfcWorker* nfc_worker);
-
-void nfc_worker_free(NfcWorker* nfc_worker);
-
-void nfc_worker_start(
-    NfcWorker* nfc_worker,
-    NfcWorkerState state,
-    NfcDeviceData* dev_data,
-    NfcWorkerCallback callback,
-    void* context);
-
-void nfc_worker_stop(NfcWorker* nfc_worker);

+ 0 - 42
apps_broken_by_last_refactors/flipperzero_vb_migrate/lib/nfc/nfc_worker_i.h

@@ -1,42 +0,0 @@
-#pragma once
-
-#include "nfc_worker.h"
-
-#include <furi.h>
-#include <lib/toolbox/stream/file_stream.h>
-
-#include "protocols/nfc_util.h"
-#include "protocols/mifare_common.h"
-#include "protocols/nfca.h"
-#include "helpers/reader_analyzer.h"
-
-struct NfcWorker {
-    FuriThread* thread;
-    Storage* storage;
-    Stream* dict_stream;
-
-    NfcDeviceData* dev_data;
-
-    NfcWorkerCallback callback;
-    void* context;
-
-    NfcWorkerState state;
-
-    ReaderAnalyzer* reader_analyzer;
-};
-
-void nfc_worker_change_state(NfcWorker* nfc_worker, NfcWorkerState state);
-
-int32_t nfc_worker_task(void* context);
-
-void nfc_worker_read(NfcWorker* nfc_worker);
-
-void nfc_worker_read_type(NfcWorker* nfc_worker);
-
-void nfc_worker_emulate_uid(NfcWorker* nfc_worker);
-
-void nfc_worker_emulate_mf_ultralight(NfcWorker* nfc_worker);
-
-void nfc_worker_mf_ultralight_read_auth(NfcWorker* nfc_worker);
-
-void nfc_worker_mf_ul_auth_attack(NfcWorker* nfc_worker);

+ 0 - 11
apps_broken_by_last_refactors/flipperzero_vb_migrate/lib/nfc/protocols/mifare_common.c

@@ -1,11 +0,0 @@
-#include "mifare_common.h"
-
-MifareType mifare_common_get_type(uint8_t ATQA0, uint8_t ATQA1, uint8_t SAK) {
-    MifareType type = MifareTypeUnknown;
-
-    if((ATQA0 == 0x44) && (ATQA1 == 0x00) && (SAK == 0x00)) {
-        type = MifareTypeUltralight;
-    }
-
-    return type;
-}

+ 0 - 10
apps_broken_by_last_refactors/flipperzero_vb_migrate/lib/nfc/protocols/mifare_common.h

@@ -1,10 +0,0 @@
-#pragma once
-
-#include <stdint.h>
-
-typedef enum {
-    MifareTypeUnknown,
-    MifareTypeUltralight,
-} MifareType;
-
-MifareType mifare_common_get_type(uint8_t ATQA0, uint8_t ATQA1, uint8_t SAK);

+ 0 - 1889
apps_broken_by_last_refactors/flipperzero_vb_migrate/lib/nfc/protocols/mifare_ultralight.c

@@ -1,1889 +0,0 @@
-#include <limits.h>
-#include <lib/nfc/protocols/mifare_ultralight.h>
-#include <lib/nfc/protocols/nfc_util.h>
-#include <furi.h>
-#include <furi_hal_nfc.h>
-
-#define TAG "MfUltralight"
-
-bool mf_ul_check_card_type(uint8_t ATQA0, uint8_t ATQA1, uint8_t SAK) {
-    if((ATQA0 == 0x44) && (ATQA1 == 0x00) && (SAK == 0x00)) {
-        return true;
-    }
-    return false;
-}
-
-void mf_ul_reset(MfUltralightData* data) {
-    furi_assert(data);
-    data->type = MfUltralightTypeUnknown;
-    memset(&data->version, 0, sizeof(MfUltralightVersion));
-    memset(data->signature, 0, sizeof(data->signature));
-    memset(data->counter, 0, sizeof(data->counter));
-    memset(data->tearing, 0, sizeof(data->tearing));
-    memset(data->data, 0, sizeof(data->data));
-    data->data_size = 0;
-    data->data_read = 0;
-    data->curr_authlim = 0;
-    data->auth_success = false;
-}
-
-static MfUltralightFeatures mf_ul_get_features(MfUltralightType type) {
-    switch(type) {
-    case MfUltralightTypeUL11:
-    case MfUltralightTypeUL21:
-        return MfUltralightSupportFastRead | MfUltralightSupportCompatWrite |
-               MfUltralightSupportReadCounter | MfUltralightSupportIncrCounter |
-               MfUltralightSupportAuth | MfUltralightSupportSignature |
-               MfUltralightSupportTearingFlags | MfUltralightSupportVcsl;
-    case MfUltralightTypeNTAG213:
-    case MfUltralightTypeNTAG215:
-    case MfUltralightTypeNTAG216:
-        return MfUltralightSupportFastRead | MfUltralightSupportCompatWrite |
-               MfUltralightSupportReadCounter | MfUltralightSupportAuth |
-               MfUltralightSupportSignature | MfUltralightSupportSingleCounter |
-               MfUltralightSupportAsciiMirror;
-    case MfUltralightTypeNTAGI2C1K:
-    case MfUltralightTypeNTAGI2C2K:
-        return MfUltralightSupportFastRead | MfUltralightSupportSectorSelect;
-    case MfUltralightTypeNTAGI2CPlus1K:
-    case MfUltralightTypeNTAGI2CPlus2K:
-        return MfUltralightSupportFastRead | MfUltralightSupportAuth |
-               MfUltralightSupportFastWrite | MfUltralightSupportSignature |
-               MfUltralightSupportSectorSelect;
-    case MfUltralightTypeNTAG203:
-        return MfUltralightSupportCompatWrite | MfUltralightSupportCounterInMemory;
-    default:
-        // Assumed original MFUL 512-bit
-        return MfUltralightSupportCompatWrite;
-    }
-}
-
-static void mf_ul_set_default_version(MfUltralightReader* reader, MfUltralightData* data) {
-    data->type = MfUltralightTypeUnknown;
-    reader->pages_to_read = 16;
-}
-
-static void mf_ul_set_version_ntag203(MfUltralightReader* reader, MfUltralightData* data) {
-    data->type = MfUltralightTypeNTAG203;
-    reader->pages_to_read = 42;
-}
-
-bool mf_ultralight_read_version(
-    FuriHalNfcTxRxContext* tx_rx,
-    MfUltralightReader* reader,
-    MfUltralightData* data) {
-    bool version_read = false;
-
-    do {
-        FURI_LOG_D(TAG, "Reading version");
-        tx_rx->tx_data[0] = MF_UL_GET_VERSION_CMD;
-        tx_rx->tx_bits = 8;
-        tx_rx->tx_rx_type = FuriHalNfcTxRxTypeDefault;
-        if(!furi_hal_nfc_tx_rx(tx_rx, 50) || tx_rx->rx_bits != 64) {
-            FURI_LOG_D(TAG, "Failed reading version");
-            mf_ul_set_default_version(reader, data);
-            furi_hal_nfc_sleep();
-            furi_hal_nfc_activate_nfca(300, NULL);
-            break;
-        }
-        MfUltralightVersion* version = (MfUltralightVersion*)tx_rx->rx_data;
-        data->version = *version;
-        if(version->storage_size == 0x0B || version->storage_size == 0x00) {
-            data->type = MfUltralightTypeUL11;
-            reader->pages_to_read = 20;
-        } else if(version->storage_size == 0x0E) {
-            data->type = MfUltralightTypeUL21;
-            reader->pages_to_read = 41;
-        } else if(version->storage_size == 0x0F) {
-            data->type = MfUltralightTypeNTAG213;
-            reader->pages_to_read = 45;
-        } else if(version->storage_size == 0x11) {
-            data->type = MfUltralightTypeNTAG215;
-            reader->pages_to_read = 135;
-        } else if(version->prod_subtype == 5 && version->prod_ver_major == 2) {
-            // NTAG I2C
-            bool known = false;
-            if(version->prod_ver_minor == 1) {
-                if(version->storage_size == 0x13) {
-                    data->type = MfUltralightTypeNTAGI2C1K;
-                    reader->pages_to_read = 231;
-                    known = true;
-                } else if(version->storage_size == 0x15) {
-                    data->type = MfUltralightTypeNTAGI2C2K;
-                    reader->pages_to_read = 485;
-                    known = true;
-                }
-            } else if(version->prod_ver_minor == 2) {
-                if(version->storage_size == 0x13) {
-                    data->type = MfUltralightTypeNTAGI2CPlus1K;
-                    reader->pages_to_read = 236;
-                    known = true;
-                } else if(version->storage_size == 0x15) {
-                    data->type = MfUltralightTypeNTAGI2CPlus2K;
-                    reader->pages_to_read = 492;
-                    known = true;
-                }
-            }
-
-            if(!known) {
-                mf_ul_set_default_version(reader, data);
-            }
-        } else if(version->storage_size == 0x13) {
-            data->type = MfUltralightTypeNTAG216;
-            reader->pages_to_read = 231;
-        } else {
-            mf_ul_set_default_version(reader, data);
-            break;
-        }
-        version_read = true;
-    } while(false);
-
-    reader->supported_features = mf_ul_get_features(data->type);
-    return version_read;
-}
-
-bool mf_ultralight_authenticate(FuriHalNfcTxRxContext* tx_rx, uint32_t key, uint16_t* pack) {
-    furi_assert(pack);
-    bool authenticated = false;
-
-    do {
-        FURI_LOG_D(TAG, "Authenticating");
-        tx_rx->tx_data[0] = MF_UL_PWD_AUTH;
-        nfc_util_num2bytes(key, 4, &tx_rx->tx_data[1]);
-        tx_rx->tx_bits = 40;
-        tx_rx->tx_rx_type = FuriHalNfcTxRxTypeDefault;
-        if(!furi_hal_nfc_tx_rx(tx_rx, 50)) {
-            FURI_LOG_D(TAG, "Tag did not respond to authentication");
-            break;
-        }
-
-        // PACK
-        if(tx_rx->rx_bits < 2 * 8) {
-            FURI_LOG_D(TAG, "Authentication failed");
-            break;
-        }
-
-        *pack = (tx_rx->rx_data[1] << 8) | tx_rx->rx_data[0];
-
-        FURI_LOG_I(TAG, "Auth success. Password: %08lX. PACK: %04X", key, *pack);
-        authenticated = true;
-    } while(false);
-
-    return authenticated;
-}
-
-static int16_t mf_ultralight_page_addr_to_tag_addr(uint8_t sector, uint8_t page) {
-    return sector * 256 + page;
-}
-
-static int16_t mf_ultralight_ntag_i2c_addr_lin_to_tag_1k(
-    int16_t linear_address,
-    uint8_t* sector,
-    int16_t* valid_pages) {
-    // 0 - 226: sector 0
-    // 227 - 228: config registers
-    // 229 - 230: session registers
-
-    if(linear_address > 230) {
-        *valid_pages = 0;
-        return -1;
-    } else if(linear_address >= 229) {
-        *sector = 3;
-        *valid_pages = 2 - (linear_address - 229);
-        return linear_address - 229 + 248;
-    } else if(linear_address >= 227) {
-        *sector = 0;
-        *valid_pages = 2 - (linear_address - 227);
-        return linear_address - 227 + 232;
-    } else {
-        *sector = 0;
-        *valid_pages = 227 - linear_address;
-        return linear_address;
-    }
-}
-
-static int16_t mf_ultralight_ntag_i2c_addr_lin_to_tag_2k(
-    int16_t linear_address,
-    uint8_t* sector,
-    int16_t* valid_pages) {
-    // 0 - 255: sector 0
-    // 256 - 480: sector 1
-    // 481 - 482: config registers
-    // 483 - 484: session registers
-
-    if(linear_address > 484) {
-        *valid_pages = 0;
-        return -1;
-    } else if(linear_address >= 483) {
-        *sector = 3;
-        *valid_pages = 2 - (linear_address - 483);
-        return linear_address - 483 + 248;
-    } else if(linear_address >= 481) {
-        *sector = 1;
-        *valid_pages = 2 - (linear_address - 481);
-        return linear_address - 481 + 232;
-    } else if(linear_address >= 256) {
-        *sector = 1;
-        *valid_pages = 225 - (linear_address - 256);
-        return linear_address - 256;
-    } else {
-        *sector = 0;
-        *valid_pages = 256 - linear_address;
-        return linear_address;
-    }
-}
-
-static int16_t mf_ultralight_ntag_i2c_addr_lin_to_tag_plus_1k(
-    int16_t linear_address,
-    uint8_t* sector,
-    int16_t* valid_pages) {
-    // 0 - 233: sector 0 + registers
-    // 234 - 235: session registers
-
-    if(linear_address > 235) {
-        *valid_pages = 0;
-        return -1;
-    } else if(linear_address >= 234) {
-        *sector = 0;
-        *valid_pages = 2 - (linear_address - 234);
-        return linear_address - 234 + 236;
-    } else {
-        *sector = 0;
-        *valid_pages = 234 - linear_address;
-        return linear_address;
-    }
-}
-
-static int16_t mf_ultralight_ntag_i2c_addr_lin_to_tag_plus_2k(
-    int16_t linear_address,
-    uint8_t* sector,
-    int16_t* valid_pages) {
-    // 0 - 233: sector 0 + registers
-    // 234 - 235: session registers
-    // 236 - 491: sector 1
-
-    if(linear_address > 491) {
-        *valid_pages = 0;
-        return -1;
-    } else if(linear_address >= 236) {
-        *sector = 1;
-        *valid_pages = 256 - (linear_address - 236);
-        return linear_address - 236;
-    } else if(linear_address >= 234) {
-        *sector = 0;
-        *valid_pages = 2 - (linear_address - 234);
-        return linear_address - 234 + 236;
-    } else {
-        *sector = 0;
-        *valid_pages = 234 - linear_address;
-        return linear_address;
-    }
-}
-
-static int16_t mf_ultralight_ntag_i2c_addr_lin_to_tag(
-    MfUltralightData* data,
-    MfUltralightReader* reader,
-    int16_t linear_address,
-    uint8_t* sector,
-    int16_t* valid_pages) {
-    switch(data->type) {
-    case MfUltralightTypeNTAGI2C1K:
-        return mf_ultralight_ntag_i2c_addr_lin_to_tag_1k(linear_address, sector, valid_pages);
-
-    case MfUltralightTypeNTAGI2C2K:
-        return mf_ultralight_ntag_i2c_addr_lin_to_tag_2k(linear_address, sector, valid_pages);
-
-    case MfUltralightTypeNTAGI2CPlus1K:
-        return mf_ultralight_ntag_i2c_addr_lin_to_tag_plus_1k(linear_address, sector, valid_pages);
-
-    case MfUltralightTypeNTAGI2CPlus2K:
-        return mf_ultralight_ntag_i2c_addr_lin_to_tag_plus_2k(linear_address, sector, valid_pages);
-
-    default:
-        *sector = 0xff;
-        *valid_pages = reader->pages_to_read - linear_address;
-        return linear_address;
-    }
-}
-
-static int16_t
-    mf_ultralight_ntag_i2c_addr_tag_to_lin_1k(uint8_t page, uint8_t sector, uint16_t* valid_pages) {
-    bool valid = false;
-    int16_t translated_page;
-    if(sector == 0) {
-        if(page <= 226) {
-            *valid_pages = 227 - page;
-            translated_page = page;
-            valid = true;
-        } else if(page >= 232 && page <= 233) {
-            *valid_pages = 2 - (page - 232);
-            translated_page = page - 232 + 227;
-            valid = true;
-        }
-    } else if(sector == 3) {
-        if(page >= 248 && page <= 249) {
-            *valid_pages = 2 - (page - 248);
-            translated_page = page - 248 + 229;
-            valid = true;
-        }
-    }
-
-    if(!valid) {
-        *valid_pages = 0;
-        translated_page = -1;
-    }
-    return translated_page;
-}
-
-static int16_t
-    mf_ultralight_ntag_i2c_addr_tag_to_lin_2k(uint8_t page, uint8_t sector, uint16_t* valid_pages) {
-    bool valid = false;
-    int16_t translated_page;
-    if(sector == 0) {
-        *valid_pages = 256 - page;
-        translated_page = page;
-        valid = true;
-    } else if(sector == 1) {
-        if(page <= 224) {
-            *valid_pages = 225 - page;
-            translated_page = 256 + page;
-            valid = true;
-        } else if(page >= 232 && page <= 233) {
-            *valid_pages = 2 - (page - 232);
-            translated_page = page - 232 + 481;
-            valid = true;
-        }
-    } else if(sector == 3) {
-        if(page >= 248 && page <= 249) {
-            *valid_pages = 2 - (page - 248);
-            translated_page = page - 248 + 483;
-            valid = true;
-        }
-    }
-
-    if(!valid) {
-        *valid_pages = 0;
-        translated_page = -1;
-    }
-    return translated_page;
-}
-
-static int16_t mf_ultralight_ntag_i2c_addr_tag_to_lin_plus_1k(
-    uint8_t page,
-    uint8_t sector,
-    uint16_t* valid_pages) {
-    bool valid = false;
-    int16_t translated_page;
-    if(sector == 0) {
-        if(page <= 233) {
-            *valid_pages = 234 - page;
-            translated_page = page;
-            valid = true;
-        } else if(page >= 236 && page <= 237) {
-            *valid_pages = 2 - (page - 236);
-            translated_page = page - 236 + 234;
-            valid = true;
-        }
-    } else if(sector == 3) {
-        if(page >= 248 && page <= 249) {
-            *valid_pages = 2 - (page - 248);
-            translated_page = page - 248 + 234;
-            valid = true;
-        }
-    }
-
-    if(!valid) {
-        *valid_pages = 0;
-        translated_page = -1;
-    }
-    return translated_page;
-}
-
-static int16_t mf_ultralight_ntag_i2c_addr_tag_to_lin_plus_2k(
-    uint8_t page,
-    uint8_t sector,
-    uint16_t* valid_pages) {
-    bool valid = false;
-    int16_t translated_page;
-    if(sector == 0) {
-        if(page <= 233) {
-            *valid_pages = 234 - page;
-            translated_page = page;
-            valid = true;
-        } else if(page >= 236 && page <= 237) {
-            *valid_pages = 2 - (page - 236);
-            translated_page = page - 236 + 234;
-            valid = true;
-        }
-    } else if(sector == 1) {
-        *valid_pages = 256 - page;
-        translated_page = page + 236;
-        valid = true;
-    } else if(sector == 3) {
-        if(page >= 248 && page <= 249) {
-            *valid_pages = 2 - (page - 248);
-            translated_page = page - 248 + 234;
-            valid = true;
-        }
-    }
-
-    if(!valid) {
-        *valid_pages = 0;
-        translated_page = -1;
-    }
-    return translated_page;
-}
-
-static int16_t mf_ultralight_ntag_i2c_addr_tag_to_lin(
-    MfUltralightData* data,
-    uint8_t page,
-    uint8_t sector,
-    uint16_t* valid_pages) {
-    switch(data->type) {
-    case MfUltralightTypeNTAGI2C1K:
-        return mf_ultralight_ntag_i2c_addr_tag_to_lin_1k(page, sector, valid_pages);
-
-    case MfUltralightTypeNTAGI2C2K:
-        return mf_ultralight_ntag_i2c_addr_tag_to_lin_2k(page, sector, valid_pages);
-
-    case MfUltralightTypeNTAGI2CPlus1K:
-        return mf_ultralight_ntag_i2c_addr_tag_to_lin_plus_1k(page, sector, valid_pages);
-
-    case MfUltralightTypeNTAGI2CPlus2K:
-        return mf_ultralight_ntag_i2c_addr_tag_to_lin_plus_2k(page, sector, valid_pages);
-
-    default:
-        *valid_pages = data->data_size / 4 - page;
-        return page;
-    }
-}
-
-MfUltralightConfigPages* mf_ultralight_get_config_pages(MfUltralightData* data) {
-    if(data->type >= MfUltralightTypeUL11 && data->type <= MfUltralightTypeNTAG216) {
-        return (MfUltralightConfigPages*)&data->data[data->data_size - 4 * 4];
-    } else if(
-        data->type >= MfUltralightTypeNTAGI2CPlus1K &&
-        data->type <= MfUltralightTypeNTAGI2CPlus2K) {
-        return (MfUltralightConfigPages*)&data->data[0xe3 * 4]; //-V641
-    } else {
-        return NULL;
-    }
-}
-
-static uint16_t mf_ultralight_calc_auth_count(MfUltralightData* data) {
-    if(mf_ul_get_features(data->type) & MfUltralightSupportAuth) {
-        MfUltralightConfigPages* config = mf_ultralight_get_config_pages(data);
-        uint16_t scaled_authlim = config->access.authlim;
-        // NTAG I2C Plus uses 2^AUTHLIM attempts rather than the direct number
-        if(scaled_authlim > 0 && data->type >= MfUltralightTypeNTAGI2CPlus1K &&
-           data->type <= MfUltralightTypeNTAGI2CPlus2K) {
-            scaled_authlim = 1 << scaled_authlim;
-        }
-        return scaled_authlim;
-    }
-
-    return 0;
-}
-
-// NTAG21x will NAK if NFC_CNT_EN unset, so preempt
-static bool mf_ultralight_should_read_counters(MfUltralightData* data) {
-    if(data->type < MfUltralightTypeNTAG213 || data->type > MfUltralightTypeNTAG216) return true;
-
-    MfUltralightConfigPages* config = mf_ultralight_get_config_pages(data);
-    return config->access.nfc_cnt_en;
-}
-
-static bool mf_ultralight_sector_select(FuriHalNfcTxRxContext* tx_rx, uint8_t sector) {
-    FURI_LOG_D(TAG, "Selecting sector %u", sector);
-    tx_rx->tx_data[0] = MF_UL_SECTOR_SELECT;
-    tx_rx->tx_data[1] = 0xff;
-    tx_rx->tx_bits = 16;
-    tx_rx->tx_rx_type = FuriHalNfcTxRxTypeDefault;
-    if(!furi_hal_nfc_tx_rx(tx_rx, 50)) {
-        FURI_LOG_D(TAG, "Failed to issue sector select command");
-        return false;
-    }
-
-    tx_rx->tx_data[0] = sector;
-    tx_rx->tx_data[1] = 0x00;
-    tx_rx->tx_data[2] = 0x00;
-    tx_rx->tx_data[3] = 0x00;
-    tx_rx->tx_bits = 32;
-    tx_rx->tx_rx_type = FuriHalNfcTxRxTypeDefault;
-    // This is NOT a typo! The tag ACKs by not sending a response within 1ms.
-    if(furi_hal_nfc_tx_rx(tx_rx, 20)) {
-        // TODO: what gets returned when an actual NAK is received?
-        FURI_LOG_D(TAG, "Sector %u select NAK'd", sector);
-        return false;
-    }
-
-    return true;
-}
-
-bool mf_ultralight_read_pages_direct(
-    FuriHalNfcTxRxContext* tx_rx,
-    uint8_t start_index,
-    uint8_t* data) {
-    FURI_LOG_D(TAG, "Reading pages %d - %d", start_index, start_index + 3);
-    tx_rx->tx_data[0] = MF_UL_READ_CMD;
-    tx_rx->tx_data[1] = start_index;
-    tx_rx->tx_bits = 16;
-    tx_rx->tx_rx_type = FuriHalNfcTxRxTypeDefault;
-    if(!furi_hal_nfc_tx_rx(tx_rx, 50) || tx_rx->rx_bits < 16 * 8) {
-        FURI_LOG_D(TAG, "Failed to read pages %d - %d", start_index, start_index + 3);
-        return false;
-    }
-    memcpy(data, tx_rx->rx_data, 16); //-V1086
-    return true;
-}
-
-bool mf_ultralight_read_pages(
-    FuriHalNfcTxRxContext* tx_rx,
-    MfUltralightReader* reader,
-    MfUltralightData* data) {
-    uint8_t pages_read_cnt = 0;
-    uint8_t curr_sector_index = 0xff;
-    reader->pages_read = 0;
-    for(size_t i = 0; i < reader->pages_to_read; i += pages_read_cnt) {
-        uint8_t tag_sector;
-        int16_t valid_pages;
-        int16_t tag_page = mf_ultralight_ntag_i2c_addr_lin_to_tag(
-            data, reader, (int16_t)i, &tag_sector, &valid_pages);
-
-        furi_assert(tag_page != -1);
-        if(curr_sector_index != tag_sector) {
-            if(!mf_ultralight_sector_select(tx_rx, tag_sector)) return false;
-            curr_sector_index = tag_sector;
-        }
-
-        FURI_LOG_D(
-            TAG, "Reading pages %zu - %zu", i, i + (valid_pages > 4 ? 4 : valid_pages) - 1U);
-        tx_rx->tx_data[0] = MF_UL_READ_CMD;
-        tx_rx->tx_data[1] = tag_page;
-        tx_rx->tx_bits = 16;
-        tx_rx->tx_rx_type = FuriHalNfcTxRxTypeDefault;
-
-        if(!furi_hal_nfc_tx_rx(tx_rx, 50) || tx_rx->rx_bits < 16 * 8) {
-            FURI_LOG_D(
-                TAG,
-                "Failed to read pages %zu - %zu",
-                i,
-                i + (valid_pages > 4 ? 4 : valid_pages) - 1U);
-            break;
-        }
-
-        if(valid_pages > 4) {
-            pages_read_cnt = 4;
-        } else {
-            pages_read_cnt = valid_pages;
-        }
-        reader->pages_read += pages_read_cnt;
-        memcpy(&data->data[i * 4], tx_rx->rx_data, pages_read_cnt * 4);
-    }
-    data->data_size = reader->pages_to_read * 4;
-    data->data_read = reader->pages_read * 4;
-
-    return reader->pages_read > 0;
-}
-
-bool mf_ultralight_fast_read_pages(
-    FuriHalNfcTxRxContext* tx_rx,
-    MfUltralightReader* reader,
-    MfUltralightData* data) {
-    uint8_t curr_sector_index = 0xff;
-    reader->pages_read = 0;
-    while(reader->pages_read < reader->pages_to_read) {
-        uint8_t tag_sector;
-        int16_t valid_pages;
-        int16_t tag_page = mf_ultralight_ntag_i2c_addr_lin_to_tag(
-            data, reader, reader->pages_read, &tag_sector, &valid_pages);
-
-        furi_assert(tag_page != -1);
-        if(curr_sector_index != tag_sector) {
-            if(!mf_ultralight_sector_select(tx_rx, tag_sector)) return false;
-            curr_sector_index = tag_sector;
-        }
-
-        FURI_LOG_D(
-            TAG, "Reading pages %d - %d", reader->pages_read, reader->pages_read + valid_pages - 1);
-        tx_rx->tx_data[0] = MF_UL_FAST_READ_CMD;
-        tx_rx->tx_data[1] = tag_page;
-        tx_rx->tx_data[2] = valid_pages - 1;
-        tx_rx->tx_bits = 24;
-        tx_rx->tx_rx_type = FuriHalNfcTxRxTypeDefault;
-        if(furi_hal_nfc_tx_rx(tx_rx, 50)) {
-            memcpy(&data->data[reader->pages_read * 4], tx_rx->rx_data, valid_pages * 4);
-            reader->pages_read += valid_pages;
-            data->data_size = reader->pages_read * 4;
-        } else {
-            FURI_LOG_D(
-                TAG,
-                "Failed to read pages %d - %d",
-                reader->pages_read,
-                reader->pages_read + valid_pages - 1);
-            break;
-        }
-    }
-
-    return reader->pages_read == reader->pages_to_read;
-}
-
-bool mf_ultralight_read_signature(FuriHalNfcTxRxContext* tx_rx, MfUltralightData* data) {
-    bool signature_read = false;
-
-    FURI_LOG_D(TAG, "Reading signature");
-    tx_rx->tx_data[0] = MF_UL_READ_SIG;
-    tx_rx->tx_data[1] = 0;
-    tx_rx->tx_bits = 16;
-    tx_rx->tx_rx_type = FuriHalNfcTxRxTypeDefault;
-    if(furi_hal_nfc_tx_rx(tx_rx, 50)) {
-        memcpy(data->signature, tx_rx->rx_data, sizeof(data->signature));
-        signature_read = true;
-    } else {
-        FURI_LOG_D(TAG, "Failed redaing signature");
-    }
-
-    return signature_read;
-}
-
-bool mf_ultralight_read_counters(FuriHalNfcTxRxContext* tx_rx, MfUltralightData* data) {
-    uint8_t counter_read = 0;
-
-    FURI_LOG_D(TAG, "Reading counters");
-    bool is_single_counter = (mf_ul_get_features(data->type) & MfUltralightSupportSingleCounter) !=
-                             0;
-    for(size_t i = is_single_counter ? 2 : 0; i < 3; i++) {
-        tx_rx->tx_data[0] = MF_UL_READ_CNT;
-        tx_rx->tx_data[1] = i;
-        tx_rx->tx_bits = 16;
-        tx_rx->tx_rx_type = FuriHalNfcTxRxTypeDefault;
-        if(!furi_hal_nfc_tx_rx(tx_rx, 50)) {
-            FURI_LOG_D(TAG, "Failed to read %d counter", i);
-            break;
-        }
-        data->counter[i] = (tx_rx->rx_data[2] << 16) | (tx_rx->rx_data[1] << 8) |
-                           tx_rx->rx_data[0];
-        counter_read++;
-    }
-
-    return counter_read == (is_single_counter ? 1 : 3);
-}
-
-bool mf_ultralight_read_tearing_flags(FuriHalNfcTxRxContext* tx_rx, MfUltralightData* data) {
-    uint8_t flag_read = 0;
-
-    FURI_LOG_D(TAG, "Reading tearing flags");
-    for(size_t i = 0; i < 3; i++) {
-        tx_rx->tx_data[0] = MF_UL_CHECK_TEARING;
-        tx_rx->rx_data[1] = i;
-        tx_rx->tx_bits = 16;
-        tx_rx->tx_rx_type = FuriHalNfcTxRxTypeDefault;
-        if(!furi_hal_nfc_tx_rx(tx_rx, 50)) {
-            FURI_LOG_D(TAG, "Failed to read %d tearing flag", i);
-            break;
-        }
-        data->tearing[i] = tx_rx->rx_data[0];
-        flag_read++;
-    }
-
-    return flag_read == 2;
-}
-
-bool mf_ul_read_card(
-    FuriHalNfcTxRxContext* tx_rx,
-    MfUltralightReader* reader,
-    MfUltralightData* data) {
-    furi_assert(tx_rx);
-    furi_assert(reader);
-    furi_assert(data);
-
-    bool card_read = false;
-
-    // Read Mifare Ultralight version
-    if(mf_ultralight_read_version(tx_rx, reader, data)) {
-        if(reader->supported_features & MfUltralightSupportSignature) {
-            // Read Signature
-            mf_ultralight_read_signature(tx_rx, data);
-        }
-    } else {
-        // No GET_VERSION command, check for NTAG203 by reading last page (41)
-        uint8_t dummy[16];
-        if(mf_ultralight_read_pages_direct(tx_rx, 41, dummy)) {
-            mf_ul_set_version_ntag203(reader, data);
-            reader->supported_features = mf_ul_get_features(data->type);
-        } else {
-            // We're really an original Mifare Ultralight, reset tag for safety
-            furi_hal_nfc_sleep();
-            furi_hal_nfc_activate_nfca(300, NULL);
-        }
-    }
-
-    card_read = mf_ultralight_read_pages(tx_rx, reader, data);
-
-    if(card_read) {
-        if(reader->supported_features & MfUltralightSupportReadCounter &&
-           mf_ultralight_should_read_counters(data)) {
-            mf_ultralight_read_counters(tx_rx, data);
-        }
-        if(reader->supported_features & MfUltralightSupportTearingFlags) {
-            mf_ultralight_read_tearing_flags(tx_rx, data);
-        }
-        data->curr_authlim = 0;
-
-        if(reader->pages_read == reader->pages_to_read &&
-           reader->supported_features & MfUltralightSupportAuth && !data->auth_success) {
-            MfUltralightConfigPages* config = mf_ultralight_get_config_pages(data);
-            if(config->access.authlim == 0) {
-                // Attempt to auth with default PWD
-                uint16_t pack;
-                data->auth_success = mf_ultralight_authenticate(tx_rx, MF_UL_DEFAULT_PWD, &pack);
-                if(data->auth_success) {
-                    config->auth_data.pwd.value = MF_UL_DEFAULT_PWD;
-                    config->auth_data.pack.value = pack;
-                } else {
-                    furi_hal_nfc_sleep();
-                    furi_hal_nfc_activate_nfca(300, NULL);
-                }
-            }
-        }
-    }
-
-    if(reader->pages_read != reader->pages_to_read) {
-        if(reader->supported_features & MfUltralightSupportAuth) {
-            // Probably password protected, fix AUTH0 and PROT so before AUTH0
-            // can be written and since AUTH0 won't be readable, like on the
-            // original card
-            MfUltralightConfigPages* config = mf_ultralight_get_config_pages(data);
-            config->auth0 = reader->pages_read;
-            config->access.prot = true;
-        }
-    }
-
-    return card_read;
-}
-
-static void mf_ul_protect_auth_data_on_read_command_i2c(
-    uint8_t* tx_buff,
-    uint8_t start_page,
-    uint8_t end_page,
-    MfUltralightEmulator* emulator) {
-    if(emulator->data.type >= MfUltralightTypeNTAGI2CPlus1K) {
-        // Blank out PWD and PACK
-        if(start_page <= 229 && end_page >= 229) {
-            uint16_t offset = (229 - start_page) * 4;
-            uint8_t count = 4;
-            if(end_page >= 230) count += 2;
-            memset(&tx_buff[offset], 0, count);
-        }
-
-        // Handle AUTH0 for sector 0
-        if(!emulator->auth_success) {
-            if(emulator->config_cache.access.prot) {
-                uint8_t auth0 = emulator->config_cache.auth0;
-                if(auth0 < end_page) {
-                    // start_page is always < auth0; otherwise is NAK'd already
-                    uint8_t page_offset = auth0 - start_page;
-                    uint8_t page_count = end_page - auth0;
-                    memset(&tx_buff[page_offset * 4], 0, page_count * 4);
-                }
-            }
-        }
-    }
-}
-
-static void mf_ul_ntag_i2c_fill_cross_area_read(
-    uint8_t* tx_buff,
-    uint8_t start_page,
-    uint8_t end_page,
-    MfUltralightEmulator* emulator) {
-    // For copying config or session registers in fast read
-    int16_t tx_page_offset;
-    int16_t data_page_offset;
-    uint8_t page_length;
-    bool apply = false;
-    MfUltralightType type = emulator->data.type;
-    if(emulator->curr_sector == 0) {
-        if(type == MfUltralightTypeNTAGI2C1K) {
-            if(start_page <= 233 && end_page >= 232) {
-                tx_page_offset = start_page - 232;
-                data_page_offset = 227;
-                page_length = 2;
-                apply = true;
-            }
-        } else if(type == MfUltralightTypeNTAGI2CPlus1K || type == MfUltralightTypeNTAGI2CPlus2K) {
-            if(start_page <= 237 && end_page >= 236) {
-                tx_page_offset = start_page - 236;
-                data_page_offset = 234;
-                page_length = 2;
-                apply = true;
-            }
-        }
-    } else if(emulator->curr_sector == 1) {
-        if(type == MfUltralightTypeNTAGI2C2K) {
-            if(start_page <= 233 && end_page >= 232) {
-                tx_page_offset = start_page - 232;
-                data_page_offset = 483;
-                page_length = 2;
-                apply = true;
-            }
-        }
-    }
-
-    if(apply) {
-        while(tx_page_offset < 0 && page_length > 0) { //-V614
-            ++tx_page_offset;
-            ++data_page_offset;
-            --page_length;
-        }
-        memcpy(
-            &tx_buff[tx_page_offset * 4],
-            &emulator->data.data[data_page_offset * 4],
-            page_length * 4);
-    }
-}
-
-static bool mf_ul_check_auth(MfUltralightEmulator* emulator, uint8_t start_page, bool is_write) {
-    if(!emulator->auth_success) {
-        if(start_page >= emulator->config_cache.auth0 &&
-           (emulator->config_cache.access.prot || is_write))
-            return false;
-    }
-
-    if(is_write && emulator->config_cache.access.cfglck) {
-        uint16_t config_start_page = emulator->page_num - 4;
-        if(start_page == config_start_page || start_page == config_start_page + 1) return false;
-    }
-
-    return true;
-}
-
-static bool mf_ul_ntag_i2c_plus_check_auth(
-    MfUltralightEmulator* emulator,
-    uint8_t start_page,
-    bool is_write) {
-    if(!emulator->auth_success) {
-        // Check NFC_PROT
-        if(emulator->curr_sector == 0 && (emulator->config_cache.access.prot || is_write)) {
-            if(start_page >= emulator->config_cache.auth0) return false;
-        } else if(emulator->curr_sector == 1) {
-            // We don't have to specifically check for type because this is done
-            // by address translator
-            uint8_t pt_i2c = emulator->data.data[231 * 4];
-            // Check 2K_PROT
-            if(pt_i2c & 0x08) return false;
-        }
-    }
-
-    if(emulator->curr_sector == 1) {
-        // Check NFC_DIS_SEC1
-        if(emulator->config_cache.access.nfc_dis_sec1) return false;
-    }
-
-    return true;
-}
-
-static int16_t mf_ul_get_dynamic_lock_page_addr(MfUltralightData* data) {
-    switch(data->type) {
-    case MfUltralightTypeNTAG203:
-        return 0x28;
-    case MfUltralightTypeUL21:
-    case MfUltralightTypeNTAG213:
-    case MfUltralightTypeNTAG215:
-    case MfUltralightTypeNTAG216:
-        return data->data_size / 4 - 5;
-    case MfUltralightTypeNTAGI2C1K:
-    case MfUltralightTypeNTAGI2CPlus1K:
-    case MfUltralightTypeNTAGI2CPlus2K:
-        return 0xe2;
-    case MfUltralightTypeNTAGI2C2K:
-        return 0x1e0;
-    default:
-        return -1; // No dynamic lock bytes
-    }
-}
-
-// Returns true if page not locked
-// write_page is tag address
-static bool mf_ul_check_lock(MfUltralightEmulator* emulator, int16_t write_page) {
-    if(write_page < 2) return false; // Page 0-1 is always locked
-    if(write_page == 2) return true; // Page 2 does not have a lock flag
-
-    // Check static lock bytes
-    if(write_page <= 15) {
-        uint16_t static_lock_bytes = emulator->data.data[10] | (emulator->data.data[11] << 8);
-        return (static_lock_bytes & (1 << write_page)) == 0;
-    }
-
-    // Check dynamic lock bytes
-
-    // Check max page
-    switch(emulator->data.type) {
-    case MfUltralightTypeNTAG203:
-        // Counter page can be locked and is after dynamic locks
-        if(write_page == 40) return true;
-        break;
-    case MfUltralightTypeUL21:
-    case MfUltralightTypeNTAG213:
-    case MfUltralightTypeNTAG215:
-    case MfUltralightTypeNTAG216:
-        if(write_page >= emulator->page_num - 5) return true;
-        break;
-    case MfUltralightTypeNTAGI2C1K:
-    case MfUltralightTypeNTAGI2CPlus1K:
-        if(write_page > 225) return true;
-        break;
-    case MfUltralightTypeNTAGI2C2K:
-        if(write_page > 479) return true;
-        break;
-    case MfUltralightTypeNTAGI2CPlus2K:
-        if(write_page >= 226 && write_page <= 255) return true;
-        if(write_page >= 512) return true;
-        break;
-    default:
-        furi_crash("Unknown MFUL");
-        return true;
-    }
-
-    int16_t dynamic_lock_index = mf_ul_get_dynamic_lock_page_addr(&emulator->data);
-    if(dynamic_lock_index == -1) return true;
-    // Run address through converter because NTAG I2C 2K is special
-    uint16_t valid_pages; // unused
-    dynamic_lock_index =
-        mf_ultralight_ntag_i2c_addr_tag_to_lin(
-            &emulator->data, dynamic_lock_index & 0xff, dynamic_lock_index >> 8, &valid_pages) *
-        4;
-
-    uint16_t dynamic_lock_bytes = emulator->data.data[dynamic_lock_index] |
-                                  (emulator->data.data[dynamic_lock_index + 1] << 8);
-    uint8_t shift;
-
-    switch(emulator->data.type) {
-    // low byte LSB range, MSB range
-    case MfUltralightTypeNTAG203:
-        if(write_page >= 16 && write_page <= 27) //-V560
-            shift = (write_page - 16) / 4 + 1;
-        else if(write_page >= 28 && write_page <= 39) //-V560
-            shift = (write_page - 28) / 4 + 5;
-        else if(write_page == 41)
-            shift = 12;
-        else {
-            furi_crash("Unknown MFUL");
-        }
-
-        break;
-    case MfUltralightTypeUL21:
-    case MfUltralightTypeNTAG213:
-        // 16-17, 30-31
-        shift = (write_page - 16) / 2;
-        break;
-    case MfUltralightTypeNTAG215:
-    case MfUltralightTypeNTAG216:
-    case MfUltralightTypeNTAGI2C1K:
-    case MfUltralightTypeNTAGI2CPlus1K:
-        // 16-31, 128-129
-        // 16-31, 128-143
-        shift = (write_page - 16) / 16;
-        break;
-    case MfUltralightTypeNTAGI2C2K:
-        // 16-47, 240-271
-        shift = (write_page - 16) / 32;
-        break;
-    case MfUltralightTypeNTAGI2CPlus2K:
-        // 16-47, 256-271
-        if(write_page >= 208 && write_page <= 225)
-            shift = 6;
-        else if(write_page >= 256 && write_page <= 271)
-            shift = 7;
-        else
-            shift = (write_page - 16) / 32;
-        break;
-    default:
-        furi_crash("Unknown MFUL");
-        break;
-    }
-
-    return (dynamic_lock_bytes & (1 << shift)) == 0;
-}
-
-static void mf_ul_make_ascii_mirror(MfUltralightEmulator* emulator, FuriString* str) {
-    // Locals to improve readability
-    uint8_t mirror_page = emulator->config->mirror_page;
-    uint8_t mirror_byte = emulator->config->mirror.mirror_byte;
-    MfUltralightMirrorConf mirror_conf = emulator->config_cache.mirror.mirror_conf;
-    uint16_t last_user_page_index = emulator->page_num - 6;
-    bool uid_printed = false;
-
-    if(mirror_conf == MfUltralightMirrorUid || mirror_conf == MfUltralightMirrorUidCounter) {
-        // UID range check
-        if(mirror_page < 4 || mirror_page > last_user_page_index - 3 ||
-           (mirror_page == last_user_page_index - 3 && mirror_byte > 2)) {
-            if(mirror_conf == MfUltralightMirrorUid) return;
-            // NTAG21x has the peculiar behavior when UID+counter selected, if UID does not fit but
-            // counter will fit, it will actually mirror the counter
-            furi_string_cat(str, "              ");
-        } else {
-            for(int i = 0; i < 3; ++i) {
-                furi_string_cat_printf(str, "%02X", emulator->data.data[i]);
-            }
-            // Skip BCC0
-            for(int i = 4; i < 8; ++i) {
-                furi_string_cat_printf(str, "%02X", emulator->data.data[i]);
-            }
-            uid_printed = true;
-        }
-
-        uint16_t next_byte_offset = mirror_page * 4 + mirror_byte + 14;
-        if(mirror_conf == MfUltralightMirrorUidCounter) ++next_byte_offset;
-        mirror_page = next_byte_offset / 4;
-        mirror_byte = next_byte_offset % 4;
-    }
-
-    if(mirror_conf == MfUltralightMirrorCounter || mirror_conf == MfUltralightMirrorUidCounter) {
-        // Counter is only printed if counter enabled
-        if(emulator->config_cache.access.nfc_cnt_en) {
-            // Counter protection check
-            if(emulator->config_cache.access.nfc_cnt_pwd_prot && !emulator->auth_success) return;
-            // Counter range check
-            if(mirror_page < 4) return;
-            if(mirror_page > last_user_page_index - 1) return;
-            if(mirror_page == last_user_page_index - 1 && mirror_byte > 2) return;
-
-            if(mirror_conf == MfUltralightMirrorUidCounter)
-                furi_string_cat(str, uid_printed ? "x" : " ");
-
-            furi_string_cat_printf(str, "%06lX", emulator->data.counter[2]);
-        }
-    }
-}
-
-static void mf_ul_increment_single_counter(MfUltralightEmulator* emulator) {
-    if(!emulator->read_counter_incremented && emulator->config_cache.access.nfc_cnt_en) {
-        if(emulator->data.counter[2] < 0xFFFFFF) {
-            ++emulator->data.counter[2];
-            emulator->data_changed = true;
-        }
-        emulator->read_counter_incremented = true;
-    }
-}
-
-static bool
-    mf_ul_emulate_ntag203_counter_write(MfUltralightEmulator* emulator, uint8_t* page_buff) {
-    // We'll reuse the existing counters for other NTAGs as staging
-    // Counter 0 stores original value, data is new value
-    uint32_t counter_value;
-    if(emulator->data.tearing[0] == MF_UL_TEARING_FLAG_DEFAULT) {
-        counter_value = emulator->data.data[MF_UL_NTAG203_COUNTER_PAGE * 4] |
-                        (emulator->data.data[MF_UL_NTAG203_COUNTER_PAGE * 4 + 1] << 8);
-    } else {
-        // We've had a reset here, so load from original value
-        counter_value = emulator->data.counter[0];
-    }
-    // Although the datasheet says increment by 0 is always possible, this is not the case on
-    // an actual tag. If the counter is at 0xFFFF, any writes are locked out.
-    if(counter_value == 0xFFFF) return false;
-    uint32_t increment = page_buff[0] | (page_buff[1] << 8);
-    if(counter_value == 0) {
-        counter_value = increment;
-    } else {
-        // Per datasheet specifying > 0x000F is supposed to NAK, but actual tag doesn't
-        increment &= 0x000F;
-        if(counter_value + increment > 0xFFFF) return false;
-        counter_value += increment;
-    }
-    // Commit to new value counter
-    emulator->data.data[MF_UL_NTAG203_COUNTER_PAGE * 4] = (uint8_t)counter_value;
-    emulator->data.data[MF_UL_NTAG203_COUNTER_PAGE * 4 + 1] = (uint8_t)(counter_value >> 8);
-    emulator->data.tearing[0] = MF_UL_TEARING_FLAG_DEFAULT;
-    if(counter_value == 0xFFFF) {
-        // Tag will lock out counter if final number is 0xFFFF, even if you try to roll it back
-        emulator->data.counter[1] = 0xFFFF;
-    }
-    emulator->data_changed = true;
-    return true;
-}
-
-static void mf_ul_emulate_write(
-    MfUltralightEmulator* emulator,
-    int16_t tag_addr,
-    int16_t write_page,
-    uint8_t* page_buff) {
-    // Assumption: all access checks have been completed
-
-    if(tag_addr == 2) {
-        // Handle static locks
-        uint16_t orig_static_locks = emulator->data.data[write_page * 4 + 2] |
-                                     (emulator->data.data[write_page * 4 + 3] << 8);
-        uint16_t new_static_locks = page_buff[2] | (page_buff[3] << 8);
-        if(orig_static_locks & 1) new_static_locks &= ~0x08;
-        if(orig_static_locks & 2) new_static_locks &= ~0xF0;
-        if(orig_static_locks & 4) new_static_locks &= 0xFF;
-        new_static_locks |= orig_static_locks;
-        page_buff[0] = emulator->data.data[write_page * 4];
-        page_buff[1] = emulator->data.data[write_page * 4 + 1];
-        page_buff[2] = new_static_locks & 0xff;
-        page_buff[3] = new_static_locks >> 8;
-    } else if(tag_addr == 3) {
-        // Handle OTP/capability container
-        *(uint32_t*)page_buff |= *(uint32_t*)&emulator->data.data[write_page * 4];
-    } else if(tag_addr == mf_ul_get_dynamic_lock_page_addr(&emulator->data)) {
-        // Handle dynamic locks
-        if(emulator->data.type == MfUltralightTypeNTAG203) {
-            // NTAG203 lock bytes are a bit different from the others
-            uint8_t orig_page_lock_byte = emulator->data.data[write_page * 4];
-            uint8_t orig_cnt_lock_byte = emulator->data.data[write_page * 4 + 1];
-            uint8_t new_page_lock_byte = page_buff[0];
-            uint8_t new_cnt_lock_byte = page_buff[1];
-
-            if(orig_page_lock_byte & 0x01) // Block lock bits 1-3
-                new_page_lock_byte &= ~0x0E;
-            if(orig_page_lock_byte & 0x10) // Block lock bits 5-7
-                new_page_lock_byte &= ~0xE0;
-            for(uint8_t i = 0; i < 4; ++i) {
-                if(orig_cnt_lock_byte & (1 << i)) // Block lock counter bit
-                    new_cnt_lock_byte &= ~(1 << (4 + i));
-            }
-
-            new_page_lock_byte |= orig_page_lock_byte;
-            new_cnt_lock_byte |= orig_cnt_lock_byte;
-            page_buff[0] = new_page_lock_byte;
-            page_buff[1] = new_cnt_lock_byte;
-        } else {
-            uint16_t orig_locks = emulator->data.data[write_page * 4] |
-                                  (emulator->data.data[write_page * 4 + 1] << 8);
-            uint8_t orig_block_locks = emulator->data.data[write_page * 4 + 2];
-            uint16_t new_locks = page_buff[0] | (page_buff[1] << 8);
-            uint8_t new_block_locks = page_buff[2];
-
-            int block_lock_count;
-            switch(emulator->data.type) {
-            case MfUltralightTypeUL21:
-                block_lock_count = 5;
-                break;
-            case MfUltralightTypeNTAG213:
-                block_lock_count = 6;
-                break;
-            case MfUltralightTypeNTAG215:
-                block_lock_count = 4;
-                break;
-            case MfUltralightTypeNTAG216:
-            case MfUltralightTypeNTAGI2C1K:
-            case MfUltralightTypeNTAGI2CPlus1K:
-                block_lock_count = 7;
-                break;
-            case MfUltralightTypeNTAGI2C2K:
-            case MfUltralightTypeNTAGI2CPlus2K:
-                block_lock_count = 8;
-                break;
-            default:
-                furi_crash("Unknown MFUL");
-                break;
-            }
-
-            for(int i = 0; i < block_lock_count; ++i) {
-                if(orig_block_locks & (1 << i)) new_locks &= ~(3 << (2 * i));
-            }
-
-            new_locks |= orig_locks;
-            new_block_locks |= orig_block_locks;
-
-            page_buff[0] = new_locks & 0xff;
-            page_buff[1] = new_locks >> 8;
-            page_buff[2] = new_block_locks;
-            if(emulator->data.type >= MfUltralightTypeUL21 && //-V1016
-               emulator->data.type <= MfUltralightTypeNTAG216)
-                page_buff[3] = MF_UL_TEARING_FLAG_DEFAULT;
-            else
-                page_buff[3] = 0;
-        }
-    }
-
-    memcpy(&emulator->data.data[write_page * 4], page_buff, 4);
-    emulator->data_changed = true;
-}
-
-void mf_ul_reset_emulation(MfUltralightEmulator* emulator, bool is_power_cycle) {
-    emulator->comp_write_cmd_started = false;
-    emulator->sector_select_cmd_started = false;
-    emulator->curr_sector = 0;
-    emulator->ntag_i2c_plus_sector3_lockout = false;
-    emulator->auth_success = false;
-    if(is_power_cycle) {
-        if(emulator->config != NULL) emulator->config_cache = *emulator->config;
-
-        if(emulator->supported_features & MfUltralightSupportSingleCounter) {
-            emulator->read_counter_incremented = false;
-        }
-
-        if(emulator->data.type == MfUltralightTypeNTAG203) {
-            // Apply lockout if counter ever reached 0xFFFF
-            if(emulator->data.counter[1] == 0xFFFF) {
-                emulator->data.data[MF_UL_NTAG203_COUNTER_PAGE * 4] = 0xFF;
-                emulator->data.data[MF_UL_NTAG203_COUNTER_PAGE * 4 + 1] = 0xFF;
-            }
-            // Copy original counter value from data
-            emulator->data.counter[0] =
-                emulator->data.data[MF_UL_NTAG203_COUNTER_PAGE * 4] |
-                (emulator->data.data[MF_UL_NTAG203_COUNTER_PAGE * 4 + 1] << 8);
-        }
-    } else {
-        if(emulator->config != NULL) {
-            // ACCESS (less CFGLCK) and AUTH0 are updated when reactivated
-            // MIRROR_CONF is not; don't know about STRG_MOD_EN, but we're not using that anyway
-            emulator->config_cache.access.value = (emulator->config->access.value & 0xBF) |
-                                                  (emulator->config_cache.access.value & 0x40);
-            emulator->config_cache.auth0 = emulator->config->auth0;
-        }
-    }
-    if(emulator->data.type == MfUltralightTypeNTAG203) {
-        // Mark counter as dirty
-        emulator->data.tearing[0] = 0;
-    }
-}
-
-void mf_ul_prepare_emulation(MfUltralightEmulator* emulator, MfUltralightData* data) {
-    FURI_LOG_D(TAG, "Prepare emulation");
-    emulator->data = *data;
-    emulator->supported_features = mf_ul_get_features(data->type);
-    emulator->config = mf_ultralight_get_config_pages(&emulator->data);
-    emulator->page_num = emulator->data.data_size / 4;
-    emulator->data_changed = false;
-    memset(&emulator->auth_attempt, 0, sizeof(MfUltralightAuth));
-    mf_ul_reset_emulation(emulator, true);
-}
-
-bool mf_ul_prepare_emulation_response(
-    uint8_t* buff_rx,
-    uint16_t buff_rx_len,
-    uint8_t* buff_tx,
-    uint16_t* buff_tx_len,
-    uint32_t* data_type,
-    void* context) {
-    furi_assert(context);
-    MfUltralightEmulator* emulator = context;
-    uint16_t tx_bytes = 0;
-    uint16_t tx_bits = 0;
-    bool command_parsed = false;
-    bool send_ack = false;
-    bool respond_nothing = false;
-    bool reset_idle = false;
-
-#ifdef FURI_DEBUG
-    FuriString* debug_buf;
-    debug_buf = furi_string_alloc();
-    for(int i = 0; i < (buff_rx_len + 7) / 8; ++i) {
-        furi_string_cat_printf(debug_buf, "%02x ", buff_rx[i]);
-    }
-    furi_string_trim(debug_buf);
-    FURI_LOG_T(TAG, "Emu RX (%d): %s", buff_rx_len, furi_string_get_cstr(debug_buf));
-    furi_string_reset(debug_buf);
-#endif
-
-    // Check composite commands
-    if(emulator->comp_write_cmd_started) {
-        if(buff_rx_len == 16 * 8) {
-            if(emulator->data.type == MfUltralightTypeNTAG203 &&
-               emulator->comp_write_page_addr == MF_UL_NTAG203_COUNTER_PAGE) {
-                send_ack = mf_ul_emulate_ntag203_counter_write(emulator, buff_rx);
-                command_parsed = send_ack;
-            } else {
-                mf_ul_emulate_write(
-                    emulator,
-                    emulator->comp_write_page_addr,
-                    emulator->comp_write_page_addr,
-                    buff_rx);
-                send_ack = true;
-                command_parsed = true;
-            }
-        }
-        emulator->comp_write_cmd_started = false;
-    } else if(emulator->sector_select_cmd_started) {
-        if(buff_rx_len == 4 * 8) {
-            if(buff_rx[0] <= 0xFE) {
-                emulator->curr_sector = buff_rx[0] > 3 ? 0 : buff_rx[0];
-                emulator->ntag_i2c_plus_sector3_lockout = false;
-                command_parsed = true;
-                respond_nothing = true;
-                FURI_LOG_D(TAG, "Changing sector to %d", emulator->curr_sector);
-            }
-        }
-        emulator->sector_select_cmd_started = false;
-    } else if(buff_rx_len >= 8) {
-        uint8_t cmd = buff_rx[0];
-        if(cmd == MF_UL_GET_VERSION_CMD) {
-            if(emulator->data.type >= MfUltralightTypeUL11) {
-                if(buff_rx_len == 1 * 8) {
-                    tx_bytes = sizeof(emulator->data.version);
-                    memcpy(buff_tx, &emulator->data.version, tx_bytes);
-                    *data_type = FURI_HAL_NFC_TXRX_DEFAULT;
-                    command_parsed = true;
-                }
-            }
-        } else if(cmd == MF_UL_READ_CMD) {
-            if(buff_rx_len == (1 + 1) * 8) {
-                int16_t start_page = buff_rx[1];
-                tx_bytes = 16;
-                if(emulator->data.type < MfUltralightTypeNTAGI2C1K) {
-                    if(start_page < emulator->page_num) {
-                        do {
-                            uint8_t copied_pages = 0;
-                            uint8_t src_page = start_page;
-                            uint8_t last_page_plus_one = start_page + 4;
-                            uint8_t pwd_page = emulator->page_num - 2;
-                            FuriString* ascii_mirror = NULL;
-                            size_t ascii_mirror_len = 0;
-                            const char* ascii_mirror_cptr = NULL;
-                            uint8_t ascii_mirror_curr_page = 0;
-                            uint8_t ascii_mirror_curr_byte = 0;
-                            if(last_page_plus_one > emulator->page_num)
-                                last_page_plus_one = emulator->page_num;
-                            if(emulator->supported_features & MfUltralightSupportAuth) {
-                                if(!mf_ul_check_auth(emulator, start_page, false)) break;
-                                if(!emulator->auth_success && emulator->config_cache.access.prot &&
-                                   emulator->config_cache.auth0 < last_page_plus_one)
-                                    last_page_plus_one = emulator->config_cache.auth0;
-                            }
-                            if(emulator->supported_features & MfUltralightSupportSingleCounter)
-                                mf_ul_increment_single_counter(emulator);
-                            if(emulator->supported_features & MfUltralightSupportAsciiMirror &&
-                               emulator->config_cache.mirror.mirror_conf !=
-                                   MfUltralightMirrorNone) {
-                                ascii_mirror_curr_byte = emulator->config->mirror.mirror_byte;
-                                ascii_mirror_curr_page = emulator->config->mirror_page;
-                                // Try to avoid wasting time making mirror if we won't copy it
-                                // Conservatively check with UID+counter mirror size
-                                if(last_page_plus_one > ascii_mirror_curr_page &&
-                                   start_page + 3 >= ascii_mirror_curr_page &&
-                                   start_page <= ascii_mirror_curr_page + 6) {
-                                    ascii_mirror = furi_string_alloc();
-                                    mf_ul_make_ascii_mirror(emulator, ascii_mirror);
-                                    ascii_mirror_len = furi_string_utf8_length(ascii_mirror);
-                                    ascii_mirror_cptr = furi_string_get_cstr(ascii_mirror);
-                                    // Move pointer to where it should be to start copying
-                                    if(ascii_mirror_len > 0 &&
-                                       ascii_mirror_curr_page < start_page &&
-                                       ascii_mirror_curr_byte != 0) {
-                                        uint8_t diff = 4 - ascii_mirror_curr_byte;
-                                        ascii_mirror_len -= diff;
-                                        ascii_mirror_cptr += diff;
-                                        ascii_mirror_curr_byte = 0;
-                                        ++ascii_mirror_curr_page;
-                                    }
-                                    while(ascii_mirror_len > 0 &&
-                                          ascii_mirror_curr_page < start_page) {
-                                        uint8_t diff = ascii_mirror_len > 4 ? 4 : ascii_mirror_len;
-                                        ascii_mirror_len -= diff;
-                                        ascii_mirror_cptr += diff;
-                                        ++ascii_mirror_curr_page;
-                                    }
-                                }
-                            }
-
-                            uint8_t* dest_ptr = buff_tx;
-                            while(copied_pages < 4) {
-                                // Copy page
-                                memcpy(dest_ptr, &emulator->data.data[src_page * 4], 4);
-
-                                // Note: don't have to worry about roll-over with ASCII mirror because
-                                // lowest valid page for it is 4, while roll-over will at best read
-                                // pages 0-2
-                                if(ascii_mirror_len > 0 && src_page == ascii_mirror_curr_page) {
-                                    // Copy ASCII mirror
-                                    size_t copy_len = 4 - ascii_mirror_curr_byte;
-                                    if(copy_len > ascii_mirror_len) copy_len = ascii_mirror_len;
-                                    for(size_t i = 0; i < copy_len; ++i) {
-                                        if(*ascii_mirror_cptr != ' ')
-                                            dest_ptr[ascii_mirror_curr_byte] =
-                                                (uint8_t)*ascii_mirror_cptr;
-                                        ++ascii_mirror_curr_byte;
-                                        ++ascii_mirror_cptr;
-                                    }
-                                    ascii_mirror_len -= copy_len;
-                                    // Don't care if this is inaccurate after ascii_mirror_len = 0
-                                    ascii_mirror_curr_byte = 0;
-                                    ++ascii_mirror_curr_page;
-                                }
-
-                                if(emulator->supported_features & MfUltralightSupportAuth) {
-                                    if(src_page == pwd_page || src_page == pwd_page + 1) {
-                                        // Blank out PWD and PACK pages
-                                        memset(dest_ptr, 0, 4);
-                                    }
-                                }
-
-                                dest_ptr += 4;
-                                ++copied_pages;
-                                ++src_page;
-                                if(src_page >= last_page_plus_one) src_page = 0;
-                            }
-                            if(ascii_mirror != NULL) {
-                                furi_string_free(ascii_mirror);
-                            }
-                            *data_type = FURI_HAL_NFC_TXRX_DEFAULT;
-                            command_parsed = true;
-                        } while(false);
-                    }
-                } else {
-                    uint16_t valid_pages;
-                    start_page = mf_ultralight_ntag_i2c_addr_tag_to_lin(
-                        &emulator->data, start_page, emulator->curr_sector, &valid_pages);
-                    if(start_page != -1) {
-                        if(emulator->data.type < MfUltralightTypeNTAGI2CPlus1K ||
-                           mf_ul_ntag_i2c_plus_check_auth(emulator, buff_rx[1], false)) {
-                            if(emulator->data.type >= MfUltralightTypeNTAGI2CPlus1K &&
-                               emulator->curr_sector == 3 && valid_pages == 1) {
-                                // Rewind back a sector to match behavior on a real tag
-                                --start_page;
-                                ++valid_pages;
-                            }
-
-                            uint16_t copy_count = (valid_pages > 4 ? 4 : valid_pages) * 4;
-                            FURI_LOG_D(
-                                TAG,
-                                "NTAG I2C Emu: page valid, %02x:%02x -> %d, %d",
-                                emulator->curr_sector,
-                                buff_rx[1],
-                                start_page,
-                                valid_pages);
-                            memcpy(buff_tx, &emulator->data.data[start_page * 4], copy_count);
-                            // For NTAG I2C, there's no roll-over; remainder is filled by null bytes
-                            if(copy_count < tx_bytes)
-                                memset(&buff_tx[copy_count], 0, tx_bytes - copy_count);
-                            // Special case: NTAG I2C Plus sector 0 page 233 read crosses into page 236
-                            if(start_page == 233)
-                                memcpy(
-                                    &buff_tx[12], &emulator->data.data[(start_page + 1) * 4], 4);
-                            mf_ul_protect_auth_data_on_read_command_i2c(
-                                buff_tx, start_page, start_page + copy_count / 4 - 1, emulator);
-                            *data_type = FURI_HAL_NFC_TXRX_DEFAULT;
-                            command_parsed = true;
-                        }
-                    } else {
-                        FURI_LOG_D(
-                            TAG,
-                            "NTAG I2C Emu: page invalid, %02x:%02x",
-                            emulator->curr_sector,
-                            buff_rx[1]);
-                        if(emulator->data.type >= MfUltralightTypeNTAGI2CPlus1K &&
-                           emulator->curr_sector == 3 &&
-                           !emulator->ntag_i2c_plus_sector3_lockout) {
-                            // NTAG I2C Plus has a weird behavior where if you read sector 3
-                            // at an invalid address, it responds with zeroes then locks
-                            // the read out, while if you read the mirrored session registers,
-                            // it returns both session registers on either pages
-                            memset(buff_tx, 0, tx_bytes);
-                            *data_type = FURI_HAL_NFC_TXRX_DEFAULT;
-                            command_parsed = true;
-                            emulator->ntag_i2c_plus_sector3_lockout = true;
-                        }
-                    }
-                }
-                if(!command_parsed) tx_bytes = 0;
-            }
-        } else if(cmd == MF_UL_FAST_READ_CMD) {
-            if(emulator->supported_features & MfUltralightSupportFastRead) {
-                if(buff_rx_len == (1 + 2) * 8) {
-                    int16_t start_page = buff_rx[1];
-                    uint8_t end_page = buff_rx[2];
-                    if(start_page <= end_page) {
-                        tx_bytes = ((end_page + 1) - start_page) * 4;
-                        if(emulator->data.type < MfUltralightTypeNTAGI2C1K) {
-                            if((start_page < emulator->page_num) &&
-                               (end_page < emulator->page_num)) {
-                                do {
-                                    if(emulator->supported_features & MfUltralightSupportAuth) {
-                                        // NAK if not authenticated and requested pages cross over AUTH0
-                                        if(!emulator->auth_success &&
-                                           emulator->config_cache.access.prot &&
-                                           (start_page >= emulator->config_cache.auth0 ||
-                                            end_page >= emulator->config_cache.auth0))
-                                            break;
-                                    }
-                                    if(emulator->supported_features &
-                                       MfUltralightSupportSingleCounter)
-                                        mf_ul_increment_single_counter(emulator);
-
-                                    // Copy requested pages
-                                    memcpy(
-                                        buff_tx, &emulator->data.data[start_page * 4], tx_bytes);
-
-                                    if(emulator->supported_features &
-                                           MfUltralightSupportAsciiMirror &&
-                                       emulator->config_cache.mirror.mirror_conf !=
-                                           MfUltralightMirrorNone) {
-                                        // Copy ASCII mirror
-                                        // Less stringent check here, because expecting FAST_READ to
-                                        // only be issued once rather than repeatedly
-                                        FuriString* ascii_mirror;
-                                        ascii_mirror = furi_string_alloc();
-                                        mf_ul_make_ascii_mirror(emulator, ascii_mirror);
-                                        size_t ascii_mirror_len =
-                                            furi_string_utf8_length(ascii_mirror);
-                                        const char* ascii_mirror_cptr =
-                                            furi_string_get_cstr(ascii_mirror);
-                                        int16_t mirror_start_offset =
-                                            (emulator->config->mirror_page - start_page) * 4 +
-                                            emulator->config->mirror.mirror_byte;
-                                        if(mirror_start_offset < 0) {
-                                            if(mirror_start_offset < -(int16_t)ascii_mirror_len) {
-                                                // Past ASCII mirror, don't copy
-                                                ascii_mirror_len = 0;
-                                            } else {
-                                                ascii_mirror_cptr += -mirror_start_offset;
-                                                ascii_mirror_len -= -mirror_start_offset;
-                                                mirror_start_offset = 0;
-                                            }
-                                        }
-                                        if(ascii_mirror_len > 0) {
-                                            int16_t mirror_end_offset =
-                                                mirror_start_offset + ascii_mirror_len;
-                                            if(mirror_end_offset > (end_page + 1) * 4) {
-                                                mirror_end_offset = (end_page + 1) * 4;
-                                                ascii_mirror_len =
-                                                    mirror_end_offset - mirror_start_offset;
-                                            }
-                                            for(size_t i = 0; i < ascii_mirror_len; ++i) {
-                                                if(*ascii_mirror_cptr != ' ')
-                                                    buff_tx[mirror_start_offset] =
-                                                        (uint8_t)*ascii_mirror_cptr;
-                                                ++mirror_start_offset;
-                                                ++ascii_mirror_cptr;
-                                            }
-                                        }
-                                        furi_string_free(ascii_mirror);
-                                    }
-
-                                    if(emulator->supported_features & MfUltralightSupportAuth) {
-                                        // Clear PWD and PACK pages
-                                        uint8_t pwd_page = emulator->page_num - 2;
-                                        int16_t pwd_page_offset = pwd_page - start_page;
-                                        // PWD page
-                                        if(pwd_page_offset >= 0 && pwd_page <= end_page) {
-                                            memset(&buff_tx[pwd_page_offset * 4], 0, 4);
-                                            // PACK page
-                                            if(pwd_page + 1 <= end_page)
-                                                memset(&buff_tx[(pwd_page_offset + 1) * 4], 0, 4);
-                                        }
-                                    }
-                                    *data_type = FURI_HAL_NFC_TXRX_DEFAULT;
-                                    command_parsed = true;
-                                } while(false);
-                            }
-                        } else {
-                            uint16_t valid_pages;
-                            start_page = mf_ultralight_ntag_i2c_addr_tag_to_lin(
-                                &emulator->data, start_page, emulator->curr_sector, &valid_pages);
-                            if(start_page != -1) {
-                                if(emulator->data.type < MfUltralightTypeNTAGI2CPlus1K ||
-                                   mf_ul_ntag_i2c_plus_check_auth(emulator, buff_rx[1], false)) {
-                                    uint16_t copy_count = tx_bytes;
-                                    if(copy_count > valid_pages * 4) copy_count = valid_pages * 4;
-                                    memcpy(
-                                        buff_tx, &emulator->data.data[start_page * 4], copy_count);
-                                    if(copy_count < tx_bytes)
-                                        memset(&buff_tx[copy_count], 0, tx_bytes - copy_count);
-                                    mf_ul_ntag_i2c_fill_cross_area_read(
-                                        buff_tx, buff_rx[1], buff_rx[2], emulator);
-                                    mf_ul_protect_auth_data_on_read_command_i2c(
-                                        buff_tx,
-                                        start_page,
-                                        start_page + copy_count / 4 - 1,
-                                        emulator);
-                                    *data_type = FURI_HAL_NFC_TXRX_DEFAULT;
-                                    command_parsed = true;
-                                }
-                            }
-                        }
-                        if(!command_parsed) tx_bytes = 0;
-                    }
-                }
-            }
-        } else if(cmd == MF_UL_WRITE) {
-            if(buff_rx_len == (1 + 5) * 8) {
-                do {
-                    uint8_t orig_write_page = buff_rx[1];
-                    int16_t write_page = orig_write_page;
-                    uint16_t valid_pages; // unused
-                    write_page = mf_ultralight_ntag_i2c_addr_tag_to_lin(
-                        &emulator->data, write_page, emulator->curr_sector, &valid_pages);
-                    if(write_page == -1) // NTAG I2C range check
-                        break;
-                    else if(write_page < 2 || write_page >= emulator->page_num) // Other MFUL/NTAG range check
-                        break;
-
-                    if(emulator->supported_features & MfUltralightSupportAuth) {
-                        if(emulator->data.type >= MfUltralightTypeNTAGI2CPlus1K) {
-                            if(!mf_ul_ntag_i2c_plus_check_auth(emulator, orig_write_page, true))
-                                break;
-                        } else {
-                            if(!mf_ul_check_auth(emulator, orig_write_page, true)) break;
-                        }
-                    }
-                    int16_t tag_addr = mf_ultralight_page_addr_to_tag_addr(
-                        emulator->curr_sector, orig_write_page);
-                    if(!mf_ul_check_lock(emulator, tag_addr)) break;
-                    if(emulator->data.type == MfUltralightTypeNTAG203 &&
-                       orig_write_page == MF_UL_NTAG203_COUNTER_PAGE) {
-                        send_ack = mf_ul_emulate_ntag203_counter_write(emulator, &buff_rx[2]);
-                        command_parsed = send_ack;
-                    } else {
-                        mf_ul_emulate_write(emulator, tag_addr, write_page, &buff_rx[2]);
-                        send_ack = true;
-                        command_parsed = true;
-                    }
-                } while(false);
-            }
-        } else if(cmd == MF_UL_FAST_WRITE) {
-            if(emulator->supported_features & MfUltralightSupportFastWrite) {
-                if(buff_rx_len == (1 + 66) * 8) {
-                    if(buff_rx[1] == 0xF0 && buff_rx[2] == 0xFF) {
-                        // TODO: update when SRAM emulation implemented
-                        send_ack = true;
-                        command_parsed = true;
-                    }
-                }
-            }
-        } else if(cmd == MF_UL_COMP_WRITE) {
-            if(emulator->supported_features & MfUltralightSupportCompatWrite) {
-                if(buff_rx_len == (1 + 1) * 8) {
-                    uint8_t write_page = buff_rx[1];
-                    do {
-                        if(write_page < 2 || write_page >= emulator->page_num) break;
-                        if(emulator->supported_features & MfUltralightSupportAuth &&
-                           !mf_ul_check_auth(emulator, write_page, true))
-                            break;
-                        // Note we don't convert to tag addr here because there's only one sector
-                        if(!mf_ul_check_lock(emulator, write_page)) break;
-
-                        emulator->comp_write_cmd_started = true;
-                        emulator->comp_write_page_addr = write_page;
-                        send_ack = true;
-                        command_parsed = true;
-                    } while(false);
-                }
-            }
-        } else if(cmd == MF_UL_READ_CNT) {
-            if(emulator->supported_features & MfUltralightSupportReadCounter) {
-                if(buff_rx_len == (1 + 1) * 8) {
-                    do {
-                        uint8_t cnt_num = buff_rx[1];
-
-                        // NTAG21x checks
-                        if(emulator->supported_features & MfUltralightSupportSingleCounter) {
-                            if(cnt_num != 2) break; // Only counter 2 is available
-                            if(!emulator->config_cache.access.nfc_cnt_en)
-                                break; // NAK if counter not enabled
-                            if(emulator->config_cache.access.nfc_cnt_pwd_prot &&
-                               !emulator->auth_success)
-                                break;
-                        }
-
-                        if(cnt_num < 3) {
-                            buff_tx[0] = emulator->data.counter[cnt_num] & 0xFF;
-                            buff_tx[1] = (emulator->data.counter[cnt_num] >> 8) & 0xFF;
-                            buff_tx[2] = (emulator->data.counter[cnt_num] >> 16) & 0xFF;
-                            tx_bytes = 3;
-                            *data_type = FURI_HAL_NFC_TXRX_DEFAULT;
-                            command_parsed = true;
-                        }
-                    } while(false);
-                }
-            }
-        } else if(cmd == MF_UL_INC_CNT) {
-            if(emulator->supported_features & MfUltralightSupportIncrCounter) {
-                if(buff_rx_len == (1 + 5) * 8) {
-                    uint8_t cnt_num = buff_rx[1];
-                    uint32_t inc = (buff_rx[2] | (buff_rx[3] << 8) | (buff_rx[4] << 16));
-                    // TODO: can you increment by 0 when counter is at 0xffffff?
-                    if((cnt_num < 3) && (emulator->data.counter[cnt_num] != 0x00FFFFFF) &&
-                       (emulator->data.counter[cnt_num] + inc <= 0x00FFFFFF)) {
-                        emulator->data.counter[cnt_num] += inc;
-                        // We're RAM-backed, so tearing never happens
-                        emulator->data.tearing[cnt_num] = MF_UL_TEARING_FLAG_DEFAULT;
-                        emulator->data_changed = true;
-                        send_ack = true;
-                        command_parsed = true;
-                    }
-                }
-            }
-        } else if(cmd == MF_UL_PWD_AUTH) {
-            if(emulator->supported_features & MfUltralightSupportAuth) {
-                if(buff_rx_len == (1 + 4) * 8) {
-                    // Record password sent by PCD
-                    memcpy(
-                        emulator->auth_attempt.pwd.raw,
-                        &buff_rx[1],
-                        sizeof(emulator->auth_attempt.pwd.raw));
-                    emulator->auth_attempted = true;
-                    if(emulator->auth_received_callback) {
-                        emulator->auth_received_callback(
-                            emulator->auth_attempt, emulator->context);
-                    }
-
-                    uint16_t scaled_authlim = mf_ultralight_calc_auth_count(&emulator->data);
-                    if(scaled_authlim != 0 && emulator->data.curr_authlim >= scaled_authlim) {
-                        if(emulator->data.curr_authlim != UINT16_MAX) {
-                            // Handle case where AUTHLIM has been lowered or changed from 0
-                            emulator->data.curr_authlim = UINT16_MAX;
-                            emulator->data_changed = true;
-                        }
-                        // AUTHLIM reached, always fail
-                        buff_tx[0] = MF_UL_NAK_AUTHLIM_REACHED;
-                        tx_bits = 4;
-                        *data_type = FURI_HAL_NFC_TX_RAW_RX_DEFAULT;
-                        mf_ul_reset_emulation(emulator, false);
-                        command_parsed = true;
-                    } else {
-                        if(memcmp(&buff_rx[1], emulator->config->auth_data.pwd.raw, 4) == 0) {
-                            // Correct password
-                            buff_tx[0] = emulator->config->auth_data.pack.raw[0];
-                            buff_tx[1] = emulator->config->auth_data.pack.raw[1];
-                            tx_bytes = 2;
-                            *data_type = FURI_HAL_NFC_TXRX_DEFAULT;
-                            emulator->auth_success = true;
-                            command_parsed = true;
-                            if(emulator->data.curr_authlim != 0) {
-                                // Reset current AUTHLIM
-                                emulator->data.curr_authlim = 0;
-                                emulator->data_changed = true;
-                            }
-                        } else if(!emulator->config->auth_data.pwd.value) {
-                            // Unknown password, pretend to be an Amiibo
-                            buff_tx[0] = 0x80;
-                            buff_tx[1] = 0x80;
-                            tx_bytes = 2;
-                            *data_type = FURI_HAL_NFC_TXRX_DEFAULT;
-                            emulator->auth_success = true;
-                            command_parsed = true;
-                        } else {
-                            // Wrong password, increase negative verification count
-                            if(emulator->data.curr_authlim < UINT16_MAX) {
-                                ++emulator->data.curr_authlim;
-                                emulator->data_changed = true;
-                            }
-                            if(scaled_authlim != 0 &&
-                               emulator->data.curr_authlim >= scaled_authlim) {
-                                emulator->data.curr_authlim = UINT16_MAX;
-                                buff_tx[0] = MF_UL_NAK_AUTHLIM_REACHED;
-                                tx_bits = 4;
-                                *data_type = FURI_HAL_NFC_TX_RAW_RX_DEFAULT;
-                                mf_ul_reset_emulation(emulator, false);
-                                command_parsed = true;
-                            } else {
-                                // Should delay here to slow brute forcing
-                            }
-                        }
-                    }
-                }
-            }
-        } else if(cmd == MF_UL_READ_SIG) {
-            if(emulator->supported_features & MfUltralightSupportSignature) {
-                // Check 2nd byte = 0x00 - RFU
-                if(buff_rx_len == (1 + 1) * 8 && buff_rx[1] == 0x00) {
-                    tx_bytes = sizeof(emulator->data.signature);
-                    memcpy(buff_tx, emulator->data.signature, tx_bytes);
-                    *data_type = FURI_HAL_NFC_TXRX_DEFAULT;
-                    command_parsed = true;
-                }
-            }
-        } else if(cmd == MF_UL_CHECK_TEARING) {
-            if(emulator->supported_features & MfUltralightSupportTearingFlags) {
-                if(buff_rx_len == (1 + 1) * 8) {
-                    uint8_t cnt_num = buff_rx[1];
-                    if(cnt_num < 3) {
-                        buff_tx[0] = emulator->data.tearing[cnt_num];
-                        tx_bytes = 1;
-                        *data_type = FURI_HAL_NFC_TXRX_DEFAULT;
-                        command_parsed = true;
-                    }
-                }
-            }
-        } else if(cmd == MF_UL_HALT_START) {
-            reset_idle = true;
-            FURI_LOG_D(TAG, "Received HLTA");
-        } else if(cmd == MF_UL_SECTOR_SELECT) {
-            if(emulator->supported_features & MfUltralightSupportSectorSelect) {
-                if(buff_rx_len == (1 + 1) * 8 && buff_rx[1] == 0xFF) {
-                    // Send ACK
-                    emulator->sector_select_cmd_started = true;
-                    send_ack = true;
-                    command_parsed = true;
-                }
-            }
-        } else if(cmd == MF_UL_READ_VCSL) {
-            if(emulator->supported_features & MfUltralightSupportVcsl) {
-                if(buff_rx_len == (1 + 20) * 8) {
-                    buff_tx[0] = emulator->config_cache.vctid;
-                    tx_bytes = 1;
-                    *data_type = FURI_HAL_NFC_TXRX_DEFAULT;
-                    command_parsed = true;
-                }
-            }
-        } else {
-            // NTAG203 appears to NAK instead of just falling off on invalid commands
-            if(emulator->data.type != MfUltralightTypeNTAG203) reset_idle = true;
-            FURI_LOG_D(TAG, "Received invalid command");
-        }
-    } else {
-        reset_idle = true;
-        FURI_LOG_D(TAG, "Received invalid buffer less than 8 bits in length");
-    }
-
-    if(reset_idle) {
-        mf_ul_reset_emulation(emulator, false);
-        tx_bits = 0;
-        command_parsed = true;
-    }
-
-    if(!command_parsed) {
-        // Send NACK
-        buff_tx[0] = MF_UL_NAK_INVALID_ARGUMENT;
-        tx_bits = 4;
-        *data_type = FURI_HAL_NFC_TX_RAW_RX_DEFAULT;
-        // Every NAK should cause reset to IDLE
-        mf_ul_reset_emulation(emulator, false);
-    } else if(send_ack) {
-        buff_tx[0] = MF_UL_ACK;
-        tx_bits = 4;
-        *data_type = FURI_HAL_NFC_TX_RAW_RX_DEFAULT;
-    }
-
-    if(respond_nothing) {
-        *buff_tx_len = UINT16_MAX;
-        *data_type = FURI_HAL_NFC_TX_RAW_RX_DEFAULT;
-    } else {
-        // Return tx buffer size in bits
-        if(tx_bytes) {
-            tx_bits = tx_bytes * 8;
-        }
-        *buff_tx_len = tx_bits;
-    }
-
-#ifdef FURI_DEBUG
-    if(*buff_tx_len == UINT16_MAX) {
-        FURI_LOG_T(TAG, "Emu TX: no reply");
-    } else if(*buff_tx_len > 0) {
-        int count = (*buff_tx_len + 7) / 8;
-        for(int i = 0; i < count; ++i) {
-            furi_string_cat_printf(debug_buf, "%02x ", buff_tx[i]);
-        }
-        furi_string_trim(debug_buf);
-        FURI_LOG_T(TAG, "Emu TX (%d): %s", *buff_tx_len, furi_string_get_cstr(debug_buf));
-        furi_string_free(debug_buf);
-    } else {
-        FURI_LOG_T(TAG, "Emu TX: HALT");
-    }
-#endif
-
-    return tx_bits > 0;
-}
-
-bool mf_ul_is_full_capture(MfUltralightData* data) {
-    if(data->data_read != data->data_size) return false;
-
-    // Having read all the pages doesn't mean that we've got everything.
-    // By default PWD is 0xFFFFFFFF, but if read back it is always 0x00000000,
-    // so a default read on an auth-supported NTAG is never complete.
-    if(!(mf_ul_get_features(data->type) & MfUltralightSupportAuth)) return true;
-    MfUltralightConfigPages* config = mf_ultralight_get_config_pages(data);
-    return config->auth_data.pwd.value != 0 || config->auth_data.pack.value != 0;
-}

+ 0 - 70
apps_broken_by_last_refactors/flipperzero_vb_migrate/lib/nfc/protocols/nfc_util.c

@@ -1,70 +0,0 @@
-#include <lib/nfc/protocols/nfc_util.h>
-
-#include <furi.h>
-
-static const uint8_t nfc_util_odd_byte_parity[256] = {
-    1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0,
-    1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1,
-    1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1,
-    0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0,
-    1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 1,
-    0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0,
-    0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1,
-    0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1,
-    1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1};
-
-void nfc_util_num2bytes(uint64_t src, uint8_t len, uint8_t* dest) {
-    furi_assert(dest);
-    furi_assert(len <= 8);
-
-    while(len--) {
-        dest[len] = (uint8_t)src;
-        src >>= 8;
-    }
-}
-
-uint64_t nfc_util_bytes2num(const uint8_t* src, uint8_t len) {
-    furi_assert(src);
-    furi_assert(len <= 8);
-
-    uint64_t res = 0;
-    while(len--) {
-        res = (res << 8) | (*src);
-        src++;
-    }
-    return res;
-}
-
-uint8_t nfc_util_even_parity32(uint32_t data) {
-    // data ^= data >> 16;
-    // data ^= data >> 8;
-    // return !nfc_util_odd_byte_parity[data];
-    return (__builtin_parity(data) & 0xFF);
-}
-
-uint8_t nfc_util_odd_parity8(uint8_t data) {
-    return nfc_util_odd_byte_parity[data];
-}
-
-void nfc_util_odd_parity(const uint8_t* src, uint8_t* dst, uint8_t len) {
-    furi_assert(src);
-    furi_assert(dst);
-
-    uint8_t parity = 0;
-    uint8_t bit = 0;
-    while(len--) {
-        parity |= nfc_util_odd_parity8(*src) << (7 - bit); // parity is MSB first
-        bit++;
-        if(bit == 8) {
-            *dst = parity;
-            dst++;
-            parity = 0;
-            bit = 0;
-        }
-        src++;
-    }
-
-    if(bit) {
-        *dst = parity;
-    }
-}

+ 0 - 142
apps_broken_by_last_refactors/flipperzero_vb_migrate/lib/nfc/protocols/nfca.c

@@ -1,142 +0,0 @@
-#include <lib/nfc/protocols/nfca.h>
-#include <string.h>
-#include <stdio.h>
-#include <furi.h>
-
-#define NFCA_CMD_RATS (0xE0U)
-
-#define NFCA_CRC_INIT (0x6363)
-
-#define NFCA_F_SIG (13560000.0)
-#define T_SIG 7374 //73.746ns*100
-#define T_SIG_x8 58992 //T_SIG*8
-#define T_SIG_x8_x8 471936 //T_SIG*8*8
-#define T_SIG_x8_x9 530928 //T_SIG*8*9
-
-#define NFCA_SIGNAL_MAX_EDGES (1350)
-
-typedef struct {
-    uint8_t cmd;
-    uint8_t param;
-} nfca_cmd_rats;
-
-static uint8_t nfca_default_ats[] = {0x05, 0x78, 0x80, 0x80, 0x00};
-
-static uint8_t nfca_sleep_req[] = {0x50, 0x00};
-
-uint16_t nfca_get_crc16(uint8_t* buff, uint16_t len) {
-    uint16_t crc = NFCA_CRC_INIT;
-    uint8_t byte = 0;
-
-    for(uint8_t i = 0; i < len; i++) {
-        byte = buff[i];
-        byte ^= (uint8_t)(crc & 0xff);
-        byte ^= byte << 4;
-        crc = (crc >> 8) ^ (((uint16_t)byte) << 8) ^ (((uint16_t)byte) << 3) ^
-              (((uint16_t)byte) >> 4);
-    }
-
-    return crc;
-}
-
-void nfca_append_crc16(uint8_t* buff, uint16_t len) {
-    uint16_t crc = nfca_get_crc16(buff, len);
-    buff[len] = (uint8_t)crc;
-    buff[len + 1] = (uint8_t)(crc >> 8);
-}
-
-bool nfca_emulation_handler(
-    uint8_t* buff_rx,
-    uint16_t buff_rx_len,
-    uint8_t* buff_tx,
-    uint16_t* buff_tx_len) {
-    bool sleep = false;
-    uint8_t rx_bytes = buff_rx_len / 8;
-
-    if(rx_bytes == sizeof(nfca_sleep_req) && !memcmp(buff_rx, nfca_sleep_req, rx_bytes)) {
-        sleep = true;
-    } else if(rx_bytes == sizeof(nfca_cmd_rats) && buff_rx[0] == NFCA_CMD_RATS) {
-        memcpy(buff_tx, nfca_default_ats, sizeof(nfca_default_ats));
-        *buff_tx_len = sizeof(nfca_default_ats) * 8;
-    }
-
-    return sleep;
-}
-
-static void nfca_add_bit(DigitalSignal* signal, bool bit) {
-    if(bit) {
-        signal->start_level = true;
-        for(size_t i = 0; i < 7; i++) {
-            signal->edge_timings[i] = T_SIG_x8;
-        }
-        signal->edge_timings[7] = T_SIG_x8_x9;
-        signal->edge_cnt = 8;
-    } else {
-        signal->start_level = false;
-        signal->edge_timings[0] = T_SIG_x8_x8;
-        for(size_t i = 1; i < 9; i++) {
-            signal->edge_timings[i] = T_SIG_x8;
-        }
-        signal->edge_cnt = 9;
-    }
-}
-
-static void nfca_add_byte(NfcaSignal* nfca_signal, uint8_t byte, bool parity) {
-    for(uint8_t i = 0; i < 8; i++) {
-        if(byte & (1 << i)) {
-            digital_signal_append(nfca_signal->tx_signal, nfca_signal->one);
-        } else {
-            digital_signal_append(nfca_signal->tx_signal, nfca_signal->zero);
-        }
-    }
-    if(parity) {
-        digital_signal_append(nfca_signal->tx_signal, nfca_signal->one);
-    } else {
-        digital_signal_append(nfca_signal->tx_signal, nfca_signal->zero);
-    }
-}
-
-NfcaSignal* nfca_signal_alloc() {
-    NfcaSignal* nfca_signal = malloc(sizeof(NfcaSignal));
-    nfca_signal->one = digital_signal_alloc(10);
-    nfca_signal->zero = digital_signal_alloc(10);
-    nfca_add_bit(nfca_signal->one, true);
-    nfca_add_bit(nfca_signal->zero, false);
-    nfca_signal->tx_signal = digital_signal_alloc(NFCA_SIGNAL_MAX_EDGES);
-
-    return nfca_signal;
-}
-
-void nfca_signal_free(NfcaSignal* nfca_signal) {
-    furi_assert(nfca_signal);
-
-    digital_signal_free(nfca_signal->one);
-    digital_signal_free(nfca_signal->zero);
-    digital_signal_free(nfca_signal->tx_signal);
-    free(nfca_signal);
-}
-
-void nfca_signal_encode(NfcaSignal* nfca_signal, uint8_t* data, uint16_t bits, uint8_t* parity) {
-    furi_assert(nfca_signal);
-    furi_assert(data);
-    furi_assert(parity);
-
-    nfca_signal->tx_signal->edge_cnt = 0;
-    nfca_signal->tx_signal->start_level = true;
-    // Start of frame
-    digital_signal_append(nfca_signal->tx_signal, nfca_signal->one);
-
-    if(bits < 8) {
-        for(size_t i = 0; i < bits; i++) {
-            if(FURI_BIT(data[0], i)) {
-                digital_signal_append(nfca_signal->tx_signal, nfca_signal->one);
-            } else {
-                digital_signal_append(nfca_signal->tx_signal, nfca_signal->zero);
-            }
-        }
-    } else {
-        for(size_t i = 0; i < bits / 8; i++) {
-            nfca_add_byte(nfca_signal, data[i], parity[i / 8] & (1 << (7 - (i & 0x07))));
-        }
-    }
-}

+ 0 - 48
apps_broken_by_last_refactors/flipperzero_vb_migrate/scenes/vb_migrate_scene.c

@@ -1,48 +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/>.
-
-#include "vb_migrate_scene.h"
-
-// Generate scene on_enter handlers array
-#define ADD_SCENE(prefix, name, id) prefix##_scene_##name##_on_enter,
-void (*const vb_migrate_on_enter_handlers[])(void*) = {
-#include "vb_migrate_scene_config.h"
-};
-#undef ADD_SCENE
-
-// Generate scene on_event handlers array
-#define ADD_SCENE(prefix, name, id) prefix##_scene_##name##_on_event,
-bool (*const vb_migrate_on_event_handlers[])(void* context, SceneManagerEvent event) = {
-#include "vb_migrate_scene_config.h"
-};
-#undef ADD_SCENE
-
-// Generate scene on_exit handlers array
-#define ADD_SCENE(prefix, name, id) prefix##_scene_##name##_on_exit,
-void (*const vb_migrate_on_exit_handlers[])(void* context) = {
-#include "vb_migrate_scene_config.h"
-};
-#undef ADD_SCENE
-
-// Initialize scene handlers configuration structure
-const SceneManagerHandlers vb_migrate_scene_handlers = {
-    .on_enter_handlers = vb_migrate_on_enter_handlers,
-    .on_event_handlers = vb_migrate_on_event_handlers,
-    .on_exit_handlers = vb_migrate_on_exit_handlers,
-    .scene_num = VbMigrateSceneNum,
-};

+ 0 - 47
apps_broken_by_last_refactors/flipperzero_vb_migrate/scenes/vb_migrate_scene.h

@@ -1,47 +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/>.
-
-#pragma once
-
-#include <gui/scene_manager.h>
-
-// Generate scene id and total number
-#define ADD_SCENE(prefix, name, id) VbMigrateScene##id,
-typedef enum {
-#include "vb_migrate_scene_config.h"
-    VbMigrateSceneNum,
-} VbMigrateScene;
-#undef ADD_SCENE
-
-extern const SceneManagerHandlers vb_migrate_scene_handlers;
-
-// Generate scene on_enter handlers declaration
-#define ADD_SCENE(prefix, name, id) void prefix##_scene_##name##_on_enter(void*);
-#include "vb_migrate_scene_config.h"
-#undef ADD_SCENE
-
-// Generate scene on_event handlers declaration
-#define ADD_SCENE(prefix, name, id) \
-    bool prefix##_scene_##name##_on_event(void* context, SceneManagerEvent event);
-#include "vb_migrate_scene_config.h"
-#undef ADD_SCENE
-
-// Generate scene on_exit handlers declaration
-#define ADD_SCENE(prefix, name, id) void prefix##_scene_##name##_on_exit(void* context);
-#include "vb_migrate_scene_config.h"
-#undef ADD_SCENE

+ 0 - 57
apps_broken_by_last_refactors/flipperzero_vb_migrate/scenes/vb_migrate_scene_about.c

@@ -1,57 +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/>.
-
-#include "../vb_migrate_i.h"
-
-void vb_migrate_scene_about_on_enter(void* context) {
-    VbMigrate* inst = context;
-
-    // Perform your setup here
-    FuriString* temp_str = furi_string_alloc_printf(
-        "\e#Information\n"
-        "Version: %s\n"
-        "Developed by: cyanic\n"
-        "Graphics by: Aderek\n"
-        "GitHub: https://github.com/GMMan/flipperzero-vb-migrate\n"
-        "\n"
-        "\e#Description\n"
-        "Makes transferring\n"
-        "characters with VB Lab/\n"
-        "Arena less cumbersome",
-        VB_MIGRATE_VERSION);
-
-    Widget* widget = inst->widget;
-    vb_migrate_add_bg(widget, VbMigrateBgTypeNone);
-    widget_add_text_scroll_element(widget, 8, 16, 113, 33, furi_string_get_cstr(temp_str));
-    furi_string_free(temp_str);
-
-    view_dispatcher_switch_to_view(inst->view_dispatcher, VbMigrateViewWidget);
-}
-
-bool vb_migrate_scene_about_on_event(void* context, SceneManagerEvent event) {
-    UNUSED(context);
-    UNUSED(event);
-    return false;
-}
-
-void vb_migrate_scene_about_on_exit(void* context) {
-    VbMigrate* inst = context;
-
-    // Perform your cleanup here
-    widget_reset(inst->widget);
-}

+ 0 - 33
apps_broken_by_last_refactors/flipperzero_vb_migrate/scenes/vb_migrate_scene_config.h

@@ -1,33 +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/>.
-
-ADD_SCENE(vb_migrate, main_menu, MainMenu)
-ADD_SCENE(vb_migrate, register, Register)
-ADD_SCENE(vb_migrate, register_save, RegisterSave)
-ADD_SCENE(vb_migrate, save_success, SaveSuccess)
-ADD_SCENE(vb_migrate, select, Select)
-ADD_SCENE(vb_migrate, load, Load)
-ADD_SCENE(vb_migrate, info, Info)
-ADD_SCENE(vb_migrate, dev_menu, DevMenu)
-ADD_SCENE(vb_migrate, delete, Delete)
-ADD_SCENE(vb_migrate, delete_success, DeleteSuccess)
-ADD_SCENE(vb_migrate, from_app, FromApp)
-ADD_SCENE(vb_migrate, to_app, ToApp)
-ADD_SCENE(vb_migrate, delete_captures, DeleteCaptures)
-ADD_SCENE(vb_migrate, delete_captures_success, DeleteCapturesSuccess)
-ADD_SCENE(vb_migrate, about, About)

+ 0 - 78
apps_broken_by_last_refactors/flipperzero_vb_migrate/scenes/vb_migrate_scene_delete.c

@@ -1,78 +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/>.
-
-#include "../vb_migrate_i.h"
-#include "../vb_tag.h"
-
-static void
-    vb_migrate_scene_delete_widget_callback(GuiButtonType result, InputType type, void* context) {
-    VbMigrate* inst = context;
-
-    if(type == InputTypeShort) {
-        view_dispatcher_send_custom_event(inst->view_dispatcher, result);
-    }
-}
-
-void vb_migrate_scene_delete_on_enter(void* context) {
-    VbMigrate* inst = context;
-
-    // Perform your setup here
-    Widget* widget = inst->widget;
-    vb_migrate_add_bg(widget, VbMigrateBgTypeLeftButton | VbMigrateBgTypeRightButton);
-    widget_add_icon_element(widget, 11, 18, &I_Delete_32x20);
-    widget_add_icon_element(widget, 48, 18, &I_TextDeleteVb_49x13);
-
-    FuriString* temp_str = furi_string_alloc_printf("%d", inst->num_captured);
-    widget_add_string_element(
-        widget, 99, 24, AlignLeft, AlignTop, FontSecondary, furi_string_get_cstr(temp_str));
-    furi_string_free(temp_str);
-
-    widget_add_button_element(
-        inst->widget, GuiButtonTypeLeft, "Cancel", vb_migrate_scene_delete_widget_callback, inst);
-    widget_add_button_element(
-        inst->widget, GuiButtonTypeRight, "Delete", vb_migrate_scene_delete_widget_callback, inst);
-
-    view_dispatcher_switch_to_view(inst->view_dispatcher, VbMigrateViewWidget);
-}
-
-bool vb_migrate_scene_delete_on_event(void* context, SceneManagerEvent event) {
-    VbMigrate* inst = context;
-    bool consumed = false;
-
-    if(event.type == SceneManagerEventTypeCustom) {
-        if(event.event == GuiButtonTypeLeft) {
-            consumed = scene_manager_previous_scene(inst->scene_manager);
-        } else if(event.event == GuiButtonTypeRight) {
-            if(vb_migrate_delete(inst, inst->text_store, true)) {
-                scene_manager_next_scene(inst->scene_manager, VbMigrateSceneDeleteSuccess);
-                consumed = true;
-            } else {
-                consumed = scene_manager_search_and_switch_to_previous_scene(
-                    inst->scene_manager, VbMigrateSceneSelect);
-            }
-        }
-    }
-    return consumed;
-}
-
-void vb_migrate_scene_delete_on_exit(void* context) {
-    VbMigrate* inst = context;
-
-    // Perform your cleanup here
-    widget_reset(inst->widget);
-}

+ 0 - 87
apps_broken_by_last_refactors/flipperzero_vb_migrate/scenes/vb_migrate_scene_delete_captures.c

@@ -1,87 +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/>.
-
-#include "../vb_migrate_i.h"
-
-static void vb_migrate_scene_delete_captures_widget_callback(
-    GuiButtonType result,
-    InputType type,
-    void* context) {
-    VbMigrate* inst = context;
-
-    if(type == InputTypeShort) {
-        view_dispatcher_send_custom_event(inst->view_dispatcher, result);
-    }
-}
-
-void vb_migrate_scene_delete_captures_on_enter(void* context) {
-    VbMigrate* inst = context;
-
-    // Perform your setup here
-    Widget* widget = inst->widget;
-    vb_migrate_add_bg(widget, VbMigrateBgTypeLeftButton | VbMigrateBgTypeRightButton);
-    widget_add_icon_element(widget, 11, 18, &I_Delete_32x20);
-    widget_add_icon_element(widget, 48, 18, &I_TextClearCaptures_49x13);
-
-    FuriString* temp_str = furi_string_alloc_printf("%d", inst->num_captured);
-    widget_add_string_element(
-        widget, 99, 24, AlignLeft, AlignTop, FontSecondary, furi_string_get_cstr(temp_str));
-    furi_string_free(temp_str);
-
-    widget_add_button_element(
-        inst->widget,
-        GuiButtonTypeLeft,
-        "Cancel",
-        vb_migrate_scene_delete_captures_widget_callback,
-        inst);
-    widget_add_button_element(
-        inst->widget,
-        GuiButtonTypeRight,
-        "Delete",
-        vb_migrate_scene_delete_captures_widget_callback,
-        inst);
-
-    view_dispatcher_switch_to_view(inst->view_dispatcher, VbMigrateViewWidget);
-}
-
-bool vb_migrate_scene_delete_captures_on_event(void* context, SceneManagerEvent event) {
-    VbMigrate* inst = context;
-    bool consumed = false;
-
-    if(event.type == SceneManagerEventTypeCustom) {
-        if(event.event == GuiButtonTypeLeft) {
-            consumed = scene_manager_previous_scene(inst->scene_manager);
-        } else if(event.event == GuiButtonTypeRight) {
-            if(vb_migrate_delete(inst, inst->text_store, false)) {
-                scene_manager_next_scene(inst->scene_manager, VbMigrateSceneDeleteCapturesSuccess);
-                consumed = true;
-            } else {
-                consumed = scene_manager_previous_scene(inst->scene_manager);
-            }
-            inst->num_captured = vb_migrate_count_captured_mons(inst, inst->text_store);
-        }
-    }
-    return consumed;
-}
-
-void vb_migrate_scene_delete_captures_on_exit(void* context) {
-    VbMigrate* inst = context;
-
-    // Perform your cleanup here
-    widget_reset(inst->widget);
-}

+ 0 - 68
apps_broken_by_last_refactors/flipperzero_vb_migrate/scenes/vb_migrate_scene_delete_captures_success.c

@@ -1,68 +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/>.
-
-#include "../vb_migrate_i.h"
-
-static void vb_migrate_scene_delete_captures_success_widget_callback(
-    GuiButtonType result,
-    InputType type,
-    void* context) {
-    VbMigrate* inst = context;
-
-    if(type == InputTypeShort) {
-        if(result == GuiButtonTypeRight)
-            view_dispatcher_send_custom_event(inst->view_dispatcher, 0);
-    }
-}
-
-void vb_migrate_scene_delete_captures_success_on_enter(void* context) {
-    VbMigrate* inst = context;
-
-    // Perform your setup here
-    Widget* widget = inst->widget;
-    vb_migrate_add_bg(widget, VbMigrateBgTypeRightButton);
-    widget_add_icon_element(widget, 11, 18, &I_Delete_32x20);
-    widget_add_icon_element(widget, 48, 18, &I_TextCleared_47x6);
-    widget_add_icon_element(widget, 9, 41, &I_PulsemonRightSad_15x15);
-    widget_add_button_element(
-        widget,
-        GuiButtonTypeRight,
-        "OK",
-        vb_migrate_scene_delete_captures_success_widget_callback,
-        inst);
-
-    view_dispatcher_switch_to_view(inst->view_dispatcher, VbMigrateViewWidget);
-}
-
-bool vb_migrate_scene_delete_captures_success_on_event(void* context, SceneManagerEvent event) {
-    VbMigrate* inst = context;
-    bool consumed = false;
-
-    if(event.type == SceneManagerEventTypeCustom || event.type == SceneManagerEventTypeBack) {
-        consumed = scene_manager_search_and_switch_to_previous_scene(
-            inst->scene_manager, VbMigrateSceneDevMenu);
-    }
-    return consumed;
-}
-
-void vb_migrate_scene_delete_captures_success_on_exit(void* context) {
-    VbMigrate* inst = context;
-
-    // Perform your cleanup here
-    widget_reset(inst->widget);
-}

+ 0 - 65
apps_broken_by_last_refactors/flipperzero_vb_migrate/scenes/vb_migrate_scene_delete_success.c

@@ -1,65 +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/>.
-
-#include "../vb_migrate_i.h"
-
-static void vb_migrate_scene_delete_success_widget_callback(
-    GuiButtonType result,
-    InputType type,
-    void* context) {
-    VbMigrate* inst = context;
-    if(type == InputTypeShort) {
-        if(result == GuiButtonTypeRight)
-
-            view_dispatcher_send_custom_event(inst->view_dispatcher, 0);
-    }
-}
-
-void vb_migrate_scene_delete_success_on_enter(void* context) {
-    VbMigrate* inst = context;
-
-    // Perform your setup here
-    Widget* widget = inst->widget;
-    vb_migrate_add_bg(widget, VbMigrateBgTypeRightButton);
-    widget_add_icon_element(widget, 11, 18, &I_Delete_32x20);
-    widget_add_icon_element(widget, 48, 18, &I_TextDeleted_46x6);
-    widget_add_icon_element(widget, 9, 41, &I_PulsemonRightSad_15x15);
-    widget_add_button_element(
-        widget, GuiButtonTypeRight, "OK", vb_migrate_scene_delete_success_widget_callback, inst);
-
-    view_dispatcher_switch_to_view(inst->view_dispatcher, VbMigrateViewWidget);
-}
-
-bool vb_migrate_scene_delete_success_on_event(void* context, SceneManagerEvent event) {
-    VbMigrate* inst = context;
-    bool consumed = false;
-
-    if(event.type == SceneManagerEventTypeCustom || event.type == SceneManagerEventTypeBack) {
-        uint32_t back_scenes[] = {VbMigrateSceneSelect, VbMigrateSceneMainMenu};
-        consumed = scene_manager_search_and_switch_to_previous_scene_one_of(
-            inst->scene_manager, back_scenes, COUNT_OF(back_scenes));
-    }
-    return consumed;
-}
-
-void vb_migrate_scene_delete_success_on_exit(void* context) {
-    VbMigrate* inst = context;
-
-    // Perform your cleanup here
-    widget_reset(inst->widget);
-}

+ 0 - 184
apps_broken_by_last_refactors/flipperzero_vb_migrate/scenes/vb_migrate_scene_dev_menu.c

@@ -1,184 +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/>.
-
-#include "../vb_migrate_i.h"
-
-typedef enum {
-    SubmenuDevMenuIndexTransferFromApp,
-    SubmenuDevMenuIndexTransferToApp,
-    SubmenuDevMenuClearAccountId,
-    SubmenuDevMenuIndexSpoof,
-    SubmenuDevMenuIndexClearCaptures,
-    SubmenuDevMenuIndexDeleteVb,
-    // -----
-    SubmenuDevMenuClearAccountIdOff,
-    SubmenuDevMenuClearAccountIdOn,
-    // -----
-    SubmenuDevMenuIndexSpoofSelection, // Always keep this last because we add tag type to it
-} SubmenuDevMenuIndex;
-
-static void vb_migrate_scene_dev_menu_var_list_enter_callback(void* context, uint32_t index) {
-    VbMigrate* inst = context;
-
-    view_dispatcher_send_custom_event(inst->view_dispatcher, index);
-}
-
-static VbTagType
-    vb_migrate_scene_dev_menu_spoof_set_item_by_index(VariableItemEx* item, uint8_t index) {
-    VbTagType type;
-    if(index >= 2) { // VBC
-        type = (VbTagType)(index + 2);
-    } else {
-        type = (VbTagType)(index + 1);
-    }
-
-    variable_item_ex_set_current_value_index(item, index);
-    variable_item_ex_set_current_value_text(item, vb_tag_get_tag_type_name(type));
-    return type;
-}
-
-static uint8_t
-    vb_migrate_scene_dev_menu_spoof_set_item_by_type(VariableItemEx* item, VbTagType type) {
-    uint8_t index;
-    if(type >= VbTagTypeVH) {
-        index = (uint8_t)type - 2;
-    } else {
-        index = (uint8_t)type - 1;
-    }
-
-    variable_item_ex_set_current_value_index(item, index);
-    variable_item_ex_set_current_value_text(item, vb_tag_get_tag_type_name(type));
-    return index;
-}
-
-static void vb_migrate_scene_dev_menu_spoof_change_callback(VariableItemEx* item) {
-    VbMigrate* inst = variable_item_ex_get_context(item);
-    uint8_t index = variable_item_ex_get_current_value_index(item);
-
-    VbTagType tag_type = vb_migrate_scene_dev_menu_spoof_set_item_by_index(item, index);
-    view_dispatcher_send_custom_event(
-        inst->view_dispatcher, SubmenuDevMenuIndexSpoofSelection + tag_type);
-}
-
-static void vb_migrate_scene_dev_menu_clear_account_id_change_callback(VariableItemEx* item) {
-    VbMigrate* inst = variable_item_ex_get_context(item);
-    uint8_t index = variable_item_ex_get_current_value_index(item);
-
-    variable_item_ex_set_current_value_text(item, index ? "On" : "Off");
-    view_dispatcher_send_custom_event(
-        inst->view_dispatcher,
-        index ? SubmenuDevMenuClearAccountIdOn : SubmenuDevMenuClearAccountIdOff);
-}
-
-void vb_migrate_scene_dev_menu_on_enter(void* context) {
-    VbMigrate* inst = context;
-    VariableItemListEx* variable_list = inst->variable_list;
-    VariableItemEx* item;
-
-    variable_item_list_ex_set_enter_callback(
-        variable_list, vb_migrate_scene_dev_menu_var_list_enter_callback, inst);
-    variable_item_list_ex_add(
-        variable_list, "Transfer App > Flipper", 0, NULL, NULL, SubmenuDevMenuIndexTransferFromApp);
-
-    if(inst->num_captured != 0) {
-        variable_item_list_ex_add(
-            variable_list,
-            "Transfer Flipper > App",
-            0,
-            NULL,
-            NULL,
-            SubmenuDevMenuIndexTransferToApp);
-    }
-
-    item = variable_item_list_ex_add(
-        variable_list,
-        "Unlink Account",
-        2,
-        vb_migrate_scene_dev_menu_clear_account_id_change_callback,
-        inst,
-        SubmenuDevMenuClearAccountId);
-    variable_item_ex_set_current_value_index(item, inst->clear_account_id ? 1 : 0);
-    variable_item_ex_set_current_value_text(item, inst->clear_account_id ? "On" : "Off");
-
-    if(inst->orig_type == VbTagTypeVBDM || inst->orig_type == VbTagTypeVBV ||
-       inst->orig_type == VbTagTypeVH) {
-        item = variable_item_list_ex_add(
-            variable_list,
-            "Spoof Version",
-            VbTagTypeMax - 1 - 2, // Removing VBC from list, skip VBBE
-            vb_migrate_scene_dev_menu_spoof_change_callback,
-            inst,
-            SubmenuDevMenuIndexSpoof);
-        vb_migrate_scene_dev_menu_spoof_set_item_by_type(item, inst->override_type);
-    }
-
-    if(inst->num_captured != 0) {
-        variable_item_list_ex_add(
-            variable_list, "Clear Captures", 0, NULL, NULL, SubmenuDevMenuIndexClearCaptures);
-    }
-
-    variable_item_list_ex_add(
-        variable_list, "Delete Vital Bracelet", 0, NULL, NULL, SubmenuDevMenuIndexDeleteVb);
-
-    // variable_item_list_ex_set_selected_item(
-    //     variable_list, scene_manager_get_scene_state(inst->scene_manager, VbMigrateSceneDevMenu));
-
-    view_dispatcher_switch_to_view(inst->view_dispatcher, VbMigrateViewVariableItemList);
-}
-
-bool vb_migrate_scene_dev_menu_on_event(void* context, SceneManagerEvent event) {
-    VbMigrate* inst = context;
-    bool consumed = false;
-
-    if(event.type == SceneManagerEventTypeCustom) {
-        // if(event.event < SubmenuDevMenuIndexSpoofSelection) {
-        //     scene_manager_set_scene_state(inst->scene_manager, VbMigrateSceneDevMenu, event.event);
-        // }
-
-        if(event.event == SubmenuDevMenuIndexTransferFromApp) {
-            scene_manager_next_scene(inst->scene_manager, VbMigrateSceneFromApp);
-            consumed = true;
-        } else if(event.event == SubmenuDevMenuIndexTransferToApp) {
-            scene_manager_next_scene(inst->scene_manager, VbMigrateSceneToApp);
-            consumed = true;
-        } else if(event.event == SubmenuDevMenuIndexClearCaptures) {
-            scene_manager_next_scene(inst->scene_manager, VbMigrateSceneDeleteCaptures);
-            consumed = true;
-        } else if(event.event == SubmenuDevMenuIndexDeleteVb) {
-            scene_manager_next_scene(inst->scene_manager, VbMigrateSceneDelete);
-            consumed = true;
-        } else if(event.event == SubmenuDevMenuClearAccountIdOff) {
-            inst->clear_account_id = false;
-            consumed = true;
-        } else if(event.event == SubmenuDevMenuClearAccountIdOn) {
-            inst->clear_account_id = true;
-            consumed = true;
-        } else if(event.event >= SubmenuDevMenuIndexSpoofSelection) {
-            // Note: skipping SubmenuDevMenuIndexSpoof because there's nothing to do on enter
-            inst->override_type = event.event - SubmenuDevMenuIndexSpoofSelection;
-            consumed = true;
-        }
-    }
-    return consumed;
-}
-
-void vb_migrate_scene_dev_menu_on_exit(void* context) {
-    VbMigrate* inst = context;
-
-    variable_item_list_ex_reset(inst->variable_list);
-}

+ 0 - 370
apps_broken_by_last_refactors/flipperzero_vb_migrate/scenes/vb_migrate_scene_from_app.c

@@ -1,370 +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/>.
-
-#include <notification/notification_messages.h>
-
-#include "../vb_migrate_i.h"
-#include "../vb_tag.h"
-
-#define TAG "vb_migrate_scene_from_app"
-
-typedef enum {
-    FromAppStateInitial,
-    FromAppStateInstructions,
-    FromAppStateEmulateReady,
-    FromAppStateEmulateCheckDim,
-    FromAppStateEmulateTransferFromApp,
-    FromAppStateTemplateError,
-    FromAppStateSaveError,
-} FromAppState;
-
-typedef enum {
-    FromAppEventTypeWidgetLeft,
-    FromAppEventTypeWidgetRight,
-    FromAppEventTypeTemplateLoadError,
-    FromAppEventTypeTagWrite,
-    FromAppEventTypeCaptureSaveError,
-    FromAppEventTypeCaptureSaveSuccess,
-} FromAppEventType;
-
-static void
-    vb_migrate_scene_from_app_widget_callback(GuiButtonType result, InputType type, void* context) {
-    VbMigrate* inst = context;
-
-    if(type == InputTypeShort) {
-        if(result == GuiButtonTypeLeft)
-            view_dispatcher_send_custom_event(inst->view_dispatcher, FromAppEventTypeWidgetLeft);
-        else if(result == GuiButtonTypeRight)
-            view_dispatcher_send_custom_event(inst->view_dispatcher, FromAppEventTypeWidgetRight);
-    }
-}
-
-static bool vb_migrate_scene_from_app_worker_callback(NfcWorkerEvent event, void* context) {
-    VbMigrate* inst = context;
-    bool result = false;
-
-    if(event == NfcWorkerEventSuccess) {
-        view_dispatcher_send_custom_event(inst->view_dispatcher, FromAppEventTypeTagWrite);
-        result = true;
-    }
-
-    return result;
-}
-
-static void vb_migrate_scene_from_app_set_nfc_state(VbMigrate* inst, FromAppState state) {
-    BantBlock* bant = vb_tag_get_bant_block(&inst->nfc_dev->dev_data);
-    if(state == FromAppStateEmulateReady) {
-        vb_tag_set_random_nonce(bant);
-        vb_tag_set_status(bant, VbTagStatusReady);
-        vb_tag_set_operation(bant, VbTagOperationReady);
-    } else if(state == FromAppStateEmulateCheckDim) {
-        vb_tag_set_status(bant, VbTagStatusReady | VbTagStatusDimReady);
-        vb_tag_set_operation(bant, VbTagOperationReady);
-    } else if(state == FromAppStateEmulateTransferFromApp) {
-        vb_tag_set_status(bant, 0);
-        vb_tag_set_operation(bant, VbTagOperationIdle);
-    }
-
-    // Override tag type
-    if(inst->override_type != inst->orig_type && inst->override_type != VbTagTypeUnknown) {
-        vb_tag_set_item_id_no(bant, vb_tag_get_default_product(inst->override_type));
-    }
-
-    if(inst->clear_account_id) {
-        vb_tag_set_app_flag(bant, false);
-    }
-}
-
-static bool vb_migrate_scene_from_app_is_state_changed(VbMigrate* inst, FromAppState state) {
-    BantBlock* bant = vb_tag_get_bant_block(&inst->nfc_dev->dev_data);
-    VbTagOperation operation = vb_tag_get_operation(bant);
-
-    if(state == FromAppStateEmulateReady) {
-        return operation == VbTagOperationCheckDim;
-    } else if(state == FromAppStateEmulateCheckDim) {
-        return operation == VbTagOperationCheckDim || operation == VbTagOperationReturnFromApp;
-    }
-
-    return false;
-}
-
-static void vb_migrate_scene_from_app_set_state(VbMigrate* inst, FromAppState state) {
-    uint32_t curr_state =
-        scene_manager_get_scene_state(inst->scene_manager, VbMigrateSceneFromApp);
-    if(state != curr_state) {
-        Widget* widget = inst->widget;
-
-        if(state == FromAppStateInstructions) {
-            widget_reset(widget);
-            vb_migrate_add_bg(widget, VbMigrateBgTypeLeftButton | VbMigrateBgTypeRightButton);
-            widget_add_text_scroll_element(
-                widget,
-                8,
-                16,
-                113,
-                33,
-                "\e#To transfer\n"
-                "\e#characters to Flipper:\n"
-                "0. If on VB Arena, select\n"
-                "the device type that\n"
-                "matches your current\n"
-                "settings\n"
-                "1. If on VB Lab, wake up\n"
-                "character from storage\n"
-                "2. Sync character to\n"
-                "Flipper as if it was a\n"
-                "Vital Bracelet. Flipper\n"
-                "will beep when it is\n"
-                "ready for the next step\n"
-                "3. The character is\n"
-                "automatically saved when\n"
-                "the transfer is complete,\n"
-                "and will be ready for\n"
-                "another transfer\n"
-                "4. Repeat the above until\n"
-                "you have transferred all\n"
-                "the characters you want\n"
-                "\n"
-                "You can cancel at any\n"
-                "time to finish transferring.");
-            widget_add_button_element(
-                widget,
-                GuiButtonTypeLeft,
-                "Cancel",
-                vb_migrate_scene_from_app_widget_callback,
-                inst);
-            widget_add_button_element(
-                widget,
-                GuiButtonTypeRight,
-                "Next",
-                vb_migrate_scene_from_app_widget_callback,
-                inst);
-
-            view_dispatcher_switch_to_view(inst->view_dispatcher, VbMigrateViewWidget);
-        } else if(state == FromAppStateEmulateReady) {
-            vb_migrate_show_loading_popup(inst, true);
-            if(vb_migrate_load_nfc(inst, inst->text_store, VB_MIGRATE_TEMPLATE_NAME)) {
-                widget_reset(widget);
-                vb_migrate_add_bg(widget, VbMigrateBgTypeLeftButton);
-                widget_add_icon_element(widget, 11, 18, &I_CommReady_32x27);
-                widget_add_icon_element(widget, 48, 18, &I_TextTransferDimCheck_70x20);
-                FuriString* temp_str = furi_string_alloc_printf("%d", inst->num_captured);
-                widget_add_string_element(
-                    widget,
-                    100,
-                    31,
-                    AlignLeft,
-                    AlignTop,
-                    FontSecondary,
-                    furi_string_get_cstr(temp_str));
-                widget_add_icon_element(widget, 106, 40, &I_PulsemonRightWaiting_15x16);
-                widget_add_button_element(
-                    widget,
-                    GuiButtonTypeLeft,
-                    "Cancel",
-                    vb_migrate_scene_from_app_widget_callback,
-                    inst);
-
-                view_dispatcher_switch_to_view(inst->view_dispatcher, VbMigrateViewWidget);
-                furi_string_free(temp_str);
-
-                vb_migrate_scene_from_app_set_nfc_state(inst, state);
-                nfc_worker_start(
-                    inst->worker,
-                    NfcWorkerStateMfUltralightEmulate,
-                    &inst->nfc_dev->dev_data,
-                    vb_migrate_scene_from_app_worker_callback,
-                    inst);
-                vb_migrate_blink_emulate(inst);
-            } else {
-                view_dispatcher_send_custom_event(
-                    inst->view_dispatcher, FromAppEventTypeTemplateLoadError);
-            }
-            vb_migrate_show_loading_popup(inst, false);
-        } else if(state == FromAppStateEmulateCheckDim) {
-            widget_reset(widget);
-            vb_migrate_add_bg(widget, VbMigrateBgTypeLeftButton);
-            widget_add_icon_element(widget, 11, 18, &I_CommReady_32x27);
-            widget_add_icon_element(widget, 48, 18, &I_TextTransferSecondDimCheck_71x20);
-            widget_add_icon_element(widget, 106, 40, &I_PulsemonRightWaiting_15x16);
-            widget_add_button_element(
-                widget,
-                GuiButtonTypeLeft,
-                "Cancel",
-                vb_migrate_scene_from_app_widget_callback,
-                inst);
-
-            view_dispatcher_switch_to_view(inst->view_dispatcher, VbMigrateViewWidget);
-            notification_message(inst->notifications, &sequence_success);
-            vb_migrate_scene_from_app_set_nfc_state(inst, state);
-            nfc_worker_start(
-                inst->worker,
-                NfcWorkerStateMfUltralightEmulate,
-                &inst->nfc_dev->dev_data,
-                vb_migrate_scene_from_app_worker_callback,
-                inst);
-            vb_migrate_blink_emulate(inst);
-        } else if(state == FromAppStateEmulateTransferFromApp) {
-            widget_reset(widget);
-            vb_migrate_add_bg(widget, VbMigrateBgTypeLeftButton);
-            widget_add_icon_element(widget, 15, 18, &I_TextTransferCaptured_97x13);
-            widget_add_icon_element(widget, 106, 40, &I_PulsemonRightWaiting_15x16);
-            widget_add_button_element(
-                widget,
-                GuiButtonTypeLeft,
-                "Cancel",
-                vb_migrate_scene_from_app_widget_callback,
-                inst);
-
-            view_dispatcher_switch_to_view(inst->view_dispatcher, VbMigrateViewWidget);
-            nfc_worker_stop(inst->worker);
-            vb_migrate_blink_stop(inst);
-            vb_migrate_scene_from_app_set_nfc_state(inst, state);
-            notification_message(inst->notifications, &sequence_success);
-
-            // Restore original tag type if necessary
-            if(inst->override_type != inst->orig_type && inst->override_type != VbTagTypeUnknown) {
-                BantBlock* bant = vb_tag_get_bant_block(&inst->nfc_dev->dev_data);
-                vb_tag_set_item_id_no(bant, inst->orig_product);
-            }
-
-            // Save the tag
-            inst->next_id = vb_migrate_get_next_id(inst, inst->text_store, inst->next_id, false);
-            FuriString* save_path = furi_string_alloc_printf(
-                VB_MIGRATE_CAPTURE_FORMAT, inst->next_id, NFC_APP_EXTENSION);
-            if(vb_migrate_save_nfc(inst, inst->text_store, furi_string_get_cstr(save_path))) {
-                view_dispatcher_send_custom_event(
-                    inst->view_dispatcher, FromAppEventTypeCaptureSaveSuccess);
-            } else {
-                view_dispatcher_send_custom_event(
-                    inst->view_dispatcher, FromAppEventTypeCaptureSaveError);
-            }
-            furi_string_free(save_path);
-        } else if(state == FromAppStateTemplateError) {
-            widget_reset(widget);
-            vb_migrate_add_bg(widget, VbMigrateBgTypeLeftButton);
-            widget_add_icon_element(widget, 11, 18, &I_WrongDevice_32x27);
-            widget_add_icon_element(widget, 48, 18, &I_TextErrLoadTemplate_69x13);
-            widget_add_icon_element(widget, 104, 41, &I_PulsemonLeftWait_15x15);
-            widget_add_button_element(
-                widget,
-                GuiButtonTypeLeft,
-                "Cancel",
-                vb_migrate_scene_from_app_widget_callback,
-                inst);
-
-            view_dispatcher_switch_to_view(inst->view_dispatcher, VbMigrateViewWidget);
-            notification_message(inst->notifications, &sequence_error);
-            notification_message(inst->notifications, &sequence_set_red_255);
-        } else if(state == FromAppStateSaveError) {
-            widget_reset(widget);
-            vb_migrate_add_bg(widget, VbMigrateBgTypeLeftButton);
-            widget_add_icon_element(widget, 11, 18, &I_WrongDevice_32x27);
-            widget_add_icon_element(widget, 48, 18, &I_TextErrSaveCapture_65x13);
-            widget_add_icon_element(widget, 104, 41, &I_PulsemonLeftWait_15x15);
-            widget_add_button_element(
-                widget,
-                GuiButtonTypeLeft,
-                "Cancel",
-                vb_migrate_scene_from_app_widget_callback,
-                inst);
-
-            view_dispatcher_switch_to_view(inst->view_dispatcher, VbMigrateViewWidget);
-            notification_message(inst->notifications, &sequence_error);
-            notification_message(inst->notifications, &sequence_set_red_255);
-        } else {
-            furi_crash("Unknown new state in vb_migrate_scene_from_app_set_state");
-        }
-
-        scene_manager_set_scene_state(inst->scene_manager, VbMigrateSceneFromApp, state);
-    }
-}
-
-void vb_migrate_scene_from_app_on_enter(void* context) {
-    VbMigrate* inst = context;
-
-    // Perform your setup here
-    inst->next_id = 0;
-    scene_manager_set_scene_state(inst->scene_manager, VbMigrateSceneFromApp, FromAppStateInitial);
-    vb_migrate_scene_from_app_set_state(inst, FromAppStateInstructions);
-}
-
-bool vb_migrate_scene_from_app_on_event(void* context, SceneManagerEvent event) {
-    VbMigrate* inst = context;
-    bool consumed = false;
-
-    if(event.type == SceneManagerEventTypeCustom) {
-        if(event.event == FromAppEventTypeWidgetLeft) {
-            consumed = scene_manager_previous_scene(inst->scene_manager);
-        } else if(event.event == FromAppEventTypeWidgetRight) {
-            vb_migrate_scene_from_app_set_state(inst, FromAppStateEmulateReady);
-            consumed = true;
-        } else if(event.event == FromAppEventTypeTagWrite) {
-            uint32_t state =
-                scene_manager_get_scene_state(inst->scene_manager, VbMigrateSceneFromApp);
-            if(vb_migrate_scene_from_app_is_state_changed(inst, state)) {
-                if(state == FromAppStateEmulateReady) {
-                    nfc_worker_stop(inst->worker);
-                    vb_migrate_blink_stop(inst);
-                    vb_migrate_scene_from_app_set_state(inst, FromAppStateEmulateCheckDim);
-                    consumed = true;
-                } else if(state == FromAppStateEmulateCheckDim) {
-                    BantBlock* bant = vb_tag_get_bant_block(&inst->nfc_dev->dev_data);
-                    VbTagOperation operation = vb_tag_get_operation(bant);
-
-                    if(operation == VbTagOperationReturnFromApp) {
-                        nfc_worker_stop(inst->worker);
-                        vb_migrate_blink_stop(inst);
-                        vb_migrate_scene_from_app_set_state(
-                            inst, FromAppStateEmulateTransferFromApp);
-                        consumed = true;
-                    } else if(operation == VbTagOperationCheckDim) {
-                        // Don't need to reset tag, but should make a beep
-                        vb_migrate_blink_stop(inst);
-                        notification_message_block(inst->notifications, &sequence_success);
-                        vb_migrate_blink_emulate(inst);
-                    }
-                }
-            }
-        } else if(event.event == FromAppEventTypeTemplateLoadError) {
-            vb_migrate_scene_from_app_set_state(inst, FromAppStateTemplateError);
-            consumed = true;
-        } else if(event.event == FromAppEventTypeCaptureSaveError) {
-            vb_migrate_scene_from_app_set_state(inst, FromAppStateSaveError);
-            consumed = true;
-        } else if(event.event == FromAppEventTypeCaptureSaveSuccess) {
-            ++inst->num_captured;
-            ++inst->next_id;
-            vb_migrate_scene_from_app_set_state(inst, FromAppStateEmulateReady);
-            consumed = true;
-        } else {
-            furi_crash("Unknown event in vb_migrate_scene_from_app_on_event");
-        }
-    }
-    return consumed;
-}
-
-void vb_migrate_scene_from_app_on_exit(void* context) {
-    VbMigrate* inst = context;
-
-    // Perform your cleanup here
-    widget_reset(inst->widget);
-    nfc_worker_stop(inst->worker);
-    vb_migrate_blink_stop(inst);
-    notification_message_block(inst->notifications, &sequence_reset_red);
-}

+ 0 - 85
apps_broken_by_last_refactors/flipperzero_vb_migrate/scenes/vb_migrate_scene_info.c

@@ -1,85 +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/>.
-
-#include "../vb_migrate_i.h"
-#include "../vb_tag.h"
-
-static void
-    vb_migrate_scene_info_button_callback(GuiButtonType result, InputType type, void* context) {
-    VbMigrate* inst = context;
-
-    if(type == InputTypeShort) {
-        if(result == GuiButtonTypeRight) {
-            view_dispatcher_send_custom_event(inst->view_dispatcher, result);
-        }
-    }
-}
-
-void vb_migrate_scene_info_on_enter(void* context) {
-    VbMigrate* inst = context;
-    FuriString* temp_str = furi_string_alloc();
-
-    // Build info scroll
-    // Name
-    furi_string_cat_printf(temp_str, "\ec%s\n", inst->text_store);
-
-    // Type
-    if(inst->orig_product == NULL)
-        furi_string_cat(temp_str, "Unknown product\n");
-    else
-        furi_string_cat_printf(temp_str, "\e#%s\n", inst->orig_product->name);
-
-    // Number of mons loaded
-    furi_string_cat_printf(temp_str, "Charas. captured: %d", inst->num_captured);
-
-    vb_migrate_add_bg(inst->widget, VbMigrateBgTypeRightButton);
-
-    widget_add_text_scroll_element(inst->widget, 8, 16, 113, 33, furi_string_get_cstr(temp_str));
-    furi_string_free(temp_str);
-
-    widget_add_button_element(
-        inst->widget, GuiButtonTypeRight, "More", vb_migrate_scene_info_button_callback, inst);
-    view_dispatcher_switch_to_view(inst->view_dispatcher, VbMigrateViewWidget);
-}
-
-bool vb_migrate_scene_info_on_event(void* context, SceneManagerEvent event) {
-    VbMigrate* inst = context;
-    bool consumed = false;
-    UNUSED(inst);
-
-    if(event.type == SceneManagerEventTypeCustom) {
-        if(event.event == GuiButtonTypeRight) {
-            // Reset menu selection index
-            scene_manager_set_scene_state(inst->scene_manager, VbMigrateSceneDevMenu, 0);
-            scene_manager_next_scene(inst->scene_manager, VbMigrateSceneDevMenu);
-            consumed = true;
-        }
-    } else if(event.type == SceneManagerEventTypeBack) {
-        uint32_t back_scenes[] = {VbMigrateSceneSelect, VbMigrateSceneMainMenu};
-        consumed = scene_manager_search_and_switch_to_previous_scene_one_of(
-            inst->scene_manager, back_scenes, COUNT_OF(back_scenes));
-    }
-    return consumed;
-}
-
-void vb_migrate_scene_info_on_exit(void* context) {
-    VbMigrate* inst = context;
-
-    // Perform your cleanup here
-    widget_reset(inst->widget);
-}

+ 0 - 61
apps_broken_by_last_refactors/flipperzero_vb_migrate/scenes/vb_migrate_scene_load.c

@@ -1,61 +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/>.
-
-#include "../vb_migrate_i.h"
-
-#define TAG "vb_migrate_scene_load"
-
-void vb_migrate_scene_load_on_enter(void* context) {
-    VbMigrate* inst = context;
-
-    // Perform your setup here
-    vb_migrate_show_loading_popup(inst, true);
-    view_dispatcher_send_custom_event(inst->view_dispatcher, 0);
-}
-
-bool vb_migrate_scene_load_on_event(void* context, SceneManagerEvent event) {
-    VbMigrate* inst = context;
-    bool consumed = false;
-
-    if(event.type == SceneManagerEventTypeCustom) {
-        if(vb_migrate_load_nfc(inst, inst->text_store, VB_MIGRATE_TEMPLATE_NAME)) {
-            inst->num_captured = vb_migrate_count_captured_mons(inst, inst->text_store);
-
-            BantBlock* bant = vb_tag_get_bant_block(&inst->nfc_dev->dev_data);
-            const VbTagProduct* product = vb_tag_find_product(bant);
-            inst->orig_product = product;
-            if(product) {
-                inst->orig_type = product->type;
-            } else {
-                inst->orig_type = VbTagTypeUnknown;
-            }
-            inst->override_type = inst->orig_type;
-
-            scene_manager_next_scene(inst->scene_manager, VbMigrateSceneInfo);
-            consumed = true;
-        } else {
-            consumed = scene_manager_previous_scene(inst->scene_manager);
-        }
-        vb_migrate_show_loading_popup(inst, false);
-    }
-    return consumed;
-}
-
-void vb_migrate_scene_load_on_exit(void* context) {
-    UNUSED(context);
-}

+ 0 - 78
apps_broken_by_last_refactors/flipperzero_vb_migrate/scenes/vb_migrate_scene_main_menu.c

@@ -1,78 +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/>.
-
-#include "../vb_migrate_i.h"
-
-typedef enum {
-    SubmenuMainIndexRegister,
-    SubmenuMainIndexSelect,
-    SubmenuMainIndexAbout,
-} SubmenuMainIndex;
-
-static void vb_migrate_scene_main_menu_submenu_callback(void* context, uint32_t index) {
-    VbMigrate* inst = context;
-
-    view_dispatcher_send_custom_event(inst->view_dispatcher, index);
-}
-
-void vb_migrate_scene_main_menu_on_enter(void* context) {
-    VbMigrate* inst = context;
-    Submenu* submenu = inst->submenu;
-
-    submenu_add_item(
-        submenu,
-        "Register Vital Bracelet",
-        SubmenuMainIndexRegister,
-        vb_migrate_scene_main_menu_submenu_callback,
-        inst);
-    submenu_add_item(
-        submenu,
-        "Select Vital Bracelet",
-        SubmenuMainIndexSelect,
-        vb_migrate_scene_main_menu_submenu_callback,
-        inst);
-    submenu_add_item(
-        submenu, "About", SubmenuMainIndexAbout, vb_migrate_scene_main_menu_submenu_callback, inst);
-
-    view_dispatcher_switch_to_view(inst->view_dispatcher, VbMigrateViewMenu);
-}
-
-bool vb_migrate_scene_main_menu_on_event(void* context, SceneManagerEvent event) {
-    VbMigrate* inst = context;
-    bool consumed = false;
-
-    if(event.type == SceneManagerEventTypeCustom) {
-        if(event.event == SubmenuMainIndexRegister) {
-            scene_manager_next_scene(inst->scene_manager, VbMigrateSceneRegister);
-            consumed = true;
-        } else if(event.event == SubmenuMainIndexSelect) {
-            scene_manager_next_scene(inst->scene_manager, VbMigrateSceneSelect);
-            consumed = true;
-        } else if(event.event == SubmenuMainIndexAbout) {
-            scene_manager_next_scene(inst->scene_manager, VbMigrateSceneAbout);
-            consumed = true;
-        }
-    }
-    return consumed;
-}
-
-void vb_migrate_scene_main_menu_on_exit(void* context) {
-    VbMigrate* inst = context;
-
-    submenu_reset(inst->submenu);
-}

+ 0 - 420
apps_broken_by_last_refactors/flipperzero_vb_migrate/scenes/vb_migrate_scene_register.c

@@ -1,420 +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/>.
-
-#include <notification/notification_messages.h>
-
-#include "../vb_tag.h"
-#include "../vb_migrate_i.h"
-
-typedef enum {
-    RegisterStateInitial,
-    RegisterStateInstructionInitial,
-    RegisterStateInstructionConnect,
-    RegisterStateCaptureInitial,
-    RegisterStateCaptureInvalidTag,
-    RegisterStateCapturePwd,
-    RegisterStateCaptureFull,
-    RegisterStateCaptureFailed,
-    RegisterStateCaptureIncorrectTag,
-} RegisterState;
-
-typedef enum {
-    RegisterEventTypeNextButton,
-    RegisterEventTypePrevButton,
-    RegisterEventTypeVbReadInitial,
-    RegisterEventTypeVbPwdAuth,
-    RegisterEventTypeVbReadFullSuccess,
-    RegisterEventTypeVbReadFullFail,
-} RegisterEventType;
-
-static void
-    vb_migrate_scene_register_widget_callback(GuiButtonType result, InputType type, void* context) {
-    VbMigrate* inst = context;
-
-    if(type == InputTypeShort) {
-        if(result == GuiButtonTypeRight)
-            view_dispatcher_send_custom_event(inst->view_dispatcher, RegisterEventTypeNextButton);
-        else if(result == GuiButtonTypeLeft)
-            view_dispatcher_send_custom_event(inst->view_dispatcher, RegisterEventTypePrevButton);
-    }
-}
-
-static bool
-    vb_migrate_scene_register_worker_read_initial_callback(NfcWorkerEvent event, void* context) {
-    VbMigrate* inst = context;
-    bool consumed = false;
-
-    if(event == NfcWorkerEventReadMfUltralight) {
-        view_dispatcher_send_custom_event(inst->view_dispatcher, RegisterEventTypeVbReadInitial);
-        consumed = true;
-    }
-
-    return consumed;
-}
-
-static bool vb_migrate_scene_register_worker_auth_callback(NfcWorkerEvent event, void* context) {
-    VbMigrate* inst = context;
-    bool consumed = false;
-
-    if(event == NfcWorkerEventMfUltralightPwdAuth) {
-        view_dispatcher_send_custom_event(inst->view_dispatcher, RegisterEventTypeVbPwdAuth);
-        consumed = true;
-    }
-
-    return consumed;
-}
-
-static bool
-    vb_migrate_scene_register_worker_full_capture_callback(NfcWorkerEvent event, void* context) {
-    VbMigrate* inst = context;
-    bool consumed = false;
-
-    if(event == NfcWorkerEventMfUltralightPassKey) {
-        memcpy(
-            inst->nfc_dev->dev_data.mf_ul_data.auth_key,
-            inst->captured_pwd,
-            sizeof(inst->captured_pwd));
-        consumed = true;
-    } else if(event == NfcWorkerEventSuccess) {
-        view_dispatcher_send_custom_event(
-            inst->view_dispatcher, RegisterEventTypeVbReadFullSuccess);
-        consumed = true;
-    } else if(event == NfcWorkerEventFail) {
-        view_dispatcher_send_custom_event(inst->view_dispatcher, RegisterEventTypeVbReadFullFail);
-        consumed = true;
-    }
-
-    return consumed;
-}
-
-static void vb_migrate_scene_register_cleanup_state(VbMigrate* inst, RegisterState state) {
-    if(state == RegisterStateCaptureInvalidTag || state == RegisterStateCaptureFailed ||
-       state == RegisterStateCaptureIncorrectTag) {
-        notification_message(inst->notifications, &sequence_reset_red);
-    } else if(
-        state == RegisterStateCaptureInitial || state == RegisterStateCapturePwd ||
-        state == RegisterStateCaptureFull) {
-        vb_migrate_blink_stop(inst);
-        nfc_worker_stop(inst->worker);
-    }
-}
-
-static void vb_migrate_scene_register_set_state(VbMigrate* inst, RegisterState state) {
-    uint32_t curr_state =
-        scene_manager_get_scene_state(inst->scene_manager, VbMigrateSceneRegister);
-    if(state != curr_state) {
-        vb_migrate_scene_register_cleanup_state(inst, curr_state);
-        Widget* widget = inst->widget;
-
-        if(state == RegisterStateInstructionInitial) {
-            widget_reset(widget);
-            vb_migrate_add_bg(widget, VbMigrateBgTypeLeftButton | VbMigrateBgTypeRightButton);
-            widget_add_text_scroll_element(
-                widget,
-                8,
-                16,
-                113,
-                33,
-                "Please make sure your\n"
-                "current character has\n"
-                "been sent to VB Lab/\n"
-                "Arena before\n"
-                "continuing.");
-            widget_add_button_element(
-                widget,
-                GuiButtonTypeLeft,
-                "Cancel",
-                vb_migrate_scene_register_widget_callback,
-                inst);
-            widget_add_button_element(
-                widget,
-                GuiButtonTypeRight,
-                "Next",
-                vb_migrate_scene_register_widget_callback,
-                inst);
-
-            view_dispatcher_switch_to_view(inst->view_dispatcher, VbMigrateViewWidget);
-        } else if(state == RegisterStateInstructionConnect) {
-            widget_reset(widget);
-            vb_migrate_add_bg(widget, VbMigrateBgTypeLeftButton | VbMigrateBgTypeRightButton);
-            widget_add_text_scroll_element(
-                widget,
-                8,
-                16,
-                113,
-                33,
-                "Prepare VB Lab:\n"
-                "1. Ensure current\n"
-                "character in VB Lab has\n"
-                "been put in storage\n"
-                "2. Open the \"Scan\" screen\n"
-                "3. Tap \"Vital Bracelet ->\n"
-                "App\"\n"
-                "\n"
-                "Prepare VB Arena:\n"
-                "1. Select the device type\n"
-                "that matches your VB\n"
-                "2. Tap the \"Send\" button");
-            widget_add_button_element(
-                widget,
-                GuiButtonTypeLeft,
-                "Cancel",
-                vb_migrate_scene_register_widget_callback,
-                inst);
-            widget_add_button_element(
-                widget,
-                GuiButtonTypeRight,
-                "Next",
-                vb_migrate_scene_register_widget_callback,
-                inst);
-
-            view_dispatcher_switch_to_view(inst->view_dispatcher, VbMigrateViewWidget);
-        } else if(state == RegisterStateCaptureInitial) {
-            widget_reset(widget);
-            vb_migrate_add_bg(widget, VbMigrateBgTypeLeftButton);
-            widget_add_icon_element(widget, 11, 25, &I_CommVB_32x20);
-            widget_add_icon_element(widget, 21, 17, &I_CommWave_12x8);
-            widget_add_icon_element(widget, 48, 18, &I_TextRegister1_71x20);
-            widget_add_icon_element(widget, 105, 40, &I_PulsemonLeftStand_14x16);
-            widget_add_button_element(
-                widget,
-                GuiButtonTypeLeft,
-                "Previous",
-                vb_migrate_scene_register_widget_callback,
-                inst);
-
-            view_dispatcher_switch_to_view(inst->view_dispatcher, VbMigrateViewWidget);
-            nfc_device_clear(inst->nfc_dev);
-            inst->nfc_dev->dev_data.read_mode = NfcReadModeMfUltralight;
-            nfc_worker_start(
-                inst->worker,
-                NfcWorkerStateRead,
-                &inst->nfc_dev->dev_data,
-                vb_migrate_scene_register_worker_read_initial_callback,
-                inst);
-            vb_migrate_blink_read(inst);
-        } else if(state == RegisterStateCaptureInvalidTag) {
-            widget_reset(widget);
-            vb_migrate_add_bg(widget, VbMigrateBgTypeLeftButton);
-            widget_add_icon_element(widget, 11, 18, &I_WrongDevice_32x27);
-            widget_add_icon_element(widget, 48, 18, &I_TextRegisterErrNotVb_71x20);
-            widget_add_icon_element(widget, 104, 41, &I_PulsemonLeftWait_15x15);
-            widget_add_button_element(
-                widget,
-                GuiButtonTypeLeft,
-                "Retry",
-                vb_migrate_scene_register_widget_callback,
-                inst);
-
-            view_dispatcher_switch_to_view(inst->view_dispatcher, VbMigrateViewWidget);
-            notification_message(inst->notifications, &sequence_set_red_255);
-        } else if(state == RegisterStateCapturePwd) {
-            widget_reset(widget);
-            vb_migrate_add_bg(widget, VbMigrateBgTypeLeftButton);
-            widget_add_icon_element(widget, 11, 18, &I_AppInteract_32x27);
-            widget_add_icon_element(widget, 48, 18, &I_TextTapApp_56x27);
-            widget_add_icon_element(widget, 105, 40, &I_PulsemonLeftStand_14x16);
-            widget_add_button_element(
-                widget,
-                GuiButtonTypeLeft,
-                "Previous",
-                vb_migrate_scene_register_widget_callback,
-                inst);
-
-            view_dispatcher_switch_to_view(inst->view_dispatcher, VbMigrateViewWidget);
-
-            BantBlock* bant = vb_tag_get_bant_block(&inst->nfc_dev->dev_data);
-            vb_tag_set_operation(bant, VbTagOperationReady);
-            vb_tag_set_status(bant, VbTagStatusReady);
-            nfc_worker_start(
-                inst->worker,
-                NfcWorkerStateMfUltralightEmulate,
-                &inst->nfc_dev->dev_data,
-                vb_migrate_scene_register_worker_auth_callback,
-                inst);
-            vb_migrate_blink_emulate(inst);
-        } else if(state == RegisterStateCaptureFull) {
-            widget_reset(widget);
-            vb_migrate_add_bg(widget, VbMigrateBgTypeLeftButton);
-            widget_add_icon_element(widget, 11, 25, &I_CommVB_32x20);
-            widget_add_icon_element(widget, 23, 18, &I_CommReturn_10x8);
-            widget_add_icon_element(widget, 48, 18, &I_TextRegisterTapAgain_67x20);
-            widget_add_icon_element(widget, 104, 41, &I_PulsemonLeftWait_15x15);
-            widget_add_button_element(
-                widget,
-                GuiButtonTypeLeft,
-                "Previous",
-                vb_migrate_scene_register_widget_callback,
-                inst);
-
-            view_dispatcher_switch_to_view(inst->view_dispatcher, VbMigrateViewWidget);
-
-            inst->nfc_dev->dev_data.mf_ul_data.auth_method = MfUltralightAuthMethodAuto;
-            nfc_worker_start(
-                inst->worker,
-                NfcWorkerStateReadMfUltralightReadAuth,
-                &inst->nfc_dev->dev_data,
-                vb_migrate_scene_register_worker_full_capture_callback,
-                inst);
-            vb_migrate_blink_read(inst);
-        } else if(state == RegisterStateCaptureFailed) {
-            widget_reset(widget);
-            vb_migrate_add_bg(widget, VbMigrateBgTypeLeftButton);
-            widget_add_icon_element(widget, 11, 18, &I_WrongDevice_32x27);
-            widget_add_icon_element(widget, 48, 18, &I_TextErrReadFailed_71x20);
-            widget_add_icon_element(widget, 104, 41, &I_PulsemonLeftWait_15x15);
-            widget_add_button_element(
-                widget,
-                GuiButtonTypeLeft,
-                "Retry",
-                vb_migrate_scene_register_widget_callback,
-                inst);
-
-            view_dispatcher_switch_to_view(inst->view_dispatcher, VbMigrateViewWidget);
-            notification_message(inst->notifications, &sequence_set_red_255);
-        } else if(state == RegisterStateCaptureIncorrectTag) {
-            widget_reset(widget);
-            vb_migrate_add_bg(widget, VbMigrateBgTypeLeftButton);
-            widget_add_icon_element(widget, 11, 18, &I_WrongDevice_32x27);
-            widget_add_icon_element(widget, 48, 18, &I_TextErrRegisterDifferentTag_47x20);
-            widget_add_icon_element(widget, 104, 41, &I_PulsemonLeftWait_15x15);
-            widget_add_button_element(
-                widget,
-                GuiButtonTypeLeft,
-                "Retry",
-                vb_migrate_scene_register_widget_callback,
-                inst);
-
-            view_dispatcher_switch_to_view(inst->view_dispatcher, VbMigrateViewWidget);
-            notification_message(inst->notifications, &sequence_set_red_255);
-        } else {
-            furi_crash("Unknown new state in vb_migrate_scene_register_set_state");
-        }
-
-        scene_manager_set_scene_state(inst->scene_manager, VbMigrateSceneRegister, state);
-    }
-}
-
-static bool vb_migrate_scene_register_next_state(VbMigrate* inst, RegisterState state) {
-    if(state == RegisterStateInstructionInitial) {
-        vb_migrate_scene_register_set_state(inst, RegisterStateInstructionConnect);
-        return true;
-    } else if(state == RegisterStateInstructionConnect) {
-        vb_migrate_scene_register_set_state(inst, RegisterStateCaptureInitial);
-        return true;
-    }
-
-    return false;
-}
-
-static bool
-    vb_migrate_scene_register_prev_state(VbMigrate* inst, RegisterState state, bool is_back) {
-    UNUSED(is_back);
-
-    if(state == RegisterStateInstructionInitial || state == RegisterStateInstructionConnect) {
-        return scene_manager_previous_scene(inst->scene_manager);
-    } else if(state == RegisterStateCaptureInitial) {
-        vb_migrate_scene_register_set_state(inst, RegisterStateInstructionConnect);
-        return true;
-    } else if(
-        state == RegisterStateCaptureInvalidTag || state == RegisterStateCapturePwd ||
-        state == RegisterStateCaptureFull) {
-        vb_migrate_scene_register_set_state(inst, RegisterStateCaptureInitial);
-        return true;
-    } else if(state == RegisterStateCaptureFailed || state == RegisterStateCaptureIncorrectTag) {
-        vb_migrate_scene_register_set_state(inst, RegisterStateCaptureFull);
-        return true;
-    }
-
-    return is_back;
-}
-
-void vb_migrate_scene_register_on_enter(void* context) {
-    VbMigrate* inst = context;
-
-    scene_manager_set_scene_state(
-        inst->scene_manager, VbMigrateSceneRegister, RegisterStateInitial);
-    vb_migrate_scene_register_set_state(inst, RegisterStateInstructionInitial);
-}
-
-bool vb_migrate_scene_register_on_event(void* context, SceneManagerEvent event) {
-    VbMigrate* inst = context;
-    bool consumed = false;
-    RegisterState state =
-        scene_manager_get_scene_state(inst->scene_manager, VbMigrateSceneRegister);
-
-    if(event.type == SceneManagerEventTypeCustom) {
-        if(event.event == RegisterEventTypeNextButton) {
-            consumed = vb_migrate_scene_register_next_state(inst, state);
-        } else if(event.event == RegisterEventTypePrevButton) {
-            consumed = vb_migrate_scene_register_prev_state(inst, state, false);
-        } else if(event.event == RegisterEventTypeVbReadInitial) {
-            if(vb_tag_validate_product(&inst->nfc_dev->dev_data)) {
-                memcpy(
-                    inst->captured_uid,
-                    inst->nfc_dev->dev_data.nfc_data.uid,
-                    sizeof(inst->captured_uid));
-                notification_message(inst->notifications, &sequence_success);
-                vb_migrate_scene_register_set_state(inst, RegisterStateCapturePwd);
-            } else {
-                notification_message(inst->notifications, &sequence_error);
-                vb_migrate_scene_register_set_state(inst, RegisterStateCaptureInvalidTag);
-            }
-            consumed = true;
-        } else if(event.event == RegisterEventTypeVbPwdAuth) {
-            // Set up for auth
-            memcpy(
-                inst->captured_pwd,
-                inst->nfc_dev->dev_data.mf_ul_auth.pwd.raw,
-                sizeof(inst->captured_pwd));
-
-            notification_message(inst->notifications, &sequence_success);
-            vb_migrate_scene_register_set_state(inst, RegisterStateCaptureFull);
-            consumed = true;
-        } else if(event.event == RegisterEventTypeVbReadFullSuccess) {
-            NfcDeviceData* dev_data = &inst->nfc_dev->dev_data;
-            if(memcmp(dev_data->nfc_data.uid, inst->captured_uid, sizeof(inst->captured_uid)) ||
-               dev_data->mf_ul_data.data_read != dev_data->mf_ul_data.data_size) {
-                notification_message(inst->notifications, &sequence_error);
-                vb_migrate_scene_register_set_state(inst, RegisterStateCaptureIncorrectTag);
-            } else {
-                notification_message(inst->notifications, &sequence_success);
-                scene_manager_next_scene(inst->scene_manager, VbMigrateSceneRegisterSave);
-            }
-            consumed = true;
-        } else if(event.event == RegisterEventTypeVbReadFullFail) {
-            notification_message(inst->notifications, &sequence_error);
-            vb_migrate_scene_register_set_state(inst, RegisterStateCaptureFailed);
-            consumed = true;
-        } else {
-            furi_crash("Unknown event in vb_migrate_scene_register_on_event");
-        }
-    } else if(event.type == SceneManagerEventTypeBack) {
-        consumed = vb_migrate_scene_register_prev_state(inst, state, true);
-    }
-    return consumed;
-}
-
-void vb_migrate_scene_register_on_exit(void* context) {
-    VbMigrate* inst = context;
-    RegisterState state =
-        scene_manager_get_scene_state(inst->scene_manager, VbMigrateSceneRegister);
-
-    vb_migrate_scene_register_cleanup_state(inst, state);
-    widget_reset(inst->widget);
-}

+ 0 - 119
apps_broken_by_last_refactors/flipperzero_vb_migrate/scenes/vb_migrate_scene_register_save.c

@@ -1,119 +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/>.
-
-#include <notification/notification_messages.h>
-
-#include "../vb_migrate_i.h"
-#include "../vb_tag.h"
-
-// This thing doesn't know what a FuriString is
-#include <gui/modules/validators.h>
-
-typedef enum {
-    RegisterSaveEventTextInput,
-} RegisterSaveEvent;
-
-static void vb_migrate_scene_register_save_text_input_callback(void* context) {
-    VbMigrate* inst = context;
-
-    view_dispatcher_send_custom_event(inst->view_dispatcher, RegisterSaveEventTextInput);
-}
-
-void vb_migrate_scene_register_save_on_enter(void* context) {
-    VbMigrate* inst = context;
-
-    // Setup view
-    TextInput* text_input = inst->text_input;
-    text_input_set_header_text(text_input, "Name this Vital Bracelet");
-    text_input_set_result_callback(
-        text_input,
-        vb_migrate_scene_register_save_text_input_callback,
-        inst,
-        inst->text_store,
-        VB_MIGRATE_MAX_DEV_NAME_LENGTH,
-        true);
-
-    // Set default name
-    FuriString* temp_str;
-    NfcDeviceData* dev_data = &inst->nfc_dev->dev_data;
-    BantBlock* bant = vb_tag_get_bant_block(dev_data);
-    const VbTagProduct* prod = vb_tag_find_product(bant);
-    temp_str = furi_string_alloc_printf("%s_", prod->short_name);
-    for(size_t i = 0; i < dev_data->nfc_data.uid_len; ++i) {
-        furi_string_cat_printf(temp_str, "%02x", dev_data->nfc_data.uid[i]);
-    }
-    vb_migrate_text_store_set(inst, furi_string_get_cstr(temp_str));
-    furi_string_free(temp_str);
-
-    // We're validating whether folder exists
-    ValidatorIsFile* validator_is_file =
-        validator_is_file_alloc_init(VB_MIGRATE_FOLDER, "/" VB_MIGRATE_TEMPLATE_NAME, NULL);
-    text_input_set_validator(text_input, validator_is_file_callback, validator_is_file);
-
-    view_dispatcher_switch_to_view(inst->view_dispatcher, VbMigrateViewTextInput);
-    notification_message(inst->notifications, &sequence_set_green_255);
-}
-
-bool vb_migrate_scene_register_save_on_event(void* context, SceneManagerEvent event) {
-    VbMigrate* inst = context;
-    bool consumed = false;
-
-    if(event.type == SceneManagerEventTypeCustom) {
-        if(event.event == RegisterSaveEventTextInput) {
-            if(strlen(inst->text_store) != 0) {
-                vb_migrate_show_loading_popup(inst, true);
-                if(vb_migrate_save_nfc(inst, inst->text_store, VB_MIGRATE_TEMPLATE_NAME)) {
-                    inst->num_captured = 0;
-
-                    BantBlock* bant = vb_tag_get_bant_block(&inst->nfc_dev->dev_data);
-                    const VbTagProduct* product = vb_tag_find_product(bant);
-                    inst->orig_product = product;
-                    if(product) {
-                        inst->orig_type = product->type;
-                    } else {
-                        inst->orig_type = VbTagTypeUnknown;
-                    }
-                    inst->override_type = inst->orig_type;
-
-                    // Go to success
-                    scene_manager_next_scene(inst->scene_manager, VbMigrateSceneSaveSuccess);
-                } else {
-                    // Otherwise just stay here
-                    view_dispatcher_switch_to_view(inst->view_dispatcher, VbMigrateViewTextInput);
-                }
-                vb_migrate_show_loading_popup(inst, false);
-
-                consumed = true;
-            }
-        }
-    }
-    return consumed;
-}
-
-void vb_migrate_scene_register_save_on_exit(void* context) {
-    VbMigrate* inst = context;
-
-    // Clear view
-    TextInput* text_input = inst->text_input;
-    ValidatorIsFile* validator = text_input_get_validator_callback_context(text_input);
-    text_input_set_validator(text_input, NULL, NULL);
-    validator_is_file_free(validator);
-
-    text_input_reset(text_input);
-    notification_message_block(inst->notifications, &sequence_reset_green);
-}

+ 0 - 64
apps_broken_by_last_refactors/flipperzero_vb_migrate/scenes/vb_migrate_scene_save_success.c

@@ -1,64 +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/>.
-
-#include "../vb_migrate_i.h"
-
-static void vb_migrate_scene_save_success_widget_callback(
-    GuiButtonType result,
-    InputType type,
-    void* context) {
-    VbMigrate* inst = context;
-
-    if(type == InputTypeShort) {
-        if(result == GuiButtonTypeRight)
-            view_dispatcher_send_custom_event(inst->view_dispatcher, 0);
-    }
-}
-
-void vb_migrate_scene_save_success_on_enter(void* context) {
-    VbMigrate* inst = context;
-
-    // Setup view
-    Widget* widget = inst->widget;
-    vb_migrate_add_bg(widget, VbMigrateBgTypeRightButton);
-    widget_add_icon_element(widget, 11, 18, &I_CommComplete_32x20);
-    widget_add_icon_element(widget, 48, 18, &I_TextSaved_30x6);
-    widget_add_icon_element(widget, 9, 40, &I_PulsemonRightHappy_14x16);
-    widget_add_button_element(
-        widget, GuiButtonTypeRight, "OK", vb_migrate_scene_save_success_widget_callback, inst);
-
-    view_dispatcher_switch_to_view(inst->view_dispatcher, VbMigrateViewWidget);
-}
-
-bool vb_migrate_scene_save_success_on_event(void* context, SceneManagerEvent event) {
-    VbMigrate* inst = context;
-    bool consumed = false;
-
-    if(event.type == SceneManagerEventTypeCustom || event.type == SceneManagerEventTypeBack) {
-        scene_manager_next_scene(inst->scene_manager, VbMigrateSceneInfo);
-        consumed = true;
-    }
-    return consumed;
-}
-
-void vb_migrate_scene_save_success_on_exit(void* context) {
-    VbMigrate* inst = context;
-
-    // Clear view
-    widget_reset(inst->widget);
-}

+ 0 - 57
apps_broken_by_last_refactors/flipperzero_vb_migrate/scenes/vb_migrate_scene_select.c

@@ -1,57 +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/>.
-
-#include "../vb_migrate_i.h"
-
-static void vb_migrate_scene_select_file_select_callback(bool result, void* context) {
-    VbMigrate* inst = context;
-
-    view_dispatcher_send_custom_event(inst->view_dispatcher, result);
-}
-
-void vb_migrate_scene_select_on_enter(void* context) {
-    VbMigrate* inst = context;
-
-    // Perform your setup here
-    file_select_set_callback(
-        inst->file_select, vb_migrate_scene_select_file_select_callback, inst);
-    file_select_set_filter(inst->file_select, VB_MIGRATE_FOLDER, "*");
-    file_select_set_result_buffer(inst->file_select, inst->text_store, sizeof(inst->text_store));
-    file_select_init(inst->file_select);
-
-    view_dispatcher_switch_to_view(inst->view_dispatcher, VbMigrateViewFileSelect);
-}
-
-bool vb_migrate_scene_select_on_event(void* context, SceneManagerEvent event) {
-    VbMigrate* inst = context;
-    bool consumed = false;
-    UNUSED(inst);
-
-    if(event.type == SceneManagerEventTypeCustom) {
-        if(event.event) {
-            // File selected
-            scene_manager_next_scene(inst->scene_manager, VbMigrateSceneLoad);
-            consumed = true;
-        }
-    }
-    return consumed;
-}
-
-void vb_migrate_scene_select_on_exit(void* context) {
-    UNUSED(context);
-}

Некоторые файлы не были показаны из-за большого количества измененных файлов