Microsoft Word - iOSAppReverseEngineering.docx

(Romina) #1

Figure 10- 94 IMServiceImpl.h


It inherits from IMService, and IMService.h is shown in figure 10-95.


Figure 10- 95 IMService.h


[IMServiceImpl iMessageService], that’s it. Reconfirm with Cycript:


cy# [IMServiceImpl iMessageService]
#"IMService[iMessage]"

By far, we’ve completely reversed the generation of an IMChat object. Let’s try it out in


Cycript:


FunMaker-5:~ root# cycript - p MobileSMS
cy# service = [IMServiceImpl iMessageService]
#"IMService[iMessage]"
cy# account = [[IMAccountController sharedInstance]
__ck_defaultAccountForService:service]
#"IMAccount: 0x145e30d0 [ID: 26B3EC90-783B-4DEC-82CF-F58FBBB22363 Service:
IMService[iMessage] Login: P:+86PhoneNumber Active: YES LoginStatus: Connected]"
cy# handle = [account imHandleWithID:@"[email protected]" alreadyCanonical:NO]
#"[IMHandle: <[email protected]:<None>:cn> (Person: <No AB Match>) (Account: P:+86
MyPhoneNumber]"
cy# chat = [[IMChatRegistry sharedInstance] chatForIMHandle:handle]
#"<IMChat 0x15809000> [Identifier: [email protected] GUID:
iMessage;-;[email protected] Persistent ID: [email protected] Account:
26B3EC90-783B-4DEC-82CF-F58FBBB22363 Style: - State: 3 Participants: 1 Room Name:
(null) Display Name: (null) Last Addressed: (null) Group ID: 6592DD84-4B34-4D54-BB40-
E2AB17B2FC67 Unread Count: 0 Failure Count: 0]"

Gorgeous! To finally make it, we need to construct an IMMessage object for sending. Let’s


move it now.


Open IMMessage.h, as shown in figure 10-96.

Free download pdf