Android 中的数据包级网络
我知道如何在 Android 中进行开发并使用 Apache HTTP 库,但我想深入了解,掌握无线接口适配器并能够发送和发送信息。无线接收数据包。我知道这是可能的,因为安卓市场上有嗅探器应用程序。我环顾四周并用谷歌搜索了很多,但似乎无法得到任何关于如何开始的想法。令人惊讶的是,之前似乎也没有人在 SO 上问过这个问题。
我想没有 Android API 可以为你做到这一点。请建议一种在 android 中发送/接收数据包的方法或发布对任何此类资源的引用。
谢谢!
注意:我知道 java.net api 可以在 android 中使用(尽管我以前没有使用过),但这并没有给我我想要的访问权限。
I know how to develop in Android and use the Apache HTTP lib, but I want to go lower, get hold of the wireless interface adapter and be able to send & receive packets wirelessly. I know its possible since there are sniffer apps in the android market. I have looked around and googled a lot, but can't seem to get any ideas on how to even start. Surprisingly nobody seems to have asked this question on SO before too.
I suppose there is no android API that does it for you. Please suggest a way of sending/receiving packets in android or post references to any such resources.
Thanks!
Note: I know java.net api can be used in android (though I haven't used it before) but that doesn't give me the kind of access I want.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
标准 SDK/NDK 无法做到这一点。
在 root 设备上,您可以调用 tcpdump 或另一个基于 libpcap 的应用程序。没有受支持的方法可以在生产 Android 设备上为 Java 应用程序提供所需的权限。
例如,这篇博文描述了如何使用
tcpdump
在 Android 上进行基本的数据包捕获。There is no way to do this with the standard SDK/NDK.
On a rooted device, you could possibly call into
tcpdump
, or another libpcap-based application. There is not a supported way to give Java applications the required privileges on a production Android device.For example, this blog post describes how to use
tcpdump
to do a basic packet capture on Android.你看过NDK吗?也许你可以用 C(++) 做你想做的事。
Did you have a look at the NDK? Maybe you can do what you want in C(++).
Android OS 4.0或更高版本提供了VpnService,您可以通过它监控网络流量。应用程序提供于 http://www.taosoftware.co.jp/en/android/packetcapture / 使用 VpnService 来捕获数据。
Android OS 4.0 or later provides a VpnService through which you can monitor the network traffic. Application provided at http://www.taosoftware.co.jp/en/android/packetcapture/ uses VpnService that capture the data.