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.api
below. 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: