Code implementation of Pinduoduo app packet capture

Code implementation of Pinduoduo app packet capture

Use charles to capture packets

After operating the app, I found that scattered data packets could be captured when I first opened the app, but subsequent operations could not capture the packets normally.

Analyze client code

By opening the apk with jeb and analyzing, we learned that the core communication package is located com.xunmeng.basiccomponent.titan.apibelow. After analyzing its code, we came to the conclusion that the fundamental reason why ordinary packet capture tools Charles and Findler cannot capture the corresponding packets is that they use long connections. Therefore, their use needs to be prevented. A long connection is required to capture packets.

Code

Just turn off the long connection option:

ApiNetChannelSelector.getInstance().setLongLinkEnableHosts(new CopyOnWriteArrayList<String>());

How to write xposed plug-in:

Insert image description here

Packet capture effect

Insert image description here

Guess you like

Origin blog.csdn.net/super19911115/article/details/120048903