Microsoft Word - iOSAppReverseEngineering.docx

(Romina) #1

Figure 10- 4 Create a new message


Since we are using Cycript to find placeholder, first we should find the view that displays the


current placeholder “Text Message”; they must have a close connection, so get one, get the


other. Right? Let’s do it.


FunMaker-5:~ root# cycript -p MobileSMS
cy# ?expand
expand == true
cy# [[UIApp keyWindow] recursiveDescription]

The view hierarchy of keyWindow is quite rich in content, so we’re not pasting it here. If


you search “Text Message” in the output, you will find that there isn’t any match. Why? Maybe


you’ve already guessed the answer: “Text Message” isn’t in keyWindow. For verification, let’s


see how many windows are there in the current view:


cy# [UIApp windows]
@[#"<UIWindow: 0x1575ca10; frame = (0 0; 320 568); gestureRecognizers = <NSArray:
0x15629c60>; layer = <UIWindowLayer: 0x156e36f0>>",#"<UITextEffectsWindow: 0x1579ab70;
frame = (0 0; 320 568); opaque = NO; autoresize = W+H; gestureRecognizers = <NSArray:
0x1579b300>; layer = <UIWindowLayer: 0x1579adf0>>",#"<CKJoystickWindow: 0x1552bf90;
baseClass = UIAutoRotatingWindow; frame = (0 0; 320 568); hidden = YES;
gestureRecognizers = <NSArray: 0x1552b730>; layer = <UIWindowLayer:
0x1552bdc0>>",#"<UITextEffectsWindow: 0x1683a2e0; frame = (0 0; 320 568); hidden = YES;
gestureRecognizers = <NSArray: 0x1688b9e0>; layer = <UIWindowLayer: 0x168b9ad0>>"]

As we can see, each item starting with “#” is a window, there are 4 of them, and the 1st is


keyWindow. Well, which one contains “Text Message”? As the names suggest, the 2nd and 4th


windows with the keyword “Text” in their names may be our targets. However, the 4th

Free download pdf