• This article is only used for technology sharing, analysis and learning, and other purposes are not allowed. Others’ behavior has nothing to do with myself or the platform.

  • DZMCycript was introduced in the previous chapter. This chapter does a small test to modify the change amount and prompt text of wechat wallet.

    / / to connect mobile terminal dengzemiaodeMacBook - Pro: SSH dengzemiao $sh login. Sh / / search WeChat program (WeChat APP in the start state) iPhone: ~ root# ps - A | grep WeChat 1668 ?? 1:11. 60 / var/containers/Bundle/Application / 2771997 e - 6 acd a14-4 - A58F - E38C099D2AE1 / WeChat. App/WeChat 1689 ttys000 0:00. 02 IPhone :~ root# cycript -p WeChat // Import DZMCycript cy# @import DZMCycriptCopy the code
  • After entering the debugging environment, you can manually cut the wechat page to me > Pay > Wallet > Change page.

  • To change the amount, use Cycript’s choose(UILabel) function to list all existing Uilabels in the current cache, and then command + F to search for iconic characters. If it is Chinese, it needs to be converted to Unicode before it can be queried.

    • There’s something in the change.Balance figure 0.21, you can search it to find the correspondingUILabelTo:
    [... // text = '\xef\ XBF \xa50.21' 0x11c6e0c40; baseClass = UILabel; frame = (212 2.5; 59 19); text = '\xef\ XBF \xa50.21'; hidden = YES;  userInteractionEnabled = NO; layer = <_UILabelLayer: 0x2816cde50>>" ... ]Copy the code

    Text = “123” to change the amount

    However, the problem is that this is a list of all the UILabel components that have been loaded from the cache. That is, the UILabel may not belong to the page. You will notice that the amount of the page you have modified has not changed.

  • Then we can use DZMCycript to get the current controller and all its child controls to see what happens.

    / / get the current controller, that is, change the page this controller cy# DZMFrontVc () # < WCPayBalanceDetailViewController:" Cy# DZMVcSubviews(# 0x10e535C00)Copy the code

    Then you will notice that they have displayed my amount of 0.21 with 4 UILabel, including. It’s all a UILabel

    So sometimes, if the change of choose() or other properties or the obtained object does not work, you can go to the page step by step to check, you may be looking for the wrong object.

    Then change the value at position 0 to #0x1264284c0.text = “8” to change the value to 8.21

    Frame = DZMRectMake(0, 0, 100, 53.5) because the width is fixed, but it doesn’t seem to stretch itself, so you need to change it one by one

  • English Test: Change the prompt into small change to DZM, need to change into small change this sentence Chinese Unicode turn, the back part because there is a space does not escape, because the space escape will also become Unicode, we may search the target text it is normal space, so it depends on the situation to avoid, After escaping, we get:

    \u8f6c\u5165\u96f6\u94b1\u901a
    Copy the code

    Then go to Command + F and search for the UI component and find it in UIButton:

    <UIButton: 0x11c6799e0; frame = (63.5 230.5; 193 29); clipsToBounds = YES; opaque = NO; layer = <CALayer: 0x28327c580>>
    |    |    |    |    | <UIButtonLabel: 0x11ca0f8c0; frame = (16 6; 161 17); text = '\u8f6c\u5165\u96f6\u94b1\u901a \u7ed9\u81ea\u5df1\u52a0\u52a0\u85aa'; opaque = NO; userInteractionEnabled = NO; layer = <_UILabelLayer: 0x281402530>>
    |    |    |    |    |    | <_UILabelContentLayer: 0x283269740> (layer)
    |    |    |    |    | <UIImageView: 0x1115c36a0; frame = (181 6.5; 8 16); opaque = NO; userInteractionEnabled = NO; layer = <CALayer: 0x28327cc80>>
    Copy the code

    Once found, modify the text using UIButton:

    cy# [#0x11c6799e0 setTitle:@"dzm" forState:UIControlStateNormal]
    Copy the code