Microsoft Word - iOSAppReverseEngineering.docx

(Romina) #1

role of a post office; its building materials, office equipments and clerks are all from ChatKit,


while IMCore is the postman. When I have a letter to send, I’ll go to the post office and put the


letter in the mailbox. Then a clerk will sort the letters out and hand them to the postman; later


the postman will give feedback of the delivery progress and result to the clerk, who are in


charge of informing me what’s happening to my letter. This kind of closed-loop service is very


Apple-ish; MobileSMS, ChatKit and IMCore play different roles, bringing Apple fans terrific user


experiences. If we can learn how Apple design and implement all kinds of services via iOS


reverse engineering, put them together and make them our own, it’ll bring dramatically


improvement to the elegance, design and robustness of our products, which is unattainable by


only reading the official documents.


10.5 Tweak writing


After prototyping the tweak with Cycript, coding with Theos is just physical labor without


much thinking. We’ll add 2 methods to SMSApplication in MobileSMS, namely “-


(int)madridStatusForAddress:(NSString *)address” and “-


(void)sendMadridMessageToAddress:(NSString )address withText:(NSString )text” then test


them with Cycript. Let’s move it!


10.5.1 Create tweak project “iOSREMadridMessenger” using Theos


The Theos commands are as follows:


snakeninnys-MacBook:Code snakeninny$ /opt/theos/bin/nic.pl
NIC 2.0 - New Instance Creator
------------------------------
[1.] iphone/application
[2.] iphone/cydget
[3.] iphone/framework
[4.] iphone/library
[5.] iphone/notification_center_widget
[6.] iphone/preference_bundle
[7.] iphone/sbsettingstoggle
[8.] iphone/tool
[9.] iphone/tweak
[10.] iphone/xpc_service
Choose a Template (required): 9
Project Name (required): iOSREMadridMessenger
Package Name [com.yourcompany.iosremadridmessenger]: com.iosre.iosremadridmessenger
Author/Maintainer Name [snakeninny]: snakeninny
[iphone/tweak] MobileSubstrate Bundle filter [com.apple.springboard]:
com.apple.MobileSMS
[iphone/tweak] List of applications to terminate upon installation (space-separated, '-'
for none) [SpringBoard]: MobileSMS
Instantiating iphone/tweak in iosremadridmessenger/...
Free download pdf