An article teaches you grab vibrato app hotspot data in Python

Today to share a simple Android app data analysis and grab method. With vibrato, for example, we want to grab a hot list of data vibrato.

640?wx_fmt=png&tp=webp&wxfrom=5&wx_lazy=1&wx_co=1

    You know, this data is no web version, you can only start from the end of the phone.

    First of all we want to install charles APP capture data, it is a charge capture editing tools, approachable, easy to control the data request, modify simple, convenient data fetch suspended from the advantages of the Internet also has finished version, download address http://www.zdfans.com/html/42074.html, all the way to the default installation ok.

    After the installation is complete to set up a proxy, then click Proxy - proxy settings.

640?wx_fmt=png&tp=webp&wxfrom=5&wx_lazy=1&wx_co=1

    Then set the proxy, the phone side as shown below:

640?wx_fmt=png&tp=webp&wxfrom=5&wx_lazy=1&wx_co=1

    In the case ensure mobile phones and computers in the same LAN, the proxy server host name to ip address of the computer, the port is set to 8888.

    Finally, at the computer and mobile phone terminals are installed certificate.

    Computer terminal installation method: Click Help --ssl agency - charles root certificate is installed, install the following figure.

640?wx_fmt=png&tp=webp&wxfrom=5&wx_lazy=1&wx_co=1

    Mobile terminal Installation: Help --ssl agency - charles root certificate is installed on a mobile device or a remote browser.

    Then enter chls.pro/ssl simulator browser will automatically download the mobile client certificates

    Finally, the phone end Click Settings - Security - from SD card installed.

640?wx_fmt=png&tp=webp&wxfrom=5&wx_lazy=1&wx_co=1

    Name the certificate, click confirm that the installation was successful.

    Charles opened, and then open the vibrato app hot list interface, it is easy to find the data interface Charles, once returned data 50, as shown in FIG.

640?wx_fmt=png&tp=webp&wxfrom=5&wx_lazy=1&wx_co=1

    It follows url information shown in FIG.

640?wx_fmt=png&tp=webp&wxfrom=5&wx_lazy=1&wx_co=1

    This interface can only return hotspot data of this moment, in order to return the new data, we must transform parameter information, but App end data interface parameters are more complicated, here we are no longer in-depth analysis.

    To solve this problem, we can use appium timed simulation to control the phone, and then use the data mitmproxy intercept them (about appium, Profile mitmproxy of installation there are many online tutorials, not repeat them here)

    Appium script as shown below:

640?wx_fmt=png&tp=webp&wxfrom=5&wx_lazy=1&wx_co=1

    This automated test script is relatively simple, the main focus is repeated to obtain the latest information.

    Mitmproxy script as shown:

640?wx_fmt=png&tp=webp&wxfrom=5&wx_lazy=1&wx_co=1

There are four points caveats:

    1. mitmproxy before capture, put the phone proxy ip port is set to 8080, set as above;

    2. To run an external function in this script, you must add the first two lines, or else be wrong;

    3. script if url in flow.request.url determination conditions of the data flow, if the request url url data in the data stream, it is determined that the data is hot app vibrato data;

    4. Finally, run the following program in the path where the script:

640?wx_fmt=png&tp=webp&wxfrom=5&wx_lazy=1&wx_co=1

Finally appium run automated test scripts, and you're done.

If you need code for this article, please reply "in the background vibrato " word, feel good, oh, remember to give a star


After reading this article harvest? Please forward to sharing more people

IT Shared House

Please respond to the group [in the group] micro letter backstage

640?wx_fmt=jpeg&tp=webp&wxfrom=5&wx_lazy=1&wx_co=1


Guess you like

Origin blog.51cto.com/13389043/2480809