seos_credential.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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. bool use_hardcoded;
  23. char name[SEOS_FILE_NAME_MAX_LENGTH + 1];
  24. FuriString* load_path;
  25. SeosLoadingCallback loading_cb;
  26. void* loading_cb_ctx;
  27. Storage* storage;
  28. DialogsApp* dialogs;
  29. enum {
  30. SeosLoadSeos,
  31. SeosLoadSeader
  32. } load_type;
  33. } SeosCredential;
  34. SeosCredential* seos_credential_alloc();
  35. void seos_credential_free(SeosCredential* seos_credential);
  36. bool seos_credential_save(SeosCredential* seos_credential, const char* dev_name);
  37. bool seos_credential_clear(SeosCredential* seos_credential);
  38. bool seos_credential_file_select(SeosCredential* seos_credential);
  39. void seos_credential_set_loading_callback(
  40. SeosCredential* seos_credential,
  41. SeosLoadingCallback callback,
  42. void* context);
  43. bool seos_credential_delete(SeosCredential* seos_credential, bool use_load_path);