continuity.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. #pragma once
  2. #include <stdint.h>
  3. #include <stdlib.h>
  4. // Hacked together by @Willy-JL
  5. // Custom adv logic by @Willy-JL (idea by @xMasterX)
  6. // iOS 17 Crash by @ECTO-1A
  7. // Extensive testing and research on behavior and parameters by @Willy-JL and @ECTO-1A
  8. // Structures docs and Nearby Action IDs from https://github.com/furiousMAC/continuity/
  9. // Proximity Pair IDs from https://github.com/ECTO-1A/AppleJuice/
  10. // Controversy explained at https://willyjl.dev/blog/the-controversy-behind-apple-ble-spam
  11. typedef enum {
  12. ContinuityTypeAirDrop = 0x05,
  13. ContinuityTypeProximityPair = 0x07,
  14. ContinuityTypeAirplayTarget = 0x09,
  15. ContinuityTypeHandoff = 0x0C,
  16. ContinuityTypeTetheringSource = 0x0E,
  17. ContinuityTypeNearbyAction = 0x0F,
  18. ContinuityTypeNearbyInfo = 0x10,
  19. ContinuityTypeCustomCrash,
  20. ContinuityTypeCount
  21. } ContinuityType;
  22. typedef union {
  23. struct {
  24. } airdrop;
  25. struct {
  26. uint8_t prefix;
  27. uint16_t model;
  28. } proximity_pair;
  29. struct {
  30. } airplay_target;
  31. struct {
  32. } handoff;
  33. struct {
  34. } tethering_source;
  35. struct {
  36. uint8_t flags;
  37. uint8_t type;
  38. } nearby_action;
  39. struct {
  40. } nearby_info;
  41. struct {
  42. } custom_crash;
  43. } ContinuityData;
  44. typedef struct {
  45. ContinuityType type;
  46. ContinuityData data;
  47. } ContinuityMsg;
  48. const char* continuity_get_type_name(ContinuityType type);
  49. uint8_t continuity_get_packet_size(ContinuityType type);
  50. void continuity_generate_packet(const ContinuityMsg* msg, uint8_t* packet);