seos_credential.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. #pragma once
  2. #include <furi.h>
  3. #include <storage/storage.h>
  4. #include <dialogs/dialogs.h>
  5. #include <lib/toolbox/path.h>
  6. #include <lib/flipper_format/flipper_format.h>
  7. /* generated by fbt from .png files in images folder */
  8. #include <seos_icons.h>
  9. #include "seos.h"
  10. #include "seos_common.h"
  11. typedef void (*SeosLoadingCallback)(void* context, bool state);
  12. typedef struct {
  13. uint8_t diversifier[16];
  14. size_t diversifier_len;
  15. uint8_t sio[128];
  16. size_t sio_len;
  17. uint8_t priv_key[16];
  18. uint8_t auth_key[16];
  19. size_t adf_oid_len;
  20. uint8_t adf_oid[32];
  21. uint8_t adf_response[80];
  22. char name[SEOS_FILE_NAME_MAX_LENGTH + 1];
  23. FuriString* load_path;
  24. SeosLoadingCallback loading_cb;
  25. void* loading_cb_ctx;
  26. Storage* storage;
  27. DialogsApp* dialogs;
  28. enum {
  29. SeosLoadSeos,
  30. SeosLoadSeader
  31. } load_type;
  32. } SeosCredential;
  33. SeosCredential* seos_credential_alloc();
  34. void seos_credential_free(SeosCredential* seos_credential);
  35. bool seos_credential_save(SeosCredential* seos_credential, const char* dev_name);
  36. bool seos_credential_clear(SeosCredential* seos_credential);
  37. bool seos_credential_file_select(SeosCredential* seos_credential);
  38. void seos_credential_set_loading_callback(
  39. SeosCredential* seos_credential,
  40. SeosLoadingCallback callback,
  41. void* context);
  42. bool seos_credential_delete(SeosCredential* seos_credential, bool use_load_path);