问题
I am looking for a way to sniff the network traffic my Android app is generating. The reason is I want to check and send statistics of the traffic generated by a third party tracking library I am using in my app.
Because of this, I cannot use any tPacketCapture or similars.
I have no access to the http client of this tracking library, so I cannot intercept any request.
I already took a look to VpnService
, but I cannot force the user to connect to a VPN every time he is using my app of course.
So I am looking for any advice on how to do this in Android, if it is possible.
I found that there is this library, NetworkEye, which is doing exactly what I would like to do... but for iOS.
回答1:
As far I know, to achieve 'global' packet sniffing in Android OS you have to run on a rooted device. For the library,I would go through the NDK and libpcap for Android
来源:https://stackoverflow.com/questions/35439479/sniffing-network-requests