diff --git a/FaceTime/MacOS-11+/BlueBubblesFaceTimeHelper.xcodeproj/project.xcworkspace/xcuserdata/tanay.xcuserdatad/UserInterfaceState.xcuserstate b/FaceTime/MacOS-11+/BlueBubblesFaceTimeHelper.xcodeproj/project.xcworkspace/xcuserdata/tanay.xcuserdatad/UserInterfaceState.xcuserstate index 5a5806b..986bd04 100644 Binary files a/FaceTime/MacOS-11+/BlueBubblesFaceTimeHelper.xcodeproj/project.xcworkspace/xcuserdata/tanay.xcuserdatad/UserInterfaceState.xcuserstate and b/FaceTime/MacOS-11+/BlueBubblesFaceTimeHelper.xcodeproj/project.xcworkspace/xcuserdata/tanay.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/Messages/MacOS-11+/BlueBubblesHelper.xcodeproj/project.pbxproj b/Messages/MacOS-11+/BlueBubblesHelper.xcodeproj/project.pbxproj index 1c0a842..a0ecea6 100644 --- a/Messages/MacOS-11+/BlueBubblesHelper.xcodeproj/project.pbxproj +++ b/Messages/MacOS-11+/BlueBubblesHelper.xcodeproj/project.pbxproj @@ -27,6 +27,8 @@ A6490A1F298DCC35002B0E1D /* VettedAliasDictionary.h in Headers */ = {isa = PBXBuildFile; fileRef = A6490A1E298DCC35002B0E1D /* VettedAliasDictionary.h */; }; A65C21A72A9AAB1500D6FB7F /* BlueBubblesHelper.dylib in CopyFiles */ = {isa = PBXBuildFile; fileRef = A62991CB29720FAC00B7E663 /* BlueBubblesHelper.dylib */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; A68E87E228C3B18900882823 /* IMSharedUtilities.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A68E87E128C3B18900882823 /* IMSharedUtilities.framework */; }; + A69960EA2B1F9A700081FB69 /* FMF.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A69960E92B1F9A6F0081FB69 /* FMF.framework */; }; + A69960F52B20D89C0081FB69 /* CTBlockDescription.m in Sources */ = {isa = PBXBuildFile; fileRef = A69960F42B20D8860081FB69 /* CTBlockDescription.m */; }; A69A83E027D18385007BB936 /* IMDPersistence.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A69A83DF27D18385007BB936 /* IMDPersistence.framework */; }; F8EA7496D989633D9E36BF1B /* libPods-BlueBubblesHelper DyLib.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 2A31F700CE646BC3B6A3921F /* libPods-BlueBubblesHelper DyLib.a */; }; FBCE4EBF201C0F4D002F8A61 /* AppKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FBCE4EBE201C0F4D002F8A61 /* AppKit.framework */; }; @@ -115,9 +117,17 @@ A68E87DF28C3B01F00882823 /* IMFileTransfer.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = IMFileTransfer.h; sourceTree = ""; }; A68E87E028C3B04500882823 /* IMFileTransferCenter.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = IMFileTransferCenter.h; sourceTree = ""; }; A68E87E128C3B18900882823 /* IMSharedUtilities.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IMSharedUtilities.framework; path = /System/Library/PrivateFrameworks/IMSharedUtilities.framework; sourceTree = ""; }; + A69960E92B1F9A6F0081FB69 /* FMF.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = FMF.framework; path = ../../../../../../System/Library/PrivateFrameworks/FMF.framework; sourceTree = ""; }; + A69960ED2B2004540081FB69 /* FindMyLocateObjCWrapper.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = FindMyLocateObjCWrapper.framework; path = ../../../../Downloads/FindMyLocateObjCWrapper.framework; sourceTree = ""; }; + A69960F12B2005100081FB69 /* FMLSession.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FMLSession.h; sourceTree = ""; }; + A69960F22B20D7B40081FB69 /* CTBlockDescription.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CTBlockDescription.h; sourceTree = ""; }; + A69960F42B20D8860081FB69 /* CTBlockDescription.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CTBlockDescription.m; sourceTree = ""; }; + A69960F62B20E46B0081FB69 /* FMLLocation.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FMLLocation.h; sourceTree = ""; }; + A69960F72B20E4AD0081FB69 /* FMLHandle.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FMLHandle.h; sourceTree = ""; }; A69A83DE27D18092007BB936 /* IMDPersistentAttachmentController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = IMDPersistentAttachmentController.h; sourceTree = ""; }; A69A83DF27D18385007BB936 /* IMDPersistence.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IMDPersistence.framework; path = /System/Library/PrivateFrameworks/IMDPersistence.framework; sourceTree = ""; }; A6DAE8E729CCD09F00C23C79 /* SKStatusSubscriptionServiceDelegate-Protocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "SKStatusSubscriptionServiceDelegate-Protocol.h"; sourceTree = ""; }; + A6E13E352B65C8F9002983AD /* FMFSessionDataManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FMFSessionDataManager.h; sourceTree = ""; }; A6E1F4CF27166012000A0EF6 /* IMPinnedConversationsController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = IMPinnedConversationsController.h; sourceTree = ""; }; A6E7318229A3D37000AAED78 /* IMAggregateAttachmentMessagePartChatItem.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = IMAggregateAttachmentMessagePartChatItem.h; sourceTree = ""; }; A6E7318329A3D49600AAED78 /* IMAttachmentMessagePartChatItem.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = IMAttachmentMessagePartChatItem.h; sourceTree = ""; }; @@ -146,6 +156,7 @@ files = ( A62991DA297210F700B7E663 /* IMDPersistence.framework in Frameworks */, A61DC02F2A5A078500EA75A5 /* IDS.framework in Frameworks */, + A69960EA2B1F9A700081FB69 /* FMF.framework in Frameworks */, A62991D9297210EB00B7E663 /* IMSharedUtilities.framework in Frameworks */, A62991D8297210D900B7E663 /* IMCore.framework in Frameworks */, A62991D7297210A500B7E663 /* Foundation.framework in Frameworks */, @@ -213,6 +224,8 @@ FBCE4EBD201C0F4D002F8A61 /* Frameworks */ = { isa = PBXGroup; children = ( + A69960ED2B2004540081FB69 /* FindMyLocateObjCWrapper.framework */, + A69960E92B1F9A6F0081FB69 /* FMF.framework */, A61DC0272A59FFF200EA75A5 /* IDS.framework */, A6490A18298AC986002B0E1D /* SocialAppsCore.framework */, A62991D6297210A500B7E663 /* Foundation.framework */, @@ -257,6 +270,8 @@ children = ( FBCE4ECA201C0F4D002F8A61 /* ZKSwizzle.h */, FBCE4ECB201C0F4D002F8A61 /* ZKSwizzle.m */, + A69960F22B20D7B40081FB69 /* CTBlockDescription.h */, + A69960F42B20D8860081FB69 /* CTBlockDescription.m */, ); name = ZKSwizzle; sourceTree = ""; @@ -325,6 +340,10 @@ A65C21B62AA96BAF00D6FB7F /* FMFXPCInternalClientProtocol-Protocol.h */, A65C21B72AAA7F5500D6FB7F /* FMFLocation.h */, A65C21B82AAA7FCF00D6FB7F /* FMFHandle.h */, + A69960F12B2005100081FB69 /* FMLSession.h */, + A69960F62B20E46B0081FB69 /* FMLLocation.h */, + A69960F72B20E4AD0081FB69 /* FMLHandle.h */, + A6E13E352B65C8F9002983AD /* FMFSessionDataManager.h */, ); name = IMCore; sourceTree = ""; @@ -353,7 +372,7 @@ A62991C929720FAC00B7E663 /* Frameworks */, A6490A0D29846973002B0E1D /* Resources */, A65C21A62A9AAAE600D6FB7F /* CopyFiles */, - A6490A0F29846A3A002B0E1D /* ShellScript */, + A6490A0F29846A3A002B0E1D /* Run Script */, ); buildRules = ( ); @@ -486,7 +505,7 @@ shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; showEnvVarsInLog = 0; }; - A6490A0F29846A3A002B0E1D /* ShellScript */ = { + A6490A0F29846A3A002B0E1D /* Run Script */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( @@ -495,6 +514,7 @@ ); inputPaths = ( ); + name = "Run Script"; outputFileListPaths = ( ); outputPaths = ( @@ -528,6 +548,7 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + A69960F52B20D89C0081FB69 /* CTBlockDescription.m in Sources */, A62991D52972107400B7E663 /* ZKSwizzle.m in Sources */, A62991D22972106500B7E663 /* NetworkController.m in Sources */, A6490A1D298DC81C002B0E1D /* VettedAliasDictionary.m in Sources */, @@ -560,7 +581,7 @@ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = "$(inherited)"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 20; + CURRENT_PROJECT_VERSION = 21; DEFINES_MODULE = YES; DSTROOT = /; DYLIB_COMPATIBILITY_VERSION = 1; @@ -570,7 +591,7 @@ INSTALL_PATH = /Users/tanay/Desktop/test; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; MACOSX_DEPLOYMENT_TARGET = 11.0; - MARKETING_VERSION = 0.0.18; + MARKETING_VERSION = 0.0.19; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; ONLY_ACTIVE_ARCH = YES; @@ -595,7 +616,7 @@ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = "$(inherited)"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 20; + CURRENT_PROJECT_VERSION = 21; DEFINES_MODULE = YES; DSTROOT = /; DYLIB_COMPATIBILITY_VERSION = 1; @@ -605,7 +626,7 @@ INSTALL_PATH = /Users/tanay/Desktop/test; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; MACOSX_DEPLOYMENT_TARGET = 11.0; - MARKETING_VERSION = 0.0.18; + MARKETING_VERSION = 0.0.19; MTL_FAST_MATH = YES; PRODUCT_NAME = BlueBubblesHelper; SDKROOT = macosx; diff --git a/Messages/MacOS-11+/BlueBubblesHelper.xcworkspace/xcuserdata/tanay.xcuserdatad/UserInterfaceState.xcuserstate b/Messages/MacOS-11+/BlueBubblesHelper.xcworkspace/xcuserdata/tanay.xcuserdatad/UserInterfaceState.xcuserstate index 7044893..e61e498 100644 Binary files a/Messages/MacOS-11+/BlueBubblesHelper.xcworkspace/xcuserdata/tanay.xcuserdatad/UserInterfaceState.xcuserstate and b/Messages/MacOS-11+/BlueBubblesHelper.xcworkspace/xcuserdata/tanay.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/Messages/MacOS-11+/BlueBubblesHelper/BlueBubblesHelper.m b/Messages/MacOS-11+/BlueBubblesHelper/BlueBubblesHelper.m index 1d39974..691df26 100644 --- a/Messages/MacOS-11+/BlueBubblesHelper/BlueBubblesHelper.m +++ b/Messages/MacOS-11+/BlueBubblesHelper/BlueBubblesHelper.m @@ -46,6 +46,11 @@ #import "IMFMFSession.h" #import "FMFSession.h" #import "FMFLocation.h" +#import "FMLSession.h" +#import "CTBlockDescription.h" +#import "FMLHandle.h" +#import "FMLLocation.h" +#import "FMFSessionDataManager.h" @interface BlueBubblesHelper : NSObject + (instancetype)sharedInstance; @@ -106,8 +111,12 @@ + (void)load { DLog("BLUEBUBBLESHELPER: %{public}@ loaded into %{public}@ on macOS %ld.%ld", [self className], [[NSBundle mainBundle] bundleIdentifier], (long)major, (long)minor); if ([[[NSBundle mainBundle] bundleIdentifier] isEqualToString:@"com.apple.MobileSMS"]) { - DLog("BLUEBUBBLESHELPER: Initializing Connection..."); - [plugin initializeNetworkController]; + // Delay by 5 seconds so the server has a chance to initialize all the socket services + dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, (int64_t)(5 * NSEC_PER_SEC)); + dispatch_after(popTime, dispatch_get_main_queue(), ^(void){ + DLog("BLUEBUBBLESHELPER: Initializing Connection..."); + [plugin initializeNetworkController]; + }); } else { DLog("BLUEBUBBLESHELPER: Injected into non-iMessage process %@, aborting.", [[NSBundle mainBundle] bundleIdentifier]); return; @@ -125,8 +134,6 @@ -(void) initializeNetworkController { controller.messageReceivedBlock = ^(NetworkController *controller, NSString *data) { [self handleMessage:controller message: data]; }; - NSDictionary *message = @{@"event": @"ping", @"message": @"Helper Connected!"}; - [controller sendMessage:message]; // DEVELOPMENT ONLY, COMMENT OUT FOR RELEASE // dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, (int64_t)(5 * NSEC_PER_SEC)); @@ -136,6 +143,25 @@ -(void) initializeNetworkController { // }); } +-(void) DumpObjcMethods:(Class) clz { + + unsigned int methodCount = 0; + Method *methods = class_copyMethodList(clz, &methodCount); + + DLog("BLUEBUBBLESHELPER: Found %d methods on '%s'\n", methodCount, class_getName(clz)); + + for (unsigned int i = 0; i < methodCount; i++) { + Method method = methods[i]; + + DLog("\tBLUEBUBBLESHELPER: '%s' has method named '%s' of encoding '%s'\n", + class_getName(clz), + sel_getName(method_getName(method)), + method_getTypeEncoding(method)); + } + + free(methods); +} + // Run when receiving a new message from the tcp socket -(void) handleMessage: (NetworkController*)controller message:(NSString *)message { // The data is in the form of a json string, so we need to convert it to a NSDictionary @@ -692,6 +718,7 @@ -(void) handleMessage: (NetworkController*)controller message:(NSString *)messa @"vetted_aliases": [BlueBubblesHelper getAliases:true], @"aliases": [BlueBubblesHelper getAliases:false], @"login_status_message": [account loginStatusMessage] ?: [NSNull null], + @"active_alias": [account displayName] ?: [NSNull null] }; [[NetworkController sharedInstance] sendMessage: data]; } @@ -714,30 +741,74 @@ -(void) handleMessage: (NetworkController*)controller message:(NSString *)messa } } // If the server tells us to get findmy friends locations - } else if ([event isEqualToString:@"findmy-friends"]) { - FMFSession *session = [[IMFMFSession sharedInstance] session]; - NSArray* handles = [session getHandlesSharingLocationsWithMe]; - NSMutableArray* locations = [[NSMutableArray alloc] initWithArray:@[]]; - - for (NSObject* handle in handles) { - FMFLocation* location = [[IMFMFSession sharedInstance] locationForFMFHandle:handle]; - NSDictionary* locDetails = @{ - @"handle": [[location handle] identifier] ?: [NSNull null], - @"coordinates": @[@([location coordinate].latitude), @([location coordinate].longitude)], - @"long_address": [location longAddress] ?: [NSNull null], - @"short_address": [location shortAddress] ?: [NSNull null], - @"subtitle": [location subtitle] ?: [NSNull null], - @"title": [location title] ?: [NSNull null], - }; - [locations addObject:locDetails]; - } - - if (transaction != nil) { - NSDictionary *data = @{ - @"transactionId": transaction, - @"locations": locations, - }; - [[NetworkController sharedInstance] sendMessage: data]; + } else if ([event isEqualToString:@"refresh-findmy-friends"]) { + if ([[NSProcessInfo processInfo] operatingSystemVersion].majorVersion > 13) { + FindMyLocateSession *session = [[IMFMFSession sharedInstance] fmlSession]; + DLog("BLUEBUBBLESHELPER: block 1: %@", [session locationUpdateCallback]); +// [self logString:[[[[CTBlockDescription alloc] initWithBlock:[session locationUpdateCallback]] blockSignature] debugDescription]]; +// NSObject *block = ^(FMLLocation *test, FMLHandle *test2) { +// DLog("BLUEBUBBLESHELPER: test2: %@", test); +// DLog("BLUEBUBBLESHELPER: test2: %@", [test className]); +// }; +// DLog("BLUEBUBBLESHELPER: setting block: %@", block); +// DLog("BLUEBUBBLESHELPER: setting block: %@", [[[[CTBlockDescription alloc] initWithBlock:block] blockSignature] debugDescription]); +// [session setLocationUpdateCallback:block]; +// DLog("BLUEBUBBLESHELPER: block 2: %@", [session locationUpdateCallback]); +// DLog("BLUEBUBBLESHELPER: block 2: %@", [[[[CTBlockDescription alloc] initWithBlock:[session locationUpdateCallback]] blockSignature] debugDescription]); + [session getFriendsSharingLocationsWithMeWithCompletion:^(NSArray *friends) { + for (NSObject* friend in friends) { + NSObject* handle = [friend performSelector:(NSSelectorFromString(@"handle"))]; + DLog("BLUEBUBBLESHELPER: test: %@", handle); + [session startRefreshingLocationForHandles:@[handle] priority:(1000) isFromGroup:FALSE reverseGeocode:TRUE completion:^() { + NSObject *test = [session cachedLocationForHandle:handle includeAddress:TRUE]; + DLog("BLUEBUBBLESHELPER: test: %@", test); + DLog("BLUEBUBBLESHELPER: test: %@", [test className]); + }]; + } + }]; + + if (transaction != nil) { + NSDictionary *data = @{ + @"transactionId": transaction, + @"locations": @[], + }; + [[NetworkController sharedInstance] sendMessage: data]; + } + } else { + FMFSession *session = [[IMFMFSession sharedInstance] session]; + NSArray* handles = [session getHandlesSharingLocationsWithMe]; + DLog("BLUEBUBBLESHELPER: Found FMF Handles: %{public}@", handles); + + // Send the current cached locations to the server just in case + NSMutableArray* locations = [[NSMutableArray alloc] initWithArray:@[]]; + for (NSObject* handle in handles) { + FMFLocation* location = [[IMFMFSession sharedInstance] locationForFMFHandle:handle]; + NSInteger* type = ([[NSProcessInfo processInfo] operatingSystemVersion].majorVersion < 13) ? 0 : [location locationType]; + NSDictionary* locDetails = @{ + @"handle": [[location handle] identifier] ?: [NSNull null], + @"coordinates": @[@([location coordinate].latitude), @([location coordinate].longitude)], + @"long_address": [location longAddress] ?: [NSNull null], + @"short_address": [location shortAddress] ?: [NSNull null], + @"subtitle": [location subtitle] ?: [NSNull null], + @"title": [location title] ?: [NSNull null], + @"last_updated": [NSNumber numberWithDouble:round([[location timestamp] timeIntervalSince1970])*1000], + @"is_locating_in_progress": [NSNumber numberWithBool:[location isLocatingInProgress]] ?: [NSNull null], + @"status": (type == 0) ? @"legacy" : (type == 2) ? @"live" : @"shallow" + }; + [locations addObject:locDetails]; + } + + if (transaction != nil) { + NSDictionary *data = @{ + @"transactionId": transaction, + @"locations": locations, + }; + [[NetworkController sharedInstance] sendMessage: data]; + } + + [session removeHandles:[session handles]]; + [session addHandles:handles]; + [session forceRefresh]; } // If the event is something that hasn't been implemented, we simply ignore it and put this log } else { @@ -1077,20 +1148,65 @@ - (BOOL)_handleIncomingItem:(id)arg1 { @end -//ZKSwizzleInterface(BBH_NSNotificationCenter, NSNotificationCenter, NSObject) -//@implementation BBH_NSNotificationCenter -// -//- (void)addObserver:(id)observer selector:(SEL)aSelector name:(nullable NSNotificationName)aName object:(nullable id)anObject { -// if ([aName localizedCaseInsensitiveContainsString:@"facetime"]) { -// DLog("BLUEBUBBLESHELPER: observer %{public}@", observer); -// DLog("BLUEBUBBLESHELPER: sel %{public}@", NSStringFromSelector(aSelector)); -// DLog("BLUEBUBBLESHELPER: name %{public}@", aName); -// DLog("BLUEBUBBLESHELPER: object %{public}@", anObject); -// } -// return ZKOrig(void, observer, aSelector, aName, anObject); -//} -// -//@end +ZKSwizzleInterface(BBH_FindMyLocateSession, FindMyLocateSession, NSObject) +@implementation BBH_FindMyLocateSession + +- (id /* block */)locationUpdateCallback { + DLog("BLUEBUBBLESHELPER: fired"); + return ZKOrig(id); +} + +@end + +// Handle FindMy data changes +ZKSwizzleInterface(BBH_FMFSessionDataManager, FMFSessionDataManager , NSObject) +@implementation BBH_FMFSessionDataManager + +- (void)setLocations:(id)arg1 { + Class class = NSClassFromString(@"FMFSessionDataManager"); + NSSet* locations = [[class sharedInstance] locations]; + DLog("BLUEBUBBLESHELPER: Got new locations: %{public}@", locations); + + for (FMFLocation* location in locations) { + NSInteger* type = ([[NSProcessInfo processInfo] operatingSystemVersion].majorVersion < 13) ? 0 : [location locationType]; + NSMutableDictionary* locDetails = [[NSMutableDictionary alloc] initWithDictionary: @{ + @"handle": [[location handle] identifier] ?: [NSNull null], + @"coordinates": @[@([location coordinate].latitude), @([location coordinate].longitude)], + @"long_address": [location longAddress] ?: [NSNull null], + @"short_address": [location shortAddress] ?: [NSNull null], + @"subtitle": [location subtitle] ?: [NSNull null], + @"title": [location title] ?: [NSNull null], + @"last_updated": [NSNumber numberWithDouble:round([[location timestamp] timeIntervalSince1970])*1000], + @"is_locating_in_progress": [NSNumber numberWithBool:[location isLocatingInProgress]] ?: [NSNull null], + @"status": (type == 0) ? @"legacy" : (type == 2) ? @"live" : @"shallow" + }]; + + if ([location coordinate].latitude == 0 && [location coordinate].longitude == 0 && [location longAddress] != nil) { + DLog("BLUEBUBBLESHELPER: Geocoding location for %{public}@", [[location handle] identifier]); + [[[CLGeocoder alloc] init] geocodeAddressString:[location longAddress] completionHandler:^(NSArray* placemarks, NSError* error) { + if (placemarks.count > 0) { + CLLocation* coords = [[placemarks firstObject] location]; + [locDetails setValue:@[@([coords coordinate].latitude), @([coords coordinate].longitude)] forKey:@"coordinates"]; + } + + NSDictionary *data = @{ + @"event": @"new-findmy-location", + @"data": @[locDetails], + }; + [[NetworkController sharedInstance] sendMessage: data]; + }]; + } else { + NSDictionary *data = @{ + @"event": @"new-findmy-location", + @"data": @[locDetails], + }; + [[NetworkController sharedInstance] sendMessage: data]; + } + } + return ZKOrig(void, arg1); +} + +@end ZKSwizzleInterface(BBH_IMAccount, IMAccount, NSObject) @implementation BBH_IMAccount @@ -1099,7 +1215,7 @@ - (void)_registrationStatusChanged:(id)arg1 { NSNotification *notif = arg1; IMAccount* acct = [notif object]; NSDictionary *info = [notif userInfo]; - if ([[acct serviceName] isEqualToString:@"iMessage"] && [info objectForKey:@"__kIMAccountAliasesRemovedKey"]) { + if ([info objectForKey:@"__kIMAccountAliasesRemovedKey"] != nil && [[acct serviceName] isEqualToString:@"iMessage"]) { DLog("BLUEBUBBLESHELPER: alias updated %{public}@", notif); [[NetworkController sharedInstance] sendMessage: @{@"event": @"aliases-removed", @"data": info}]; } @@ -1108,11 +1224,20 @@ - (void)_registrationStatusChanged:(id)arg1 { @end -//ZKSwizzleInterface(WBWT_IMChat, IMChat, NSObject) -//@implementation WBWT_IMChat -//-(void)_setDisplayName:(id)arg1 { -// DLog("BLUEBUBBLESHELPER: %{public}@", [arg1 className]); +//ZKSwizzleInterface(BBH_NSNotificationCenter, NSNotificationCenter, NSObject) +//@implementation BBH_NSNotificationCenter +// +//- (void)addObserver:(id)observer selector:(SEL)aSelector name:(nullable NSNotificationName)aName object:(nullable id)anObject { +// if ([aName isEqualToString:@"CNContactStoreDidChangeNotification"]) { +// return ZKOrig(void, observer, aSelector, aName, anObject); +// } +// DLog("BLUEBUBBLESFACETIMEHELPER: >>>>>>>>>>>>> name %{public}@", aName); +// DLog("BLUEBUBBLESFACETIMEHELPER: observer %{public}@", observer); +// DLog("BLUEBUBBLESFACETIMEHELPER: sel %{public}@", NSStringFromSelector(aSelector)); +// DLog("BLUEBUBBLESFACETIMEHELPER: object %{public}@", anObject); +// return ZKOrig(void, observer, aSelector, aName, anObject); //} +// //@end // //-(void)sendMessageAcknowledgment:(long long)arg1 forChatItem:(id)arg2 withAssociatedMessageInfo:(id)arg3 withGuid:(id)arg4 { diff --git a/Messages/MacOS-11+/BlueBubblesHelper/CTBlockDescription.h b/Messages/MacOS-11+/BlueBubblesHelper/CTBlockDescription.h new file mode 100644 index 0000000..daf9496 --- /dev/null +++ b/Messages/MacOS-11+/BlueBubblesHelper/CTBlockDescription.h @@ -0,0 +1,50 @@ +// +// CTBlockDescription.h +// CTBlockDescription +// +// Created by Oliver Letterer on 01.09.12. +// Copyright (c) 2012 olettere. All rights reserved. +// + +#import + +struct CTBlockLiteral { + void *isa; // initialized to &_NSConcreteStackBlock or &_NSConcreteGlobalBlock + int flags; + int reserved; + void (*invoke)(void *, ...); + struct block_descriptor { + unsigned long int reserved; // NULL + unsigned long int size; // sizeof(struct Block_literal_1) + // optional helper functions + void (*copy_helper)(void *dst, void *src); // IFF (1<<25) + void (*dispose_helper)(void *src); // IFF (1<<25) + // required ABI.2010.3.16 + const char *signature; // IFF (1<<30) + } *descriptor; + // imported variables +}; + +enum { + CTBlockDescriptionFlagsHasCopyDispose = (1 << 25), + CTBlockDescriptionFlagsHasCtor = (1 << 26), // helpers have C++ code + CTBlockDescriptionFlagsIsGlobal = (1 << 28), + CTBlockDescriptionFlagsHasStret = (1 << 29), // IFF BLOCK_HAS_SIGNATURE + CTBlockDescriptionFlagsHasSignature = (1 << 30) +}; +typedef int CTBlockDescriptionFlags; + + + +@interface CTBlockDescription : NSObject + +@property (nonatomic, readonly) CTBlockDescriptionFlags flags; +@property (nonatomic, readonly) NSMethodSignature *blockSignature; +@property (nonatomic, readonly) unsigned long int size; +@property (nonatomic, readonly) id block; + +- (id)initWithBlock:(id)block; + +- (BOOL)isCompatibleForBlockSwizzlingWithMethodSignature:(NSMethodSignature *)methodSignature; + +@end diff --git a/Messages/MacOS-11+/BlueBubblesHelper/CTBlockDescription.m b/Messages/MacOS-11+/BlueBubblesHelper/CTBlockDescription.m new file mode 100644 index 0000000..960c4d9 --- /dev/null +++ b/Messages/MacOS-11+/BlueBubblesHelper/CTBlockDescription.m @@ -0,0 +1,75 @@ +// +// CTBlockDescription.m +// CTBlockDescription +// +// Created by Oliver Letterer on 01.09.12. +// Copyright (c) 2012 olettere. All rights reserved. +// + +#import +#import "CTBlockDescription.h" + +@implementation CTBlockDescription + +- (id)initWithBlock:(id)block +{ + if (self = [super init]) { + _block = block; + + struct CTBlockLiteral *blockRef = (__bridge struct CTBlockLiteral *)block; + _flags = blockRef->flags; + _size = blockRef->descriptor->size; + + if (_flags & CTBlockDescriptionFlagsHasSignature) { + void *signatureLocation = blockRef->descriptor; + signatureLocation += sizeof(unsigned long int); + signatureLocation += sizeof(unsigned long int); + + if (_flags & CTBlockDescriptionFlagsHasCopyDispose) { + signatureLocation += sizeof(void(*)(void *dst, void *src)); + signatureLocation += sizeof(void (*)(void *src)); + } + + const char *signature = (*(const char **)signatureLocation); + _blockSignature = [NSMethodSignature signatureWithObjCTypes:signature]; + } + } + return self; +} + +- (BOOL)isCompatibleForBlockSwizzlingWithMethodSignature:(NSMethodSignature *)methodSignature +{ + if (_blockSignature.numberOfArguments != methodSignature.numberOfArguments + 1) { + return NO; + } + + if (strcmp(_blockSignature.methodReturnType, methodSignature.methodReturnType) != 0) { + return NO; + } + + for (int i = 0; i < methodSignature.numberOfArguments; i++) { + if (i == 1) { + // SEL in method, IMP in block + if (strcmp([methodSignature getArgumentTypeAtIndex:i], ":") != 0) { + return NO; + } + + if (strcmp([_blockSignature getArgumentTypeAtIndex:i + 1], "^?") != 0) { + return NO; + } + } else { + if (strcmp([methodSignature getArgumentTypeAtIndex:i], [_blockSignature getArgumentTypeAtIndex:i + 1]) != 0) { + return NO; + } + } + } + + return YES; +} + +- (NSString *)description +{ + return [NSString stringWithFormat:@"%@: %@", [super description], _blockSignature.description]; +} + +@end diff --git a/Messages/MacOS-11+/BlueBubblesHelper/FMFSessionDataManager.h b/Messages/MacOS-11+/BlueBubblesHelper/FMFSessionDataManager.h new file mode 100644 index 0000000..16a0088 --- /dev/null +++ b/Messages/MacOS-11+/BlueBubblesHelper/FMFSessionDataManager.h @@ -0,0 +1,36 @@ +// Headers generated with ktool v1.4.0 +// https://github.com/cxnder/ktool | pip3 install k2l +// Platform: IOS | Minimum OS: 16.0.0 | SDK: 16.0.0 + + +#ifndef FMFSESSIONDATAMANAGER_H +#define FMFSESSIONDATAMANAGER_H + +@class NSSet, NSMutableDictionary; + +#import + + +@interface FMFSessionDataManager : NSObject + +@property (retain, nonatomic) NSSet *fences; // ivar: _fences +@property (retain, nonatomic) NSSet *followers; // ivar: _followers +@property (retain, nonatomic) NSSet *following; // ivar: _following +@property (retain, nonatomic) NSSet *locations; // ivar: _locations +@property (retain, nonatomic) NSMutableDictionary *locationsCache; // ivar: _locationsCache + + ++(id)sharedInstance; +-(id)favoritesOrdered; +-(id)followerForHandle:(id)arg0 ; +-(id)followingForHandle:(id)arg0 ; +-(id)locationForHandle:(id)arg0 ; +-(id)offerExpirationForHandle:(id)arg0 groupId:(id)arg1 ; +-(void)abDidChange; +-(void)abPreferencesDidChange; + + +@end + + +#endif diff --git a/Messages/MacOS-11+/BlueBubblesHelper/FMLHandle.h b/Messages/MacOS-11+/BlueBubblesHelper/FMLHandle.h new file mode 100644 index 0000000..541ecbc --- /dev/null +++ b/Messages/MacOS-11+/BlueBubblesHelper/FMLHandle.h @@ -0,0 +1,18 @@ + +@interface FMLHandle : NSObject { + NSString * _identifier; +} + +@property (nonatomic, copy) NSString *identifier; + ++ (id)handleWithIdentifier:(id)arg1; + +- (id)comparisonIdentifier; +- (id)debugDescription; +- (id)description; +- (unsigned long long)hash; +- (id)identifier; +- (bool)isEqual:(id)arg1; +- (void)setIdentifier:(id)arg1; + +@end diff --git a/Messages/MacOS-11+/BlueBubblesHelper/FMLLocation.h b/Messages/MacOS-11+/BlueBubblesHelper/FMLLocation.h new file mode 100644 index 0000000..410c88e --- /dev/null +++ b/Messages/MacOS-11+/BlueBubblesHelper/FMLLocation.h @@ -0,0 +1,62 @@ + +@interface FMLLocation : NSObject { + NSObject * _address; + double _altitude; + NSString * _coarseAddressLabel; + int _floorLevel; + double _horizontalAccuracy; + NSArray * _labels; + double _latitude; + long long _locationType; + double _longitude; + double _speed; + double _timestamp; + long long _type; + double _verticalAccuracy; +} + +@property (nonatomic, retain) NSObject *address; +@property (nonatomic) double altitude; +@property (nonatomic, copy) NSString *coarseAddressLabel; +@property (nonatomic) int floorLevel; +@property (nonatomic) double horizontalAccuracy; +@property (nonatomic, copy) NSArray *labels; +@property (nonatomic) double latitude; +@property (nonatomic) long long locationType; +@property (nonatomic) double longitude; +@property (nonatomic) double speed; +@property (nonatomic) double timestamp; +@property (nonatomic, readonly) long long type; +@property (nonatomic) double verticalAccuracy; + +- (id)address; +- (double)altitude; +- (id)coarseAddressLabel; +- (id)debugDescription; +- (id)description; +- (int)floorLevel; +- (double)horizontalAccuracy; +- (id)initWithAddress:(id)arg1 altitude:(double)arg2 longitude:(double)arg3 speed:(double)arg4 floorLevel:(int)arg5 horizontalAccuracy:(double)arg6 labels:(id)arg7 latitude:(double)arg8 timestamp:(double)arg9 verticalAccuracy:(double)arg10 locationType:(long long)arg11 coarseAddressLabel:(id)arg12; +- (id)labels; +- (double)latitude; +- (long long)locationType; +- (id)locationTypeDescription; +- (double)longitude; +- (void)setAddress:(id)arg1; +- (void)setAltitude:(double)arg1; +- (void)setCoarseAddressLabel:(id)arg1; +- (void)setFloorLevel:(int)arg1; +- (void)setHorizontalAccuracy:(double)arg1; +- (void)setLabels:(id)arg1; +- (void)setLatitude:(double)arg1; +- (void)setLocationType:(long long)arg1; +- (void)setLongitude:(double)arg1; +- (void)setSpeed:(double)arg1; +- (void)setTimestamp:(double)arg1; +- (void)setVerticalAccuracy:(double)arg1; +- (double)speed; +- (double)timestamp; +- (long long)type; +- (double)verticalAccuracy; + +@end diff --git a/Messages/MacOS-11+/BlueBubblesHelper/FMLSession.h b/Messages/MacOS-11+/BlueBubblesHelper/FMLSession.h new file mode 100644 index 0000000..591dd21 --- /dev/null +++ b/Messages/MacOS-11+/BlueBubblesHelper/FMLSession.h @@ -0,0 +1,47 @@ + +@interface FindMyLocateSession : NSObject + +@property (nonatomic, copy) id /* block */ friendshipUpdateCallback; +@property (nonatomic, copy) id /* block */ locationUpdateCallback; +@property (nonatomic, copy) id /* block */ meDeviceUpdateCallback; + ++ (bool)FMFAllowed; ++ (bool)FMFRestricted; + +- (long long)cachedCanShareLocationWithHandle:(id)arg1 isFromGroup:(bool)arg2; +- (id)cachedFriendsFollowingMyLocation; +- (id)cachedFriendsSharingLocationsWithMe; +- (id)cachedLocationForHandle:(id)arg1; +- (id)cachedLocationForHandle:(id)arg1 includeAddress:(bool)arg2; +- (id)cachedOfferExpirationForHandle:(id)arg1 groupId:(id)arg2; +- (void)canShareLocationWithHandle:(id)arg1 isFromGroup:(bool)arg2 completion:(id /* block */)arg3; +- (void)friendshipStateWithHandle:(id)arg1 isFromGroup:(bool)arg2 completion:(id /* block */)arg3; +- (id /* block */)friendshipUpdateCallback; +- (void)getActiveLocationSharingDeviceWithCompletion:(id /* block */)arg1; +- (void)getFriendsFollowingMyLocationWithCompletion:(id /* block */)arg1; +- (void)getFriendsSharingLocationsWithMeWithCompletion:(id /* block */)arg1; +- (void)getOfferExpirationForHandle:(id)arg1 groupId:(id)arg2 completion:(id /* block */)arg3; +- (id)init; +- (id /* block */)locationUpdateCallback; +- (id /* block */)meDeviceUpdateCallback; +- (void)sendFriendshipInviteToHandle:(id)arg1 from:(id)arg2 isFromGroup:(bool)arg3 completion:(id /* block */)arg4; +- (void)sendFriendshipInviteToHandle:(id)arg1 isFromGroup:(bool)arg2 completion:(id /* block */)arg3; +- (void)sendFriendshipOfferToHandles:(id)arg1 expiration:(long long)arg2 isFromGroup:(bool)arg3 completion:(id /* block */)arg4; +- (void)sendFriendshipOfferToHandles:(id)arg1 from:(id)arg2 expiration:(long long)arg3 isFromGroup:(bool)arg4 completion:(id /* block */)arg5; +- (void)setActiveLocationSharingDevice:(id)arg1 completion:(id /* block */)arg2; +- (void)setFriendshipUpdateCallback:(id /* block */)arg1; +- (void)setLocationUpdateCallback:(id /* block */)arg1; +- (void)setMeDeviceUpdateCallback:(id /* block */)arg1; +- (void)setTrampoline:(id)arg1; +- (void)startMonitoringActiveLocationSharingDeviceChangeWithCompletion:(id /* block */)arg1; +- (void)startRefreshingLocationForHandles:(id)arg1 priority:(long long)arg2 isFromGroup:(bool)arg3 completion:(id /* block */)arg4; +- (void)startRefreshingLocationForHandles:(id)arg1 priority:(long long)arg2 isFromGroup:(bool)arg3 reverseGeocode:(bool)arg4 completion:(id /* block */)arg5; +- (void)startUpdatingFriendsWithInitialUpdates:(bool)arg1 completion:(id /* block */)arg2; +- (void)stopRefreshingLocationForHandles:(id)arg1 priority:(long long)arg2 isFromGroup:(bool)arg3 completion:(id /* block */)arg4; +- (void)stopRefreshingLocationWithCompletion:(id /* block */)arg1; +- (void)stopSharingLocationWith:(id)arg1 from:(id)arg2 isFromGroup:(bool)arg3 completion:(id /* block */)arg4; +- (void)stopSharingLocationWith:(id)arg1 isFromGroup:(bool)arg2 completion:(id /* block */)arg3; +- (void)stopUpdatingFriendsWithCompletion:(id /* block */)arg1; +- (id)trampoline; + +@end diff --git a/Messages/MacOS-11+/BlueBubblesHelper/IMFMFSession.h b/Messages/MacOS-11+/BlueBubblesHelper/IMFMFSession.h index 438cf0d..9f25730 100644 --- a/Messages/MacOS-11+/BlueBubblesHelper/IMFMFSession.h +++ b/Messages/MacOS-11+/BlueBubblesHelper/IMFMFSession.h @@ -19,69 +19,97 @@ @property (retain, nonatomic) FMFDevice *activeDevice; // ivar: _activeDevice @property (readonly, copy) NSString *debugDescription; @property (readonly, copy) NSString *description; -@property (readonly, nonatomic) BOOL disableLocationSharing; -@property (retain, nonatomic) NSString *establishingAccountID; // ivar: _establishingAccountID -@property (nonatomic) NSUInteger fmfProvisionedState; // ivar: _fmfProvisionedState -@property (readonly) NSUInteger hash; -@property (readonly, nonatomic) BOOL restrictLocationSharing; -@property (retain, nonatomic) FMFSession *session; // ivar: _session +@property (nonatomic, readonly) bool disableLocationSharing; +@property (nonatomic, retain) NSString *establishingAccountID; +@property (nonatomic) unsigned long long fmfProvisionedState; +@property (nonatomic, retain) id fmlSession; +@property (readonly) unsigned long long hash; +@property (nonatomic, readonly) bool restrictLocationSharing; +@property (nonatomic, retain) FMFSession *session; @property (readonly) Class superclass; ++ (id)sharedInstance; -+(id)sharedInstance; --(BOOL)allChatParticipantsFollowingMyLocation:(id)arg0 ; --(BOOL)allChatParticipantsSharingLocationWithMe:(id)arg0 ; --(BOOL)chatHasParticipantsFollowingMyLocation:(id)arg0 ; --(BOOL)chatHasParticipantsSharingLocationWithMe:(id)arg0 ; --(BOOL)chatHasSiblingParticipantsSharingLocationWithMe:(id)arg0 ; --(BOOL)fmfHandleIsFollowingMyLocation:(id)arg0 ; --(BOOL)fmfHandleIsSharingLocationWithMe:(id)arg0 ; --(BOOL)handleIsFollowingMyLocation:(id)arg0 ; --(BOOL)handleIsSharingLocationWithMe:(id)arg0 ; --(BOOL)imIsProvisionedForLocationSharing; --(Class)__FMFSessionClass; --(id)_accountStore; --(id)_bestAccountForAddresses:(id)arg0 ; --(id)_callerIDForChat:(id)arg0 ; --(id)allSiblingFMFHandlesForChat:(id)arg0 ; --(id)fmfGroupIdGroup; --(id)fmfGroupIdOneToOne; --(id)fmfHandlesForChat:(id)arg0 ; --(id)fmfOpenURLStringForChat:(id)arg0 ; --(id)init; +- (Class)__FMFSessionClass; +- (Class)__FMLSessionClass; +- (id)_accountStore; +- (void)_accountStoreDidChangeNotification:(id)arg1; +- (id)_bestAccountForAddresses:(id)arg1; +- (id)_callerIDForChat:(id)arg1; +- (bool)_canShareLocationWithFMLHandle:(id)arg1 isFromGroup:(bool)arg2; +- (void)_configureFindMyLocateSession; +- (id)_dateFromShareDuration:(long long)arg1; +- (void)_initializeFindMySessionIfInAllowedProcess; +- (void)_postNotification:(id)arg1 object:(id)arg2 userInfo:(id)arg3; +- (void)_postRelationshipStatusDidChangeNotificationWithIMFindMyHandle:(id)arg1; +- (void)_setUpFindMyLocateSessionCallbacks; +- (void)_startFMLSessionMonitoring; +- (void)_startRefreshingLocationForFMLHandles:(id)arg1 priority:(long long)arg2 isFromGroup:(bool)arg3; +- (void)_startSharingWithFMFHandles:(id)arg1 inChat:(id)arg2 untilDate:(id)arg3; +- (void)_startSharingWithFMLHandles:(id)arg1 inChat:(id)arg2 withDuration:(long long)arg3; +- (void)_stopSharingWithFMFHandles:(id)arg1 inChat:(id)arg2; +- (void)_stopSharingWithFMLHandles:(id)arg1 inChat:(id)arg2; +- (void)_stopTrackingLocationForFMLHandles:(id)arg1 priority:(long long)arg2 isFromGroup:(bool)arg3; +- (void)_updateActiveDevice; +- (id)activeDevice; +- (bool)allChatParticipantsFollowingMyLocation:(id)arg1; +- (bool)allChatParticipantsSharingLocationWithMe:(id)arg1; +- (id)allSiblingFindMyHandlesForChat:(id)arg1; +- (bool)chatHasParticipantsFollowingMyLocation:(id)arg1; +- (bool)chatHasParticipantsSharingLocationWithMe:(id)arg1; +- (bool)chatHasSiblingParticipantsSharingLocationWithMe:(id)arg1; +- (void)dealloc; +- (void)didChangeActiveLocationSharingDevice:(id)arg1; +- (void)didReceiveLocation:(id)arg1; +- (void)didReceiveLocationForHandle:(id)arg1; +- (void)didStartAbilityToGetLocationForHandle:(id)arg1; +- (void)didStartSharingMyLocationWithHandle:(id)arg1; +- (void)didStopAbilityToGetLocationForHandle:(id)arg1; +- (void)didStopSharingMyLocationWithHandle:(id)arg1; +- (void)didUpdateHidingStatus:(bool)arg1; +- (bool)disableLocationSharing; +- (id)establishingAccountID; +- (bool)findMyHandleIsFollowingMyLocation:(id)arg1; +- (bool)findMyHandleIsSharingLocationWithMe:(id)arg1; +- (id)findMyHandlesForChat:(id)arg1; +- (id)findMyHandlesSharingLocationWithMe; +- (id)findMyLocationForFindMyHandle:(id)arg1; +- (id)findMyLocationForHandle:(id)arg1; +- (id)findMyLocationForHandleOrSibling:(id)arg1; +- (id)findMyURLForChat:(id)arg1; +- (id)fmfGroupIdGroup; +- (id)fmfGroupIdOneToOne; +- (unsigned long long)fmfProvisionedState; +- (id)fmlSession; +- (void)friendshipRequestReceived:(id)arg1; +- (void)friendshipWasRemoved:(id)arg1; +- (bool)handleIsFollowingMyLocation:(id)arg1; +- (bool)handleIsSharingLocationWithMe:(id)arg1; +- (bool)imIsProvisionedForLocationSharing; +- (id)init; -(id)locationForFMFHandle:(id)arg0 ; -(id)locationForHandle:(id)arg0 ; -(id)locationForHandleOrSibling:(id)arg0 ; --(id)timedOfferExpirationForChat:(id)arg0 ; --(void)_accountStoreDidChangeNotification:(id)arg0 ; --(void)_postNotification:(id)arg0 object:(id)arg1 userInfo:(id)arg2 ; --(void)_postRelationshipStatusDidChangeNotificationWithHandle:(id)arg0 ; --(void)_startSharingWithFMFHandles:(id)arg0 inChat:(id)arg1 untilDate:(id)arg2 ; --(void)_stopSharingWithFMFHandles:(id)arg0 inChat:(id)arg1 ; --(void)_updateActiveDevice; --(void)dealloc; --(void)didChangeActiveLocationSharingDevice:(id)arg0 ; --(void)didReceiveLocation:(id)arg0 ; --(void)didStartAbilityToGetLocationForHandle:(id)arg0 ; --(void)didStartSharingMyLocationWithHandle:(id)arg0 ; --(void)didStopAbilityToGetLocationForHandle:(id)arg0 ; --(void)didStopSharingMyLocationWithHandle:(id)arg0 ; --(void)didUpdateHidingStatus:(BOOL)arg0 ; --(void)friendshipRequestReceived:(id)arg0 ; --(void)friendshipWasRemoved:(id)arg0 ; --(void)makeThisDeviceActiveDevice; --(void)refreshLocationForChat:(id)arg0 ; --(void)refreshLocationForHandle:(id)arg0 inChat:(id)arg1 ; --(void)sendMappingPacket:(id)arg0 toHandle:(id)arg1 ; --(void)startSharingWithChat:(id)arg0 untilDate:(id)arg1 ; --(void)startSharingWithHandle:(id)arg0 inChat:(id)arg1 untilDate:(id)arg2 ; --(void)startTrackingLocationForChat:(id)arg0 ; --(void)startTrackingLocationForHandle:(id)arg0 ; --(void)stopSharingWithChat:(id)arg0 ; --(void)stopSharingWithHandle:(id)arg0 inChat:(id)arg1 ; --(void)stopTrackingLocationForChat:(id)arg0 ; --(void)stopTrackingLocationForHandle:(id)arg0 ; - +- (void)makeThisDeviceActiveDevice; +- (void)refreshLocationForChat:(id)arg1; +- (void)refreshLocationForHandle:(id)arg1 inChat:(id)arg2; +- (bool)restrictLocationSharing; +- (void)sendMappingPacket:(id)arg1 toHandle:(id)arg2; +- (id)session; +- (void)setActiveDevice:(id)arg1; +- (void)setEstablishingAccountID:(id)arg1; +- (void)setFmfProvisionedState:(unsigned long long)arg1; +- (void)setFmlSession:(id)arg1; +- (void)setSession:(id)arg1; +- (void)startSharingWithChat:(id)arg1 withDuration:(long long)arg2; +- (void)startSharingWithHandle:(id)arg1 inChat:(id)arg2 withDuration:(long long)arg3; +- (void)startTrackingLocationForChat:(id)arg1; +- (void)startTrackingLocationForHandle:(id)arg1; +- (void)stopSharingWithChat:(id)arg1; +- (void)stopSharingWithHandle:(id)arg1 inChat:(id)arg2; +- (void)stopTrackingLocationForChat:(id)arg1; +- (void)stopTrackingLocationForHandle:(id)arg1; +- (id)timedOfferExpirationForChat:(id)arg1; @end diff --git a/Messages/MacOS-11+/BlueBubblesHelper/NetworkController.m b/Messages/MacOS-11+/BlueBubblesHelper/NetworkController.m index c5ca669..fe2c517 100644 --- a/Messages/MacOS-11+/BlueBubblesHelper/NetworkController.m +++ b/Messages/MacOS-11+/BlueBubblesHelper/NetworkController.m @@ -77,7 +77,11 @@ - (void)sendMessage:(NSDictionary*)data { - (void)socket:(GCDAsyncSocket *)sock didConnectToHost:(NSString *)host port:(UInt16)port { DLog("BLUEBUBBLESHELPER: socket:%{public}p didConnectToHost:%{public}@ port:%{public}hu", sock, host, port); - NSDictionary *message = @{@"event": @"ping", @"message": @"Helper Connected!"}; + NSDictionary *message = @{ + @"event": @"ping", + @"message": @"Helper Connected!", + @"process": [[NSBundle mainBundle] bundleIdentifier], + }; [self sendMessage:message]; } @@ -100,7 +104,7 @@ - (void)socket:(GCDAsyncSocket *)sock didReadData:(NSData *)data withTag:(long)t } - (void)socketDidDisconnect:(GCDAsyncSocket *)sock withError:(NSError *)err { - DLog("BLUEBUBBLESHELPER: Disconnected from server, attempting to reconnect in 5 seconds..."); + DLog("BLUEBUBBLESHELPER: Disconnected from server, attempting to reconnect in 5 seconds... (%{public}@)", err); double delayInSeconds = 5.0; dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, (int64_t)(delayInSeconds * NSEC_PER_SEC)); dispatch_after(popTime, dispatch_get_main_queue(), ^(void){