本文介绍了嗅探网络请求的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要寻找一种方式来嗅探网络流量我的Andr​​oid应用程序正在生成。原因是我要检查和发送由我使用我的应用程序第三方跟踪库产生的流量统计信息。

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.

由于这一点,我不能使用任何<一个href=\"https://play.google.com/store/apps/details?id=jp.co.taosoftware.android.packetcapture&hl=en\">tPacketCapture或同类者。

Because of this, I cannot use any tPacketCapture or similars.

我必须把这个跟踪库的HTTP客户端不能访问,所以我不能拦截任何请求。

I have no access to the http client of this tracking library, so I cannot intercept any request.

我已经拍了一下,以 VpnService ,但我不能强迫用户在他使用我的课程的应用程序每次连接到VPN。

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.

所以我在寻找如何做到这在Android中,如果有可能的任何建议。

So I am looking for any advice on how to do this in Android, if it is possible.

我发现有这个库,的,这是做正是我想要做什么..但适用于iOS。

I found that there is this library, NetworkEye, which is doing exactly what I would like to do... but for iOS.

推荐答案

据我所知,实现全球性包在Android操作系统嗅,你必须有root权限的设备上运行。
对于图书馆,我会去通过NDK和 libpcap的

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

这篇关于嗅探网络请求的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-26 11:29