Compare commits
43 Commits
Kordophone
...
kordophone
| Author | SHA1 | Date | |
|---|---|---|---|
| 7cceb5b92d | |||
| 3f03937ca4 | |||
| d706435103 | |||
| e1ec237053 | |||
| a9c2f5d93e | |||
| 1dc6f0ec1b | |||
| e97edc10b7 | |||
| 283e6c2218 | |||
| f040b95827 | |||
| 7352efbcfd | |||
| 78eb946109 | |||
| 1a5bb874dc | |||
| 7339b49759 | |||
| 95c2e855dd | |||
|
|
d0e1f51b6b | ||
| 9007b4503f | |||
| 030e86e205 | |||
|
|
b7312bccb9 | ||
| 58c84f6472 | |||
| 413fe338ca | |||
| 72527088cc | |||
| c65803845b | |||
|
|
147dc15d1d | ||
|
|
87d65e294b | ||
| b92c683a0e | |||
|
|
37ff0b375f | ||
|
|
d071e68a56 | ||
|
|
2f5d50188b | ||
|
|
56ae7982c6 | ||
|
|
bc9e4f52b4 | ||
|
|
3082c4ab19 | ||
| ba8f76f4bd | |||
|
|
e5b78d62f0 | ||
|
|
3ca9abcccd | ||
|
|
cad3425327 | ||
|
|
83ba072a9d | ||
|
|
bd01480ad6 | ||
|
|
c7087a394e | ||
| ebad248c1c | |||
| e161eedef3 | |||
| 7a3303da06 | |||
| 641e4c53fa | |||
|
|
4d51ba7dd2 |
@@ -1754,10 +1754,13 @@ __attribute__((visibility("default"))) @interface IMService : NSObject { }
|
|||||||
@property(nonatomic) BOOL chatInScrutinyMode; // @synthesize chatInScrutinyMode=_chatInScrutinyMode;
|
@property(nonatomic) BOOL chatInScrutinyMode; // @synthesize chatInScrutinyMode=_chatInScrutinyMode;
|
||||||
@property(readonly, nonatomic) NSArray *messageEditChatItems; // @synthesize messageEditChatItems=_messageEditChatItems;
|
@property(readonly, nonatomic) NSArray *messageEditChatItems; // @synthesize messageEditChatItems=_messageEditChatItems;
|
||||||
@property(retain, nonatomic, setter=_setVisibleAssociatedMessageChatItems:) NSArray *visibleAssociatedMessageChatItems; // @synthesize visibleAssociatedMessageChatItems=_visibleAssociatedMessageChatItems;
|
@property(retain, nonatomic, setter=_setVisibleAssociatedMessageChatItems:) NSArray *visibleAssociatedMessageChatItems; // @synthesize visibleAssociatedMessageChatItems=_visibleAssociatedMessageChatItems;
|
||||||
@property(nonatomic) struct _NSRange messagePartRange; // @synthesize messagePartRange=_messagePartRange;
|
|
||||||
@property(nonatomic) long long index; // @synthesize index=_index;
|
@property(nonatomic) long long index; // @synthesize index=_index;
|
||||||
@property(readonly, copy, nonatomic) NSAttributedString *text; // @synthesize text=_text;
|
@property(readonly, copy, nonatomic) NSAttributedString *text; // @synthesize text=_text;
|
||||||
|
|
||||||
|
@property (nonatomic, copy, readonly) NSString *threadIdentifier;
|
||||||
|
@property(nonatomic) struct _NSRange messagePartRange; // @synthesize messagePartRange=_messagePartRange;
|
||||||
|
|
||||||
|
|
||||||
- (BOOL)canSendMessageAcknowledgment;
|
- (BOOL)canSendMessageAcknowledgment;
|
||||||
- (void)_setMessageEditChatItems:(id)arg1;
|
- (void)_setMessageEditChatItems:(id)arg1;
|
||||||
- (id)_initWithItem:(id)arg1 text:(id)arg2 index:(long long)arg3 messagePartRange:(struct _NSRange)arg4 visibleAssociatedMessageChatItems:(id)arg5;
|
- (id)_initWithItem:(id)arg1 text:(id)arg2 index:(long long)arg3 messagePartRange:(struct _NSRange)arg4 visibleAssociatedMessageChatItems:(id)arg5;
|
||||||
@@ -3457,6 +3460,7 @@ __attribute__((visibility("default"))) @interface IMService : NSObject { }
|
|||||||
- (id)loadUnreadMessagesWithLimit:(unsigned long long)arg1 fallbackToMessagesUpToGUID:(id)arg2;
|
- (id)loadUnreadMessagesWithLimit:(unsigned long long)arg1 fallbackToMessagesUpToGUID:(id)arg2;
|
||||||
- (id)loadFrequentRepliesLimit:(unsigned long long)arg1 loadImmediately:(BOOL)arg2;
|
- (id)loadFrequentRepliesLimit:(unsigned long long)arg1 loadImmediately:(BOOL)arg2;
|
||||||
- (id)loadMessagesBeforeAndAfterGUID:(id)arg1 numberOfMessagesToLoadBeforeGUID:(unsigned long long)arg2 numberOfMessagesToLoadAfterGUID:(unsigned long long)arg3 loadImmediately:(BOOL)arg4;
|
- (id)loadMessagesBeforeAndAfterGUID:(id)arg1 numberOfMessagesToLoadBeforeGUID:(unsigned long long)arg2 numberOfMessagesToLoadAfterGUID:(unsigned long long)arg3 loadImmediately:(BOOL)arg4;
|
||||||
|
- (id)loadMessagesBeforeAndAfterGUID:(id)arg1 numberOfMessagesToLoadBeforeGUID:(unsigned long long)arg2 numberOfMessagesToLoadAfterGUID:(unsigned long long)arg3 loadImmediately:(BOOL)arg4 threadIdentifier:(id)tid;
|
||||||
- (id)loadMessagesUpToGUID:(id)arg1 date:(id)arg2 limit:(unsigned long long)arg3 loadImmediately:(BOOL)arg4;
|
- (id)loadMessagesUpToGUID:(id)arg1 date:(id)arg2 limit:(unsigned long long)arg3 loadImmediately:(BOOL)arg4;
|
||||||
- (id)loadMessagesBeforeDate:(id)arg1 limit:(unsigned long long)arg2 loadImmediately:(BOOL)arg3;
|
- (id)loadMessagesBeforeDate:(id)arg1 limit:(unsigned long long)arg2 loadImmediately:(BOOL)arg3;
|
||||||
- (id)loadMessagesBeforeDate:(id)arg1 limit:(unsigned long long)arg2;
|
- (id)loadMessagesBeforeDate:(id)arg1 limit:(unsigned long long)arg2;
|
||||||
@@ -3679,6 +3683,68 @@ __attribute__((visibility("default"))) @interface IMService : NSObject { }
|
|||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
typedef NS_ENUM(NSInteger, IMMessageDescriptionType) {
|
||||||
|
IMMessageDescriptionAccessibility,
|
||||||
|
IMMessageDescriptionAcknowledgement,
|
||||||
|
IMMessageDescriptionConversationList,
|
||||||
|
IMMessageDescriptionNotification,
|
||||||
|
IMMessageDescriptionSiri,
|
||||||
|
IMMessageDescriptionSPI,
|
||||||
|
};
|
||||||
|
|
||||||
|
typedef NS_ENUM(int64_t, IMAssociatedMessageType) {
|
||||||
|
IMAssociatedMessageTypeUnspecified = 0,
|
||||||
|
|
||||||
|
IMAssociatedMessageTypeBreadcrumbUnconsumed = 2,
|
||||||
|
IMAssociatedMessageTypeBreadcrumbConsumed = 3,
|
||||||
|
IMAssociatedMessageTypeSticker = 1000,
|
||||||
|
IMAssociatedMessageTypeEmojiSticker = 1001,
|
||||||
|
|
||||||
|
IMAssociatedMessageTypeAcknowledgmentHeart = 2000,
|
||||||
|
IMAssociatedMessageTypeAcknowledgmentThumbsUp = 2001,
|
||||||
|
IMAssociatedMessageTypeAcknowledgmentThumbsDown = 2002,
|
||||||
|
IMAssociatedMessageTypeAcknowledgmentHa = 2003,
|
||||||
|
IMAssociatedMessageTypeAcknowledgmentExclamation = 2004,
|
||||||
|
IMAssociatedMessageTypeAcknowledgmentQuestionMark = 2005,
|
||||||
|
|
||||||
|
IMAssociatedMessageTypeAcknowledgmentHeartRemoved = 3000,
|
||||||
|
IMAssociatedMessageTypeAcknowledgmentThumbsUpRemoved = 3001,
|
||||||
|
IMAssociatedMessageTypeAcknowledgmentThumbsDownRemoved = 3002,
|
||||||
|
IMAssociatedMessageTypeAcknowledgmentHaRemoved = 3003,
|
||||||
|
IMAssociatedMessageTypeAcknowledgmentExclamationRemoved = 3004,
|
||||||
|
IMAssociatedMessageTypeAcknowledgmentQuestionMarkRemoved = 3005,
|
||||||
|
};
|
||||||
|
|
||||||
|
extern NSString * const IMMessageSummaryInfoSummary;
|
||||||
|
extern NSString * const IMMessageSummaryInfoContentType;
|
||||||
|
extern NSString * const IMMessageSummaryInfoPluginBundleID;
|
||||||
|
extern NSString * const IMMessageSummaryInfoPluginDisplayName;
|
||||||
|
extern NSString * const IMMessageSummaryInfoAssociatedBalloonBundleID;
|
||||||
|
extern NSString * const IMMessageSummaryInfoSourceApplicationID;
|
||||||
|
extern NSString * const IMMessageSummaryInfoUpdatedDateWithServerTime;
|
||||||
|
extern NSString * const IMMessageSummaryInfoHasBeenRetried;
|
||||||
|
extern NSString * const IMMessageSummaryInfoTapbackRepresentationKey;
|
||||||
|
extern NSString * const IMMessageSummaryInfoStickerRepositioningKey;
|
||||||
|
extern NSString * const IMMessageSummaryInfoTranscriptSharingMessageTypeKey;
|
||||||
|
extern NSString * const IMMessageSummaryInfoTranscriptSharingMessageFirstItemKey;
|
||||||
|
extern NSString * const IMMessageSummaryInfoEditedPartIndexes;
|
||||||
|
extern NSString * const IMMessageSummaryInfoRetractedPartIndexes;
|
||||||
|
extern NSString * const IMMessageSummaryInfoOriginalTextRangesByPartIndex;
|
||||||
|
extern NSString * const IMMessageSummaryInfoOriginalTextRangeLocationSubKey;
|
||||||
|
extern NSString * const IMMessageSummaryInfoOriginalTextRangeLengthSubKey;
|
||||||
|
extern NSString * const IMMessageSummaryInfoEditDeliveryFailedForPartIndexes;
|
||||||
|
extern NSString * const IMMessageSummaryInfoRetractDeliveryFailedForPartIndexes;
|
||||||
|
extern NSString * const IMMessageSummaryInfoEditUnsupportedByHandleIDs;
|
||||||
|
extern NSString * const IMMessageSummaryInfoTranslatedText;
|
||||||
|
extern NSString * const IMMessageSummaryInfoDetectedLanguage;
|
||||||
|
extern NSString * const IMMessageSummaryInfoCMMState;
|
||||||
|
extern NSString * const IMMessageSummaryInfoCMMAssetOffset;
|
||||||
|
extern NSString * const IMMessageItemErrorDomain;
|
||||||
|
extern NSString * const IMMessageSentDistributedNotification;
|
||||||
|
extern NSString * const IMMessageSentDistributedNotificationUserInfoMessageGUIDKey;
|
||||||
|
extern NSString * const IMMessageSentDistributedNotificationUserInfoSucessKey;
|
||||||
|
|
||||||
|
|
||||||
@interface IMMessage : NSObject <NSCopying>
|
@interface IMMessage : NSObject <NSCopying>
|
||||||
{
|
{
|
||||||
IMHandle *_sender;
|
IMHandle *_sender;
|
||||||
@@ -3734,6 +3800,22 @@ __attribute__((visibility("default"))) @interface IMService : NSObject { }
|
|||||||
+ (id)breadcrumbMessageWithText:(id)arg1 associatedMessageGUID:(id)arg2 balloonBundleID:(id)arg3 fileTransferGUIDs:(id)arg4 payloadData:(id)arg5;
|
+ (id)breadcrumbMessageWithText:(id)arg1 associatedMessageGUID:(id)arg2 balloonBundleID:(id)arg3 fileTransferGUIDs:(id)arg4 payloadData:(id)arg5;
|
||||||
+ (id)editedMessageWithOriginalMessage:(id)arg1 originalPrefixedGUID:(id)arg2 newBody:(id)arg3;
|
+ (id)editedMessageWithOriginalMessage:(id)arg1 originalPrefixedGUID:(id)arg2 newBody:(id)arg3;
|
||||||
+ (id)instantMessageWithAssociatedMessageContent:(id)arg1 flags:(unsigned long long)arg2 associatedMessageGUID:(id)arg3 associatedMessageType:(long long)arg4 associatedMessageRange:(struct _NSRange)arg5 messageSummaryInfo:(id)arg6;
|
+ (id)instantMessageWithAssociatedMessageContent:(id)arg1 flags:(unsigned long long)arg2 associatedMessageGUID:(id)arg3 associatedMessageType:(long long)arg4 associatedMessageRange:(struct _NSRange)arg5 messageSummaryInfo:(id)arg6;
|
||||||
|
|
||||||
|
+ (instancetype)instantMessageWithAssociatedMessageContent:(NSAttributedString *) content
|
||||||
|
flags:(IMMessageFlags)flags
|
||||||
|
associatedMessageGUID:(NSString*) associatedMessageGUID
|
||||||
|
associatedMessageType:(IMAssociatedMessageType) associatedMessageType
|
||||||
|
associatedMessageRange:(NSRange) associatedMessageRange
|
||||||
|
messageSummaryInfo:(NSDictionary*) messageSummaryInfo
|
||||||
|
threadIdentifier:(NSString *)threadIdentifier;
|
||||||
|
|
||||||
|
+ (instancetype)breadcrumbMessageWithText:(NSAttributedString *)text
|
||||||
|
associatedMessageGUID:(NSString *)messageGUID
|
||||||
|
balloonBundleID:(NSString *)balloonBundleID
|
||||||
|
fileTransferGUIDs:(NSArray<NSString *> *)fileTransferGUIDs
|
||||||
|
payloadData:(NSData *)payloadData
|
||||||
|
threadIdentifier:(NSString *)threadIdentifier;
|
||||||
|
|
||||||
@property(nonatomic) unsigned long long sortID; // @synthesize sortID=_sortID;
|
@property(nonatomic) unsigned long long sortID; // @synthesize sortID=_sortID;
|
||||||
@property(nonatomic) BOOL isSOS; // @synthesize isSOS=_isSOS;
|
@property(nonatomic) BOOL isSOS; // @synthesize isSOS=_isSOS;
|
||||||
@property(retain, nonatomic) NSString *notificationIDSTokenURI; // @synthesize notificationIDSTokenURI=_notificationIDSTokenURI;
|
@property(retain, nonatomic) NSString *notificationIDSTokenURI; // @synthesize notificationIDSTokenURI=_notificationIDSTokenURI;
|
||||||
@@ -3803,8 +3885,8 @@ __attribute__((visibility("default"))) @interface IMService : NSObject { }
|
|||||||
- (id)_initWithSender:(id)arg1 time:(id)arg2 timeRead:(id)arg3 timeDelivered:(id)arg4 timePlayed:(id)arg5 plainText:(id)arg6 text:(id)arg7 messageSubject:(id)arg8 fileTransferGUIDs:(id)arg9 flags:(unsigned long long)arg10 error:(id)arg11 guid:(id)arg12 messageID:(long long)arg13 subject:(id)arg14 balloonBundleID:(id)arg15 payloadData:(id)arg16 expressiveSendStyleID:(id)arg17 timeExpressiveSendPlayed:(id)arg18 associatedMessageGUID:(id)arg19 associatedMessageType:(long long)arg20 associatedMessageRange:(struct _NSRange)arg21 messageSummaryInfo:(id)arg22;
|
- (id)_initWithSender:(id)arg1 time:(id)arg2 timeRead:(id)arg3 timeDelivered:(id)arg4 timePlayed:(id)arg5 plainText:(id)arg6 text:(id)arg7 messageSubject:(id)arg8 fileTransferGUIDs:(id)arg9 flags:(unsigned long long)arg10 error:(id)arg11 guid:(id)arg12 messageID:(long long)arg13 subject:(id)arg14 balloonBundleID:(id)arg15 payloadData:(id)arg16 expressiveSendStyleID:(id)arg17 timeExpressiveSendPlayed:(id)arg18 associatedMessageGUID:(id)arg19 associatedMessageType:(long long)arg20 associatedMessageRange:(struct _NSRange)arg21 messageSummaryInfo:(id)arg22;
|
||||||
- (id)_copyWithFlags:(unsigned long long)arg1;
|
- (id)_copyWithFlags:(unsigned long long)arg1;
|
||||||
- (id)copyWithZone:(struct _NSZone *)arg1;
|
- (id)copyWithZone:(struct _NSZone *)arg1;
|
||||||
- (id)descriptionForPurpose:(long long)arg1 inChat:(id)arg2;
|
- (id)descriptionForPurpose:(IMMessageDescriptionType)arg1 inChat:(id)arg2;
|
||||||
- (id)descriptionForPurpose:(long long)arg1;
|
- (id)descriptionForPurpose:(IMMessageDescriptionType)arg1;
|
||||||
- (void)_ovverrideGUIDForTest:(id)arg1;
|
- (void)_ovverrideGUIDForTest:(id)arg1;
|
||||||
@property(readonly, nonatomic) BOOL isAssociatedMessage;
|
@property(readonly, nonatomic) BOOL isAssociatedMessage;
|
||||||
- (id)initWithSender:(id)arg1 time:(id)arg2 text:(id)arg3 messageSubject:(id)arg4 fileTransferGUIDs:(id)arg5 flags:(unsigned long long)arg6 error:(id)arg7 guid:(id)arg8 subject:(id)arg9 associatedMessageGUID:(id)arg10 associatedMessageType:(long long)arg11 associatedMessageRange:(struct _NSRange)arg12 associatedMessageInfo:(id)arg13;
|
- (id)initWithSender:(id)arg1 time:(id)arg2 text:(id)arg3 messageSubject:(id)arg4 fileTransferGUIDs:(id)arg5 flags:(unsigned long long)arg6 error:(id)arg7 guid:(id)arg8 subject:(id)arg9 associatedMessageGUID:(id)arg10 associatedMessageType:(long long)arg11 associatedMessageRange:(struct _NSRange)arg12 associatedMessageInfo:(id)arg13;
|
||||||
@@ -4079,6 +4161,30 @@ __attribute__((visibility("default"))) @interface IMService : NSObject { }
|
|||||||
@property(readonly) unsigned long long hash;
|
@property(readonly) unsigned long long hash;
|
||||||
@property(readonly) Class superclass;
|
@property(readonly) Class superclass;
|
||||||
|
|
||||||
|
- (IMChat *)chatWithHandle:(IMHandle *)handle;
|
||||||
|
- (IMChat *)chatWithHandle:(IMHandle *)handle lastAddressedHandle:( NSString *)lastAddressedHandle lastAddressedSIMID:( NSString *)lastAddressedSIMID;
|
||||||
|
- (IMChat *)chatWithHandles:(NSArray<IMHandle *> *)handles;
|
||||||
|
- (IMChat *)chatWithHandles:(NSArray<IMHandle *> *)handles lastAddressedHandle:( NSString *)lastAddressedHandle lastAddressedSIMID:( NSString *)lastAddressedSIMID;
|
||||||
|
- (IMChat *)chatWithHandles:(NSArray<IMHandle *> *)handles displayName:( NSString *)displayName joinedChatsOnly:(BOOL)joinedChatsOnly;
|
||||||
|
- (IMChat *)chatWithHandles:(NSArray<IMHandle *> *)handles displayName:( NSString *)displayName joinedChatsOnly:(BOOL)joinedChatsOnly lastAddressedHandle:( NSString *)lastAddressedHandle lastAddressedSIMID:( NSString *)lastAddressedSIMID;
|
||||||
|
|
||||||
|
- (NSArray<NSString *> *)allGUIDsForChat:(IMChat *)chat;
|
||||||
|
- ( IMChat *)existingChatWithHandle:(IMHandle *)handle;
|
||||||
|
- ( IMChat *)existingChatWithHandle:(IMHandle *)handle allowAlternativeService:(BOOL)allowAlternativeService;
|
||||||
|
- ( IMChat *)existingChatWithHandles:(NSArray<IMHandle *> *)handles;
|
||||||
|
- ( IMChat *)existingChatWithHandles:(NSArray<IMHandle *> *)handles allowAlternativeService:(BOOL)allowAlternativeService;
|
||||||
|
- ( IMChat *)existingChatWithHandles:(NSArray<IMHandle *> *)handles allowAlternativeService:(BOOL)allowAlternativeService groupID:(NSString *)groupID;
|
||||||
|
- ( IMChat *)existingChatWithHandles:(NSArray *)handles allowAlternativeService:(BOOL)allowAlternativeService groupID:( NSString *)groupID displayName:( NSString *)displayName joinedChatsOnly:(BOOL)joinedChatsOnly;
|
||||||
|
// - ( IMChat *)existingChatWithGUID:(NSString *)guid;
|
||||||
|
- ( IMChat *)existingChatWithPinningIdentifier:(NSString *)pinningIdentifier;
|
||||||
|
- ( IMChat *)existingChatWithDeviceIndependentID:(NSString *)deviceIndependentID;
|
||||||
|
// - ( IMChat *)existingChatWithChatIdentifier:(NSString *)identifier;
|
||||||
|
- ( IMChat *)existingChatWithPersonID:(NSString *)personID;
|
||||||
|
// - ( IMChat *)existingChatWithGroupID:(NSString *)groupID;
|
||||||
|
// - ( IMChat *)existingChatWithDisplayName:(NSString *)displayName;
|
||||||
|
- ( IMChat *)existingChatWithAddresses:(NSArray<NSString *> *)addresses allowAlternativeService:(BOOL)allowAlternativeService bestHandles:(NSArray<IMHandle *> * __autoreleasing*)outBestHandles;
|
||||||
|
- ( IMChat *)existingChatWithContacts:(NSSet /* <CNContact *> */ *)contacts bestHandles:(NSArray<IMHandle *> * __autoreleasing * )outBestHandles;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@interface IMSimulatedChat : IMChat // <IMSimulatedChatDelegate, IMSimulatedDaemonListener>
|
@interface IMSimulatedChat : IMChat // <IMSimulatedChatDelegate, IMSimulatedDaemonListener>
|
||||||
@@ -4974,3 +5080,66 @@ __attribute__((visibility("default"))) @interface IMService : NSObject { }
|
|||||||
- (struct __CFArray *)copyDDResultArrayByScanningStringForURLs;
|
- (struct __CFArray *)copyDDResultArrayByScanningStringForURLs;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
|
typedef NS_ENUM(NSInteger, FZIDType) {
|
||||||
|
FZUnknownIDType = -1,
|
||||||
|
FZPhoneNumberBasedID = 0,
|
||||||
|
FZEmailBasedID = 1,
|
||||||
|
FZDSBasedID = 2,
|
||||||
|
FZBusinessBasedID = 3,
|
||||||
|
FZTemporaryBasedID = 4,
|
||||||
|
FZPseudonymBasedID = 5,
|
||||||
|
FZHardwareBasedID = 6,
|
||||||
|
FZSIPBasedID = 7,
|
||||||
|
};
|
||||||
|
|
||||||
|
@interface NSString (FezAdditions)
|
||||||
|
|
||||||
|
- (FZIDType) _FZIDType;
|
||||||
|
- (FZIDType) _FZBestGuessFZIDType;
|
||||||
|
|
||||||
|
- (NSString *) _IDFromFZIDType:(FZIDType)IDType;
|
||||||
|
- (NSString *) _stripFZIDPrefix;
|
||||||
|
|
||||||
|
- (NSString *) _URIFromFZIDType:(FZIDType)IDType;
|
||||||
|
- (NSString *) _bestGuessURI;
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
||||||
|
extern BOOL IMStringIsEmail( NSString * string );
|
||||||
|
extern BOOL IMStringIsPhoneNumber( NSString * string );
|
||||||
|
extern BOOL IMStringIsBusinessID( NSString * string );
|
||||||
|
extern BOOL IMStringIsTemporaryID( NSString * string );
|
||||||
|
extern BOOL IMStringIsPseudonymID( NSString * string );
|
||||||
|
extern BOOL IMStringIsHardwareID( NSString * string );
|
||||||
|
extern BOOL IMStringIsSIPID( NSString * string );
|
||||||
|
|
||||||
|
enum {
|
||||||
|
IMChatServiceForSendingAvailabilityErrorNone = 0,
|
||||||
|
IMChatServiceForSendingAvailabilityErrorTooManyRecipients = 1,
|
||||||
|
IMChatServiceForSendingAvailabilityErrorIMessageRequired = 2,
|
||||||
|
IMChatServiceForSendingAvailabilityErrorMMSRequired = 3,
|
||||||
|
IMChatServiceForSendingAvailabilityErrorNoAvailableServices = 4,
|
||||||
|
IMChatServiceForSendingAvailabilityErrorSpamFiltered = 5,
|
||||||
|
};
|
||||||
|
typedef int8_t IMChatServiceForSendingAvailabilityError;
|
||||||
|
|
||||||
|
extern void IMChatCalculateServiceForSendingNewComposeMaybeForce(NSArray<NSString *> *canonicalIDSAddresses,
|
||||||
|
NSString* _Nullable senderLastAddressedHandle,
|
||||||
|
NSString* _Nullable senderLastAddressedSIMID,
|
||||||
|
BOOL forceMMS,
|
||||||
|
BOOL hasEmailRecipients,
|
||||||
|
BOOL lastSentMessageWasNotDelivered,
|
||||||
|
BOOL conversationWasDowngraded,
|
||||||
|
BOOL hasConversationHistory,
|
||||||
|
IMService * _Nullable previousService,
|
||||||
|
void(^ _Nonnull completion)(BOOL allAddressesiMessageCapable,
|
||||||
|
NSDictionary * _Nullable perRecipientAvailability,
|
||||||
|
BOOL checkedServer,
|
||||||
|
IMChatServiceForSendingAvailabilityError error));
|
||||||
|
|
||||||
|
extern NSString *IMCopyIDForPhoneNumber(NSString *phoneNumber, NSString *_Nullable countryCode, BOOL useNetworkCountryCode) NS_RETURNS_RETAINED;
|
||||||
|
extern NSString *IMCopyIDForEmailAddress(NSString *emailAddress) NS_RETURNS_RETAINED;
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_END
|
||||||
|
|||||||
@@ -18,12 +18,18 @@ struct IMFileLocation_t {
|
|||||||
int _field5;
|
int _field5;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct IMPreviewConstraints {
|
typedef struct IMPreviewConstraints {
|
||||||
double _field1;
|
CGFloat maxPxWidth;
|
||||||
struct CGSize _field2;
|
CGSize minThumbnailPxSize;
|
||||||
double _field3;
|
CGFloat scale;
|
||||||
char _field4;
|
BOOL isSticker;
|
||||||
};
|
BOOL generateMetadata;
|
||||||
|
} IMPreviewConstraints;
|
||||||
|
|
||||||
|
extern IMPreviewConstraints IMPreviewConstraintsFromDictionary(NSDictionary *dictionary);
|
||||||
|
extern NSDictionary *IMPreviewConstraintsDictionaryFromConstraint(IMPreviewConstraints constraint);
|
||||||
|
extern BOOL IMPreviewConstraintsEqualToConstraints(IMPreviewConstraints constraints1, IMPreviewConstraints constraints2);
|
||||||
|
extern IMPreviewConstraints IMPreviewConstraintsZero(void);
|
||||||
|
|
||||||
struct _TidyDoc {
|
struct _TidyDoc {
|
||||||
int _field1;
|
int _field1;
|
||||||
@@ -155,6 +161,8 @@ struct __va_list_tag {
|
|||||||
- (void)setObject:(id)arg1 forKey:(id)arg2;
|
- (void)setObject:(id)arg1 forKey:(id)arg2;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
extern NSURL* IMAttachmentPreviewFileURL(NSURL *attachmentURL, NSString *extension, BOOL generateIntermediaryDirectories);
|
||||||
|
|
||||||
@protocol IMPreviewGeneratorProtocol
|
@protocol IMPreviewGeneratorProtocol
|
||||||
+ (BOOL)shouldShadePreview;
|
+ (BOOL)shouldShadePreview;
|
||||||
+ (BOOL)shouldScaleUpPreview;
|
+ (BOOL)shouldScaleUpPreview;
|
||||||
@@ -1696,3 +1704,4 @@ struct __va_list_tag {
|
|||||||
- (id)initWithSerializedError_im:(struct NSDictionary *)arg1;
|
- (id)initWithSerializedError_im:(struct NSDictionary *)arg1;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
extern NSString *IMAssociatedMessageDecodeGUID(NSString* guid);
|
||||||
|
|||||||
14
Makefile
Normal file
14
Makefile
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
INSTALL_PATH := /usr/share/kordophone
|
||||||
|
|
||||||
|
.PHONY: build/Release/kordophoned
|
||||||
|
build/Release/kordophoned:
|
||||||
|
xcodebuild
|
||||||
|
|
||||||
|
.PHONY: install
|
||||||
|
install: build/Release/kordophoned
|
||||||
|
install -d $(INSTALL_PATH)
|
||||||
|
install build/Release/kordophoned $(INSTALL_PATH)
|
||||||
|
cp -rf build/Release/CocoaHTTPServer.framework $(INSTALL_PATH)
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm -Rf build
|
||||||
@@ -14,75 +14,61 @@
|
|||||||
1AA43E95219EC38E00EDF1A7 /* MBIMHTTPUtilities.m in Sources */ = {isa = PBXBuildFile; fileRef = 1AA43E94219EC38E00EDF1A7 /* MBIMHTTPUtilities.m */; };
|
1AA43E95219EC38E00EDF1A7 /* MBIMHTTPUtilities.m in Sources */ = {isa = PBXBuildFile; fileRef = 1AA43E94219EC38E00EDF1A7 /* MBIMHTTPUtilities.m */; };
|
||||||
1AAB32B121F82EB7004A2A72 /* MBIMLogging.m in Sources */ = {isa = PBXBuildFile; fileRef = 1AAB32B021F82EB7004A2A72 /* MBIMLogging.m */; };
|
1AAB32B121F82EB7004A2A72 /* MBIMLogging.m in Sources */ = {isa = PBXBuildFile; fileRef = 1AAB32B021F82EB7004A2A72 /* MBIMLogging.m */; };
|
||||||
1AAB32B421F837BB004A2A72 /* hookAgent.sh in CopyFiles */ = {isa = PBXBuildFile; fileRef = CD83E1B5219BF78E00F4CCEA /* hookAgent.sh */; };
|
1AAB32B421F837BB004A2A72 /* hookAgent.sh in CopyFiles */ = {isa = PBXBuildFile; fileRef = CD83E1B5219BF78E00F4CCEA /* hookAgent.sh */; };
|
||||||
1ACFCF2A219EB2AC00E2C237 /* HTTPConnection.h in Headers */ = {isa = PBXBuildFile; fileRef = 1ACFCE00219EB2AB00E2C237 /* HTTPConnection.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
|
||||||
1ACFCF2B219EB2AC00E2C237 /* HTTPLogging.h in Headers */ = {isa = PBXBuildFile; fileRef = 1ACFCE01219EB2AB00E2C237 /* HTTPLogging.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
|
||||||
1ACFCF2C219EB2AC00E2C237 /* HTTPMessage.h in Headers */ = {isa = PBXBuildFile; fileRef = 1ACFCE02219EB2AB00E2C237 /* HTTPMessage.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
|
||||||
1ACFCF2D219EB2AC00E2C237 /* WebSocket.h in Headers */ = {isa = PBXBuildFile; fileRef = 1ACFCE03219EB2AB00E2C237 /* WebSocket.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
|
||||||
1ACFCF2E219EB2AC00E2C237 /* HTTPAuthenticationRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = 1ACFCE04219EB2AB00E2C237 /* HTTPAuthenticationRequest.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
|
||||||
1ACFCF2F219EB2AC00E2C237 /* HTTPAsyncFileResponse.h in Headers */ = {isa = PBXBuildFile; fileRef = 1ACFCE06219EB2AB00E2C237 /* HTTPAsyncFileResponse.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
|
||||||
1ACFCF30219EB2AC00E2C237 /* HTTPErrorResponse.m in Sources */ = {isa = PBXBuildFile; fileRef = 1ACFCE07219EB2AB00E2C237 /* HTTPErrorResponse.m */; };
|
1ACFCF30219EB2AC00E2C237 /* HTTPErrorResponse.m in Sources */ = {isa = PBXBuildFile; fileRef = 1ACFCE07219EB2AB00E2C237 /* HTTPErrorResponse.m */; };
|
||||||
1ACFCF31219EB2AC00E2C237 /* HTTPDataResponse.m in Sources */ = {isa = PBXBuildFile; fileRef = 1ACFCE08219EB2AB00E2C237 /* HTTPDataResponse.m */; };
|
1ACFCF31219EB2AC00E2C237 /* HTTPDataResponse.m in Sources */ = {isa = PBXBuildFile; fileRef = 1ACFCE08219EB2AB00E2C237 /* HTTPDataResponse.m */; };
|
||||||
1ACFCF32219EB2AC00E2C237 /* HTTPRedirectResponse.h in Headers */ = {isa = PBXBuildFile; fileRef = 1ACFCE09219EB2AB00E2C237 /* HTTPRedirectResponse.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
|
||||||
1ACFCF33219EB2AC00E2C237 /* HTTPDynamicFileResponse.m in Sources */ = {isa = PBXBuildFile; fileRef = 1ACFCE0A219EB2AB00E2C237 /* HTTPDynamicFileResponse.m */; };
|
1ACFCF33219EB2AC00E2C237 /* HTTPDynamicFileResponse.m in Sources */ = {isa = PBXBuildFile; fileRef = 1ACFCE0A219EB2AB00E2C237 /* HTTPDynamicFileResponse.m */; };
|
||||||
1ACFCF34219EB2AC00E2C237 /* HTTPFileResponse.m in Sources */ = {isa = PBXBuildFile; fileRef = 1ACFCE0B219EB2AB00E2C237 /* HTTPFileResponse.m */; };
|
1ACFCF34219EB2AC00E2C237 /* HTTPFileResponse.m in Sources */ = {isa = PBXBuildFile; fileRef = 1ACFCE0B219EB2AB00E2C237 /* HTTPFileResponse.m */; };
|
||||||
1ACFCF35219EB2AC00E2C237 /* HTTPAsyncFileResponse.m in Sources */ = {isa = PBXBuildFile; fileRef = 1ACFCE0C219EB2AB00E2C237 /* HTTPAsyncFileResponse.m */; };
|
1ACFCF35219EB2AC00E2C237 /* HTTPAsyncFileResponse.m in Sources */ = {isa = PBXBuildFile; fileRef = 1ACFCE0C219EB2AB00E2C237 /* HTTPAsyncFileResponse.m */; };
|
||||||
1ACFCF36219EB2AC00E2C237 /* HTTPRedirectResponse.m in Sources */ = {isa = PBXBuildFile; fileRef = 1ACFCE0D219EB2AB00E2C237 /* HTTPRedirectResponse.m */; };
|
1ACFCF36219EB2AC00E2C237 /* HTTPRedirectResponse.m in Sources */ = {isa = PBXBuildFile; fileRef = 1ACFCE0D219EB2AB00E2C237 /* HTTPRedirectResponse.m */; };
|
||||||
1ACFCF37219EB2AC00E2C237 /* HTTPDataResponse.h in Headers */ = {isa = PBXBuildFile; fileRef = 1ACFCE0E219EB2AB00E2C237 /* HTTPDataResponse.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
|
||||||
1ACFCF38219EB2AC00E2C237 /* HTTPErrorResponse.h in Headers */ = {isa = PBXBuildFile; fileRef = 1ACFCE0F219EB2AB00E2C237 /* HTTPErrorResponse.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
|
||||||
1ACFCF39219EB2AC00E2C237 /* HTTPFileResponse.h in Headers */ = {isa = PBXBuildFile; fileRef = 1ACFCE10219EB2AB00E2C237 /* HTTPFileResponse.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
|
||||||
1ACFCF3A219EB2AC00E2C237 /* HTTPDynamicFileResponse.h in Headers */ = {isa = PBXBuildFile; fileRef = 1ACFCE11219EB2AB00E2C237 /* HTTPDynamicFileResponse.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
|
||||||
1ACFCF3B219EB2AC00E2C237 /* HTTPServer.h in Headers */ = {isa = PBXBuildFile; fileRef = 1ACFCE12219EB2AB00E2C237 /* HTTPServer.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
|
||||||
1ACFCF3C219EB2AC00E2C237 /* HTTPMessage.m in Sources */ = {isa = PBXBuildFile; fileRef = 1ACFCE13219EB2AB00E2C237 /* HTTPMessage.m */; };
|
1ACFCF3C219EB2AC00E2C237 /* HTTPMessage.m in Sources */ = {isa = PBXBuildFile; fileRef = 1ACFCE13219EB2AB00E2C237 /* HTTPMessage.m */; };
|
||||||
1ACFCF3D219EB2AC00E2C237 /* HTTPConnection.m in Sources */ = {isa = PBXBuildFile; fileRef = 1ACFCE14219EB2AB00E2C237 /* HTTPConnection.m */; };
|
1ACFCF3D219EB2AC00E2C237 /* HTTPConnection.m in Sources */ = {isa = PBXBuildFile; fileRef = 1ACFCE14219EB2AB00E2C237 /* HTTPConnection.m */; };
|
||||||
1ACFCF3E219EB2AC00E2C237 /* WebSocket.m in Sources */ = {isa = PBXBuildFile; fileRef = 1ACFCE15219EB2AB00E2C237 /* WebSocket.m */; };
|
1ACFCF3E219EB2AC00E2C237 /* WebSocket.m in Sources */ = {isa = PBXBuildFile; fileRef = 1ACFCE15219EB2AB00E2C237 /* WebSocket.m */; };
|
||||||
1ACFCF3F219EB2AC00E2C237 /* HTTPResponse.h in Headers */ = {isa = PBXBuildFile; fileRef = 1ACFCE16219EB2AB00E2C237 /* HTTPResponse.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
|
||||||
1ACFCF40219EB2AC00E2C237 /* MultipartFormDataParser.h in Headers */ = {isa = PBXBuildFile; fileRef = 1ACFCE18219EB2AB00E2C237 /* MultipartFormDataParser.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
|
||||||
1ACFCF41219EB2AC00E2C237 /* MultipartMessageHeader.h in Headers */ = {isa = PBXBuildFile; fileRef = 1ACFCE19219EB2AB00E2C237 /* MultipartMessageHeader.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
|
||||||
1ACFCF42219EB2AC00E2C237 /* MultipartMessageHeaderField.m in Sources */ = {isa = PBXBuildFile; fileRef = 1ACFCE1A219EB2AB00E2C237 /* MultipartMessageHeaderField.m */; };
|
1ACFCF42219EB2AC00E2C237 /* MultipartMessageHeaderField.m in Sources */ = {isa = PBXBuildFile; fileRef = 1ACFCE1A219EB2AB00E2C237 /* MultipartMessageHeaderField.m */; };
|
||||||
1ACFCF43219EB2AC00E2C237 /* MultipartFormDataParser.m in Sources */ = {isa = PBXBuildFile; fileRef = 1ACFCE1B219EB2AB00E2C237 /* MultipartFormDataParser.m */; };
|
1ACFCF43219EB2AC00E2C237 /* MultipartFormDataParser.m in Sources */ = {isa = PBXBuildFile; fileRef = 1ACFCE1B219EB2AB00E2C237 /* MultipartFormDataParser.m */; };
|
||||||
1ACFCF44219EB2AC00E2C237 /* MultipartMessageHeader.m in Sources */ = {isa = PBXBuildFile; fileRef = 1ACFCE1C219EB2AB00E2C237 /* MultipartMessageHeader.m */; };
|
1ACFCF44219EB2AC00E2C237 /* MultipartMessageHeader.m in Sources */ = {isa = PBXBuildFile; fileRef = 1ACFCE1C219EB2AB00E2C237 /* MultipartMessageHeader.m */; };
|
||||||
1ACFCF45219EB2AC00E2C237 /* MultipartMessageHeaderField.h in Headers */ = {isa = PBXBuildFile; fileRef = 1ACFCE1D219EB2AB00E2C237 /* MultipartMessageHeaderField.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
|
||||||
1ACFCF46219EB2AC00E2C237 /* HTTPAuthenticationRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = 1ACFCE1E219EB2AB00E2C237 /* HTTPAuthenticationRequest.m */; };
|
1ACFCF46219EB2AC00E2C237 /* HTTPAuthenticationRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = 1ACFCE1E219EB2AB00E2C237 /* HTTPAuthenticationRequest.m */; };
|
||||||
1ACFCF47219EB2AC00E2C237 /* DDNumber.m in Sources */ = {isa = PBXBuildFile; fileRef = 1ACFCE20219EB2AB00E2C237 /* DDNumber.m */; };
|
1ACFCF47219EB2AC00E2C237 /* DDNumber.m in Sources */ = {isa = PBXBuildFile; fileRef = 1ACFCE20219EB2AB00E2C237 /* DDNumber.m */; };
|
||||||
1ACFCF48219EB2AC00E2C237 /* DDData.m in Sources */ = {isa = PBXBuildFile; fileRef = 1ACFCE21219EB2AB00E2C237 /* DDData.m */; };
|
1ACFCF48219EB2AC00E2C237 /* DDData.m in Sources */ = {isa = PBXBuildFile; fileRef = 1ACFCE21219EB2AB00E2C237 /* DDData.m */; };
|
||||||
1ACFCF49219EB2AC00E2C237 /* DDRange.h in Headers */ = {isa = PBXBuildFile; fileRef = 1ACFCE22219EB2AB00E2C237 /* DDRange.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
|
||||||
1ACFCF4A219EB2AC00E2C237 /* DDNumber.h in Headers */ = {isa = PBXBuildFile; fileRef = 1ACFCE23219EB2AB00E2C237 /* DDNumber.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
|
||||||
1ACFCF4B219EB2AC00E2C237 /* DDRange.m in Sources */ = {isa = PBXBuildFile; fileRef = 1ACFCE24219EB2AB00E2C237 /* DDRange.m */; };
|
1ACFCF4B219EB2AC00E2C237 /* DDRange.m in Sources */ = {isa = PBXBuildFile; fileRef = 1ACFCE24219EB2AB00E2C237 /* DDRange.m */; };
|
||||||
1ACFCF4C219EB2AC00E2C237 /* DDData.h in Headers */ = {isa = PBXBuildFile; fileRef = 1ACFCE25219EB2AB00E2C237 /* DDData.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
|
||||||
1ACFCF4D219EB2AC00E2C237 /* HTTPServer.m in Sources */ = {isa = PBXBuildFile; fileRef = 1ACFCE26219EB2AB00E2C237 /* HTTPServer.m */; };
|
1ACFCF4D219EB2AC00E2C237 /* HTTPServer.m in Sources */ = {isa = PBXBuildFile; fileRef = 1ACFCE26219EB2AB00E2C237 /* HTTPServer.m */; };
|
||||||
1ACFCFCA219EB2AC00E2C237 /* DDTTYLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = 1ACFCF09219EB2AC00E2C237 /* DDTTYLogger.m */; };
|
1ACFCFCA219EB2AC00E2C237 /* DDTTYLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = 1ACFCF09219EB2AC00E2C237 /* DDTTYLogger.m */; };
|
||||||
1ACFCFCB219EB2AC00E2C237 /* DDLog.h in Headers */ = {isa = PBXBuildFile; fileRef = 1ACFCF0A219EB2AC00E2C237 /* DDLog.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
|
||||||
1ACFCFCC219EB2AC00E2C237 /* DDAbstractDatabaseLogger.h in Headers */ = {isa = PBXBuildFile; fileRef = 1ACFCF0B219EB2AC00E2C237 /* DDAbstractDatabaseLogger.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
|
||||||
1ACFCFCD219EB2AC00E2C237 /* DDASLLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = 1ACFCF0C219EB2AC00E2C237 /* DDASLLogger.m */; };
|
1ACFCFCD219EB2AC00E2C237 /* DDASLLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = 1ACFCF0C219EB2AC00E2C237 /* DDASLLogger.m */; };
|
||||||
1ACFCFCE219EB2AC00E2C237 /* DDFileLogger.h in Headers */ = {isa = PBXBuildFile; fileRef = 1ACFCF0D219EB2AC00E2C237 /* DDFileLogger.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
|
||||||
1ACFCFCF219EB2AC00E2C237 /* ContextFilterLogFormatter.h in Headers */ = {isa = PBXBuildFile; fileRef = 1ACFCF0F219EB2AC00E2C237 /* ContextFilterLogFormatter.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
|
||||||
1ACFCFD0219EB2AC00E2C237 /* DispatchQueueLogFormatter.h in Headers */ = {isa = PBXBuildFile; fileRef = 1ACFCF10219EB2AC00E2C237 /* DispatchQueueLogFormatter.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
|
||||||
1ACFCFD1219EB2AC00E2C237 /* ContextFilterLogFormatter.m in Sources */ = {isa = PBXBuildFile; fileRef = 1ACFCF11219EB2AC00E2C237 /* ContextFilterLogFormatter.m */; };
|
1ACFCFD1219EB2AC00E2C237 /* ContextFilterLogFormatter.m in Sources */ = {isa = PBXBuildFile; fileRef = 1ACFCF11219EB2AC00E2C237 /* ContextFilterLogFormatter.m */; };
|
||||||
1ACFCFD2219EB2AC00E2C237 /* DispatchQueueLogFormatter.m in Sources */ = {isa = PBXBuildFile; fileRef = 1ACFCF12219EB2AC00E2C237 /* DispatchQueueLogFormatter.m */; };
|
1ACFCFD2219EB2AC00E2C237 /* DispatchQueueLogFormatter.m in Sources */ = {isa = PBXBuildFile; fileRef = 1ACFCF12219EB2AC00E2C237 /* DispatchQueueLogFormatter.m */; };
|
||||||
1ACFCFD4219EB2AC00E2C237 /* DDLog.m in Sources */ = {isa = PBXBuildFile; fileRef = 1ACFCF14219EB2AC00E2C237 /* DDLog.m */; };
|
1ACFCFD4219EB2AC00E2C237 /* DDLog.m in Sources */ = {isa = PBXBuildFile; fileRef = 1ACFCF14219EB2AC00E2C237 /* DDLog.m */; };
|
||||||
1ACFCFD6219EB2AC00E2C237 /* DDTTYLogger.h in Headers */ = {isa = PBXBuildFile; fileRef = 1ACFCF16219EB2AC00E2C237 /* DDTTYLogger.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
|
||||||
1ACFCFD7219EB2AC00E2C237 /* DDAbstractDatabaseLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = 1ACFCF17219EB2AC00E2C237 /* DDAbstractDatabaseLogger.m */; };
|
1ACFCFD7219EB2AC00E2C237 /* DDAbstractDatabaseLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = 1ACFCF17219EB2AC00E2C237 /* DDAbstractDatabaseLogger.m */; };
|
||||||
1ACFCFD8219EB2AC00E2C237 /* DDFileLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = 1ACFCF18219EB2AC00E2C237 /* DDFileLogger.m */; };
|
1ACFCFD8219EB2AC00E2C237 /* DDFileLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = 1ACFCF18219EB2AC00E2C237 /* DDFileLogger.m */; };
|
||||||
1ACFCFD9219EB2AC00E2C237 /* DDASLLogger.h in Headers */ = {isa = PBXBuildFile; fileRef = 1ACFCF19219EB2AC00E2C237 /* DDASLLogger.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
|
||||||
1ACFCFDA219EB2AC00E2C237 /* GCDAsyncSocket.m in Sources */ = {isa = PBXBuildFile; fileRef = 1ACFCF1B219EB2AC00E2C237 /* GCDAsyncSocket.m */; };
|
1ACFCFDA219EB2AC00E2C237 /* GCDAsyncSocket.m in Sources */ = {isa = PBXBuildFile; fileRef = 1ACFCF1B219EB2AC00E2C237 /* GCDAsyncSocket.m */; };
|
||||||
1ACFCFDC219EB2AC00E2C237 /* GCDAsyncSocket.h in Headers */ = {isa = PBXBuildFile; fileRef = 1ACFCF1D219EB2AC00E2C237 /* GCDAsyncSocket.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
1ACFCFDF219EB31400E2C237 /* libCocoaHTTPServer.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1ACFCDE2219EB28A00E2C237 /* libCocoaHTTPServer.a */; };
|
||||||
1ACFCFDF219EB31400E2C237 /* CocoaHTTPServer.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1ACFCDE2219EB28A00E2C237 /* CocoaHTTPServer.framework */; };
|
|
||||||
1AD8936E21EFD986009B599A /* MBIMUploadAttachmentOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = 1AD8936D21EFD986009B599A /* MBIMUploadAttachmentOperation.m */; };
|
1AD8936E21EFD986009B599A /* MBIMUploadAttachmentOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = 1AD8936D21EFD986009B599A /* MBIMUploadAttachmentOperation.m */; };
|
||||||
CD14F18E219E2DB400E7DD22 /* CryptoTests.m in Sources */ = {isa = PBXBuildFile; fileRef = CD14F18D219E2DB400E7DD22 /* CryptoTests.m */; };
|
CD14F18E219E2DB400E7DD22 /* CryptoTests.m in Sources */ = {isa = PBXBuildFile; fileRef = CD14F18D219E2DB400E7DD22 /* CryptoTests.m */; };
|
||||||
CD14F1A1219FE7D600E7DD22 /* MBIMUpdatePollOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = CD14F1A0219FE7D600E7DD22 /* MBIMUpdatePollOperation.m */; };
|
CD14F1A1219FE7D600E7DD22 /* MBIMUpdatePollOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = CD14F1A0219FE7D600E7DD22 /* MBIMUpdatePollOperation.m */; };
|
||||||
CD14F1A4219FF22700E7DD22 /* IMMessageItem+Encoded.m in Sources */ = {isa = PBXBuildFile; fileRef = CD14F1A3219FF22700E7DD22 /* IMMessageItem+Encoded.m */; };
|
CD14F1A4219FF22700E7DD22 /* IMMessageItem+Encoded.m in Sources */ = {isa = PBXBuildFile; fileRef = CD14F1A3219FF22700E7DD22 /* IMMessageItem+Encoded.m */; };
|
||||||
CD14F1AA219FF3B800E7DD22 /* MBIMUpdateQueue.m in Sources */ = {isa = PBXBuildFile; fileRef = CD14F1A9219FF3B800E7DD22 /* MBIMUpdateQueue.m */; };
|
CD14F1AA219FF3B800E7DD22 /* MBIMUpdateQueue.m in Sources */ = {isa = PBXBuildFile; fileRef = CD14F1A9219FF3B800E7DD22 /* MBIMUpdateQueue.m */; };
|
||||||
CD14F1AD219FFAE100E7DD22 /* MBIMConcurrentHTTPServer.m in Sources */ = {isa = PBXBuildFile; fileRef = CD14F1AC219FFAE100E7DD22 /* MBIMConcurrentHTTPServer.m */; };
|
CD14F1AD219FFAE100E7DD22 /* MBIMConcurrentHTTPServer.m in Sources */ = {isa = PBXBuildFile; fileRef = CD14F1AC219FFAE100E7DD22 /* MBIMConcurrentHTTPServer.m */; };
|
||||||
|
CD2782BC29527FE500C0C030 /* IMSharedUtilities.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CD2782BB29527FE500C0C030 /* IMSharedUtilities.framework */; };
|
||||||
|
CD2782BF2952832B00C0C030 /* MBIMImageUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = CD2782BE2952832B00C0C030 /* MBIMImageUtils.m */; };
|
||||||
|
CD2782FE2952875F00C0C030 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CD2782FD2952875F00C0C030 /* CoreGraphics.framework */; };
|
||||||
|
CD2783002952876700C0C030 /* ImageIO.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CD2782FF2952876700C0C030 /* ImageIO.framework */; };
|
||||||
|
CD2ECEC2269539100055E302 /* MBIMAuthenticateOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = CD2ECEC1269539100055E302 /* MBIMAuthenticateOperation.m */; };
|
||||||
|
CD2ECEC526953F2A0055E302 /* MBIMAuthToken.m in Sources */ = {isa = PBXBuildFile; fileRef = CD2ECEC426953F2A0055E302 /* MBIMAuthToken.m */; };
|
||||||
|
CD3F62B1297769F2004305D9 /* MBIMURLUtilities.m in Sources */ = {isa = PBXBuildFile; fileRef = CD3F62B0297769F2004305D9 /* MBIMURLUtilities.m */; };
|
||||||
CD602056219B5DFD0024D9C5 /* MBIMBridgeOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = CD602055219B5DFD0024D9C5 /* MBIMBridgeOperation.m */; };
|
CD602056219B5DFD0024D9C5 /* MBIMBridgeOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = CD602055219B5DFD0024D9C5 /* MBIMBridgeOperation.m */; };
|
||||||
CD60205C219B623F0024D9C5 /* MBIMMessagesListOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = CD60205B219B623F0024D9C5 /* MBIMMessagesListOperation.m */; };
|
CD60205C219B623F0024D9C5 /* MBIMMessagesListOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = CD60205B219B623F0024D9C5 /* MBIMMessagesListOperation.m */; };
|
||||||
CD60205F219B674B0024D9C5 /* MBIMConversationListOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = CD60205E219B674B0024D9C5 /* MBIMConversationListOperation.m */; };
|
CD60205F219B674B0024D9C5 /* MBIMConversationListOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = CD60205E219B674B0024D9C5 /* MBIMConversationListOperation.m */; };
|
||||||
CD602062219B68950024D9C5 /* MBIMSendMessageOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = CD602061219B68950024D9C5 /* MBIMSendMessageOperation.m */; };
|
CD602062219B68950024D9C5 /* MBIMSendMessageOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = CD602061219B68950024D9C5 /* MBIMSendMessageOperation.m */; };
|
||||||
CD83E156219BE10A00F4CCEA /* hooking.m in Sources */ = {isa = PBXBuildFile; fileRef = CD83E155219BE10A00F4CCEA /* hooking.m */; };
|
CD83E156219BE10A00F4CCEA /* hooking.m in Sources */ = {isa = PBXBuildFile; fileRef = CD83E155219BE10A00F4CCEA /* hooking.m */; };
|
||||||
CD83E166219BE91600F4CCEA /* agentHook.m in Sources */ = {isa = PBXBuildFile; fileRef = CD83E165219BE91600F4CCEA /* agentHook.m */; };
|
CD83E166219BE91600F4CCEA /* agentHook.m in Sources */ = {isa = PBXBuildFile; fileRef = CD83E165219BE91600F4CCEA /* agentHook.m */; };
|
||||||
|
CD936A32289B353F0093A1AC /* MBIMErrorResponse.m in Sources */ = {isa = PBXBuildFile; fileRef = CD936A31289B353F0093A1AC /* MBIMErrorResponse.m */; };
|
||||||
|
CD936A35289B47D60093A1AC /* MBIMVersionOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = CD936A34289B47D50093A1AC /* MBIMVersionOperation.m */; };
|
||||||
|
CD936A39289B49FC0093A1AC /* MBIMStatusOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = CD936A38289B49FC0093A1AC /* MBIMStatusOperation.m */; };
|
||||||
|
CDA64B472DFCBF3000E9B07E /* MBIMPingPongWebSocket.m in Sources */ = {isa = PBXBuildFile; fileRef = CDA64B462DFCBF3000E9B07E /* MBIMPingPongWebSocket.m */; };
|
||||||
|
CDDCF78D283F398C0087ABDF /* MBIMDeleteConversationOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = CDDCF78C283F398C0087ABDF /* MBIMDeleteConversationOperation.m */; };
|
||||||
CDE4556421A3578A0041F5DD /* IMChat+Encoded.m in Sources */ = {isa = PBXBuildFile; fileRef = CDE4556321A3578A0041F5DD /* IMChat+Encoded.m */; };
|
CDE4556421A3578A0041F5DD /* IMChat+Encoded.m in Sources */ = {isa = PBXBuildFile; fileRef = CDE4556321A3578A0041F5DD /* IMChat+Encoded.m */; };
|
||||||
CDE455A121A365AD0041F5DD /* MBIMMarkOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = CDE455A021A365AD0041F5DD /* MBIMMarkOperation.m */; };
|
CDE455A121A365AD0041F5DD /* MBIMMarkOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = CDE455A021A365AD0041F5DD /* MBIMMarkOperation.m */; };
|
||||||
CDE455A421A5308D0041F5DD /* MBIMFetchAttachmentOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = CDE455A321A5308D0041F5DD /* MBIMFetchAttachmentOperation.m */; };
|
CDE455A421A5308D0041F5DD /* MBIMFetchAttachmentOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = CDE455A321A5308D0041F5DD /* MBIMFetchAttachmentOperation.m */; };
|
||||||
CDE455A721A531ED0041F5DD /* MBIMDataResponse.m in Sources */ = {isa = PBXBuildFile; fileRef = CDE455A621A531ED0041F5DD /* MBIMDataResponse.m */; };
|
CDE455A721A531ED0041F5DD /* MBIMDataResponse.m in Sources */ = {isa = PBXBuildFile; fileRef = CDE455A621A531ED0041F5DD /* MBIMDataResponse.m */; };
|
||||||
|
CDEFF9FE2CACC7A700063C52 /* MBIMResolveHandleOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = CDEFF9FD2CACC7A700063C52 /* MBIMResolveHandleOperation.m */; };
|
||||||
CDF62335219A895D00690038 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = CDF62334219A895D00690038 /* main.m */; };
|
CDF62335219A895D00690038 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = CDF62334219A895D00690038 /* main.m */; };
|
||||||
CDF62339219A8A5600690038 /* MBIMBridge.h in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C4469219A4BC300F2AC00 /* MBIMBridge.h */; };
|
CDF62339219A8A5600690038 /* MBIMBridge.h in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C4469219A4BC300F2AC00 /* MBIMBridge.h */; };
|
||||||
CDF6233A219A8A5600690038 /* MBIMBridge.m in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C446A219A4BC300F2AC00 /* MBIMBridge.m */; };
|
CDF6233A219A8A5600690038 /* MBIMBridge.m in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C446A219A4BC300F2AC00 /* MBIMBridge.m */; };
|
||||||
@@ -144,7 +130,7 @@
|
|||||||
1AAB32AF21F82EB7004A2A72 /* MBIMLogging.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MBIMLogging.h; sourceTree = "<group>"; };
|
1AAB32AF21F82EB7004A2A72 /* MBIMLogging.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MBIMLogging.h; sourceTree = "<group>"; };
|
||||||
1AAB32B021F82EB7004A2A72 /* MBIMLogging.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MBIMLogging.m; sourceTree = "<group>"; };
|
1AAB32B021F82EB7004A2A72 /* MBIMLogging.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MBIMLogging.m; sourceTree = "<group>"; };
|
||||||
1AAB32B221F835BD004A2A72 /* KPServer.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = KPServer.pch; sourceTree = "<group>"; };
|
1AAB32B221F835BD004A2A72 /* KPServer.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = KPServer.pch; sourceTree = "<group>"; };
|
||||||
1ACFCDE2219EB28A00E2C237 /* CocoaHTTPServer.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = CocoaHTTPServer.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
1ACFCDE2219EB28A00E2C237 /* libCocoaHTTPServer.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libCocoaHTTPServer.a; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||||
1ACFCDFC219EB2AB00E2C237 /* LICENSE.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = LICENSE.txt; sourceTree = "<group>"; };
|
1ACFCDFC219EB2AB00E2C237 /* LICENSE.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = LICENSE.txt; sourceTree = "<group>"; };
|
||||||
1ACFCDFE219EB2AB00E2C237 /* README.markdown */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; path = README.markdown; sourceTree = "<group>"; };
|
1ACFCDFE219EB2AB00E2C237 /* README.markdown */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; path = README.markdown; sourceTree = "<group>"; };
|
||||||
1ACFCE00219EB2AB00E2C237 /* HTTPConnection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTTPConnection.h; sourceTree = "<group>"; };
|
1ACFCE00219EB2AB00E2C237 /* HTTPConnection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTTPConnection.h; sourceTree = "<group>"; };
|
||||||
@@ -217,6 +203,17 @@
|
|||||||
CD14F1A9219FF3B800E7DD22 /* MBIMUpdateQueue.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MBIMUpdateQueue.m; sourceTree = "<group>"; };
|
CD14F1A9219FF3B800E7DD22 /* MBIMUpdateQueue.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MBIMUpdateQueue.m; sourceTree = "<group>"; };
|
||||||
CD14F1AB219FFAE100E7DD22 /* MBIMConcurrentHTTPServer.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MBIMConcurrentHTTPServer.h; sourceTree = "<group>"; };
|
CD14F1AB219FFAE100E7DD22 /* MBIMConcurrentHTTPServer.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MBIMConcurrentHTTPServer.h; sourceTree = "<group>"; };
|
||||||
CD14F1AC219FFAE100E7DD22 /* MBIMConcurrentHTTPServer.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MBIMConcurrentHTTPServer.m; sourceTree = "<group>"; };
|
CD14F1AC219FFAE100E7DD22 /* MBIMConcurrentHTTPServer.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MBIMConcurrentHTTPServer.m; sourceTree = "<group>"; };
|
||||||
|
CD2782BB29527FE500C0C030 /* IMSharedUtilities.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IMSharedUtilities.framework; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.0.Internal.sdk/System/Library/PrivateFrameworks/IMSharedUtilities.framework; sourceTree = DEVELOPER_DIR; };
|
||||||
|
CD2782BD2952832B00C0C030 /* MBIMImageUtils.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MBIMImageUtils.h; sourceTree = "<group>"; };
|
||||||
|
CD2782BE2952832B00C0C030 /* MBIMImageUtils.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MBIMImageUtils.m; sourceTree = "<group>"; };
|
||||||
|
CD2782FD2952875F00C0C030 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
|
||||||
|
CD2782FF2952876700C0C030 /* ImageIO.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ImageIO.framework; path = System/Library/Frameworks/ImageIO.framework; sourceTree = SDKROOT; };
|
||||||
|
CD2ECEC0269539100055E302 /* MBIMAuthenticateOperation.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MBIMAuthenticateOperation.h; sourceTree = "<group>"; };
|
||||||
|
CD2ECEC1269539100055E302 /* MBIMAuthenticateOperation.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MBIMAuthenticateOperation.m; sourceTree = "<group>"; };
|
||||||
|
CD2ECEC326953F2A0055E302 /* MBIMAuthToken.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MBIMAuthToken.h; sourceTree = "<group>"; };
|
||||||
|
CD2ECEC426953F2A0055E302 /* MBIMAuthToken.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MBIMAuthToken.m; sourceTree = "<group>"; };
|
||||||
|
CD3F62AF297769F2004305D9 /* MBIMURLUtilities.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MBIMURLUtilities.h; sourceTree = "<group>"; };
|
||||||
|
CD3F62B0297769F2004305D9 /* MBIMURLUtilities.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MBIMURLUtilities.m; sourceTree = "<group>"; };
|
||||||
CD602054219B5DFD0024D9C5 /* MBIMBridgeOperation.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MBIMBridgeOperation.h; sourceTree = "<group>"; };
|
CD602054219B5DFD0024D9C5 /* MBIMBridgeOperation.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MBIMBridgeOperation.h; sourceTree = "<group>"; };
|
||||||
CD602055219B5DFD0024D9C5 /* MBIMBridgeOperation.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MBIMBridgeOperation.m; sourceTree = "<group>"; };
|
CD602055219B5DFD0024D9C5 /* MBIMBridgeOperation.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MBIMBridgeOperation.m; sourceTree = "<group>"; };
|
||||||
CD60205A219B623F0024D9C5 /* MBIMMessagesListOperation.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MBIMMessagesListOperation.h; sourceTree = "<group>"; };
|
CD60205A219B623F0024D9C5 /* MBIMMessagesListOperation.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MBIMMessagesListOperation.h; sourceTree = "<group>"; };
|
||||||
@@ -230,6 +227,17 @@
|
|||||||
CD83E161219BE91500F4CCEA /* libagentHook.dylib */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.dylib"; includeInIndex = 0; path = libagentHook.dylib; sourceTree = BUILT_PRODUCTS_DIR; };
|
CD83E161219BE91500F4CCEA /* libagentHook.dylib */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.dylib"; includeInIndex = 0; path = libagentHook.dylib; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||||
CD83E165219BE91600F4CCEA /* agentHook.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = agentHook.m; sourceTree = "<group>"; };
|
CD83E165219BE91600F4CCEA /* agentHook.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = agentHook.m; sourceTree = "<group>"; };
|
||||||
CD83E1B5219BF78E00F4CCEA /* hookAgent.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = hookAgent.sh; sourceTree = "<group>"; };
|
CD83E1B5219BF78E00F4CCEA /* hookAgent.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = hookAgent.sh; sourceTree = "<group>"; };
|
||||||
|
CD936A2F289B31740093A1AC /* kordophoned-RestrictedEntitlements.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "kordophoned-RestrictedEntitlements.plist"; sourceTree = "<group>"; };
|
||||||
|
CD936A30289B353F0093A1AC /* MBIMErrorResponse.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MBIMErrorResponse.h; sourceTree = "<group>"; };
|
||||||
|
CD936A31289B353F0093A1AC /* MBIMErrorResponse.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MBIMErrorResponse.m; sourceTree = "<group>"; };
|
||||||
|
CD936A33289B47D50093A1AC /* MBIMVersionOperation.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MBIMVersionOperation.h; sourceTree = "<group>"; };
|
||||||
|
CD936A34289B47D50093A1AC /* MBIMVersionOperation.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MBIMVersionOperation.m; sourceTree = "<group>"; };
|
||||||
|
CD936A37289B49FC0093A1AC /* MBIMStatusOperation.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MBIMStatusOperation.h; sourceTree = "<group>"; };
|
||||||
|
CD936A38289B49FC0093A1AC /* MBIMStatusOperation.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MBIMStatusOperation.m; sourceTree = "<group>"; };
|
||||||
|
CDA64B452DFCBF3000E9B07E /* MBIMPingPongWebSocket.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MBIMPingPongWebSocket.h; sourceTree = "<group>"; };
|
||||||
|
CDA64B462DFCBF3000E9B07E /* MBIMPingPongWebSocket.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MBIMPingPongWebSocket.m; sourceTree = "<group>"; };
|
||||||
|
CDDCF78B283F398C0087ABDF /* MBIMDeleteConversationOperation.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MBIMDeleteConversationOperation.h; sourceTree = "<group>"; };
|
||||||
|
CDDCF78C283F398C0087ABDF /* MBIMDeleteConversationOperation.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MBIMDeleteConversationOperation.m; sourceTree = "<group>"; };
|
||||||
CDE4556221A3578A0041F5DD /* IMChat+Encoded.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "IMChat+Encoded.h"; sourceTree = "<group>"; };
|
CDE4556221A3578A0041F5DD /* IMChat+Encoded.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "IMChat+Encoded.h"; sourceTree = "<group>"; };
|
||||||
CDE4556321A3578A0041F5DD /* IMChat+Encoded.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "IMChat+Encoded.m"; sourceTree = "<group>"; };
|
CDE4556321A3578A0041F5DD /* IMChat+Encoded.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "IMChat+Encoded.m"; sourceTree = "<group>"; };
|
||||||
CDE4559F21A365AD0041F5DD /* MBIMMarkOperation.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MBIMMarkOperation.h; sourceTree = "<group>"; };
|
CDE4559F21A365AD0041F5DD /* MBIMMarkOperation.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MBIMMarkOperation.h; sourceTree = "<group>"; };
|
||||||
@@ -238,6 +246,8 @@
|
|||||||
CDE455A321A5308D0041F5DD /* MBIMFetchAttachmentOperation.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MBIMFetchAttachmentOperation.m; sourceTree = "<group>"; };
|
CDE455A321A5308D0041F5DD /* MBIMFetchAttachmentOperation.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MBIMFetchAttachmentOperation.m; sourceTree = "<group>"; };
|
||||||
CDE455A521A531ED0041F5DD /* MBIMDataResponse.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MBIMDataResponse.h; sourceTree = "<group>"; };
|
CDE455A521A531ED0041F5DD /* MBIMDataResponse.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MBIMDataResponse.h; sourceTree = "<group>"; };
|
||||||
CDE455A621A531ED0041F5DD /* MBIMDataResponse.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MBIMDataResponse.m; sourceTree = "<group>"; };
|
CDE455A621A531ED0041F5DD /* MBIMDataResponse.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MBIMDataResponse.m; sourceTree = "<group>"; };
|
||||||
|
CDEFF9FC2CACC7A700063C52 /* MBIMResolveHandleOperation.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MBIMResolveHandleOperation.h; sourceTree = "<group>"; };
|
||||||
|
CDEFF9FD2CACC7A700063C52 /* MBIMResolveHandleOperation.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MBIMResolveHandleOperation.m; sourceTree = "<group>"; };
|
||||||
CDF62332219A895D00690038 /* kordophoned */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = kordophoned; sourceTree = BUILT_PRODUCTS_DIR; };
|
CDF62332219A895D00690038 /* kordophoned */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = kordophoned; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||||
CDF62334219A895D00690038 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
|
CDF62334219A895D00690038 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
|
||||||
/* End PBXFileReference section */
|
/* End PBXFileReference section */
|
||||||
@@ -268,8 +278,11 @@
|
|||||||
isa = PBXFrameworksBuildPhase;
|
isa = PBXFrameworksBuildPhase;
|
||||||
buildActionMask = 2147483647;
|
buildActionMask = 2147483647;
|
||||||
files = (
|
files = (
|
||||||
|
CD2782BC29527FE500C0C030 /* IMSharedUtilities.framework in Frameworks */,
|
||||||
1A257CCB23A8681200A4A2C8 /* Security.framework in Frameworks */,
|
1A257CCB23A8681200A4A2C8 /* Security.framework in Frameworks */,
|
||||||
1ACFCFDF219EB31400E2C237 /* CocoaHTTPServer.framework in Frameworks */,
|
CD2783002952876700C0C030 /* ImageIO.framework in Frameworks */,
|
||||||
|
1ACFCFDF219EB31400E2C237 /* libCocoaHTTPServer.a in Frameworks */,
|
||||||
|
CD2782FE2952875F00C0C030 /* CoreGraphics.framework in Frameworks */,
|
||||||
1A257CC923A867EF00A4A2C8 /* IMCore.framework in Frameworks */,
|
1A257CC923A867EF00A4A2C8 /* IMCore.framework in Frameworks */,
|
||||||
);
|
);
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
@@ -297,7 +310,7 @@
|
|||||||
CDF62332219A895D00690038 /* kordophoned */,
|
CDF62332219A895D00690038 /* kordophoned */,
|
||||||
CD83E161219BE91500F4CCEA /* libagentHook.dylib */,
|
CD83E161219BE91500F4CCEA /* libagentHook.dylib */,
|
||||||
CD14F18B219E2DB400E7DD22 /* Tests.xctest */,
|
CD14F18B219E2DB400E7DD22 /* Tests.xctest */,
|
||||||
1ACFCDE2219EB28A00E2C237 /* CocoaHTTPServer.framework */,
|
1ACFCDE2219EB28A00E2C237 /* libCocoaHTTPServer.a */,
|
||||||
);
|
);
|
||||||
name = Products;
|
name = Products;
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
@@ -315,6 +328,9 @@
|
|||||||
1A0C445E219A45B400F2AC00 /* Frameworks */ = {
|
1A0C445E219A45B400F2AC00 /* Frameworks */ = {
|
||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
|
CD2782FF2952876700C0C030 /* ImageIO.framework */,
|
||||||
|
CD2782FD2952875F00C0C030 /* CoreGraphics.framework */,
|
||||||
|
CD2782BB29527FE500C0C030 /* IMSharedUtilities.framework */,
|
||||||
1A257CCA23A8681200A4A2C8 /* Security.framework */,
|
1A257CCA23A8681200A4A2C8 /* Security.framework */,
|
||||||
1A257CC823A867EF00A4A2C8 /* IMCore.framework */,
|
1A257CC823A867EF00A4A2C8 /* IMCore.framework */,
|
||||||
);
|
);
|
||||||
@@ -328,13 +344,16 @@
|
|||||||
1A0C4469219A4BC300F2AC00 /* MBIMBridge.h */,
|
1A0C4469219A4BC300F2AC00 /* MBIMBridge.h */,
|
||||||
1AAB32AC21F8212E004A2A72 /* MBIMBridge_Private.h */,
|
1AAB32AC21F8212E004A2A72 /* MBIMBridge_Private.h */,
|
||||||
1A0C446A219A4BC300F2AC00 /* MBIMBridge.m */,
|
1A0C446A219A4BC300F2AC00 /* MBIMBridge.m */,
|
||||||
|
CD2ECEC326953F2A0055E302 /* MBIMAuthToken.h */,
|
||||||
|
CD2ECEC426953F2A0055E302 /* MBIMAuthToken.m */,
|
||||||
CD14F1A8219FF3B800E7DD22 /* MBIMUpdateQueue.h */,
|
CD14F1A8219FF3B800E7DD22 /* MBIMUpdateQueue.h */,
|
||||||
CD14F1A9219FF3B800E7DD22 /* MBIMUpdateQueue.m */,
|
CD14F1A9219FF3B800E7DD22 /* MBIMUpdateQueue.m */,
|
||||||
CD14F1AB219FFAE100E7DD22 /* MBIMConcurrentHTTPServer.h */,
|
CD14F1AB219FFAE100E7DD22 /* MBIMConcurrentHTTPServer.h */,
|
||||||
CD14F1AC219FFAE100E7DD22 /* MBIMConcurrentHTTPServer.m */,
|
CD14F1AC219FFAE100E7DD22 /* MBIMConcurrentHTTPServer.m */,
|
||||||
1ACFCFE2219EB45300E2C237 /* MBIMHTTPConnection.h */,
|
1ACFCFE2219EB45300E2C237 /* MBIMHTTPConnection.h */,
|
||||||
1ACFCFE3219EB45300E2C237 /* MBIMHTTPConnection.m */,
|
1ACFCFE3219EB45300E2C237 /* MBIMHTTPConnection.m */,
|
||||||
1AAB32A921F81AD0004A2A72 /* Security */,
|
CDA64B452DFCBF3000E9B07E /* MBIMPingPongWebSocket.h */,
|
||||||
|
CDA64B462DFCBF3000E9B07E /* MBIMPingPongWebSocket.m */,
|
||||||
);
|
);
|
||||||
path = Bridge;
|
path = Bridge;
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
@@ -346,19 +365,18 @@
|
|||||||
1AA43E8E219EBB2D00EDF1A7 /* MBIMJSONDataResponse.m */,
|
1AA43E8E219EBB2D00EDF1A7 /* MBIMJSONDataResponse.m */,
|
||||||
CDE455A521A531ED0041F5DD /* MBIMDataResponse.h */,
|
CDE455A521A531ED0041F5DD /* MBIMDataResponse.h */,
|
||||||
CDE455A621A531ED0041F5DD /* MBIMDataResponse.m */,
|
CDE455A621A531ED0041F5DD /* MBIMDataResponse.m */,
|
||||||
|
CD936A30289B353F0093A1AC /* MBIMErrorResponse.h */,
|
||||||
|
CD936A31289B353F0093A1AC /* MBIMErrorResponse.m */,
|
||||||
1AA43E93219EC38E00EDF1A7 /* MBIMHTTPUtilities.h */,
|
1AA43E93219EC38E00EDF1A7 /* MBIMHTTPUtilities.h */,
|
||||||
1AA43E94219EC38E00EDF1A7 /* MBIMHTTPUtilities.m */,
|
1AA43E94219EC38E00EDF1A7 /* MBIMHTTPUtilities.m */,
|
||||||
|
CD2782BD2952832B00C0C030 /* MBIMImageUtils.h */,
|
||||||
|
CD2782BE2952832B00C0C030 /* MBIMImageUtils.m */,
|
||||||
|
CD3F62AF297769F2004305D9 /* MBIMURLUtilities.h */,
|
||||||
|
CD3F62B0297769F2004305D9 /* MBIMURLUtilities.m */,
|
||||||
);
|
);
|
||||||
path = Utilities;
|
path = Utilities;
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
};
|
};
|
||||||
1AAB32A921F81AD0004A2A72 /* Security */ = {
|
|
||||||
isa = PBXGroup;
|
|
||||||
children = (
|
|
||||||
);
|
|
||||||
path = Security;
|
|
||||||
sourceTree = "<group>";
|
|
||||||
};
|
|
||||||
1AAB32AE21F82E73004A2A72 /* Utilities */ = {
|
1AAB32AE21F82E73004A2A72 /* Utilities */ = {
|
||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
@@ -520,22 +538,32 @@
|
|||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
1AA43E90219EBB3400EDF1A7 /* Utilities */,
|
1AA43E90219EBB3400EDF1A7 /* Utilities */,
|
||||||
|
CD2ECEC0269539100055E302 /* MBIMAuthenticateOperation.h */,
|
||||||
|
CD2ECEC1269539100055E302 /* MBIMAuthenticateOperation.m */,
|
||||||
CD602054219B5DFD0024D9C5 /* MBIMBridgeOperation.h */,
|
CD602054219B5DFD0024D9C5 /* MBIMBridgeOperation.h */,
|
||||||
CD602055219B5DFD0024D9C5 /* MBIMBridgeOperation.m */,
|
CD602055219B5DFD0024D9C5 /* MBIMBridgeOperation.m */,
|
||||||
CD60205A219B623F0024D9C5 /* MBIMMessagesListOperation.h */,
|
|
||||||
CD60205B219B623F0024D9C5 /* MBIMMessagesListOperation.m */,
|
|
||||||
CD60205D219B674B0024D9C5 /* MBIMConversationListOperation.h */,
|
CD60205D219B674B0024D9C5 /* MBIMConversationListOperation.h */,
|
||||||
CD60205E219B674B0024D9C5 /* MBIMConversationListOperation.m */,
|
CD60205E219B674B0024D9C5 /* MBIMConversationListOperation.m */,
|
||||||
|
CDDCF78B283F398C0087ABDF /* MBIMDeleteConversationOperation.h */,
|
||||||
|
CDDCF78C283F398C0087ABDF /* MBIMDeleteConversationOperation.m */,
|
||||||
CDE455A221A5308D0041F5DD /* MBIMFetchAttachmentOperation.h */,
|
CDE455A221A5308D0041F5DD /* MBIMFetchAttachmentOperation.h */,
|
||||||
CDE455A321A5308D0041F5DD /* MBIMFetchAttachmentOperation.m */,
|
CDE455A321A5308D0041F5DD /* MBIMFetchAttachmentOperation.m */,
|
||||||
CDE4559F21A365AD0041F5DD /* MBIMMarkOperation.h */,
|
CDE4559F21A365AD0041F5DD /* MBIMMarkOperation.h */,
|
||||||
CDE455A021A365AD0041F5DD /* MBIMMarkOperation.m */,
|
CDE455A021A365AD0041F5DD /* MBIMMarkOperation.m */,
|
||||||
|
CD60205A219B623F0024D9C5 /* MBIMMessagesListOperation.h */,
|
||||||
|
CD60205B219B623F0024D9C5 /* MBIMMessagesListOperation.m */,
|
||||||
|
CDEFF9FC2CACC7A700063C52 /* MBIMResolveHandleOperation.h */,
|
||||||
|
CDEFF9FD2CACC7A700063C52 /* MBIMResolveHandleOperation.m */,
|
||||||
CD602060219B68950024D9C5 /* MBIMSendMessageOperation.h */,
|
CD602060219B68950024D9C5 /* MBIMSendMessageOperation.h */,
|
||||||
CD602061219B68950024D9C5 /* MBIMSendMessageOperation.m */,
|
CD602061219B68950024D9C5 /* MBIMSendMessageOperation.m */,
|
||||||
|
CD936A37289B49FC0093A1AC /* MBIMStatusOperation.h */,
|
||||||
|
CD936A38289B49FC0093A1AC /* MBIMStatusOperation.m */,
|
||||||
CD14F19F219FE7D600E7DD22 /* MBIMUpdatePollOperation.h */,
|
CD14F19F219FE7D600E7DD22 /* MBIMUpdatePollOperation.h */,
|
||||||
CD14F1A0219FE7D600E7DD22 /* MBIMUpdatePollOperation.m */,
|
CD14F1A0219FE7D600E7DD22 /* MBIMUpdatePollOperation.m */,
|
||||||
1AD8936C21EFD986009B599A /* MBIMUploadAttachmentOperation.h */,
|
1AD8936C21EFD986009B599A /* MBIMUploadAttachmentOperation.h */,
|
||||||
1AD8936D21EFD986009B599A /* MBIMUploadAttachmentOperation.m */,
|
1AD8936D21EFD986009B599A /* MBIMUploadAttachmentOperation.m */,
|
||||||
|
CD936A33289B47D50093A1AC /* MBIMVersionOperation.h */,
|
||||||
|
CD936A34289B47D50093A1AC /* MBIMVersionOperation.m */,
|
||||||
);
|
);
|
||||||
path = Operations;
|
path = Operations;
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
@@ -567,6 +595,7 @@
|
|||||||
1A0C446D219A4BCD00F2AC00 /* Bridge */,
|
1A0C446D219A4BCD00F2AC00 /* Bridge */,
|
||||||
CDF62334219A895D00690038 /* main.m */,
|
CDF62334219A895D00690038 /* main.m */,
|
||||||
1AAB32B221F835BD004A2A72 /* KPServer.pch */,
|
1AAB32B221F835BD004A2A72 /* KPServer.pch */,
|
||||||
|
CD936A2F289B31740093A1AC /* kordophoned-RestrictedEntitlements.plist */,
|
||||||
);
|
);
|
||||||
path = kordophone;
|
path = kordophone;
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
@@ -574,40 +603,6 @@
|
|||||||
/* End PBXGroup section */
|
/* End PBXGroup section */
|
||||||
|
|
||||||
/* Begin PBXHeadersBuildPhase section */
|
/* Begin PBXHeadersBuildPhase section */
|
||||||
1ACFCDDF219EB28A00E2C237 /* Headers */ = {
|
|
||||||
isa = PBXHeadersBuildPhase;
|
|
||||||
buildActionMask = 2147483647;
|
|
||||||
files = (
|
|
||||||
1ACFCFCB219EB2AC00E2C237 /* DDLog.h in Headers */,
|
|
||||||
1ACFCF40219EB2AC00E2C237 /* MultipartFormDataParser.h in Headers */,
|
|
||||||
1ACFCF2F219EB2AC00E2C237 /* HTTPAsyncFileResponse.h in Headers */,
|
|
||||||
1ACFCF37219EB2AC00E2C237 /* HTTPDataResponse.h in Headers */,
|
|
||||||
1ACFCF45219EB2AC00E2C237 /* MultipartMessageHeaderField.h in Headers */,
|
|
||||||
1ACFCF3A219EB2AC00E2C237 /* HTTPDynamicFileResponse.h in Headers */,
|
|
||||||
1ACFCFCC219EB2AC00E2C237 /* DDAbstractDatabaseLogger.h in Headers */,
|
|
||||||
1ACFCFD6219EB2AC00E2C237 /* DDTTYLogger.h in Headers */,
|
|
||||||
1ACFCF4C219EB2AC00E2C237 /* DDData.h in Headers */,
|
|
||||||
1ACFCF2D219EB2AC00E2C237 /* WebSocket.h in Headers */,
|
|
||||||
1ACFCF49219EB2AC00E2C237 /* DDRange.h in Headers */,
|
|
||||||
1ACFCF32219EB2AC00E2C237 /* HTTPRedirectResponse.h in Headers */,
|
|
||||||
1ACFCF2E219EB2AC00E2C237 /* HTTPAuthenticationRequest.h in Headers */,
|
|
||||||
1ACFCFDC219EB2AC00E2C237 /* GCDAsyncSocket.h in Headers */,
|
|
||||||
1ACFCF4A219EB2AC00E2C237 /* DDNumber.h in Headers */,
|
|
||||||
1ACFCF3F219EB2AC00E2C237 /* HTTPResponse.h in Headers */,
|
|
||||||
1ACFCF39219EB2AC00E2C237 /* HTTPFileResponse.h in Headers */,
|
|
||||||
1ACFCFCF219EB2AC00E2C237 /* ContextFilterLogFormatter.h in Headers */,
|
|
||||||
1ACFCF3B219EB2AC00E2C237 /* HTTPServer.h in Headers */,
|
|
||||||
1ACFCF41219EB2AC00E2C237 /* MultipartMessageHeader.h in Headers */,
|
|
||||||
1ACFCF38219EB2AC00E2C237 /* HTTPErrorResponse.h in Headers */,
|
|
||||||
1ACFCF2B219EB2AC00E2C237 /* HTTPLogging.h in Headers */,
|
|
||||||
1ACFCFD0219EB2AC00E2C237 /* DispatchQueueLogFormatter.h in Headers */,
|
|
||||||
1ACFCF2C219EB2AC00E2C237 /* HTTPMessage.h in Headers */,
|
|
||||||
1ACFCFD9219EB2AC00E2C237 /* DDASLLogger.h in Headers */,
|
|
||||||
1ACFCFCE219EB2AC00E2C237 /* DDFileLogger.h in Headers */,
|
|
||||||
1ACFCF2A219EB2AC00E2C237 /* HTTPConnection.h in Headers */,
|
|
||||||
);
|
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
|
||||||
};
|
|
||||||
CD83E15D219BE91500F4CCEA /* Headers */ = {
|
CD83E15D219BE91500F4CCEA /* Headers */ = {
|
||||||
isa = PBXHeadersBuildPhase;
|
isa = PBXHeadersBuildPhase;
|
||||||
buildActionMask = 2147483647;
|
buildActionMask = 2147483647;
|
||||||
@@ -624,8 +619,6 @@
|
|||||||
buildPhases = (
|
buildPhases = (
|
||||||
1ACFCDDD219EB28A00E2C237 /* Sources */,
|
1ACFCDDD219EB28A00E2C237 /* Sources */,
|
||||||
1ACFCDDE219EB28A00E2C237 /* Frameworks */,
|
1ACFCDDE219EB28A00E2C237 /* Frameworks */,
|
||||||
1ACFCDDF219EB28A00E2C237 /* Headers */,
|
|
||||||
1ACFCDE0219EB28A00E2C237 /* Resources */,
|
|
||||||
);
|
);
|
||||||
buildRules = (
|
buildRules = (
|
||||||
);
|
);
|
||||||
@@ -633,8 +626,8 @@
|
|||||||
);
|
);
|
||||||
name = CocoaHTTPServer;
|
name = CocoaHTTPServer;
|
||||||
productName = CocoaHTTPServer;
|
productName = CocoaHTTPServer;
|
||||||
productReference = 1ACFCDE2219EB28A00E2C237 /* CocoaHTTPServer.framework */;
|
productReference = 1ACFCDE2219EB28A00E2C237 /* libCocoaHTTPServer.a */;
|
||||||
productType = "com.apple.product-type.framework";
|
productType = "com.apple.product-type.library.static";
|
||||||
};
|
};
|
||||||
CD14F18A219E2DB400E7DD22 /* Tests */ = {
|
CD14F18A219E2DB400E7DD22 /* Tests */ = {
|
||||||
isa = PBXNativeTarget;
|
isa = PBXNativeTarget;
|
||||||
@@ -675,10 +668,10 @@
|
|||||||
isa = PBXNativeTarget;
|
isa = PBXNativeTarget;
|
||||||
buildConfigurationList = CDF62336219A895D00690038 /* Build configuration list for PBXNativeTarget "kordophoned" */;
|
buildConfigurationList = CDF62336219A895D00690038 /* Build configuration list for PBXNativeTarget "kordophoned" */;
|
||||||
buildPhases = (
|
buildPhases = (
|
||||||
|
CD936A36289B48930093A1AC /* Compile Version String */,
|
||||||
CDF6232E219A895D00690038 /* Sources */,
|
CDF6232E219A895D00690038 /* Sources */,
|
||||||
CDF6232F219A895D00690038 /* Frameworks */,
|
CDF6232F219A895D00690038 /* Frameworks */,
|
||||||
CDF62330219A895D00690038 /* CopyFiles */,
|
CDF62330219A895D00690038 /* CopyFiles */,
|
||||||
1AAB32AD21F8245D004A2A72 /* Add current directory to rpath */,
|
|
||||||
);
|
);
|
||||||
buildRules = (
|
buildRules = (
|
||||||
);
|
);
|
||||||
@@ -736,13 +729,6 @@
|
|||||||
/* End PBXProject section */
|
/* End PBXProject section */
|
||||||
|
|
||||||
/* Begin PBXResourcesBuildPhase section */
|
/* Begin PBXResourcesBuildPhase section */
|
||||||
1ACFCDE0219EB28A00E2C237 /* Resources */ = {
|
|
||||||
isa = PBXResourcesBuildPhase;
|
|
||||||
buildActionMask = 2147483647;
|
|
||||||
files = (
|
|
||||||
);
|
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
|
||||||
};
|
|
||||||
CD14F189219E2DB400E7DD22 /* Resources */ = {
|
CD14F189219E2DB400E7DD22 /* Resources */ = {
|
||||||
isa = PBXResourcesBuildPhase;
|
isa = PBXResourcesBuildPhase;
|
||||||
buildActionMask = 2147483647;
|
buildActionMask = 2147483647;
|
||||||
@@ -753,7 +739,7 @@
|
|||||||
/* End PBXResourcesBuildPhase section */
|
/* End PBXResourcesBuildPhase section */
|
||||||
|
|
||||||
/* Begin PBXShellScriptBuildPhase section */
|
/* Begin PBXShellScriptBuildPhase section */
|
||||||
1AAB32AD21F8245D004A2A72 /* Add current directory to rpath */ = {
|
CD936A36289B48930093A1AC /* Compile Version String */ = {
|
||||||
isa = PBXShellScriptBuildPhase;
|
isa = PBXShellScriptBuildPhase;
|
||||||
buildActionMask = 2147483647;
|
buildActionMask = 2147483647;
|
||||||
files = (
|
files = (
|
||||||
@@ -762,14 +748,14 @@
|
|||||||
);
|
);
|
||||||
inputPaths = (
|
inputPaths = (
|
||||||
);
|
);
|
||||||
name = "Add current directory to rpath";
|
name = "Compile Version String";
|
||||||
outputFileListPaths = (
|
outputFileListPaths = (
|
||||||
);
|
);
|
||||||
outputPaths = (
|
outputPaths = (
|
||||||
);
|
);
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
shellPath = /bin/sh;
|
shellPath = /bin/sh;
|
||||||
shellScript = "# Type a script or drag a script file from your workspace to insert its path.\n\nRESULT=$(install_name_tool -delete_rpath $BUILT_PRODUCTS_DIR $BUILT_PRODUCTS_DIR/$EXECUTABLE_NAME 2> /dev/null)\n\ninstall_name_tool -add_rpath $BUILT_PRODUCTS_DIR $BUILT_PRODUCTS_DIR/$EXECUTABLE_NAME\n";
|
shellScript = "# Type a script or drag a script file from your workspace to insert its path.\nOUTPUT_FILE=\"$DERIVED_FILE_DIR/MBIMVersion.c\"\nVERSION_STR=`git describe`\n\necho \"const char* MBIMVersion() { return \\\"$VERSION_STR\\\"; }\" > $OUTPUT_FILE\n";
|
||||||
};
|
};
|
||||||
/* End PBXShellScriptBuildPhase section */
|
/* End PBXShellScriptBuildPhase section */
|
||||||
|
|
||||||
@@ -826,27 +812,37 @@
|
|||||||
isa = PBXSourcesBuildPhase;
|
isa = PBXSourcesBuildPhase;
|
||||||
buildActionMask = 2147483647;
|
buildActionMask = 2147483647;
|
||||||
files = (
|
files = (
|
||||||
|
CDA64B472DFCBF3000E9B07E /* MBIMPingPongWebSocket.m in Sources */,
|
||||||
CD14F1AD219FFAE100E7DD22 /* MBIMConcurrentHTTPServer.m in Sources */,
|
CD14F1AD219FFAE100E7DD22 /* MBIMConcurrentHTTPServer.m in Sources */,
|
||||||
1AA43E91219EBC2C00EDF1A7 /* MBIMHTTPConnection.m in Sources */,
|
1AA43E91219EBC2C00EDF1A7 /* MBIMHTTPConnection.m in Sources */,
|
||||||
CDF62339219A8A5600690038 /* MBIMBridge.h in Sources */,
|
CDF62339219A8A5600690038 /* MBIMBridge.h in Sources */,
|
||||||
1AA43E95219EC38E00EDF1A7 /* MBIMHTTPUtilities.m in Sources */,
|
1AA43E95219EC38E00EDF1A7 /* MBIMHTTPUtilities.m in Sources */,
|
||||||
CDE455A421A5308D0041F5DD /* MBIMFetchAttachmentOperation.m in Sources */,
|
CDE455A421A5308D0041F5DD /* MBIMFetchAttachmentOperation.m in Sources */,
|
||||||
|
CD2ECEC526953F2A0055E302 /* MBIMAuthToken.m in Sources */,
|
||||||
CD83E156219BE10A00F4CCEA /* hooking.m in Sources */,
|
CD83E156219BE10A00F4CCEA /* hooking.m in Sources */,
|
||||||
1AAB32B121F82EB7004A2A72 /* MBIMLogging.m in Sources */,
|
1AAB32B121F82EB7004A2A72 /* MBIMLogging.m in Sources */,
|
||||||
|
CDDCF78D283F398C0087ABDF /* MBIMDeleteConversationOperation.m in Sources */,
|
||||||
1AD8936E21EFD986009B599A /* MBIMUploadAttachmentOperation.m in Sources */,
|
1AD8936E21EFD986009B599A /* MBIMUploadAttachmentOperation.m in Sources */,
|
||||||
CDF6233A219A8A5600690038 /* MBIMBridge.m in Sources */,
|
CDF6233A219A8A5600690038 /* MBIMBridge.m in Sources */,
|
||||||
CDF62335219A895D00690038 /* main.m in Sources */,
|
CDF62335219A895D00690038 /* main.m in Sources */,
|
||||||
CD60205C219B623F0024D9C5 /* MBIMMessagesListOperation.m in Sources */,
|
CD60205C219B623F0024D9C5 /* MBIMMessagesListOperation.m in Sources */,
|
||||||
CD14F1AA219FF3B800E7DD22 /* MBIMUpdateQueue.m in Sources */,
|
CD14F1AA219FF3B800E7DD22 /* MBIMUpdateQueue.m in Sources */,
|
||||||
|
CD3F62B1297769F2004305D9 /* MBIMURLUtilities.m in Sources */,
|
||||||
CD14F1A4219FF22700E7DD22 /* IMMessageItem+Encoded.m in Sources */,
|
CD14F1A4219FF22700E7DD22 /* IMMessageItem+Encoded.m in Sources */,
|
||||||
CD602062219B68950024D9C5 /* MBIMSendMessageOperation.m in Sources */,
|
CD602062219B68950024D9C5 /* MBIMSendMessageOperation.m in Sources */,
|
||||||
CD14F1A1219FE7D600E7DD22 /* MBIMUpdatePollOperation.m in Sources */,
|
CD14F1A1219FE7D600E7DD22 /* MBIMUpdatePollOperation.m in Sources */,
|
||||||
|
CD936A39289B49FC0093A1AC /* MBIMStatusOperation.m in Sources */,
|
||||||
|
CDEFF9FE2CACC7A700063C52 /* MBIMResolveHandleOperation.m in Sources */,
|
||||||
CDE455A121A365AD0041F5DD /* MBIMMarkOperation.m in Sources */,
|
CDE455A121A365AD0041F5DD /* MBIMMarkOperation.m in Sources */,
|
||||||
CDE455A721A531ED0041F5DD /* MBIMDataResponse.m in Sources */,
|
CDE455A721A531ED0041F5DD /* MBIMDataResponse.m in Sources */,
|
||||||
|
CD936A35289B47D60093A1AC /* MBIMVersionOperation.m in Sources */,
|
||||||
CD602056219B5DFD0024D9C5 /* MBIMBridgeOperation.m in Sources */,
|
CD602056219B5DFD0024D9C5 /* MBIMBridgeOperation.m in Sources */,
|
||||||
CD60205F219B674B0024D9C5 /* MBIMConversationListOperation.m in Sources */,
|
CD60205F219B674B0024D9C5 /* MBIMConversationListOperation.m in Sources */,
|
||||||
CDE4556421A3578A0041F5DD /* IMChat+Encoded.m in Sources */,
|
CDE4556421A3578A0041F5DD /* IMChat+Encoded.m in Sources */,
|
||||||
|
CD2782BF2952832B00C0C030 /* MBIMImageUtils.m in Sources */,
|
||||||
1AA43E8F219EBB2D00EDF1A7 /* MBIMJSONDataResponse.m in Sources */,
|
1AA43E8F219EBB2D00EDF1A7 /* MBIMJSONDataResponse.m in Sources */,
|
||||||
|
CD936A32289B353F0093A1AC /* MBIMErrorResponse.m in Sources */,
|
||||||
|
CD2ECEC2269539100055E302 /* MBIMAuthenticateOperation.m in Sources */,
|
||||||
);
|
);
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
};
|
};
|
||||||
@@ -991,27 +987,10 @@
|
|||||||
isa = XCBuildConfiguration;
|
isa = XCBuildConfiguration;
|
||||||
buildSettings = {
|
buildSettings = {
|
||||||
CLANG_ENABLE_MODULES = YES;
|
CLANG_ENABLE_MODULES = YES;
|
||||||
CODE_SIGN_IDENTITY = "";
|
|
||||||
CODE_SIGN_STYLE = Automatic;
|
|
||||||
COMBINE_HIDPI_IMAGES = YES;
|
COMBINE_HIDPI_IMAGES = YES;
|
||||||
CURRENT_PROJECT_VERSION = 1;
|
|
||||||
DEFINES_MODULE = YES;
|
|
||||||
DYLIB_COMPATIBILITY_VERSION = 1;
|
|
||||||
DYLIB_CURRENT_VERSION = 1;
|
|
||||||
DYLIB_INSTALL_NAME_BASE = "@rpath";
|
|
||||||
FRAMEWORK_VERSION = A;
|
|
||||||
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
|
|
||||||
LD_RUNPATH_SEARCH_PATHS = (
|
|
||||||
"$(inherited)",
|
|
||||||
"@executable_path/../Frameworks",
|
|
||||||
"@loader_path/Frameworks",
|
|
||||||
);
|
|
||||||
MTL_ENABLE_DEBUG_INFO = YES;
|
MTL_ENABLE_DEBUG_INFO = YES;
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = com.github.CocoaHTTPServer;
|
|
||||||
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
|
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
|
||||||
SKIP_INSTALL = YES;
|
SKIP_INSTALL = YES;
|
||||||
VERSIONING_SYSTEM = "apple-generic";
|
|
||||||
VERSION_INFO_PREFIX = "";
|
|
||||||
};
|
};
|
||||||
name = Debug;
|
name = Debug;
|
||||||
};
|
};
|
||||||
@@ -1019,26 +998,9 @@
|
|||||||
isa = XCBuildConfiguration;
|
isa = XCBuildConfiguration;
|
||||||
buildSettings = {
|
buildSettings = {
|
||||||
CLANG_ENABLE_MODULES = YES;
|
CLANG_ENABLE_MODULES = YES;
|
||||||
CODE_SIGN_IDENTITY = "";
|
|
||||||
CODE_SIGN_STYLE = Automatic;
|
|
||||||
COMBINE_HIDPI_IMAGES = YES;
|
COMBINE_HIDPI_IMAGES = YES;
|
||||||
CURRENT_PROJECT_VERSION = 1;
|
|
||||||
DEFINES_MODULE = YES;
|
|
||||||
DYLIB_COMPATIBILITY_VERSION = 1;
|
|
||||||
DYLIB_CURRENT_VERSION = 1;
|
|
||||||
DYLIB_INSTALL_NAME_BASE = "@rpath";
|
|
||||||
FRAMEWORK_VERSION = A;
|
|
||||||
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
|
|
||||||
LD_RUNPATH_SEARCH_PATHS = (
|
|
||||||
"$(inherited)",
|
|
||||||
"@executable_path/../Frameworks",
|
|
||||||
"@loader_path/Frameworks",
|
|
||||||
);
|
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = com.github.CocoaHTTPServer;
|
|
||||||
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
|
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
|
||||||
SKIP_INSTALL = YES;
|
SKIP_INSTALL = YES;
|
||||||
VERSIONING_SYSTEM = "apple-generic";
|
|
||||||
VERSION_INFO_PREFIX = "";
|
|
||||||
};
|
};
|
||||||
name = Release;
|
name = Release;
|
||||||
};
|
};
|
||||||
@@ -1114,9 +1076,11 @@
|
|||||||
isa = XCBuildConfiguration;
|
isa = XCBuildConfiguration;
|
||||||
buildSettings = {
|
buildSettings = {
|
||||||
CLANG_ENABLE_MODULES = NO;
|
CLANG_ENABLE_MODULES = NO;
|
||||||
|
CODE_SIGN_ENTITLEMENTS = "kordophone/kordophoned-RestrictedEntitlements.plist";
|
||||||
CODE_SIGN_IDENTITY = "-";
|
CODE_SIGN_IDENTITY = "-";
|
||||||
CODE_SIGN_STYLE = Automatic;
|
CODE_SIGN_STYLE = Automatic;
|
||||||
GCC_PREFIX_HEADER = kordophone/KPServer.pch;
|
GCC_PREFIX_HEADER = kordophone/KPServer.pch;
|
||||||
|
OTHER_LDFLAGS = "-ObjC";
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
SDKROOT = macosx;
|
SDKROOT = macosx;
|
||||||
SYSTEM_FRAMEWORK_SEARCH_PATHS = (
|
SYSTEM_FRAMEWORK_SEARCH_PATHS = (
|
||||||
@@ -1133,6 +1097,7 @@
|
|||||||
CODE_SIGN_IDENTITY = "-";
|
CODE_SIGN_IDENTITY = "-";
|
||||||
CODE_SIGN_STYLE = Automatic;
|
CODE_SIGN_STYLE = Automatic;
|
||||||
GCC_PREFIX_HEADER = kordophone/KPServer.pch;
|
GCC_PREFIX_HEADER = kordophone/KPServer.pch;
|
||||||
|
OTHER_LDFLAGS = "-ObjC";
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
SDKROOT = macosx;
|
SDKROOT = macosx;
|
||||||
SYSTEM_FRAMEWORK_SEARCH_PATHS = (
|
SYSTEM_FRAMEWORK_SEARCH_PATHS = (
|
||||||
|
|||||||
@@ -7,6 +7,9 @@ sudo defaults write /Library/Preferences/com.apple.security.coderequirements Ent
|
|||||||
|
|
||||||
Maybe a better thing to do is to DYLD_PRELOAD `imagent` and swizzle `IMDAuditTokenTaskHasEntitlement` to always return YES.
|
Maybe a better thing to do is to DYLD_PRELOAD `imagent` and swizzle `IMDAuditTokenTaskHasEntitlement` to always return YES.
|
||||||
|
|
||||||
|
Included in the project is "kordophoned-RestrictedEntitlements.plist", which contains all necessary restricted entitlements.
|
||||||
|
On production macOS builds, the kernel will kill kordophoned immediately if it's signed using restricted entitlements, so agent hook is a
|
||||||
|
better option when running on prod machines. By default, the project is configured to ignore kordophoned-RestrictedEntitlements.plist when building.
|
||||||
|
|
||||||
## Building/linking
|
## Building/linking
|
||||||
If you get dyld errors running from the command line, use `install_name_tool` to update the @rpath (where @rpath points to where linked Frameworks like GCDWebServer is).
|
If you get dyld errors running from the command line, use `install_name_tool` to update the @rpath (where @rpath points to where linked Frameworks like GCDWebServer is).
|
||||||
|
|||||||
26
kordophone/Bridge/MBIMAuthToken.h
Normal file
26
kordophone/Bridge/MBIMAuthToken.h
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
//
|
||||||
|
// MBIMAuthToken.h
|
||||||
|
// MBIMAuthToken
|
||||||
|
//
|
||||||
|
// Created by James Magahern on 7/6/21.
|
||||||
|
// Copyright © 2021 James Magahern. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import <Foundation/Foundation.h>
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
|
@interface MBIMAuthToken : NSObject
|
||||||
|
@property (nonatomic, readonly) NSString *username;
|
||||||
|
@property (nonatomic, readonly) NSString *jwtToken;
|
||||||
|
@property (nonatomic, readonly) NSDate *expirationDate;
|
||||||
|
|
||||||
|
- (instancetype)initWithUsername:(NSString *)username NS_DESIGNATED_INITIALIZER;
|
||||||
|
- (instancetype)initWithTokenString:(NSString *)tokenString NS_DESIGNATED_INITIALIZER;
|
||||||
|
|
||||||
|
- (BOOL)isValid;
|
||||||
|
|
||||||
|
- (instancetype)init NS_UNAVAILABLE;
|
||||||
|
@end
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_END
|
||||||
149
kordophone/Bridge/MBIMAuthToken.m
Normal file
149
kordophone/Bridge/MBIMAuthToken.m
Normal file
@@ -0,0 +1,149 @@
|
|||||||
|
//
|
||||||
|
// MBIMAuthToken.m
|
||||||
|
// MBIMAuthToken
|
||||||
|
//
|
||||||
|
// Created by James Magahern on 7/6/21.
|
||||||
|
// Copyright © 2021 James Magahern. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import "MBIMAuthToken.h"
|
||||||
|
#import <CommonCrypto/CommonHMAC.h>
|
||||||
|
|
||||||
|
#define HOUR 3600
|
||||||
|
#define DAY (24*HOUR)
|
||||||
|
|
||||||
|
static const NSTimeInterval ExpirationTime = 15 * DAY;
|
||||||
|
static const char *SecretKey = "709E7CD8-4983-4D5F-B7BF-8B1C6341D2DB";
|
||||||
|
|
||||||
|
static NSString *const kUsernamePayloadKey = @"user";
|
||||||
|
static NSString *const kIssuerPayloadKey = @"iss";
|
||||||
|
static NSString *const kExpirationDatePayloadKey = @"exp";
|
||||||
|
|
||||||
|
static NSString *const kIssuerPayloadValue = @"kordophone";
|
||||||
|
|
||||||
|
@interface MBIMAuthToken ()
|
||||||
|
@property (nonatomic, copy) NSString *username;
|
||||||
|
@property (nonatomic, copy) NSString *jwtToken;
|
||||||
|
@property (nonatomic, copy) NSDate *expirationDate;
|
||||||
|
|
||||||
|
// JWT Payload data
|
||||||
|
@property (nonatomic, copy) NSString *headerString;
|
||||||
|
@property (nonatomic, copy) NSString *payloadString;
|
||||||
|
@property (nonatomic, copy) NSData *signatureData;
|
||||||
|
@end
|
||||||
|
|
||||||
|
@implementation MBIMAuthToken
|
||||||
|
|
||||||
|
- (instancetype)initWithUsername:(NSString *)username
|
||||||
|
{
|
||||||
|
self = [super init];
|
||||||
|
if (self) {
|
||||||
|
self.username = username;
|
||||||
|
self.expirationDate = [NSDate dateWithTimeIntervalSinceNow:ExpirationTime];
|
||||||
|
}
|
||||||
|
|
||||||
|
return self;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (instancetype)initWithTokenString:(NSString *)tokenString
|
||||||
|
{
|
||||||
|
NSArray<NSString *> *components = [tokenString componentsSeparatedByString:@"."];
|
||||||
|
if (components.count != 3) {
|
||||||
|
return nil;
|
||||||
|
}
|
||||||
|
|
||||||
|
NSString *header = components[0];
|
||||||
|
NSString *payload = components[1];
|
||||||
|
NSString *signature = components[2];
|
||||||
|
|
||||||
|
NSData *payloadData = [[NSData alloc] initWithBase64EncodedString:payload options:0];
|
||||||
|
NSDictionary *decodedPayload = [NSJSONSerialization JSONObjectWithData:payloadData options:0 error:nil];
|
||||||
|
if (!decodedPayload) {
|
||||||
|
return nil;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (![decodedPayload[kIssuerPayloadKey] isEqualToString:@"kordophone"]) {
|
||||||
|
return nil;
|
||||||
|
}
|
||||||
|
|
||||||
|
self = [super init];
|
||||||
|
if (self) {
|
||||||
|
_headerString = header;
|
||||||
|
_payloadString = payload;
|
||||||
|
_signatureData = [[NSData alloc] initWithBase64EncodedString:signature options:0];
|
||||||
|
|
||||||
|
_username = decodedPayload[kUsernamePayloadKey];
|
||||||
|
|
||||||
|
NSTimeInterval expirationDate = [decodedPayload[kExpirationDatePayloadKey] floatValue];
|
||||||
|
_expirationDate = [NSDate dateWithTimeIntervalSince1970:expirationDate];
|
||||||
|
}
|
||||||
|
|
||||||
|
return self;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (NSUInteger)hash
|
||||||
|
{
|
||||||
|
return (_username.hash ^ _expirationDate.hash);
|
||||||
|
}
|
||||||
|
|
||||||
|
- (NSString *)jwtToken
|
||||||
|
{
|
||||||
|
if (!_jwtToken) {
|
||||||
|
NSDictionary *header = @{
|
||||||
|
@"alg" : @"HS256",
|
||||||
|
@"typ" : @"jwt"
|
||||||
|
};
|
||||||
|
|
||||||
|
NSData *headerData = [NSJSONSerialization dataWithJSONObject:header options:0 error:nil];
|
||||||
|
NSString *headerStr = [headerData base64EncodedStringWithOptions:0];
|
||||||
|
|
||||||
|
NSInteger expirationDate = [_expirationDate timeIntervalSince1970];
|
||||||
|
NSDictionary *payload = @{
|
||||||
|
kUsernamePayloadKey : _username,
|
||||||
|
kIssuerPayloadKey : kIssuerPayloadValue,
|
||||||
|
kExpirationDatePayloadKey : [NSString stringWithFormat:@"%ld", expirationDate]
|
||||||
|
};
|
||||||
|
NSData *payloadData = [NSJSONSerialization dataWithJSONObject:payload options:0 error:nil];
|
||||||
|
NSString *payloadStr = [payloadData base64EncodedStringWithOptions:0];
|
||||||
|
|
||||||
|
NSString *jwtDataStr = [NSString stringWithFormat:@"%@.%@", headerStr, payloadStr];
|
||||||
|
NSData *jwtData = [jwtDataStr dataUsingEncoding:NSASCIIStringEncoding];
|
||||||
|
|
||||||
|
unsigned char signature[CC_SHA256_DIGEST_LENGTH];
|
||||||
|
CCHmac(kCCHmacAlgSHA256, SecretKey, sizeof(SecretKey), jwtData.bytes, jwtData.length, signature);
|
||||||
|
|
||||||
|
NSData *signatureData = [NSData dataWithBytes:signature length:CC_SHA256_DIGEST_LENGTH];
|
||||||
|
NSString *signatureStr = [signatureData base64EncodedStringWithOptions:0];
|
||||||
|
|
||||||
|
_jwtToken = [NSString stringWithFormat:@"%@.%@", jwtDataStr, signatureStr];
|
||||||
|
}
|
||||||
|
|
||||||
|
return _jwtToken;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (BOOL)isValid
|
||||||
|
{
|
||||||
|
// Verify expiration date
|
||||||
|
BOOL expirationDateValid = [_expirationDate timeIntervalSinceNow] > 0;
|
||||||
|
if (!expirationDateValid) {
|
||||||
|
MBIMLogInfo(@"Auth token expired.");
|
||||||
|
return NO;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Verify signature
|
||||||
|
NSString *verificationDataStr = [NSString stringWithFormat:@"%@.%@", _headerString, _payloadString];
|
||||||
|
NSData *verificationData = [verificationDataStr dataUsingEncoding:NSASCIIStringEncoding];
|
||||||
|
|
||||||
|
unsigned char computedSignature[CC_SHA256_DIGEST_LENGTH];
|
||||||
|
CCHmac(kCCHmacAlgSHA256, SecretKey, sizeof(SecretKey), verificationData.bytes, verificationData.length, computedSignature);
|
||||||
|
|
||||||
|
NSData *computedSignatureData = [NSData dataWithBytes:computedSignature length:CC_SHA256_DIGEST_LENGTH];
|
||||||
|
if (![computedSignatureData isEqualToData:_signatureData]) {
|
||||||
|
MBIMLogInfo(@"Auth token signature verification failed.");
|
||||||
|
return NO;
|
||||||
|
}
|
||||||
|
|
||||||
|
return YES;
|
||||||
|
}
|
||||||
|
|
||||||
|
@end
|
||||||
@@ -14,7 +14,7 @@
|
|||||||
#import "MBIMUpdateQueue.h"
|
#import "MBIMUpdateQueue.h"
|
||||||
#import "hooking.h"
|
#import "hooking.h"
|
||||||
|
|
||||||
#import <CocoaHTTPServer/HTTPServer.h>
|
#import "HTTPServer.h"
|
||||||
|
|
||||||
#import "IMCore_ClassDump.h"
|
#import "IMCore_ClassDump.h"
|
||||||
#import "IMFoundation_ClassDump.h"
|
#import "IMFoundation_ClassDump.h"
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
// Copyright © 2018 James Magahern. All rights reserved.
|
// Copyright © 2018 James Magahern. All rights reserved.
|
||||||
//
|
//
|
||||||
|
|
||||||
#import <CocoaHTTPServer/HTTPServer.h>
|
#import "HTTPServer.h"
|
||||||
|
|
||||||
NS_ASSUME_NONNULL_BEGIN
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
// Copyright © 2018 James Magahern. All rights reserved.
|
// Copyright © 2018 James Magahern. All rights reserved.
|
||||||
//
|
//
|
||||||
|
|
||||||
#import <CocoaHTTPServer/HTTPConnection.h>
|
#import "HTTPConnection.h"
|
||||||
|
|
||||||
@interface MBIMHTTPConnection : HTTPConnection
|
@interface MBIMHTTPConnection : HTTPConnection
|
||||||
|
|
||||||
|
|||||||
@@ -11,8 +11,16 @@
|
|||||||
#import "MBIMBridge.h"
|
#import "MBIMBridge.h"
|
||||||
#import "MBIMBridge_Private.h"
|
#import "MBIMBridge_Private.h"
|
||||||
#import "MBIMBridgeOperation.h"
|
#import "MBIMBridgeOperation.h"
|
||||||
|
#import "MBIMAuthToken.h"
|
||||||
|
#import "MBIMUpdateQueue.h"
|
||||||
|
#import "MBIMURLUtilities.h"
|
||||||
|
|
||||||
#import <Security/Security.h>
|
#import <Security/Security.h>
|
||||||
|
#import "HTTPMessage.h"
|
||||||
|
|
||||||
|
@interface HTTPConnection (/* INTERNAL */)
|
||||||
|
- (BOOL)isAuthenticated;
|
||||||
|
@end
|
||||||
|
|
||||||
@implementation MBIMHTTPConnection {
|
@implementation MBIMHTTPConnection {
|
||||||
NSMutableData *_bodyData;
|
NSMutableData *_bodyData;
|
||||||
@@ -31,7 +39,15 @@
|
|||||||
|
|
||||||
- (BOOL)isPasswordProtected:(NSString *)path
|
- (BOOL)isPasswordProtected:(NSString *)path
|
||||||
{
|
{
|
||||||
return [[MBIMBridge sharedInstance] usesAccessControl];
|
if ([[MBIMBridge sharedInstance] usesAccessControl]) {
|
||||||
|
NSURL *url = [NSURL URLWithString:path];
|
||||||
|
NSString *endpointName = [url lastPathComponent];
|
||||||
|
|
||||||
|
Class operationClass = [MBIMBridgeOperation operationClassForEndpointName:endpointName];
|
||||||
|
return [operationClass requiresAuthentication];
|
||||||
|
}
|
||||||
|
|
||||||
|
return NO;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (NSString *)passwordForUser:(NSString *)username
|
- (NSString *)passwordForUser:(NSString *)username
|
||||||
@@ -41,7 +57,23 @@
|
|||||||
return bridge.authPassword;
|
return bridge.authPassword;
|
||||||
}
|
}
|
||||||
|
|
||||||
return @"";
|
// nil means "user not in system"
|
||||||
|
return nil;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (BOOL)isAuthenticated
|
||||||
|
{
|
||||||
|
NSString *authInfo = [request headerField:@"Authorization"];
|
||||||
|
if ([authInfo hasPrefix:@"Bearer"]) {
|
||||||
|
NSArray *bearerAuthTuple = [authInfo componentsSeparatedByString:@" "];
|
||||||
|
if ([bearerAuthTuple count] == 2) {
|
||||||
|
NSString *jwtToken = [bearerAuthTuple objectAtIndex:1];
|
||||||
|
MBIMAuthToken *authToken = [[MBIMAuthToken alloc] initWithTokenString:jwtToken];
|
||||||
|
return [authToken isValid];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return [super isAuthenticated];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (BOOL)useDigestAccessAuthentication
|
- (BOOL)useDigestAccessAuthentication
|
||||||
@@ -77,6 +109,7 @@
|
|||||||
if (operationClass != nil) {
|
if (operationClass != nil) {
|
||||||
_currentOperation = [[operationClass alloc] initWithRequestURL:url completion:completion];
|
_currentOperation = [[operationClass alloc] initWithRequestURL:url completion:completion];
|
||||||
_currentOperation.requestBodyData = _bodyData;
|
_currentOperation.requestBodyData = _bodyData;
|
||||||
|
_currentOperation.request = self->request;
|
||||||
|
|
||||||
[[[MBIMBridge sharedInstance] operationQueue] addOperation:_currentOperation];
|
[[[MBIMBridge sharedInstance] operationQueue] addOperation:_currentOperation];
|
||||||
long status = dispatch_semaphore_wait(sema, dispatch_time(DISPATCH_TIME_NOW, (int64_t)(60.0 * NSEC_PER_SEC)));
|
long status = dispatch_semaphore_wait(sema, dispatch_time(DISPATCH_TIME_NOW, (int64_t)(60.0 * NSEC_PER_SEC)));
|
||||||
@@ -94,6 +127,28 @@
|
|||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (WebSocket *)webSocketForURI:(NSString *)path
|
||||||
|
{
|
||||||
|
NSURL *url = [NSURL URLWithString:path];
|
||||||
|
NSString *endpointName = [url lastPathComponent];
|
||||||
|
NSString *authTokenString = [url valueForQueryItemWithName:@"token"];
|
||||||
|
MBIMAuthToken *queryAuthToken = [[MBIMAuthToken alloc] initWithTokenString:authTokenString];
|
||||||
|
|
||||||
|
NSLog(@"Websocket for URI: %@ | authenticated request: %@", path, [self isAuthenticated] ? @"YES" : @"NO");
|
||||||
|
if ([endpointName isEqualToString:@"updates"]) {
|
||||||
|
if (![self isAuthenticated] && ![queryAuthToken isValid]) {
|
||||||
|
NSLog(@"Websocket: auth invalid, rejecting.");
|
||||||
|
NSLog(@"Query Token: %@, raw: %@", queryAuthToken, authTokenString);
|
||||||
|
return nil;
|
||||||
|
}
|
||||||
|
|
||||||
|
NSLog(@"Vending websocket for consumer");
|
||||||
|
return [[MBIMUpdateQueue sharedInstance] vendUpdateWebSocketConsumerForRequest:request socket:asyncSocket];
|
||||||
|
}
|
||||||
|
|
||||||
|
return [super webSocketForURI:path];
|
||||||
|
}
|
||||||
|
|
||||||
- (BOOL)expectsRequestBodyFromMethod:(NSString *)method atPath:(NSString *)path
|
- (BOOL)expectsRequestBodyFromMethod:(NSString *)method atPath:(NSString *)path
|
||||||
{
|
{
|
||||||
if ([method isEqualToString:@"POST"]) {
|
if ([method isEqualToString:@"POST"]) {
|
||||||
|
|||||||
17
kordophone/Bridge/MBIMPingPongWebSocket.h
Normal file
17
kordophone/Bridge/MBIMPingPongWebSocket.h
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
//
|
||||||
|
// MBIMPingPongWebSocket.h
|
||||||
|
// kordophoned
|
||||||
|
//
|
||||||
|
// Created by James Magahern on 6/13/25.
|
||||||
|
// Copyright © 2025 James Magahern. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import "WebSocket.h"
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
|
@interface MBIMPingPongWebSocket : WebSocket
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_END
|
||||||
216
kordophone/Bridge/MBIMPingPongWebSocket.m
Normal file
216
kordophone/Bridge/MBIMPingPongWebSocket.m
Normal file
@@ -0,0 +1,216 @@
|
|||||||
|
//
|
||||||
|
// MBIMPingPongWebSocket.m
|
||||||
|
// kordophoned
|
||||||
|
//
|
||||||
|
// Created by James Magahern on 6/13/25.
|
||||||
|
// Copyright © 2025 James Magahern. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import "MBIMPingPongWebSocket.h"
|
||||||
|
#import "GCDAsyncSocket.h"
|
||||||
|
|
||||||
|
// WebSocket opcodes (from the base class)
|
||||||
|
#define TIMEOUT_NONE -1
|
||||||
|
#define TIMEOUT_REQUEST_BODY 10
|
||||||
|
|
||||||
|
#define TAG_HTTP_REQUEST_BODY 100
|
||||||
|
#define TAG_HTTP_RESPONSE_HEADERS 200
|
||||||
|
#define TAG_HTTP_RESPONSE_BODY 201
|
||||||
|
|
||||||
|
#define TAG_PREFIX 300
|
||||||
|
#define TAG_MSG_PLUS_SUFFIX 301
|
||||||
|
#define TAG_MSG_WITH_LENGTH 302
|
||||||
|
#define TAG_MSG_MASKING_KEY 303
|
||||||
|
#define TAG_PAYLOAD_PREFIX 304
|
||||||
|
#define TAG_PAYLOAD_LENGTH 305
|
||||||
|
#define TAG_PAYLOAD_LENGTH16 306
|
||||||
|
#define TAG_PAYLOAD_LENGTH64 307
|
||||||
|
|
||||||
|
#define WS_OP_CONTINUATION_FRAME 0
|
||||||
|
#define WS_OP_TEXT_FRAME 1
|
||||||
|
#define WS_OP_BINARY_FRAME 2
|
||||||
|
#define WS_OP_CONNECTION_CLOSE 8
|
||||||
|
#define WS_OP_PING 9
|
||||||
|
#define WS_OP_PONG 10
|
||||||
|
|
||||||
|
// Additional tags for ping/pong handling
|
||||||
|
#define TAG_PING_PAYLOAD 400
|
||||||
|
#define TAG_PONG_SENT 401
|
||||||
|
|
||||||
|
@interface WebSocket ()
|
||||||
|
- (void)socket:(GCDAsyncSocket *)asyncSocket didReadData:(NSData *)data withTag:(long)tag;
|
||||||
|
@end
|
||||||
|
|
||||||
|
@implementation MBIMPingPongWebSocket
|
||||||
|
{
|
||||||
|
NSUInteger currentPayloadLength;
|
||||||
|
}
|
||||||
|
|
||||||
|
#pragma mark - Ping/Pong Frame Construction
|
||||||
|
|
||||||
|
- (NSData *)createPongFrameWithPayload:(NSData *)pingPayload {
|
||||||
|
NSMutableData *frame = [NSMutableData data];
|
||||||
|
|
||||||
|
// First byte: FIN (1) + RSV (000) + Opcode (1010 = 0xA for Pong)
|
||||||
|
uint8_t firstByte = 0x8A; // 10001010 in binary
|
||||||
|
[frame appendBytes:&firstByte length:1];
|
||||||
|
|
||||||
|
// Second byte: MASK (0) + Payload Length
|
||||||
|
NSUInteger payloadLength = [pingPayload length];
|
||||||
|
|
||||||
|
if (payloadLength <= 125) {
|
||||||
|
// Short payload length (0-125 bytes)
|
||||||
|
uint8_t secondByte = (uint8_t)payloadLength; // MASK bit is 0 for server-to-client
|
||||||
|
[frame appendBytes:&secondByte length:1];
|
||||||
|
}
|
||||||
|
else if (payloadLength <= 65535) {
|
||||||
|
// Medium payload length (126-65535 bytes)
|
||||||
|
uint8_t secondByte = 126;
|
||||||
|
[frame appendBytes:&secondByte length:1];
|
||||||
|
|
||||||
|
// Add 16-bit length in network byte order (big-endian)
|
||||||
|
uint16_t extendedLength = htons((uint16_t)payloadLength);
|
||||||
|
[frame appendBytes:&extendedLength length:2];
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
// Large payload length (65536+ bytes) - rarely needed for pings
|
||||||
|
uint8_t secondByte = 127;
|
||||||
|
[frame appendBytes:&secondByte length:1];
|
||||||
|
|
||||||
|
// Add 64-bit length in network byte order (big-endian)
|
||||||
|
uint64_t extendedLength = OSSwapHostToBigInt64(payloadLength);
|
||||||
|
[frame appendBytes:&extendedLength length:8];
|
||||||
|
}
|
||||||
|
|
||||||
|
// Append the payload (copied exactly from ping)
|
||||||
|
if (payloadLength > 0) {
|
||||||
|
[frame appendData:pingPayload];
|
||||||
|
}
|
||||||
|
|
||||||
|
return [frame copy];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)sendPongWithPayload:(NSData *)payload {
|
||||||
|
NSData *pongFrame = [self createPongFrameWithPayload:payload];
|
||||||
|
|
||||||
|
// Send the pong frame directly through the socket
|
||||||
|
[asyncSocket writeData:pongFrame withTimeout:TIMEOUT_NONE tag:TAG_PONG_SENT];
|
||||||
|
}
|
||||||
|
|
||||||
|
#pragma mark - Override AsyncSocket Delegate
|
||||||
|
|
||||||
|
- (void)socket:(GCDAsyncSocket *)asyncSocket didReadData:(NSData *)data withTag:(long)tag {
|
||||||
|
// xxx: sheesh: really need to get off of CococaHTTPServer.
|
||||||
|
NSData *maskingKey = [self valueForKey:@"maskingKey"];
|
||||||
|
BOOL nextFrameMasked = [[self valueForKey:@"nextFrameMasked"] boolValue];
|
||||||
|
NSUInteger nextOpCode = [[self valueForKey:@"nextOpCode"] unsignedIntValue];
|
||||||
|
|
||||||
|
// Handle our custom ping payload tag
|
||||||
|
if (tag == TAG_PING_PAYLOAD) {
|
||||||
|
// We've read the ping payload, now send the pong response
|
||||||
|
NSData *payload = data;
|
||||||
|
|
||||||
|
// If the frame was masked, we need to unmask it
|
||||||
|
if (nextFrameMasked && maskingKey) {
|
||||||
|
NSMutableData *unmaskedPayload = [data mutableCopy];
|
||||||
|
UInt8 *payloadBytes = [unmaskedPayload mutableBytes];
|
||||||
|
UInt8 *maskBytes = (UInt8 *)[maskingKey bytes];
|
||||||
|
|
||||||
|
for (NSUInteger i = 0; i < [data length]; i++) {
|
||||||
|
payloadBytes[i] ^= maskBytes[i % 4];
|
||||||
|
}
|
||||||
|
payload = [unmaskedPayload copy];
|
||||||
|
}
|
||||||
|
|
||||||
|
[self sendPongWithPayload:payload];
|
||||||
|
|
||||||
|
// Continue reading the next frame
|
||||||
|
[asyncSocket readDataToLength:1 withTimeout:TIMEOUT_NONE tag:TAG_PAYLOAD_PREFIX];
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Let parent handle TAG_PAYLOAD_PREFIX first to set nextOpCode
|
||||||
|
if (tag == TAG_PAYLOAD_PREFIX) {
|
||||||
|
[super socket:asyncSocket didReadData:data withTag:tag];
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Now intercept ping/pong handling after nextOpCode is set
|
||||||
|
if (nextOpCode == WS_OP_PING || nextOpCode == WS_OP_PONG) {
|
||||||
|
if (tag == TAG_PAYLOAD_LENGTH) {
|
||||||
|
UInt8 frame = *(UInt8 *)[data bytes];
|
||||||
|
BOOL masked = (frame & 0x80) != 0;
|
||||||
|
NSUInteger length = frame & 0x7F;
|
||||||
|
nextFrameMasked = masked;
|
||||||
|
currentPayloadLength = length;
|
||||||
|
|
||||||
|
if (length <= 125) {
|
||||||
|
if (nextFrameMasked) {
|
||||||
|
[asyncSocket readDataToLength:4 withTimeout:TIMEOUT_NONE tag:TAG_MSG_MASKING_KEY];
|
||||||
|
} else if (length > 0) {
|
||||||
|
[asyncSocket readDataToLength:length withTimeout:TIMEOUT_NONE tag:TAG_PING_PAYLOAD];
|
||||||
|
} else {
|
||||||
|
// Empty payload, no masking - handle immediately
|
||||||
|
[self sendPongWithPayload:[NSData data]];
|
||||||
|
[asyncSocket readDataToLength:1 withTimeout:TIMEOUT_NONE tag:TAG_PAYLOAD_PREFIX];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (length == 126) {
|
||||||
|
[asyncSocket readDataToLength:2 withTimeout:TIMEOUT_NONE tag:TAG_PAYLOAD_LENGTH16];
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
[asyncSocket readDataToLength:8 withTimeout:TIMEOUT_NONE tag:TAG_PAYLOAD_LENGTH64];
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (tag == TAG_MSG_MASKING_KEY) {
|
||||||
|
// Store the masking key
|
||||||
|
maskingKey = [data copy];
|
||||||
|
|
||||||
|
// Now read the payload (or handle empty payload)
|
||||||
|
if (currentPayloadLength > 0) {
|
||||||
|
[asyncSocket readDataToLength:currentPayloadLength withTimeout:TIMEOUT_NONE tag:TAG_PING_PAYLOAD];
|
||||||
|
} else {
|
||||||
|
// Empty payload - send pong immediately
|
||||||
|
[self sendPongWithPayload:[NSData data]];
|
||||||
|
[asyncSocket readDataToLength:1 withTimeout:TIMEOUT_NONE tag:TAG_PAYLOAD_PREFIX];
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (tag == TAG_PAYLOAD_LENGTH16) {
|
||||||
|
UInt8 *pFrame = (UInt8 *)[data bytes];
|
||||||
|
NSUInteger length = ((NSUInteger)pFrame[0] << 8) | (NSUInteger)pFrame[1];
|
||||||
|
|
||||||
|
if (nextFrameMasked) {
|
||||||
|
[asyncSocket readDataToLength:4 withTimeout:TIMEOUT_NONE tag:TAG_MSG_MASKING_KEY];
|
||||||
|
}
|
||||||
|
[asyncSocket readDataToLength:length withTimeout:TIMEOUT_NONE tag:TAG_PING_PAYLOAD];
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (tag == TAG_PAYLOAD_LENGTH64) {
|
||||||
|
// For 64-bit length, this is too complex for ping frames - just close
|
||||||
|
[self didClose];
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// For all other cases, call the parent implementation
|
||||||
|
[super socket:asyncSocket didReadData:data withTag:tag];
|
||||||
|
}
|
||||||
|
|
||||||
|
#pragma mark - Helper Methods
|
||||||
|
|
||||||
|
// Expose the isValidWebSocketFrame method since it's private in the parent
|
||||||
|
- (BOOL)isValidWebSocketFrame:(UInt8)frame {
|
||||||
|
NSUInteger rsv = frame & 0x70;
|
||||||
|
NSUInteger opcode = frame & 0x0F;
|
||||||
|
if (rsv || (3 <= opcode && opcode <= 7) || (0xB <= opcode && opcode <= 0xF)) {
|
||||||
|
return NO;
|
||||||
|
}
|
||||||
|
return YES;
|
||||||
|
}
|
||||||
|
|
||||||
|
@end
|
||||||
@@ -10,6 +10,9 @@
|
|||||||
#import "IMFoundation_ClassDump.h"
|
#import "IMFoundation_ClassDump.h"
|
||||||
|
|
||||||
NS_ASSUME_NONNULL_BEGIN
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
@class GCDAsyncSocket;
|
||||||
|
@class HTTPMessage;
|
||||||
|
@class WebSocket;
|
||||||
|
|
||||||
@interface MBIMUpdateItem : NSObject
|
@interface MBIMUpdateItem : NSObject
|
||||||
@property (nonatomic, strong) IMChat *changedChat;
|
@property (nonatomic, strong) IMChat *changedChat;
|
||||||
@@ -24,11 +27,13 @@ typedef void (^MBIMUpdateConsumer)(NSArray<MBIMUpdateItem *> *items);
|
|||||||
|
|
||||||
+ (instancetype)sharedInstance;
|
+ (instancetype)sharedInstance;
|
||||||
|
|
||||||
- (void)addConsumer:(MBIMUpdateConsumer)consumer withLastSyncedMessageSeq:(NSInteger)messageSeq;
|
- (void)addPollingConsumer:(MBIMUpdateConsumer)consumer withLastSyncedMessageSeq:(NSInteger)messageSeq;
|
||||||
- (void)removeConsumer:(MBIMUpdateConsumer)consumer;
|
- (void)removePollingConsumer:(MBIMUpdateConsumer)consumer;
|
||||||
|
|
||||||
- (void)enqueueUpdateItem:(MBIMUpdateItem *)item;
|
- (void)enqueueUpdateItem:(MBIMUpdateItem *)item;
|
||||||
|
|
||||||
|
- (WebSocket *)vendUpdateWebSocketConsumerForRequest:(HTTPMessage *)request socket:(GCDAsyncSocket *)socket;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
NS_ASSUME_NONNULL_END
|
NS_ASSUME_NONNULL_END
|
||||||
|
|||||||
@@ -9,20 +9,30 @@
|
|||||||
#import "MBIMUpdateQueue.h"
|
#import "MBIMUpdateQueue.h"
|
||||||
#import "IMMessageItem+Encoded.h"
|
#import "IMMessageItem+Encoded.h"
|
||||||
#import "IMChat+Encoded.h"
|
#import "IMChat+Encoded.h"
|
||||||
|
#import "MBIMHTTPConnection.h"
|
||||||
|
#import "MBIMURLUtilities.h"
|
||||||
|
#import "MBIMPingPongWebSocket.h"
|
||||||
|
|
||||||
|
#import "GCDAsyncSocket.h"
|
||||||
|
#import "HTTPMessage.h"
|
||||||
|
#import "WebSocket.h"
|
||||||
|
|
||||||
static const NSUInteger kUpdateItemsCullingLength = 100;
|
static const NSUInteger kUpdateItemsCullingLength = 100;
|
||||||
|
|
||||||
@interface MBIMUpdateItem (/*INTERNAL*/)
|
@interface MBIMUpdateItem (/*INTERNAL*/) <WebSocketDelegate>
|
||||||
@property (nonatomic, assign) NSUInteger messageSequenceNumber;
|
@property (nonatomic, assign) NSUInteger messageSequenceNumber;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@implementation MBIMUpdateQueue {
|
@implementation MBIMUpdateQueue {
|
||||||
NSUInteger _messageSequenceNumber;
|
NSUInteger _messageSequenceNumber;
|
||||||
dispatch_queue_t _accessQueue;
|
dispatch_queue_t _accessQueue;
|
||||||
NSMutableArray *_consumers;
|
NSMutableArray *_longPollConsumers;
|
||||||
|
|
||||||
// Maps message sequence number to update item
|
// Maps message sequence number to update item
|
||||||
NSMutableDictionary<NSNumber *, MBIMUpdateItem *> *_updateItemHistory;
|
NSMutableDictionary<NSNumber *, MBIMUpdateItem *> *_updateItemHistory;
|
||||||
|
|
||||||
|
// WebSocket consumers
|
||||||
|
NSMutableDictionary<NSString *, MBIMUpdateConsumer> *_websocketConsumers;
|
||||||
}
|
}
|
||||||
|
|
||||||
+ (instancetype)sharedInstance
|
+ (instancetype)sharedInstance
|
||||||
@@ -41,20 +51,93 @@ static const NSUInteger kUpdateItemsCullingLength = 100;
|
|||||||
self = [super init];
|
self = [super init];
|
||||||
if (self) {
|
if (self) {
|
||||||
_accessQueue = dispatch_queue_create("net.buzzert.MBIMUpdateQueue", DISPATCH_QUEUE_SERIAL);
|
_accessQueue = dispatch_queue_create("net.buzzert.MBIMUpdateQueue", DISPATCH_QUEUE_SERIAL);
|
||||||
_consumers = [[NSMutableArray alloc] init];
|
|
||||||
_messageSequenceNumber = 0;
|
_messageSequenceNumber = 0;
|
||||||
_updateItemHistory = [[NSMutableDictionary alloc] init];
|
_updateItemHistory = [[NSMutableDictionary alloc] init];
|
||||||
|
_websocketConsumers = [[NSMutableDictionary alloc] init];
|
||||||
|
_longPollConsumers = [[NSMutableArray alloc] init];
|
||||||
}
|
}
|
||||||
|
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)addConsumer:(MBIMUpdateConsumer)consumer withLastSyncedMessageSeq:(NSInteger)messageSeq
|
- (void)addPollingConsumer:(MBIMUpdateConsumer)consumer withLastSyncedMessageSeq:(NSInteger)messageSeq
|
||||||
{
|
{
|
||||||
__weak NSMutableArray *consumers = _consumers;
|
if (![self _syncConsumer:consumer fromLastMessageSeq:messageSeq]) {
|
||||||
|
__weak NSMutableArray *consumers = _longPollConsumers;
|
||||||
|
dispatch_async(_accessQueue, ^{
|
||||||
|
[consumers addObject:consumer];
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)removePollingConsumer:(MBIMUpdateConsumer)consumer
|
||||||
|
{
|
||||||
|
__weak NSMutableArray *consumers = _longPollConsumers;
|
||||||
|
dispatch_async(_accessQueue, ^{
|
||||||
|
[consumers removeObject:consumer];
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)enqueueUpdateItem:(MBIMUpdateItem *)item
|
||||||
|
{
|
||||||
|
__weak __auto_type pollingConsumers = _longPollConsumers;
|
||||||
|
__weak __auto_type websocketConsumers = _websocketConsumers;
|
||||||
__weak NSMutableDictionary *updateItemHistory = _updateItemHistory;
|
__weak NSMutableDictionary *updateItemHistory = _updateItemHistory;
|
||||||
dispatch_async(_accessQueue, ^{
|
dispatch_async(_accessQueue, ^{
|
||||||
if ((messageSeq >= 0) && messageSeq < self->_messageSequenceNumber) {
|
self->_messageSequenceNumber++;
|
||||||
|
item.messageSequenceNumber = self->_messageSequenceNumber;
|
||||||
|
|
||||||
|
// Notify polling consumers
|
||||||
|
for (MBIMUpdateConsumer consumer in pollingConsumers) {
|
||||||
|
consumer(@[ item ]);
|
||||||
|
}
|
||||||
|
[pollingConsumers removeAllObjects];
|
||||||
|
|
||||||
|
// Notify websocket consumers
|
||||||
|
for (MBIMUpdateConsumer consumer in [websocketConsumers allValues]) {
|
||||||
|
consumer(@[ item ]);
|
||||||
|
}
|
||||||
|
|
||||||
|
[updateItemHistory setObject:item forKey:@(item.messageSequenceNumber)];
|
||||||
|
|
||||||
|
[self _cullUpdateItems];
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
- (WebSocket *)vendUpdateWebSocketConsumerForRequest:(HTTPMessage *)request socket:(GCDAsyncSocket *)gcdSocket
|
||||||
|
{
|
||||||
|
WebSocket *socket = [[MBIMPingPongWebSocket alloc] initWithRequest:request socket:gcdSocket];
|
||||||
|
socket.delegate = self;
|
||||||
|
|
||||||
|
MBIMUpdateConsumer consumer = ^(NSArray<MBIMUpdateItem *> *updates) {
|
||||||
|
NSMutableArray *encodedUpdates = [NSMutableArray array];
|
||||||
|
for (MBIMUpdateItem *item in updates) {
|
||||||
|
NSDictionary *updateDict = [item dictionaryRepresentation];
|
||||||
|
[encodedUpdates addObject:updateDict];
|
||||||
|
}
|
||||||
|
|
||||||
|
NSData *data = [NSJSONSerialization dataWithJSONObject:encodedUpdates options:0 error:NULL];
|
||||||
|
[socket sendData:data];
|
||||||
|
};
|
||||||
|
|
||||||
|
NSString *messageSeqString = [[request url] valueForQueryItemWithName:@"seq"];
|
||||||
|
[self _syncConsumer:consumer fromLastMessageSeq:(messageSeqString ? [messageSeqString integerValue] : -1)];
|
||||||
|
|
||||||
|
__weak __auto_type websocketConsumers = _websocketConsumers;
|
||||||
|
dispatch_async(_accessQueue, ^{
|
||||||
|
NSString *websocketKey = [socket description];
|
||||||
|
[websocketConsumers setObject:consumer forKey:websocketKey];
|
||||||
|
});
|
||||||
|
|
||||||
|
return socket;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (BOOL)_syncConsumer:(MBIMUpdateConsumer)consumer fromLastMessageSeq:(NSInteger)messageSeq
|
||||||
|
{
|
||||||
|
const BOOL needsSync = (messageSeq >= 0) && messageSeq < self->_messageSequenceNumber;
|
||||||
|
if (needsSync) {
|
||||||
|
__weak NSMutableDictionary *updateItemHistory = _updateItemHistory;
|
||||||
|
dispatch_async(_accessQueue, ^{
|
||||||
NSMutableArray *batchedUpdates = [NSMutableArray array];
|
NSMutableArray *batchedUpdates = [NSMutableArray array];
|
||||||
for (NSUInteger seq = messageSeq + 1; seq <= self->_messageSequenceNumber; seq++) {
|
for (NSUInteger seq = messageSeq + 1; seq <= self->_messageSequenceNumber; seq++) {
|
||||||
MBIMUpdateItem *item = [updateItemHistory objectForKey:@(seq)];
|
MBIMUpdateItem *item = [updateItemHistory objectForKey:@(seq)];
|
||||||
@@ -64,37 +147,10 @@ static const NSUInteger kUpdateItemsCullingLength = 100;
|
|||||||
}
|
}
|
||||||
|
|
||||||
consumer(batchedUpdates);
|
consumer(batchedUpdates);
|
||||||
} else {
|
});
|
||||||
[consumers addObject:consumer];
|
}
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
- (void)removeConsumer:(MBIMUpdateConsumer)consumer
|
return needsSync;
|
||||||
{
|
|
||||||
__weak NSMutableArray *consumers = _consumers;
|
|
||||||
dispatch_async(_accessQueue, ^{
|
|
||||||
[consumers removeObject:consumer];
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
- (void)enqueueUpdateItem:(MBIMUpdateItem *)item
|
|
||||||
{
|
|
||||||
__weak NSMutableArray *consumers = _consumers;
|
|
||||||
__weak NSMutableDictionary *updateItemHistory = _updateItemHistory;
|
|
||||||
dispatch_async(_accessQueue, ^{
|
|
||||||
self->_messageSequenceNumber++;
|
|
||||||
item.messageSequenceNumber = self->_messageSequenceNumber;
|
|
||||||
|
|
||||||
for (MBIMUpdateConsumer consumer in consumers) {
|
|
||||||
consumer(@[ item ]);
|
|
||||||
}
|
|
||||||
|
|
||||||
[consumers removeAllObjects];
|
|
||||||
[updateItemHistory setObject:item forKey:@(item.messageSequenceNumber)];
|
|
||||||
|
|
||||||
[self _cullUpdateItems];
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)_cullUpdateItems
|
- (void)_cullUpdateItems
|
||||||
@@ -113,6 +169,18 @@ static const NSUInteger kUpdateItemsCullingLength = 100;
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#pragma mark - <WebSocketDelegate>
|
||||||
|
|
||||||
|
- (void)webSocketDidClose:(WebSocket *)ws
|
||||||
|
{
|
||||||
|
// xxx: not great, but works.
|
||||||
|
NSString *websocketKey = [ws description];
|
||||||
|
__weak __auto_type websocketConsumers = _websocketConsumers;
|
||||||
|
dispatch_async(_accessQueue, ^{
|
||||||
|
[websocketConsumers removeObjectForKey:websocketKey];
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@implementation MBIMUpdateItem
|
@implementation MBIMUpdateItem
|
||||||
|
|||||||
17
kordophone/Bridge/Operations/MBIMAuthenticateOperation.h
Normal file
17
kordophone/Bridge/Operations/MBIMAuthenticateOperation.h
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
//
|
||||||
|
// MBIMAuthenticateOperation.h
|
||||||
|
// MBIMAuthenticateOperation
|
||||||
|
//
|
||||||
|
// Created by James Magahern on 7/6/21.
|
||||||
|
// Copyright © 2021 James Magahern. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import "MBIMBridgeOperation.h"
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
|
@interface MBIMAuthenticateOperation : MBIMBridgeOperation
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_END
|
||||||
77
kordophone/Bridge/Operations/MBIMAuthenticateOperation.m
Normal file
77
kordophone/Bridge/Operations/MBIMAuthenticateOperation.m
Normal file
@@ -0,0 +1,77 @@
|
|||||||
|
//
|
||||||
|
// MBIMAuthenticateOperation.m
|
||||||
|
// MBIMAuthenticateOperation
|
||||||
|
//
|
||||||
|
// Created by James Magahern on 7/6/21.
|
||||||
|
// Copyright © 2021 James Magahern. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import "MBIMAuthenticateOperation.h"
|
||||||
|
#import "MBIMBridge.h"
|
||||||
|
#import "MBIMAuthToken.h"
|
||||||
|
|
||||||
|
@implementation MBIMAuthenticateOperation
|
||||||
|
|
||||||
|
+ (void)load { [super load]; }
|
||||||
|
|
||||||
|
+ (NSString *)endpointName
|
||||||
|
{
|
||||||
|
return @"authenticate";
|
||||||
|
}
|
||||||
|
|
||||||
|
+ (BOOL)requiresAuthentication
|
||||||
|
{
|
||||||
|
return NO;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)main
|
||||||
|
{
|
||||||
|
NSObject<HTTPResponse> *response = nil;
|
||||||
|
|
||||||
|
if (self.requestBodyData.length == 0) {
|
||||||
|
self.serverCompletionBlock([[HTTPErrorResponse alloc] initWithErrorCode:400]);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
NSError *error = nil;
|
||||||
|
NSDictionary *args = [NSJSONSerialization JSONObjectWithData:self.requestBodyData options:0 error:&error];
|
||||||
|
if (error || args.count == 0) {
|
||||||
|
response = [[HTTPErrorResponse alloc] initWithErrorCode:400];
|
||||||
|
} else {
|
||||||
|
do {
|
||||||
|
NSString *username = [args objectForKey:@"username"];
|
||||||
|
NSString *password = [args objectForKey:@"password"];
|
||||||
|
|
||||||
|
if (!username || !password) {
|
||||||
|
response = [[HTTPErrorResponse alloc] initWithErrorCode:400];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (![MBIMBridge.sharedInstance.authUsername isEqualToString:username]) {
|
||||||
|
response = [[HTTPErrorResponse alloc] initWithErrorCode:401];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (![MBIMBridge.sharedInstance.authPassword isEqualToString:password]) {
|
||||||
|
response = [[HTTPErrorResponse alloc] initWithErrorCode:401];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
MBIMAuthToken *token = [[MBIMAuthToken alloc] initWithUsername:username];
|
||||||
|
|
||||||
|
// All systems go
|
||||||
|
MBIMJSONDataResponse *dataResponse = [MBIMJSONDataResponse responseWithJSONObject:@{
|
||||||
|
@"jwt" : token.jwtToken
|
||||||
|
}];
|
||||||
|
|
||||||
|
// Send a cookie down so we can use httpOnly cookies
|
||||||
|
dataResponse.httpHeaders[@"Set-Cookie"] = [NSString stringWithFormat:@"auth_token=%@", token.jwtToken];
|
||||||
|
|
||||||
|
response = dataResponse;
|
||||||
|
} while (NO);
|
||||||
|
}
|
||||||
|
|
||||||
|
self.serverCompletionBlock(response);
|
||||||
|
}
|
||||||
|
|
||||||
|
@end
|
||||||
@@ -7,8 +7,9 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
#import <Foundation/Foundation.h>
|
#import <Foundation/Foundation.h>
|
||||||
#import <CocoaHTTPServer/HTTPResponse.h>
|
#import "HTTPMessage.h"
|
||||||
#import <CocoaHTTPServer/HTTPErrorResponse.h>
|
#import "HTTPResponse.h"
|
||||||
|
#import "HTTPErrorResponse.h"
|
||||||
|
|
||||||
#import "MBIMJSONDataResponse.h"
|
#import "MBIMJSONDataResponse.h"
|
||||||
|
|
||||||
@@ -18,7 +19,9 @@ typedef void (^MBIMBridgeOperationCompletionBlock)(NSObject<HTTPResponse> * _Nul
|
|||||||
|
|
||||||
@interface MBIMBridgeOperation : NSOperation
|
@interface MBIMBridgeOperation : NSOperation
|
||||||
@property (class, nonatomic, readonly) NSString *endpointName;
|
@property (class, nonatomic, readonly) NSString *endpointName;
|
||||||
|
@property (class, nonatomic, readonly) BOOL requiresAuthentication; // default YES
|
||||||
|
|
||||||
|
@property (nonatomic, strong) HTTPMessage *request;
|
||||||
@property (nonatomic, strong) NSData *requestBodyData;
|
@property (nonatomic, strong) NSData *requestBodyData;
|
||||||
@property (nonatomic, readonly) NSURL *requestURL;
|
@property (nonatomic, readonly) NSURL *requestURL;
|
||||||
@property (nonatomic, readonly) MBIMBridgeOperationCompletionBlock serverCompletionBlock;
|
@property (nonatomic, readonly) MBIMBridgeOperationCompletionBlock serverCompletionBlock;
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
#import "MBIMBridgeOperation.h"
|
#import "MBIMBridgeOperation.h"
|
||||||
|
#import "MBIMURLUtilities.h"
|
||||||
|
|
||||||
@interface MBIMBridgeOperation (/*INTERNAL*/)
|
@interface MBIMBridgeOperation (/*INTERNAL*/)
|
||||||
@property (nonatomic, strong) NSURL *requestURL;
|
@property (nonatomic, strong) NSURL *requestURL;
|
||||||
@@ -55,6 +56,11 @@
|
|||||||
return [[self _operationClassMapping] objectForKey:endpointName];
|
return [[self _operationClassMapping] objectForKey:endpointName];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
+ (BOOL)requiresAuthentication
|
||||||
|
{
|
||||||
|
return YES;
|
||||||
|
}
|
||||||
|
|
||||||
- (instancetype)initWithRequestURL:(NSURL *)requestURL completion:(MBIMBridgeOperationCompletionBlock)completionBlock
|
- (instancetype)initWithRequestURL:(NSURL *)requestURL completion:(MBIMBridgeOperationCompletionBlock)completionBlock
|
||||||
{
|
{
|
||||||
self = [super init];
|
self = [super init];
|
||||||
@@ -74,18 +80,7 @@
|
|||||||
|
|
||||||
- (NSString *)valueForQueryItemWithName:(NSString *)queryItemName
|
- (NSString *)valueForQueryItemWithName:(NSString *)queryItemName
|
||||||
{
|
{
|
||||||
NSURLComponents *urlComponents = [NSURLComponents componentsWithURL:self.requestURL
|
return [[self requestURL] valueForQueryItemWithName:queryItemName];
|
||||||
resolvingAgainstBaseURL:NO];
|
|
||||||
|
|
||||||
NSString *value = nil;
|
|
||||||
for (NSURLQueryItem *queryItem in [urlComponents queryItems]) {
|
|
||||||
if ([[queryItem name] isEqualToString:queryItemName]) {
|
|
||||||
value = [queryItem value];
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return value;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|||||||
@@ -0,0 +1,17 @@
|
|||||||
|
//
|
||||||
|
// MBIMDeleteConversationOperation.h
|
||||||
|
// kordophoned
|
||||||
|
//
|
||||||
|
// Created by James Magahern on 5/25/22.
|
||||||
|
// Copyright © 2022 James Magahern. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import "MBIMBridgeOperation.h"
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
|
@interface MBIMDeleteConversationOperation : MBIMBridgeOperation
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_END
|
||||||
@@ -0,0 +1,49 @@
|
|||||||
|
//
|
||||||
|
// MBIMDeleteConversationOperation.m
|
||||||
|
// kordophoned
|
||||||
|
//
|
||||||
|
// Created by James Magahern on 5/25/22.
|
||||||
|
// Copyright © 2022 James Magahern. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import "MBIMDeleteConversationOperation.h"
|
||||||
|
#import "IMChat+Encoded.h"
|
||||||
|
|
||||||
|
#import "IMCore_ClassDump.h"
|
||||||
|
|
||||||
|
@implementation MBIMDeleteConversationOperation
|
||||||
|
+ (void)load { [super load]; }
|
||||||
|
|
||||||
|
+ (NSString *)endpointName
|
||||||
|
{
|
||||||
|
return @"delete";
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)main
|
||||||
|
{
|
||||||
|
__block NSObject<HTTPResponse> *response = nil;
|
||||||
|
do {
|
||||||
|
NSString *guid = [self valueForQueryItemWithName:@"guid"];
|
||||||
|
|
||||||
|
if (!guid) {
|
||||||
|
MBIMLogInfo(@"No conversation GUID provided.");
|
||||||
|
response = [[HTTPErrorResponse alloc] initWithErrorCode:500];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
dispatch_sync([[self class] sharedIMAccessQueue], ^{
|
||||||
|
IMChat *chat = [[IMChatRegistry sharedInstance] existingChatWithGUID:guid];
|
||||||
|
if (!chat) {
|
||||||
|
MBIMLogInfo(@"Chat with guid: %@ not found", guid);
|
||||||
|
response = [[HTTPErrorResponse alloc] initWithErrorCode:500];
|
||||||
|
} else {
|
||||||
|
[chat remove];
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
response = [[HTTPErrorResponse alloc] initWithErrorCode:200];
|
||||||
|
} while (0);
|
||||||
|
|
||||||
|
self.serverCompletionBlock(response);
|
||||||
|
}
|
||||||
|
@end
|
||||||
@@ -8,8 +8,11 @@
|
|||||||
|
|
||||||
#import "MBIMFetchAttachmentOperation.h"
|
#import "MBIMFetchAttachmentOperation.h"
|
||||||
#import "MBIMDataResponse.h"
|
#import "MBIMDataResponse.h"
|
||||||
|
#import "MBIMImageUtils.h"
|
||||||
|
|
||||||
#import "IMCore_ClassDump.h"
|
#import "IMCore_ClassDump.h"
|
||||||
|
#import "IMSharedUtilities_ClassDump.h"
|
||||||
|
#import <CoreGraphics/CoreGraphics.h>
|
||||||
|
|
||||||
@implementation MBIMFetchAttachmentOperation
|
@implementation MBIMFetchAttachmentOperation
|
||||||
|
|
||||||
@@ -24,8 +27,8 @@
|
|||||||
{
|
{
|
||||||
NSObject<HTTPResponse> *response = nil;
|
NSObject<HTTPResponse> *response = nil;
|
||||||
do {
|
do {
|
||||||
|
BOOL preview = [[self valueForQueryItemWithName:@"preview"] boolValue];
|
||||||
NSString *guid = [self valueForQueryItemWithName:@"guid"];
|
NSString *guid = [self valueForQueryItemWithName:@"guid"];
|
||||||
|
|
||||||
if (!guid) {
|
if (!guid) {
|
||||||
MBIMLogInfo(@"No query item provided");
|
MBIMLogInfo(@"No query item provided");
|
||||||
response = [[HTTPErrorResponse alloc] initWithErrorCode:500];
|
response = [[HTTPErrorResponse alloc] initWithErrorCode:500];
|
||||||
@@ -45,23 +48,85 @@
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
NSString *localPath = [transfer localPath];
|
NSData *responseData = nil;
|
||||||
NSData *responseData = [NSData dataWithContentsOfFile:localPath];
|
NSURL *localURL = [transfer localURL];
|
||||||
|
NSString *extension = [[localURL pathExtension] lowercaseString];
|
||||||
|
if (preview) {
|
||||||
|
IMPreviewConstraints constraints = IMPreviewConstraintsZero();
|
||||||
|
|
||||||
|
// Fetch preview constraints from transfer
|
||||||
|
NSDictionary *previewConstraintsDict = [[transfer attributionInfo] objectForKey:@"pgenszc"];
|
||||||
|
if (previewConstraintsDict) {
|
||||||
|
constraints = IMPreviewConstraintsFromDictionary(previewConstraintsDict);
|
||||||
|
} else {
|
||||||
|
// Or, make a guess.
|
||||||
|
constraints.maxPxWidth = 500.0;
|
||||||
|
constraints.scale = 1.0;
|
||||||
|
}
|
||||||
|
|
||||||
|
NSURL *previewURL = IMAttachmentPreviewFileURL(localURL, extension, YES);
|
||||||
|
if (!previewURL) {
|
||||||
|
// I'm not sure why this sometimes returns nil...
|
||||||
|
MBIMLogInfo(@"Unable to generate attachment preview cache URL for %@, making one up.", localURL);
|
||||||
|
|
||||||
|
NSURL *temporaryAttachmentCache = [[[NSFileManager defaultManager] temporaryDirectory] URLByAppendingPathComponent:@"kordophone_attachment_cache"];
|
||||||
|
temporaryAttachmentCache = [temporaryAttachmentCache URLByAppendingPathComponent:guid];
|
||||||
|
|
||||||
|
[[NSFileManager defaultManager] createDirectoryAtURL:temporaryAttachmentCache withIntermediateDirectories:YES attributes:nil error:nil];
|
||||||
|
|
||||||
|
previewURL = [temporaryAttachmentCache URLByAppendingPathComponent:[localURL lastPathComponent]];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (![[NSFileManager defaultManager] fileExistsAtPath:[previewURL path]]) {
|
||||||
|
MBIMLogInfo(@"Generating preview image for guid: %@ at %@", guid, [previewURL path]);
|
||||||
|
|
||||||
|
// Generate preview using preview generator manager
|
||||||
|
NSError *error = nil;
|
||||||
|
IMPreviewGeneratorManager *generator = [IMPreviewGeneratorManager sharedInstance];
|
||||||
|
CGImageRef previewImage = [generator newPreviewFromSourceURL:localURL withPreviewConstraints:constraints error:&error];
|
||||||
|
if (error) {
|
||||||
|
MBIMLogInfo(@"Unable to generate preview for attachment guid: %@", guid);
|
||||||
|
response = [[HTTPErrorResponse alloc] initWithErrorCode:500];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Convert to JPEG.
|
||||||
|
responseData = MBIMCGImageJPEGRepresentation(previewImage);
|
||||||
|
|
||||||
|
// Persist JPEG preview to disk
|
||||||
|
if (previewURL) {
|
||||||
|
[responseData writeToURL:previewURL atomically:YES];
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// File exists
|
||||||
|
MBIMLogInfo(@"Using cached preview image for guid: %@ at %@", guid, [previewURL path]);
|
||||||
|
responseData = [NSData dataWithContentsOfURL:previewURL];
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
responseData = [NSData dataWithContentsOfURL:localURL];
|
||||||
|
}
|
||||||
|
|
||||||
if (!responseData) {
|
if (!responseData) {
|
||||||
MBIMLogInfo(@"Wasn't able to load data from local path: %@", localPath);
|
MBIMLogInfo(@"Wasn't able to load data for guid: %@", guid);
|
||||||
response = [[HTTPErrorResponse alloc] initWithErrorCode:404];
|
response = [[HTTPErrorResponse alloc] initWithErrorCode:404];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
NSString *mimeType = [transfer mimeType];
|
NSString *mimeType = [transfer mimeType];
|
||||||
|
if ([mimeType isEqualToString:@"image/heic"]) {
|
||||||
|
// TODO: We should convert this to JPEG here. I don't want clients to have to deal with HEIC.
|
||||||
|
MBIMLogInfo(@"WARNING: Returning HEIC data for attachment %@", guid);
|
||||||
|
}
|
||||||
|
|
||||||
// It's unusual, but if this is nil, try to guess the MIME type based on the filename
|
// It's unusual, but if this is nil, try to guess the MIME type based on the filename
|
||||||
if (!mimeType) {
|
if (!mimeType) {
|
||||||
NSString *extension = [[localPath pathExtension] lowercaseString];
|
|
||||||
|
|
||||||
// XXX: REALLY hacky
|
// XXX: REALLY hacky
|
||||||
mimeType = [NSString stringWithFormat:@"image/%@", extension];
|
mimeType = [NSString stringWithFormat:@"image/%@", extension];
|
||||||
}
|
}
|
||||||
response = [[MBIMDataResponse alloc] initWithData:responseData contentType:mimeType];
|
|
||||||
|
MBIMDataResponse *dataResponse = [[MBIMDataResponse alloc] initWithData:responseData contentType:mimeType];
|
||||||
|
dataResponse.httpHeaders[@"Cache-Control"] = @"public, immutable, max-age=31536000";
|
||||||
|
response = dataResponse;
|
||||||
} while (0);
|
} while (0);
|
||||||
|
|
||||||
self.serverCompletionBlock(response);
|
self.serverCompletionBlock(response);
|
||||||
|
|||||||
@@ -9,9 +9,17 @@
|
|||||||
#import "MBIMMessagesListOperation.h"
|
#import "MBIMMessagesListOperation.h"
|
||||||
#import "MBIMHTTPUtilities.h"
|
#import "MBIMHTTPUtilities.h"
|
||||||
#import "IMMessageItem+Encoded.h"
|
#import "IMMessageItem+Encoded.h"
|
||||||
|
#import "MBIMErrorResponse.h"
|
||||||
|
|
||||||
#import "IMCore_ClassDump.h"
|
#import "IMCore_ClassDump.h"
|
||||||
|
|
||||||
|
#define kDefaultMessagesLimit 75
|
||||||
|
|
||||||
|
@interface IMChat (MBIMSafeMessagesLoading)
|
||||||
|
- (void)load:(NSUInteger)number messagesBeforeGUID:(NSString *)beforeMessageGUID;
|
||||||
|
- (void)load:(NSUInteger)number messagesAfterGUID:(NSString *)afterMessageGUID;
|
||||||
|
@end
|
||||||
|
|
||||||
@implementation MBIMMessagesListOperation
|
@implementation MBIMMessagesListOperation
|
||||||
|
|
||||||
+ (void)load { [super load]; }
|
+ (void)load { [super load]; }
|
||||||
@@ -25,11 +33,32 @@
|
|||||||
{
|
{
|
||||||
__block NSObject<HTTPResponse> *response = nil;
|
__block NSObject<HTTPResponse> *response = nil;
|
||||||
do {
|
do {
|
||||||
|
// Required parameters
|
||||||
NSString *guid = [self valueForQueryItemWithName:@"guid"];
|
NSString *guid = [self valueForQueryItemWithName:@"guid"];
|
||||||
|
|
||||||
|
// Optional
|
||||||
|
NSString *limitValue = [self valueForQueryItemWithName:@"limit"];
|
||||||
|
|
||||||
|
NSDate *beforeDate = nil;
|
||||||
|
NSString *beforeDateValue = [self valueForQueryItemWithName:@"beforeDate"];
|
||||||
|
if (beforeDateValue) {
|
||||||
|
beforeDate = [beforeDateValue ISO8601Date];
|
||||||
|
if (!beforeDate) {
|
||||||
|
response = [[MBIMErrorResponse alloc] initWithErrorCode:500 message:@"Unable to decode ISO8601 beforeDate value"];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
NSString *beforeMessageGUID = [self valueForQueryItemWithName:@"beforeMessageGUID"];
|
||||||
|
NSString *afterMessageGUID = [self valueForQueryItemWithName:@"afterMessageGUID"];
|
||||||
|
|
||||||
|
if (beforeMessageGUID && afterMessageGUID) {
|
||||||
|
response = [[MBIMErrorResponse alloc] initWithErrorCode:500 message:@"Cannot provide both beforeMessageGUID and afterMessageGUID params."];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
if (!guid) {
|
if (!guid) {
|
||||||
MBIMLogInfo(@"No query item provided");
|
response = [[MBIMErrorResponse alloc] initWithErrorCode:500 message:@"No GUID provided."];
|
||||||
response = [[HTTPErrorResponse alloc] initWithErrorCode:500];
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -41,12 +70,35 @@
|
|||||||
response = [[HTTPErrorResponse alloc] initWithErrorCode:500];
|
response = [[HTTPErrorResponse alloc] initWithErrorCode:500];
|
||||||
} else {
|
} else {
|
||||||
// Load messages
|
// Load messages
|
||||||
[chat loadMessagesBeforeDate:[NSDate date] limit:50 loadImmediately:YES];
|
// (Must be done on main queue for some reason)
|
||||||
|
dispatch_sync(dispatch_get_main_queue(), ^{
|
||||||
|
NSUInteger limit = kDefaultMessagesLimit;
|
||||||
|
if (limitValue) {
|
||||||
|
limit = [limitValue integerValue];
|
||||||
|
}
|
||||||
|
|
||||||
[[chat chatItems] enumerateMessagesWithOptions:0 usingBlock:^(IMMessage *message, BOOL *stop) {
|
if (beforeMessageGUID) {
|
||||||
NSDictionary *messageDict = [message mbim_dictionaryRepresentation];
|
[chat load:limit messagesBeforeGUID:beforeMessageGUID];
|
||||||
[messages addObject:messageDict];
|
} else if (afterMessageGUID) {
|
||||||
}];
|
[chat load:limit messagesAfterGUID:afterMessageGUID];
|
||||||
|
} else {
|
||||||
|
[chat loadMessagesBeforeDate:beforeDate limit:limit loadImmediately:YES];
|
||||||
|
}
|
||||||
|
|
||||||
|
[[chat chatItems] enumerateMessagesWithOptions:0 usingBlock:^(IMMessage *message, BOOL *stop) {
|
||||||
|
// Assume "beforeMessageGUID" is exclusive
|
||||||
|
if ([[message guid] isEqual:beforeMessageGUID]) {
|
||||||
|
*stop = YES;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Assume "afterMessageGUID" is exclusive.
|
||||||
|
if (![[message guid] isEqual:afterMessageGUID]) {
|
||||||
|
NSDictionary *messageDict = [message mbim_dictionaryRepresentation];
|
||||||
|
[messages addObject:messageDict];
|
||||||
|
}
|
||||||
|
}];
|
||||||
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -57,3 +109,35 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
@implementation IMChat (MBIMSafeMessagesLoading)
|
||||||
|
|
||||||
|
- (id)_safe_loadMessagesBeforeAndAfterGUID:(NSString *)messagesGUID numberOfMessagesToLoadBeforeGUID:(NSUInteger)limitBefore numberOfMessagesToLoadAfterGUID:(NSUInteger)limitAfter loadImmediately:(BOOL)loadImmediately
|
||||||
|
{
|
||||||
|
if ([self respondsToSelector:@selector(loadMessagesBeforeAndAfterGUID:
|
||||||
|
numberOfMessagesToLoadBeforeGUID:
|
||||||
|
numberOfMessagesToLoadAfterGUID:
|
||||||
|
loadImmediately:threadIdentifier:)]) {
|
||||||
|
return [self loadMessagesBeforeAndAfterGUID:messagesGUID
|
||||||
|
numberOfMessagesToLoadBeforeGUID:limitBefore
|
||||||
|
numberOfMessagesToLoadAfterGUID:limitAfter
|
||||||
|
loadImmediately:YES threadIdentifier:nil];
|
||||||
|
} else {
|
||||||
|
return [self loadMessagesBeforeAndAfterGUID:messagesGUID
|
||||||
|
numberOfMessagesToLoadBeforeGUID:limitBefore
|
||||||
|
numberOfMessagesToLoadAfterGUID:limitAfter
|
||||||
|
loadImmediately:YES];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)load:(NSUInteger)number messagesBeforeGUID:(NSString *)beforeMessageGUID
|
||||||
|
{
|
||||||
|
[self _safe_loadMessagesBeforeAndAfterGUID:beforeMessageGUID numberOfMessagesToLoadBeforeGUID:number numberOfMessagesToLoadAfterGUID:0 loadImmediately:YES];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)load:(NSUInteger)number messagesAfterGUID:(NSString *)afterMessageGUID
|
||||||
|
{
|
||||||
|
[self _safe_loadMessagesBeforeAndAfterGUID:afterMessageGUID numberOfMessagesToLoadBeforeGUID:0 numberOfMessagesToLoadAfterGUID:number loadImmediately:YES];
|
||||||
|
}
|
||||||
|
|
||||||
|
@end
|
||||||
|
|||||||
17
kordophone/Bridge/Operations/MBIMResolveHandleOperation.h
Normal file
17
kordophone/Bridge/Operations/MBIMResolveHandleOperation.h
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
//
|
||||||
|
// MBIMResolveHandleOperation.h
|
||||||
|
// kordophoned
|
||||||
|
//
|
||||||
|
// Created by James Magahern on 10/1/24.
|
||||||
|
// Copyright © 2024 James Magahern. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import "MBIMBridgeOperation.h"
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
|
@interface MBIMResolveHandleOperation : MBIMBridgeOperation
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_END
|
||||||
134
kordophone/Bridge/Operations/MBIMResolveHandleOperation.m
Normal file
134
kordophone/Bridge/Operations/MBIMResolveHandleOperation.m
Normal file
@@ -0,0 +1,134 @@
|
|||||||
|
//
|
||||||
|
// MBIMResolveHandleOperation.m
|
||||||
|
// kordophoned
|
||||||
|
//
|
||||||
|
// Created by James Magahern on 10/1/24.
|
||||||
|
// Copyright © 2024 James Magahern. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import "MBIMResolveHandleOperation.h"
|
||||||
|
|
||||||
|
#import "IMCore_ClassDump.h"
|
||||||
|
#import "IMMessageItem+Encoded.h"
|
||||||
|
|
||||||
|
/*
|
||||||
|
# Response:
|
||||||
|
Dictionary {
|
||||||
|
"resolvedHandle": <Encoded IMHandle>
|
||||||
|
"status": valid | invalid | unknown,
|
||||||
|
"existingChat": chatGUID | null
|
||||||
|
}
|
||||||
|
|
||||||
|
# IMHandle:
|
||||||
|
Dictionary {
|
||||||
|
"id" : resolvedID
|
||||||
|
"name" : fullName | null
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
@interface NSNumber (IDSStatusUtility)
|
||||||
|
- (NSString *)_idsStatusDescription;
|
||||||
|
@end
|
||||||
|
|
||||||
|
@implementation NSNumber (IDSStatusUtility)
|
||||||
|
- (NSString *)_idsStatusDescription
|
||||||
|
{
|
||||||
|
switch ([self unsignedIntegerValue]) {
|
||||||
|
case 1: return @"valid";
|
||||||
|
case 2: return @"invalid";
|
||||||
|
default:
|
||||||
|
return @"unknown";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@end
|
||||||
|
|
||||||
|
@interface IMHandle (Encoded)
|
||||||
|
- (NSDictionary *)mbim_dictionaryRepresentation;
|
||||||
|
@end
|
||||||
|
|
||||||
|
@implementation IMHandle (Encoded)
|
||||||
|
- (NSDictionary *)mbim_dictionaryRepresentation
|
||||||
|
{
|
||||||
|
return @{
|
||||||
|
@"id" : [self ID],
|
||||||
|
@"name" : [self name] ?: [NSNull null],
|
||||||
|
};
|
||||||
|
}
|
||||||
|
@end
|
||||||
|
|
||||||
|
@implementation MBIMResolveHandleOperation
|
||||||
|
|
||||||
|
+ (void)load { [super load]; }
|
||||||
|
|
||||||
|
+ (NSString *)endpointName
|
||||||
|
{
|
||||||
|
return @"resolveHandle";
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)main
|
||||||
|
{
|
||||||
|
NSString *specifiedIdentifier = [[self valueForQueryItemWithName:@"id"] _stripFZIDPrefix];
|
||||||
|
if (!specifiedIdentifier) {
|
||||||
|
MBIMLogError(@"No handle ID provided.");
|
||||||
|
HTTPErrorResponse *response = [[HTTPErrorResponse alloc] initWithErrorCode:500];
|
||||||
|
self.serverCompletionBlock(response);
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (IMStringIsPhoneNumber(specifiedIdentifier)) {
|
||||||
|
// Phone numbers will require a country code guess here.
|
||||||
|
// Passing nil, I presume, will make some kind of guess for the country code (useNetworkCountryCode).
|
||||||
|
specifiedIdentifier = IMCopyIDForPhoneNumber(specifiedIdentifier, nil, YES);
|
||||||
|
}
|
||||||
|
|
||||||
|
NSString *canonicalAddress = [specifiedIdentifier _bestGuessURI];
|
||||||
|
|
||||||
|
IMAccount *iMessageAccount = [[IMAccountController sharedInstance] bestAccountForService:[IMServiceImpl iMessageService]];
|
||||||
|
IMHandle *loginHandle = [iMessageAccount loginIMHandle];
|
||||||
|
|
||||||
|
NSString *lastAddressedHandle = [[[loginHandle ID] _stripFZIDPrefix] _bestGuessURI];
|
||||||
|
IMChatCalculateServiceForSendingNewComposeMaybeForce(@[ canonicalAddress ], lastAddressedHandle, nil, NO, IMStringIsEmail(canonicalAddress), NO, NO, NO, [iMessageAccount service], ^(BOOL allAddressesiMessageCapable, NSDictionary * _Nullable perRecipientAvailability, BOOL checkedServer, IMChatServiceForSendingAvailabilityError error)
|
||||||
|
{
|
||||||
|
NSError *encodingError = nil;
|
||||||
|
NSObject<HTTPResponse> *response = nil;
|
||||||
|
|
||||||
|
do {
|
||||||
|
// Assume we have returned just one key here.
|
||||||
|
NSString *resolvedHandleID = [[perRecipientAvailability allKeys] firstObject];
|
||||||
|
if (!resolvedHandleID) {
|
||||||
|
MBIMLogError(@"Unexpected missing handle id");
|
||||||
|
response = [[HTTPErrorResponse alloc] initWithErrorCode:500];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
IMHandle *resolvedHandle = [iMessageAccount imHandleWithID:resolvedHandleID];
|
||||||
|
if (!resolvedHandle) {
|
||||||
|
MBIMLogError(@"Couldn't resolve handle");
|
||||||
|
response = [[HTTPErrorResponse alloc] initWithErrorCode:500];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
NSString *handleStatus = [[perRecipientAvailability objectForKey:resolvedHandleID] _idsStatusDescription];
|
||||||
|
|
||||||
|
IMChat *existingChat = [[IMChatRegistry sharedInstance] existingChatForIMHandle:resolvedHandle];
|
||||||
|
|
||||||
|
NSDictionary *responseDict = @{
|
||||||
|
@"resolvedHandle" : [resolvedHandle mbim_dictionaryRepresentation],
|
||||||
|
@"status" : handleStatus,
|
||||||
|
@"existingChat" : [existingChat guid] ?: [NSNull null],
|
||||||
|
};
|
||||||
|
|
||||||
|
NSData *data = [NSJSONSerialization dataWithJSONObject:responseDict options:0 error:&encodingError];
|
||||||
|
if (encodingError) {
|
||||||
|
response = [[HTTPErrorResponse alloc] initWithErrorCode:500];
|
||||||
|
} else {
|
||||||
|
response = [[MBIMDataResponse alloc] initWithData:data contentType:@"application/json"];
|
||||||
|
}
|
||||||
|
} while (0);
|
||||||
|
|
||||||
|
self.serverCompletionBlock(response);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@end
|
||||||
@@ -9,6 +9,7 @@
|
|||||||
#import "MBIMSendMessageOperation.h"
|
#import "MBIMSendMessageOperation.h"
|
||||||
|
|
||||||
#import "IMCore_ClassDump.h"
|
#import "IMCore_ClassDump.h"
|
||||||
|
#import "IMMessageItem+Encoded.h"
|
||||||
|
|
||||||
@implementation MBIMSendMessageOperation
|
@implementation MBIMSendMessageOperation
|
||||||
|
|
||||||
@@ -19,9 +20,9 @@
|
|||||||
return @"sendMessage";
|
return @"sendMessage";
|
||||||
}
|
}
|
||||||
|
|
||||||
- (BOOL)_sendMessage:(NSString *)messageBody toChatWithGUID:(NSString *)chatGUID attachmentGUIDs:(NSArray<NSString *> *)guids
|
- (IMMessage *)_sendMessage:(NSString *)messageBody toChatWithGUID:(NSString *)chatGUID attachmentGUIDs:(NSArray<NSString *> *)guids
|
||||||
{
|
{
|
||||||
__block BOOL result = YES;
|
__block IMMessage *result = nil;
|
||||||
|
|
||||||
dispatch_sync([[self class] sharedIMAccessQueue], ^{
|
dispatch_sync([[self class] sharedIMAccessQueue], ^{
|
||||||
IMChat *chat = [[IMChatRegistry sharedInstance] existingChatWithGUID:chatGUID];
|
IMChat *chat = [[IMChatRegistry sharedInstance] existingChatWithGUID:chatGUID];
|
||||||
@@ -44,15 +45,38 @@
|
|||||||
|
|
||||||
if (!chat) {
|
if (!chat) {
|
||||||
MBIMLogInfo(@"Chat does not exist: %@", chatGUID);
|
MBIMLogInfo(@"Chat does not exist: %@", chatGUID);
|
||||||
result = NO;
|
|
||||||
} else {
|
} else {
|
||||||
[chat sendMessage:reply];
|
result = reply;
|
||||||
|
|
||||||
|
dispatch_async(dispatch_get_main_queue(), ^{
|
||||||
|
[chat sendMessage:reply];
|
||||||
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if 0
|
||||||
|
- (NSDictionary *)adjustMessageSummaryInfoForSending:(NSDictionary *)messageSummaryInfo
|
||||||
|
{
|
||||||
|
NSMutableDictionary *adjustedInfo = [messageSummaryInfo mutableCopy];
|
||||||
|
if (!adjustedInfo) {
|
||||||
|
adjustedInfo = [NSMutableDictionary dictionary];
|
||||||
|
}
|
||||||
|
|
||||||
|
if ([fullText length] > 50) {
|
||||||
|
summary = [[summary substringToIndex:[summary rangeOfComposedCharacterSequenceAtIndex:kMaxSummaryLength].location] stringByAppendingString:@"…"];
|
||||||
|
adjustedInfo[IMMessageSummaryInfoSummary] = summary;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
adjustedInfo[IMMessageSummaryInfoTapbackRepresentationKey] = @"Loved";
|
||||||
|
|
||||||
|
return adjustedInfo;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
- (void)main
|
- (void)main
|
||||||
{
|
{
|
||||||
NSObject<HTTPResponse> *response = [[HTTPErrorResponse alloc] initWithErrorCode:500];
|
NSObject<HTTPResponse> *response = [[HTTPErrorResponse alloc] initWithErrorCode:500];
|
||||||
@@ -71,14 +95,25 @@
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// tapbacks
|
||||||
|
#if 0
|
||||||
|
IMMessage *acknowledgment = [IMMessage instantMessageWithAssociatedMessageContent: /* [NSString stringWithFormat:@"%@ \"%%@\"", tapbackAction] */
|
||||||
|
flags:0
|
||||||
|
associatedMessageGUID:guid
|
||||||
|
associatedMessageType:IMAssociatedMessageTypeAcknowledgmentHeart
|
||||||
|
associatedMessageRange:[imMessage messagePartRange]
|
||||||
|
messageSummaryInfo:[self adjustMessageSummaryInfoForSending:message]
|
||||||
|
threadIdentifier:[imMessage threadIdentifier]];
|
||||||
|
#endif
|
||||||
|
|
||||||
NSArray *transferGUIDs = [args objectForKey:@"fileTransferGUIDs"];
|
NSArray *transferGUIDs = [args objectForKey:@"fileTransferGUIDs"];
|
||||||
if (!transferGUIDs) {
|
if (!transferGUIDs) {
|
||||||
transferGUIDs = @[];
|
transferGUIDs = @[];
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL result = [self _sendMessage:messageBody toChatWithGUID:guid attachmentGUIDs:transferGUIDs];
|
IMMessage *result = [self _sendMessage:messageBody toChatWithGUID:guid attachmentGUIDs:transferGUIDs];
|
||||||
if (result) {
|
if (result) {
|
||||||
response = [[HTTPErrorResponse alloc] initWithErrorCode:200];
|
response = [MBIMJSONDataResponse responseWithJSONObject:[result mbim_dictionaryRepresentation]];
|
||||||
}
|
}
|
||||||
|
|
||||||
self.serverCompletionBlock(response);
|
self.serverCompletionBlock(response);
|
||||||
|
|||||||
17
kordophone/Bridge/Operations/MBIMStatusOperation.h
Normal file
17
kordophone/Bridge/Operations/MBIMStatusOperation.h
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
//
|
||||||
|
// MBIMStatusOperation.h
|
||||||
|
// kordophoned
|
||||||
|
//
|
||||||
|
// Created by James Magahern on 8/3/22.
|
||||||
|
// Copyright © 2022 James Magahern. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import "MBIMBridgeOperation.h"
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
|
@interface MBIMStatusOperation : MBIMBridgeOperation
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_END
|
||||||
25
kordophone/Bridge/Operations/MBIMStatusOperation.m
Normal file
25
kordophone/Bridge/Operations/MBIMStatusOperation.m
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
//
|
||||||
|
// MBIMStatusOperation.m
|
||||||
|
// kordophoned
|
||||||
|
//
|
||||||
|
// Created by James Magahern on 8/3/22.
|
||||||
|
// Copyright © 2022 James Magahern. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import "MBIMStatusOperation.h"
|
||||||
|
|
||||||
|
@implementation MBIMStatusOperation
|
||||||
|
|
||||||
|
+ (void)load { [super load]; }
|
||||||
|
|
||||||
|
+ (NSString *)endpointName
|
||||||
|
{
|
||||||
|
return @"status";
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)main
|
||||||
|
{
|
||||||
|
self.serverCompletionBlock([[MBIMDataResponse alloc] initWithData:[@"OK" dataUsingEncoding:NSUTF8StringEncoding]]);
|
||||||
|
}
|
||||||
|
|
||||||
|
@end
|
||||||
@@ -40,13 +40,13 @@
|
|||||||
weakSelf.serverCompletionBlock(response);
|
weakSelf.serverCompletionBlock(response);
|
||||||
};
|
};
|
||||||
|
|
||||||
[[MBIMUpdateQueue sharedInstance] addConsumer:_updateConsumer withLastSyncedMessageSeq:messageSeq];
|
[[MBIMUpdateQueue sharedInstance] addPollingConsumer:_updateConsumer withLastSyncedMessageSeq:messageSeq];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)cancel
|
- (void)cancel
|
||||||
{
|
{
|
||||||
[super cancel];
|
[super cancel];
|
||||||
[[MBIMUpdateQueue sharedInstance] removeConsumer:_updateConsumer];
|
[[MBIMUpdateQueue sharedInstance] removePollingConsumer:_updateConsumer];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (NSObject<HTTPResponse> *)cancelAndReturnTimeoutResponse
|
- (NSObject<HTTPResponse> *)cancelAndReturnTimeoutResponse
|
||||||
|
|||||||
@@ -38,7 +38,14 @@
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
NSString *localPath = [NSTemporaryDirectory() stringByAppendingPathComponent:filename];
|
// Sanitize filename
|
||||||
|
NSCharacterSet *dotCharacter = [NSCharacterSet characterSetWithCharactersInString:@"."];
|
||||||
|
NSCharacterSet *illegalFileNameCharacters = [NSCharacterSet characterSetWithCharactersInString:@"/\\?%*|\"<>"];
|
||||||
|
NSString *sanitizedFilename = [[[filename componentsSeparatedByCharactersInSet:illegalFileNameCharacters]
|
||||||
|
componentsJoinedByString:@"-"]
|
||||||
|
stringByTrimmingCharactersInSet:dotCharacter];
|
||||||
|
|
||||||
|
NSString *localPath = [NSTemporaryDirectory() stringByAppendingPathComponent:sanitizedFilename];
|
||||||
NSURL *localURL = [NSURL fileURLWithPath:localPath];
|
NSURL *localURL = [NSURL fileURLWithPath:localPath];
|
||||||
BOOL success = [attachmentData writeToURL:localURL atomically:NO];
|
BOOL success = [attachmentData writeToURL:localURL atomically:NO];
|
||||||
if (!success) {
|
if (!success) {
|
||||||
|
|||||||
17
kordophone/Bridge/Operations/MBIMVersionOperation.h
Normal file
17
kordophone/Bridge/Operations/MBIMVersionOperation.h
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
//
|
||||||
|
// MBIMVersionOperation.h
|
||||||
|
// kordophoned
|
||||||
|
//
|
||||||
|
// Created by James Magahern on 8/3/22.
|
||||||
|
// Copyright © 2022 James Magahern. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import "MBIMBridgeOperation.h"
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
|
@interface MBIMVersionOperation : MBIMBridgeOperation
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_END
|
||||||
40
kordophone/Bridge/Operations/MBIMVersionOperation.m
Normal file
40
kordophone/Bridge/Operations/MBIMVersionOperation.m
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
//
|
||||||
|
// MBIMVersionOperation.m
|
||||||
|
// kordophoned
|
||||||
|
//
|
||||||
|
// Created by James Magahern on 8/3/22.
|
||||||
|
// Copyright © 2022 James Magahern. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import "MBIMVersionOperation.h"
|
||||||
|
#import "MBIMErrorResponse.h"
|
||||||
|
|
||||||
|
#ifdef __clang_analyzer__
|
||||||
|
const char* MBIMVersion() {
|
||||||
|
return "UNKNOWN";
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
#import "MBIMVersion.c"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
@implementation MBIMVersionOperation
|
||||||
|
|
||||||
|
+ (void)load { [super load]; }
|
||||||
|
|
||||||
|
+ (BOOL)requiresAuthentication
|
||||||
|
{
|
||||||
|
return NO;
|
||||||
|
}
|
||||||
|
|
||||||
|
+ (NSString *)endpointName
|
||||||
|
{
|
||||||
|
return @"version";
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)main
|
||||||
|
{
|
||||||
|
NSString *versionString = [NSString stringWithUTF8String:MBIMVersion()];
|
||||||
|
self.serverCompletionBlock([[MBIMDataResponse alloc] initWithData:[versionString dataUsingEncoding:NSUTF8StringEncoding]]);
|
||||||
|
}
|
||||||
|
|
||||||
|
@end
|
||||||
@@ -7,11 +7,12 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
#import <Foundation/Foundation.h>
|
#import <Foundation/Foundation.h>
|
||||||
#import <CocoaHTTPServer/HTTPDataResponse.h>
|
#import "HTTPDataResponse.h"
|
||||||
|
|
||||||
NS_ASSUME_NONNULL_BEGIN
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
@interface MBIMDataResponse : HTTPDataResponse
|
@interface MBIMDataResponse : HTTPDataResponse
|
||||||
|
@property (nonatomic, readonly) NSMutableDictionary *httpHeaders;
|
||||||
- (instancetype)initWithData:(NSData *)data contentType:(NSString *)contentType;
|
- (instancetype)initWithData:(NSData *)data contentType:(NSString *)contentType;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
|||||||
@@ -10,6 +10,7 @@
|
|||||||
|
|
||||||
@implementation MBIMDataResponse {
|
@implementation MBIMDataResponse {
|
||||||
NSString *_contentType;
|
NSString *_contentType;
|
||||||
|
NSMutableDictionary *_httpHeaders;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (instancetype)initWithData:(NSData *)data contentType:(NSString *)contentType
|
- (instancetype)initWithData:(NSData *)data contentType:(NSString *)contentType
|
||||||
@@ -17,6 +18,11 @@
|
|||||||
self = [super initWithData:data];
|
self = [super initWithData:data];
|
||||||
if (self) {
|
if (self) {
|
||||||
_contentType = contentType;
|
_contentType = contentType;
|
||||||
|
_httpHeaders = [@{
|
||||||
|
@"Content-Type" : _contentType ?: @"application/octet-stream",
|
||||||
|
@"Access-Control-Allow-Origin" : @"*", // CORS
|
||||||
|
@"Access-Control-Allow-Credentials" : @"true"
|
||||||
|
} mutableCopy];
|
||||||
}
|
}
|
||||||
|
|
||||||
return self;
|
return self;
|
||||||
@@ -24,9 +30,7 @@
|
|||||||
|
|
||||||
- (NSDictionary *)httpHeaders
|
- (NSDictionary *)httpHeaders
|
||||||
{
|
{
|
||||||
return @{
|
return _httpHeaders;
|
||||||
@"Content-Type" : _contentType ?: @"application/octet-stream"
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|||||||
18
kordophone/Bridge/Operations/Utilities/MBIMErrorResponse.h
Normal file
18
kordophone/Bridge/Operations/Utilities/MBIMErrorResponse.h
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
//
|
||||||
|
// MBIMErrorResponse.h
|
||||||
|
// kordophoned
|
||||||
|
//
|
||||||
|
// Created by James Magahern on 8/3/22.
|
||||||
|
// Copyright © 2022 James Magahern. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import "HTTPDataResponse.h"
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
|
@interface MBIMErrorResponse : HTTPDataResponse
|
||||||
|
- (instancetype)initWithErrorCode:(int)httpErrorCode;
|
||||||
|
- (instancetype)initWithErrorCode:(int)httpErrorCode message:(NSString *)message;
|
||||||
|
@end
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_END
|
||||||
38
kordophone/Bridge/Operations/Utilities/MBIMErrorResponse.m
Normal file
38
kordophone/Bridge/Operations/Utilities/MBIMErrorResponse.m
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
//
|
||||||
|
// MBIMErrorResponse.m
|
||||||
|
// kordophoned
|
||||||
|
//
|
||||||
|
// Created by James Magahern on 8/3/22.
|
||||||
|
// Copyright © 2022 James Magahern. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import "MBIMErrorResponse.h"
|
||||||
|
|
||||||
|
@implementation MBIMErrorResponse {
|
||||||
|
int _status;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (instancetype)initWithErrorCode:(int)httpErrorCode
|
||||||
|
{
|
||||||
|
if (self = [super initWithData:nil]) {
|
||||||
|
_status = httpErrorCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
return self;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (instancetype)initWithErrorCode:(int)httpErrorCode message:(NSString *)message
|
||||||
|
{
|
||||||
|
if (self = [super initWithData:[message dataUsingEncoding:NSUTF8StringEncoding]]) {
|
||||||
|
_status = httpErrorCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
return self;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (NSInteger)status
|
||||||
|
{
|
||||||
|
return _status;
|
||||||
|
}
|
||||||
|
|
||||||
|
@end
|
||||||
@@ -10,3 +10,13 @@
|
|||||||
|
|
||||||
NSString* MBIMWebServerFormatRFC822(NSDate *date);
|
NSString* MBIMWebServerFormatRFC822(NSDate *date);
|
||||||
NSString* MBIMWebServerFormatISO8601(NSDate *date);
|
NSString* MBIMWebServerFormatISO8601(NSDate *date);
|
||||||
|
|
||||||
|
@interface NSDate (MBIMWebServerFormat)
|
||||||
|
- (NSString *)RFC822StringValue;
|
||||||
|
- (NSString *)ISO8601StringValue;
|
||||||
|
@end
|
||||||
|
|
||||||
|
@interface NSString (MBIMWebServerFormat)
|
||||||
|
- (NSDate *)RFC822Date;
|
||||||
|
- (NSDate *)ISO8601Date;
|
||||||
|
@end
|
||||||
|
|||||||
@@ -47,3 +47,31 @@ NSString* MBIMWebServerFormatISO8601(NSDate *date)
|
|||||||
|
|
||||||
return string;
|
return string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@implementation NSDate (MBIMWebServerFormat)
|
||||||
|
|
||||||
|
- (NSString *)RFC822StringValue
|
||||||
|
{
|
||||||
|
return MBIMWebServerFormatRFC822(self);
|
||||||
|
}
|
||||||
|
|
||||||
|
- (NSString *)ISO8601StringValue
|
||||||
|
{
|
||||||
|
return MBIMWebServerFormatISO8601(self);
|
||||||
|
}
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
||||||
|
@implementation NSString (MBIMWebServerFormat)
|
||||||
|
|
||||||
|
- (NSDate *)RFC822Date
|
||||||
|
{
|
||||||
|
return [_dateFormatterRFC822 dateFromString:self];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (NSDate *)ISO8601Date
|
||||||
|
{
|
||||||
|
return [_dateFormatterISO8601 dateFromString:self];
|
||||||
|
}
|
||||||
|
|
||||||
|
@end
|
||||||
|
|||||||
12
kordophone/Bridge/Operations/Utilities/MBIMImageUtils.h
Normal file
12
kordophone/Bridge/Operations/Utilities/MBIMImageUtils.h
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
//
|
||||||
|
// MBIMImageUtils.h
|
||||||
|
// kordophoned
|
||||||
|
//
|
||||||
|
// Created by James Magahern on 12/20/22.
|
||||||
|
// Copyright © 2022 James Magahern. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import <Foundation/Foundation.h>
|
||||||
|
#import <CoreGraphics/CoreGraphics.h>
|
||||||
|
|
||||||
|
extern NSData* MBIMCGImageJPEGRepresentation(CGImageRef imageRef);
|
||||||
37
kordophone/Bridge/Operations/Utilities/MBIMImageUtils.m
Normal file
37
kordophone/Bridge/Operations/Utilities/MBIMImageUtils.m
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
//
|
||||||
|
// MBIMImageUtils.m
|
||||||
|
// kordophoned
|
||||||
|
//
|
||||||
|
// Created by James Magahern on 12/20/22.
|
||||||
|
// Copyright © 2022 James Magahern. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import "MBIMImageUtils.h"
|
||||||
|
#import <ImageIO/ImageIO.h>
|
||||||
|
|
||||||
|
NSData* MBIMCGImageJPEGRepresentation(CGImageRef imageRef)
|
||||||
|
{
|
||||||
|
if (imageRef == NULL) return nil;
|
||||||
|
|
||||||
|
NSNumber *const DPI = @72.0;
|
||||||
|
NSNumber *const compressionQuality = @0.9;
|
||||||
|
NSDictionary *properties = @{
|
||||||
|
(__bridge NSString *)kCGImagePropertyDPIWidth : DPI,
|
||||||
|
(__bridge NSString *)kCGImagePropertyDPIHeight : DPI,
|
||||||
|
(__bridge NSString *)kCGImageDestinationLossyCompressionQuality : compressionQuality,
|
||||||
|
};
|
||||||
|
|
||||||
|
bool success = false;
|
||||||
|
NSMutableData *data = [NSMutableData data];
|
||||||
|
if (data) {
|
||||||
|
CGImageDestinationRef imageDestination = CGImageDestinationCreateWithData((CFMutableDataRef)data, CFSTR("public.jpeg"), 1/*count*/, NULL/*options*/);
|
||||||
|
if (imageDestination != NULL) {
|
||||||
|
CGImageDestinationAddImage(imageDestination, imageRef, (__bridge CFDictionaryRef)properties);
|
||||||
|
success = CGImageDestinationFinalize(imageDestination);
|
||||||
|
CFRelease(imageDestination);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return success ? data : nil;
|
||||||
|
}
|
||||||
|
|
||||||
@@ -12,8 +12,10 @@
|
|||||||
|
|
||||||
+ (instancetype)responseWithJSONObject:(id)object
|
+ (instancetype)responseWithJSONObject:(id)object
|
||||||
{
|
{
|
||||||
NSData *data = [NSJSONSerialization dataWithJSONObject:object options:0 error:NULL];
|
NSError *error = nil;
|
||||||
|
NSData *data = [NSJSONSerialization dataWithJSONObject:object options:0 error:&error];
|
||||||
if (data == nil) {
|
if (data == nil) {
|
||||||
|
NSLog(@"JSON encoding error: %@", error);
|
||||||
return nil;
|
return nil;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
17
kordophone/Bridge/Operations/Utilities/MBIMURLUtilities.h
Normal file
17
kordophone/Bridge/Operations/Utilities/MBIMURLUtilities.h
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
//
|
||||||
|
// MBIMURLUtilities.h
|
||||||
|
// kordophoned
|
||||||
|
//
|
||||||
|
// Created by James Magahern on 1/17/23.
|
||||||
|
// Copyright © 2023 James Magahern. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import <Foundation/Foundation.h>
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
|
@interface NSURL (MBIMURLUtilities)
|
||||||
|
- (nullable NSString *)valueForQueryItemWithName:(NSString *)queryItemName;
|
||||||
|
@end
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_END
|
||||||
28
kordophone/Bridge/Operations/Utilities/MBIMURLUtilities.m
Normal file
28
kordophone/Bridge/Operations/Utilities/MBIMURLUtilities.m
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
//
|
||||||
|
// MBIMURLUtilities.m
|
||||||
|
// kordophoned
|
||||||
|
//
|
||||||
|
// Created by James Magahern on 1/17/23.
|
||||||
|
// Copyright © 2023 James Magahern. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import "MBIMURLUtilities.h"
|
||||||
|
|
||||||
|
@implementation NSURL (MBIMURLUtilities)
|
||||||
|
|
||||||
|
- (nullable NSString *)valueForQueryItemWithName:(NSString *)queryItemName
|
||||||
|
{
|
||||||
|
NSURLComponents *urlComponents = [NSURLComponents componentsWithURL:self resolvingAgainstBaseURL:NO];
|
||||||
|
|
||||||
|
NSString *value = nil;
|
||||||
|
for (NSURLQueryItem *queryItem in [urlComponents queryItems]) {
|
||||||
|
if ([[queryItem name] isEqualToString:queryItemName]) {
|
||||||
|
value = [queryItem value];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
@end
|
||||||
@@ -7,6 +7,7 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
#import "IMChat+Encoded.h"
|
#import "IMChat+Encoded.h"
|
||||||
|
#import "IMMessageItem+Encoded.h"
|
||||||
#import "MBIMHTTPUtilities.h"
|
#import "MBIMHTTPUtilities.h"
|
||||||
|
|
||||||
@implementation IMChat (Encoded)
|
@implementation IMChat (Encoded)
|
||||||
@@ -19,9 +20,18 @@
|
|||||||
chatDict[@"date"] = MBIMWebServerFormatISO8601([self lastFinishedMessageDate]);
|
chatDict[@"date"] = MBIMWebServerFormatISO8601([self lastFinishedMessageDate]);
|
||||||
chatDict[@"unreadCount"] = @([self unreadMessageCount]);
|
chatDict[@"unreadCount"] = @([self unreadMessageCount]);
|
||||||
|
|
||||||
|
// NOTE: -[IMChat lastMessage] != -[[IMChat chatItems] lastMessage].
|
||||||
|
// This means the messages we get back from the message list operation might be different from this here, which means we
|
||||||
|
// can't reliably use `lastMessage.guid` as a sync anchor.
|
||||||
|
//
|
||||||
|
// Ideally, everything should move to use chat items instead of messages so we can handle associated message items (reactions).
|
||||||
|
// When that happens, we should use `lastFinishedMessageItem` here instead of `lastMessage`, and avoid the db hit.
|
||||||
|
//
|
||||||
IMMessage *lastMessage = [self lastMessage];
|
IMMessage *lastMessage = [self lastMessage];
|
||||||
if (lastMessage) {
|
if (lastMessage) {
|
||||||
chatDict[@"lastMessagePreview"] = [[lastMessage text] string];
|
NSString *lastMessagePreview = [lastMessage descriptionForPurpose:IMMessageDescriptionConversationList];
|
||||||
|
chatDict[@"lastMessagePreview"] = [lastMessagePreview substringToIndex:MIN(128, [lastMessagePreview length])];
|
||||||
|
chatDict[@"lastMessage"] = [lastMessage mbim_dictionaryRepresentation];
|
||||||
}
|
}
|
||||||
|
|
||||||
NSMutableArray *participantStrings = [NSMutableArray array];
|
NSMutableArray *participantStrings = [NSMutableArray array];
|
||||||
|
|||||||
@@ -9,6 +9,40 @@
|
|||||||
#import "IMMessageItem+Encoded.h"
|
#import "IMMessageItem+Encoded.h"
|
||||||
#import "MBIMHTTPUtilities.h"
|
#import "MBIMHTTPUtilities.h"
|
||||||
|
|
||||||
|
static NSString* IMAssociatedMessageTypeValue(IMAssociatedMessageType type) {
|
||||||
|
switch (type) {
|
||||||
|
case IMAssociatedMessageTypeAcknowledgmentHeart:
|
||||||
|
return @"heart";
|
||||||
|
case IMAssociatedMessageTypeAcknowledgmentThumbsUp:
|
||||||
|
return @"thumbsUp";
|
||||||
|
case IMAssociatedMessageTypeAcknowledgmentThumbsDown:
|
||||||
|
return @"thumbsDown";
|
||||||
|
case IMAssociatedMessageTypeAcknowledgmentHa:
|
||||||
|
return @"ha";
|
||||||
|
case IMAssociatedMessageTypeAcknowledgmentExclamation:
|
||||||
|
return @"exclamation";
|
||||||
|
case IMAssociatedMessageTypeAcknowledgmentQuestionMark:
|
||||||
|
return @"questionMark";
|
||||||
|
|
||||||
|
case IMAssociatedMessageTypeAcknowledgmentHeartRemoved:
|
||||||
|
return @"removed heart";
|
||||||
|
case IMAssociatedMessageTypeAcknowledgmentThumbsUpRemoved:
|
||||||
|
return @"removed thumbsUp";
|
||||||
|
case IMAssociatedMessageTypeAcknowledgmentThumbsDownRemoved:
|
||||||
|
return @"removed thumbsDown";
|
||||||
|
case IMAssociatedMessageTypeAcknowledgmentHaRemoved:
|
||||||
|
return @"removed ha";
|
||||||
|
case IMAssociatedMessageTypeAcknowledgmentExclamationRemoved:
|
||||||
|
return @"removed exclamation";
|
||||||
|
case IMAssociatedMessageTypeAcknowledgmentQuestionMarkRemoved:
|
||||||
|
return @"removed questionMark";
|
||||||
|
|
||||||
|
case IMAssociatedMessageTypeUnspecified:
|
||||||
|
default:
|
||||||
|
return @"unknown";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@implementation IMMessage (Encoded)
|
@implementation IMMessage (Encoded)
|
||||||
|
|
||||||
- (NSDictionary *)mbim_dictionaryRepresentation
|
- (NSDictionary *)mbim_dictionaryRepresentation
|
||||||
@@ -19,18 +53,38 @@
|
|||||||
messageDict[@"sender"] = ([self isFromMe] ? nil : [[self sender] displayID]); // TODO: nil sender is still a weird way to represent this...
|
messageDict[@"sender"] = ([self isFromMe] ? nil : [[self sender] displayID]); // TODO: nil sender is still a weird way to represent this...
|
||||||
messageDict[@"guid"] = [self guid];
|
messageDict[@"guid"] = [self guid];
|
||||||
|
|
||||||
|
if ([self associatedMessageGUID]) {
|
||||||
|
NSString *encodedAssociatedMessageGUID = [self associatedMessageGUID];
|
||||||
|
messageDict[@"associatedMessageGUID"] = encodedAssociatedMessageGUID;
|
||||||
|
messageDict[@"associatedMessageType"] = IMAssociatedMessageTypeValue([self associatedMessageType]);
|
||||||
|
|
||||||
|
NSString *decodedAssociatedChatItemGUID = IMAssociatedMessageDecodeGUID(encodedAssociatedMessageGUID);
|
||||||
|
if (decodedAssociatedChatItemGUID) messageDict[@"associatedChatItemGUID"] = decodedAssociatedChatItemGUID;
|
||||||
|
}
|
||||||
|
|
||||||
if ([self fileTransferGUIDs]) {
|
if ([self fileTransferGUIDs]) {
|
||||||
// Support only images right now
|
// Support only images right now
|
||||||
|
NSMutableDictionary *attachmentMetadatas = [NSMutableDictionary dictionary];
|
||||||
NSMutableArray *filteredFileTransferGUIDs = [NSMutableArray array];
|
NSMutableArray *filteredFileTransferGUIDs = [NSMutableArray array];
|
||||||
for (NSString *guid in self.fileTransferGUIDs) {
|
for (NSString *guid in self.fileTransferGUIDs) {
|
||||||
|
NSMutableDictionary *metadata = [NSMutableDictionary dictionary];
|
||||||
IMFileTransfer *transfer = [[IMFileTransferCenter sharedInstance] transferForGUID:guid];
|
IMFileTransfer *transfer = [[IMFileTransferCenter sharedInstance] transferForGUID:guid];
|
||||||
if ([[transfer mimeType] containsString:@"image"]) {
|
if ([[transfer mimeType] containsString:@"image"]) {
|
||||||
[filteredFileTransferGUIDs addObject:guid];
|
[filteredFileTransferGUIDs addObject:guid];
|
||||||
|
|
||||||
|
if ([transfer attributionInfo] != nil) {
|
||||||
|
metadata[@"attributionInfo"] = [transfer attributionInfo];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (metadata.count) {
|
||||||
|
attachmentMetadatas[guid] = metadata;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ([filteredFileTransferGUIDs count]) {
|
if ([filteredFileTransferGUIDs count]) {
|
||||||
messageDict[@"fileTransferGUIDs"] = filteredFileTransferGUIDs;
|
messageDict[@"fileTransferGUIDs"] = filteredFileTransferGUIDs;
|
||||||
|
messageDict[@"attachmentMetadata"] = attachmentMetadatas;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -7,38 +7,69 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
#import "MBIMLogging.h"
|
#import "MBIMLogging.h"
|
||||||
|
#import <os/log.h>
|
||||||
|
|
||||||
#define ESC(inner) "\033[" inner "m"
|
#define ESC(inner) "\033[" inner "m"
|
||||||
#define CLR ESC("0")
|
#define CLR ESC("0")
|
||||||
#define BLD "1;"
|
#define BLD "1;"
|
||||||
#define RED "31;"
|
#define RED "31;"
|
||||||
|
|
||||||
extern void __MBIMLogCommon(MBIMLogLevel level, NSString *format, ...)
|
static os_log_t MBIMOSLog(void)
|
||||||
{
|
{
|
||||||
static dispatch_once_t onceToken;
|
static dispatch_once_t onceToken;
|
||||||
static NSDateFormatter *dateFormatter = nil;
|
static os_log_t customLog = NULL;
|
||||||
dispatch_once(&onceToken, ^{
|
dispatch_once(&onceToken, ^{
|
||||||
dateFormatter = [[NSDateFormatter alloc] init];
|
customLog = os_log_create("net.buzzert.kordophoned", "General");
|
||||||
dateFormatter.dateFormat = @"Y-MM-d HH:mm:ss";
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
return customLog;
|
||||||
|
}
|
||||||
|
|
||||||
|
extern void __MBIMLogCommon(MBIMLogLevel level, NSString *format, ...)
|
||||||
|
{
|
||||||
va_list args;
|
va_list args;
|
||||||
va_start(args, format);
|
va_start(args, format);
|
||||||
NSString *message = [[NSString alloc] initWithFormat:format arguments:args];
|
NSString *message = [[NSString alloc] initWithFormat:format arguments:args];
|
||||||
va_end(args);
|
va_end(args);
|
||||||
|
|
||||||
const char *c_fmt = "%s";
|
if (getenv("NSRunningFromLaunchd") != NULL) {
|
||||||
if (level == ML_NOTIFY) {
|
// Running with launchd, use oslog.
|
||||||
// BOLD
|
os_log_t mbimlog = MBIMOSLog();
|
||||||
c_fmt = ESC(BLD) "%s";
|
|
||||||
} else if (level == ML_ERROR) {
|
|
||||||
c_fmt = ESC(RED) "%s";
|
|
||||||
} else if (level == ML_FATAL) {
|
|
||||||
c_fmt = ESC(BLD RED) "%s";
|
|
||||||
}
|
|
||||||
|
|
||||||
NSString *dateStr = [dateFormatter stringFromDate:[NSDate date]];
|
switch (level) {
|
||||||
fprintf(stdout, "%s: ", [dateStr UTF8String]);
|
case ML_INFO:
|
||||||
fprintf(stdout, c_fmt, [message UTF8String]);
|
os_log_debug(mbimlog, "%{public}@", message);
|
||||||
fprintf(stdout, CLR "\n");
|
break;
|
||||||
|
case ML_NOTIFY:
|
||||||
|
os_log_info(mbimlog, "%{public}@", message);
|
||||||
|
break;
|
||||||
|
case ML_FATAL:
|
||||||
|
case ML_ERROR:
|
||||||
|
os_log_error(mbimlog, "%{public}@", message);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// Otherwise, write to stdout.
|
||||||
|
static dispatch_once_t onceToken;
|
||||||
|
static NSDateFormatter *dateFormatter = nil;
|
||||||
|
dispatch_once(&onceToken, ^{
|
||||||
|
dateFormatter = [[NSDateFormatter alloc] init];
|
||||||
|
dateFormatter.dateFormat = @"Y-MM-d HH:mm:ss";
|
||||||
|
});
|
||||||
|
|
||||||
|
const char *c_fmt = "%s";
|
||||||
|
if (level == ML_NOTIFY) {
|
||||||
|
// BOLD
|
||||||
|
c_fmt = ESC(BLD) "%s";
|
||||||
|
} else if (level == ML_ERROR) {
|
||||||
|
c_fmt = ESC(RED) "%s";
|
||||||
|
} else if (level == ML_FATAL) {
|
||||||
|
c_fmt = ESC(BLD RED) "%s";
|
||||||
|
}
|
||||||
|
|
||||||
|
NSString *dateStr = [dateFormatter stringFromDate:[NSDate date]];
|
||||||
|
fprintf(stdout, "%s: ", [dateStr UTF8String]);
|
||||||
|
fprintf(stdout, c_fmt, [message UTF8String]);
|
||||||
|
fprintf(stdout, CLR "\n");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
16
kordophone/kordophoned-RestrictedEntitlements.plist
Normal file
16
kordophone/kordophoned-RestrictedEntitlements.plist
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
|
<plist version="1.0">
|
||||||
|
<dict>
|
||||||
|
<key>com.apple.imagent</key>
|
||||||
|
<true/>
|
||||||
|
<key>com.apple.private.imagent</key>
|
||||||
|
<true/>
|
||||||
|
<key>com.apple.private.imcore.imagent</key>
|
||||||
|
<true/>
|
||||||
|
<key>com.apple.imagent.av</key>
|
||||||
|
<true/>
|
||||||
|
<key>com.apple.imagent.chat</key>
|
||||||
|
<true/>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
||||||
Reference in New Issue
Block a user