Private
Public Access
1
0

24 Commits

Author SHA1 Message Date
7cceb5b92d remove logging from pingpong 2025-06-13 14:56:40 -07:00
3f03937ca4 guessing at this point 2025-06-13 14:54:51 -07:00
d706435103 pingpong prevent superclass from handling rest of ping frame 2025-06-13 14:50:13 -07:00
e1ec237053 now actually handle pong 2025-06-13 14:47:47 -07:00
a9c2f5d93e pingpong: need to handle the first part of the frame first 2025-06-13 14:44:03 -07:00
1dc6f0ec1b add logging 2025-06-13 14:39:24 -07:00
e97edc10b7 Apparently need -ObjC for loading categories from a static library. 2025-06-13 14:36:00 -07:00
283e6c2218 Revert "static link categories"
This reverts commit f040b95827.
2025-06-13 14:35:26 -07:00
f040b95827 static link categories 2025-06-13 13:57:06 -07:00
7352efbcfd Switch to statically linking CocoaHTTPServer 2025-06-13 13:35:42 -07:00
78eb946109 prototype of ping pong websocket (ai generated) 2025-06-13 13:26:15 -07:00
1a5bb874dc rpath manipulation: This may not be necessary anymore 2025-06-13 13:17:31 -07:00
7339b49759 Encoding: need to include associated chat item guids.
Beginning to understand associated chat items (reactions, etc).
2025-05-09 23:39:16 -07:00
95c2e855dd some better logging around websocket connections 2025-05-09 22:25:57 -07:00
James Magahern
d0e1f51b6b adds some clues about how to implement tapbacks 2025-04-07 18:59:53 -07:00
9007b4503f JSON encoding error for super long messages 2024-10-24 22:27:19 -07:00
030e86e205 uploadAttachment: [Security] sanitize incoming filename 2024-10-24 21:28:31 -07:00
James Magahern
b7312bccb9 adds /resolveHandle for resolving handles 2024-10-01 19:52:21 -07:00
58c84f6472 MBIMFetchAttachmentOperation: Add cache headers 2024-03-23 16:49:33 -07:00
413fe338ca Logging: these need to be public oslogs 2024-01-07 18:14:50 -08:00
72527088cc logging: Use os log if running in launchd 2024-01-07 18:12:17 -08:00
c65803845b FetchAttachment: need to check for some edge cases wrt preview generation 2024-01-07 18:11:59 -08:00
James Magahern
147dc15d1d SendOperation: Return whole message, not just GUID. 2024-01-02 18:14:31 -08:00
James Magahern
87d65e294b sendMessage: return guid after sending. This guid is stable 2023-12-05 15:41:07 -08:00
22 changed files with 762 additions and 182 deletions

View File

@@ -1754,10 +1754,13 @@ __attribute__((visibility("default"))) @interface IMService : NSObject { }
@property(nonatomic) BOOL chatInScrutinyMode; // @synthesize chatInScrutinyMode=_chatInScrutinyMode;
@property(readonly, nonatomic) NSArray *messageEditChatItems; // @synthesize messageEditChatItems=_messageEditChatItems;
@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(readonly, copy, nonatomic) NSAttributedString *text; // @synthesize text=_text;
@property (nonatomic, copy, readonly) NSString *threadIdentifier;
@property(nonatomic) struct _NSRange messagePartRange; // @synthesize messagePartRange=_messagePartRange;
- (BOOL)canSendMessageAcknowledgment;
- (void)_setMessageEditChatItems:(id)arg1;
- (id)_initWithItem:(id)arg1 text:(id)arg2 index:(long long)arg3 messagePartRange:(struct _NSRange)arg4 visibleAssociatedMessageChatItems:(id)arg5;
@@ -3689,6 +3692,58 @@ typedef NS_ENUM(NSInteger, IMMessageDescriptionType) {
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>
{
@@ -3745,6 +3800,22 @@ typedef NS_ENUM(NSInteger, IMMessageDescriptionType) {
+ (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)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) BOOL isSOS; // @synthesize isSOS=_isSOS;
@property(retain, nonatomic) NSString *notificationIDSTokenURI; // @synthesize notificationIDSTokenURI=_notificationIDSTokenURI;
@@ -4090,6 +4161,30 @@ typedef NS_ENUM(NSInteger, IMMessageDescriptionType) {
@property(readonly) unsigned long long hash;
@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
@interface IMSimulatedChat : IMChat // <IMSimulatedChatDelegate, IMSimulatedDaemonListener>
@@ -4985,3 +5080,66 @@ typedef NS_ENUM(NSInteger, IMMessageDescriptionType) {
- (struct __CFArray *)copyDDResultArrayByScanningStringForURLs;
@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

View File

@@ -1704,3 +1704,4 @@ extern NSURL* IMAttachmentPreviewFileURL(NSURL *attachmentURL, NSString *extensi
- (id)initWithSerializedError_im:(struct NSDictionary *)arg1;
@end
extern NSString *IMAssociatedMessageDecodeGUID(NSString* guid);

View File

@@ -1,5 +1,6 @@
INSTALL_PATH := /usr/share/kordophone
.PHONY: build/Release/kordophoned
build/Release/kordophoned:
xcodebuild

View File

@@ -14,59 +14,32 @@
1AA43E95219EC38E00EDF1A7 /* MBIMHTTPUtilities.m in Sources */ = {isa = PBXBuildFile; fileRef = 1AA43E94219EC38E00EDF1A7 /* MBIMHTTPUtilities.m */; };
1AAB32B121F82EB7004A2A72 /* MBIMLogging.m in Sources */ = {isa = PBXBuildFile; fileRef = 1AAB32B021F82EB7004A2A72 /* MBIMLogging.m */; };
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 */; };
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 */; };
1ACFCF34219EB2AC00E2C237 /* HTTPFileResponse.m in Sources */ = {isa = PBXBuildFile; fileRef = 1ACFCE0B219EB2AB00E2C237 /* HTTPFileResponse.m */; };
1ACFCF35219EB2AC00E2C237 /* HTTPAsyncFileResponse.m in Sources */ = {isa = PBXBuildFile; fileRef = 1ACFCE0C219EB2AB00E2C237 /* HTTPAsyncFileResponse.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 */; };
1ACFCF3D219EB2AC00E2C237 /* HTTPConnection.m in Sources */ = {isa = PBXBuildFile; fileRef = 1ACFCE14219EB2AB00E2C237 /* HTTPConnection.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 */; };
1ACFCF43219EB2AC00E2C237 /* MultipartFormDataParser.m in Sources */ = {isa = PBXBuildFile; fileRef = 1ACFCE1B219EB2AB00E2C237 /* MultipartFormDataParser.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 */; };
1ACFCF47219EB2AC00E2C237 /* DDNumber.m in Sources */ = {isa = PBXBuildFile; fileRef = 1ACFCE20219EB2AB00E2C237 /* DDNumber.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 */; };
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 */; };
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 */; };
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 */; };
1ACFCFD2219EB2AC00E2C237 /* DispatchQueueLogFormatter.m in Sources */ = {isa = PBXBuildFile; fileRef = 1ACFCF12219EB2AC00E2C237 /* DispatchQueueLogFormatter.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 */; };
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 */; };
1ACFCFDC219EB2AC00E2C237 /* GCDAsyncSocket.h in Headers */ = {isa = PBXBuildFile; fileRef = 1ACFCF1D219EB2AC00E2C237 /* GCDAsyncSocket.h */; settings = {ATTRIBUTES = (Public, ); }; };
1ACFCFDF219EB31400E2C237 /* CocoaHTTPServer.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1ACFCDE2219EB28A00E2C237 /* CocoaHTTPServer.framework */; };
1ACFCFDF219EB31400E2C237 /* libCocoaHTTPServer.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1ACFCDE2219EB28A00E2C237 /* libCocoaHTTPServer.a */; };
1AD8936E21EFD986009B599A /* MBIMUploadAttachmentOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = 1AD8936D21EFD986009B599A /* MBIMUploadAttachmentOperation.m */; };
CD14F18E219E2DB400E7DD22 /* CryptoTests.m in Sources */ = {isa = PBXBuildFile; fileRef = CD14F18D219E2DB400E7DD22 /* CryptoTests.m */; };
CD14F1A1219FE7D600E7DD22 /* MBIMUpdatePollOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = CD14F1A0219FE7D600E7DD22 /* MBIMUpdatePollOperation.m */; };
@@ -89,11 +62,13 @@
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 */; };
CDE455A121A365AD0041F5DD /* MBIMMarkOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = CDE455A021A365AD0041F5DD /* MBIMMarkOperation.m */; };
CDE455A421A5308D0041F5DD /* MBIMFetchAttachmentOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = CDE455A321A5308D0041F5DD /* MBIMFetchAttachmentOperation.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 */; };
CDF62339219A8A5600690038 /* MBIMBridge.h in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C4469219A4BC300F2AC00 /* MBIMBridge.h */; };
CDF6233A219A8A5600690038 /* MBIMBridge.m in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C446A219A4BC300F2AC00 /* MBIMBridge.m */; };
@@ -155,7 +130,7 @@
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>"; };
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>"; };
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>"; };
@@ -259,6 +234,8 @@
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>"; };
@@ -269,6 +246,8 @@
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>"; };
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; };
CDF62334219A895D00690038 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
/* End PBXFileReference section */
@@ -302,7 +281,7 @@
CD2782BC29527FE500C0C030 /* IMSharedUtilities.framework in Frameworks */,
1A257CCB23A8681200A4A2C8 /* Security.framework in Frameworks */,
CD2783002952876700C0C030 /* ImageIO.framework in Frameworks */,
1ACFCFDF219EB31400E2C237 /* CocoaHTTPServer.framework in Frameworks */,
1ACFCFDF219EB31400E2C237 /* libCocoaHTTPServer.a in Frameworks */,
CD2782FE2952875F00C0C030 /* CoreGraphics.framework in Frameworks */,
1A257CC923A867EF00A4A2C8 /* IMCore.framework in Frameworks */,
);
@@ -331,7 +310,7 @@
CDF62332219A895D00690038 /* kordophoned */,
CD83E161219BE91500F4CCEA /* libagentHook.dylib */,
CD14F18B219E2DB400E7DD22 /* Tests.xctest */,
1ACFCDE2219EB28A00E2C237 /* CocoaHTTPServer.framework */,
1ACFCDE2219EB28A00E2C237 /* libCocoaHTTPServer.a */,
);
name = Products;
sourceTree = "<group>";
@@ -373,6 +352,8 @@
CD14F1AC219FFAE100E7DD22 /* MBIMConcurrentHTTPServer.m */,
1ACFCFE2219EB45300E2C237 /* MBIMHTTPConnection.h */,
1ACFCFE3219EB45300E2C237 /* MBIMHTTPConnection.m */,
CDA64B452DFCBF3000E9B07E /* MBIMPingPongWebSocket.h */,
CDA64B462DFCBF3000E9B07E /* MBIMPingPongWebSocket.m */,
);
path = Bridge;
sourceTree = "<group>";
@@ -571,6 +552,8 @@
CDE455A021A365AD0041F5DD /* MBIMMarkOperation.m */,
CD60205A219B623F0024D9C5 /* MBIMMessagesListOperation.h */,
CD60205B219B623F0024D9C5 /* MBIMMessagesListOperation.m */,
CDEFF9FC2CACC7A700063C52 /* MBIMResolveHandleOperation.h */,
CDEFF9FD2CACC7A700063C52 /* MBIMResolveHandleOperation.m */,
CD602060219B68950024D9C5 /* MBIMSendMessageOperation.h */,
CD602061219B68950024D9C5 /* MBIMSendMessageOperation.m */,
CD936A37289B49FC0093A1AC /* MBIMStatusOperation.h */,
@@ -620,40 +603,6 @@
/* End PBXGroup 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 */ = {
isa = PBXHeadersBuildPhase;
buildActionMask = 2147483647;
@@ -670,8 +619,6 @@
buildPhases = (
1ACFCDDD219EB28A00E2C237 /* Sources */,
1ACFCDDE219EB28A00E2C237 /* Frameworks */,
1ACFCDDF219EB28A00E2C237 /* Headers */,
1ACFCDE0219EB28A00E2C237 /* Resources */,
);
buildRules = (
);
@@ -679,8 +626,8 @@
);
name = CocoaHTTPServer;
productName = CocoaHTTPServer;
productReference = 1ACFCDE2219EB28A00E2C237 /* CocoaHTTPServer.framework */;
productType = "com.apple.product-type.framework";
productReference = 1ACFCDE2219EB28A00E2C237 /* libCocoaHTTPServer.a */;
productType = "com.apple.product-type.library.static";
};
CD14F18A219E2DB400E7DD22 /* Tests */ = {
isa = PBXNativeTarget;
@@ -725,7 +672,6 @@
CDF6232E219A895D00690038 /* Sources */,
CDF6232F219A895D00690038 /* Frameworks */,
CDF62330219A895D00690038 /* CopyFiles */,
1AAB32AD21F8245D004A2A72 /* Add current directory to rpath */,
);
buildRules = (
);
@@ -783,13 +729,6 @@
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
1ACFCDE0219EB28A00E2C237 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
CD14F189219E2DB400E7DD22 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
@@ -800,24 +739,6 @@
/* End PBXResourcesBuildPhase section */
/* Begin PBXShellScriptBuildPhase section */
1AAB32AD21F8245D004A2A72 /* Add current directory to rpath */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
);
name = "Add current directory to rpath";
outputFileListPaths = (
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
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";
};
CD936A36289B48930093A1AC /* Compile Version String */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
@@ -891,6 +812,7 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
CDA64B472DFCBF3000E9B07E /* MBIMPingPongWebSocket.m in Sources */,
CD14F1AD219FFAE100E7DD22 /* MBIMConcurrentHTTPServer.m in Sources */,
1AA43E91219EBC2C00EDF1A7 /* MBIMHTTPConnection.m in Sources */,
CDF62339219A8A5600690038 /* MBIMBridge.h in Sources */,
@@ -910,6 +832,7 @@
CD602062219B68950024D9C5 /* MBIMSendMessageOperation.m in Sources */,
CD14F1A1219FE7D600E7DD22 /* MBIMUpdatePollOperation.m in Sources */,
CD936A39289B49FC0093A1AC /* MBIMStatusOperation.m in Sources */,
CDEFF9FE2CACC7A700063C52 /* MBIMResolveHandleOperation.m in Sources */,
CDE455A121A365AD0041F5DD /* MBIMMarkOperation.m in Sources */,
CDE455A721A531ED0041F5DD /* MBIMDataResponse.m in Sources */,
CD936A35289B47D60093A1AC /* MBIMVersionOperation.m in Sources */,
@@ -1064,27 +987,10 @@
isa = XCBuildConfiguration;
buildSettings = {
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_IDENTITY = "";
CODE_SIGN_STYLE = Automatic;
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;
PRODUCT_BUNDLE_IDENTIFIER = com.github.CocoaHTTPServer;
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
SKIP_INSTALL = YES;
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
};
name = Debug;
};
@@ -1092,26 +998,9 @@
isa = XCBuildConfiguration;
buildSettings = {
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_IDENTITY = "";
CODE_SIGN_STYLE = Automatic;
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)";
SKIP_INSTALL = YES;
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
};
name = Release;
};
@@ -1191,6 +1080,7 @@
CODE_SIGN_IDENTITY = "-";
CODE_SIGN_STYLE = Automatic;
GCC_PREFIX_HEADER = kordophone/KPServer.pch;
OTHER_LDFLAGS = "-ObjC";
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = macosx;
SYSTEM_FRAMEWORK_SEARCH_PATHS = (
@@ -1207,6 +1097,7 @@
CODE_SIGN_IDENTITY = "-";
CODE_SIGN_STYLE = Automatic;
GCC_PREFIX_HEADER = kordophone/KPServer.pch;
OTHER_LDFLAGS = "-ObjC";
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = macosx;
SYSTEM_FRAMEWORK_SEARCH_PATHS = (

View File

@@ -14,7 +14,7 @@
#import "MBIMUpdateQueue.h"
#import "hooking.h"
#import <CocoaHTTPServer/HTTPServer.h>
#import "HTTPServer.h"
#import "IMCore_ClassDump.h"
#import "IMFoundation_ClassDump.h"

View File

@@ -6,7 +6,7 @@
// Copyright © 2018 James Magahern. All rights reserved.
//
#import <CocoaHTTPServer/HTTPServer.h>
#import "HTTPServer.h"
NS_ASSUME_NONNULL_BEGIN

View File

@@ -6,7 +6,7 @@
// Copyright © 2018 James Magahern. All rights reserved.
//
#import <CocoaHTTPServer/HTTPConnection.h>
#import "HTTPConnection.h"
@interface MBIMHTTPConnection : HTTPConnection

View File

@@ -16,7 +16,7 @@
#import "MBIMURLUtilities.h"
#import <Security/Security.h>
#import <CocoaHTTPServer/HTTPMessage.h>
#import "HTTPMessage.h"
@interface HTTPConnection (/* INTERNAL */)
- (BOOL)isAuthenticated;
@@ -132,13 +132,17 @@
NSURL *url = [NSURL URLWithString:path];
NSString *endpointName = [url lastPathComponent];
NSString *authTokenString = [url valueForQueryItemWithName:@"token"];
MBIMAuthToken *authToken = [[MBIMAuthToken alloc] initWithTokenString:authTokenString];
MBIMAuthToken *queryAuthToken = [[MBIMAuthToken alloc] initWithTokenString:authTokenString];
NSLog(@"Websocket for URI: %@ | authenticated request: %@", path, [self isAuthenticated] ? @"YES" : @"NO");
if ([endpointName isEqualToString:@"updates"]) {
if (![authToken isValid]) {
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];
}

View 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

View 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

View File

@@ -11,10 +11,11 @@
#import "IMChat+Encoded.h"
#import "MBIMHTTPConnection.h"
#import "MBIMURLUtilities.h"
#import "MBIMPingPongWebSocket.h"
#import <CocoaHTTPServer/GCDAsyncSocket.h>
#import <CocoaHTTPServer/HTTPMessage.h>
#import <CocoaHTTPServer/WebSocket.h>
#import "GCDAsyncSocket.h"
#import "HTTPMessage.h"
#import "WebSocket.h"
static const NSUInteger kUpdateItemsCullingLength = 100;
@@ -105,7 +106,7 @@ static const NSUInteger kUpdateItemsCullingLength = 100;
- (WebSocket *)vendUpdateWebSocketConsumerForRequest:(HTTPMessage *)request socket:(GCDAsyncSocket *)gcdSocket
{
WebSocket *socket = [[WebSocket alloc] initWithRequest:request socket:gcdSocket];
WebSocket *socket = [[MBIMPingPongWebSocket alloc] initWithRequest:request socket:gcdSocket];
socket.delegate = self;
MBIMUpdateConsumer consumer = ^(NSArray<MBIMUpdateItem *> *updates) {

View File

@@ -7,9 +7,9 @@
//
#import <Foundation/Foundation.h>
#import <CocoaHTTPServer/HTTPMessage.h>
#import <CocoaHTTPServer/HTTPResponse.h>
#import <CocoaHTTPServer/HTTPErrorResponse.h>
#import "HTTPMessage.h"
#import "HTTPResponse.h"
#import "HTTPErrorResponse.h"
#import "MBIMJSONDataResponse.h"

View File

@@ -52,19 +52,33 @@
NSURL *localURL = [transfer localURL];
NSString *extension = [[localURL pathExtension] lowercaseString];
if (preview) {
NSURL *previewURL = IMAttachmentPreviewFileURL(localURL, extension, YES);
if (![[NSFileManager defaultManager] fileExistsAtPath:[previewURL path]]) {
MBIMLogInfo(@"Generating preview image for guid: %@ at %@", guid, [previewURL path]);
IMPreviewConstraints constraints = IMPreviewConstraintsZero();
// Fetch preview constraints from transfer
NSDictionary *previewConstraintsDict = [[transfer attributionInfo] objectForKey:@"pgenszc"];
if (!previewConstraintsDict) {
MBIMLogInfo(@"No preview constraints for attachment guid: %@", guid);
response = [[HTTPErrorResponse alloc] initWithErrorCode:500];
break;
if (previewConstraintsDict) {
constraints = IMPreviewConstraintsFromDictionary(previewConstraintsDict);
} else {
// Or, make a guess.
constraints.maxPxWidth = 500.0;
constraints.scale = 1.0;
}
IMPreviewConstraints constraints = IMPreviewConstraintsFromDictionary(previewConstraintsDict);
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;
@@ -110,7 +124,9 @@
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);
self.serverCompletionBlock(response);

View 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

View 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

View File

@@ -9,6 +9,7 @@
#import "MBIMSendMessageOperation.h"
#import "IMCore_ClassDump.h"
#import "IMMessageItem+Encoded.h"
@implementation MBIMSendMessageOperation
@@ -19,9 +20,9 @@
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], ^{
IMChat *chat = [[IMChatRegistry sharedInstance] existingChatWithGUID:chatGUID];
@@ -44,8 +45,9 @@
if (!chat) {
MBIMLogInfo(@"Chat does not exist: %@", chatGUID);
result = NO;
} else {
result = reply;
dispatch_async(dispatch_get_main_queue(), ^{
[chat sendMessage:reply];
});
@@ -55,6 +57,26 @@
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
{
NSObject<HTTPResponse> *response = [[HTTPErrorResponse alloc] initWithErrorCode:500];
@@ -73,14 +95,25 @@
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"];
if (!transferGUIDs) {
transferGUIDs = @[];
}
BOOL result = [self _sendMessage:messageBody toChatWithGUID:guid attachmentGUIDs:transferGUIDs];
IMMessage *result = [self _sendMessage:messageBody toChatWithGUID:guid attachmentGUIDs:transferGUIDs];
if (result) {
response = [[HTTPErrorResponse alloc] initWithErrorCode:200];
response = [MBIMJSONDataResponse responseWithJSONObject:[result mbim_dictionaryRepresentation]];
}
self.serverCompletionBlock(response);

View File

@@ -38,7 +38,14 @@
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];
BOOL success = [attachmentData writeToURL:localURL atomically:NO];
if (!success) {

View File

@@ -7,7 +7,7 @@
//
#import <Foundation/Foundation.h>
#import <CocoaHTTPServer/HTTPDataResponse.h>
#import "HTTPDataResponse.h"
NS_ASSUME_NONNULL_BEGIN

View File

@@ -12,8 +12,10 @@
+ (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) {
NSLog(@"JSON encoding error: %@", error);
return nil;
}

View File

@@ -20,9 +20,17 @@
chatDict[@"date"] = MBIMWebServerFormatISO8601([self lastFinishedMessageDate]);
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];
if (lastMessage) {
chatDict[@"lastMessagePreview"] = [lastMessage descriptionForPurpose:IMMessageDescriptionConversationList];
NSString *lastMessagePreview = [lastMessage descriptionForPurpose:IMMessageDescriptionConversationList];
chatDict[@"lastMessagePreview"] = [lastMessagePreview substringToIndex:MIN(128, [lastMessagePreview length])];
chatDict[@"lastMessage"] = [lastMessage mbim_dictionaryRepresentation];
}

View File

@@ -9,6 +9,40 @@
#import "IMMessageItem+Encoded.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)
- (NSDictionary *)mbim_dictionaryRepresentation
@@ -19,6 +53,15 @@
messageDict[@"sender"] = ([self isFromMe] ? nil : [[self sender] displayID]); // TODO: nil sender is still a weird way to represent this...
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]) {
// Support only images right now
NSMutableDictionary *attachmentMetadatas = [NSMutableDictionary dictionary];

View File

@@ -7,14 +7,49 @@
//
#import "MBIMLogging.h"
#import <os/log.h>
#define ESC(inner) "\033[" inner "m"
#define CLR ESC("0")
#define BLD "1;"
#define RED "31;"
static os_log_t MBIMOSLog(void)
{
static dispatch_once_t onceToken;
static os_log_t customLog = NULL;
dispatch_once(&onceToken, ^{
customLog = os_log_create("net.buzzert.kordophoned", "General");
});
return customLog;
}
extern void __MBIMLogCommon(MBIMLogLevel level, NSString *format, ...)
{
va_list args;
va_start(args, format);
NSString *message = [[NSString alloc] initWithFormat:format arguments:args];
va_end(args);
if (getenv("NSRunningFromLaunchd") != NULL) {
// Running with launchd, use oslog.
os_log_t mbimlog = MBIMOSLog();
switch (level) {
case ML_INFO:
os_log_debug(mbimlog, "%{public}@", message);
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, ^{
@@ -22,11 +57,6 @@ extern void __MBIMLogCommon(MBIMLogLevel level, NSString *format, ...)
dateFormatter.dateFormat = @"Y-MM-d HH:mm:ss";
});
va_list args;
va_start(args, format);
NSString *message = [[NSString alloc] initWithFormat:format arguments:args];
va_end(args);
const char *c_fmt = "%s";
if (level == ML_NOTIFY) {
// BOLD
@@ -42,3 +72,4 @@ extern void __MBIMLogCommon(MBIMLogLevel level, NSString *format, ...)
fprintf(stdout, c_fmt, [message UTF8String]);
fprintf(stdout, CLR "\n");
}
}