I want to create a module that capture packets ( like Shark for Root app in Android).

Can i use JPCAP library (Java)? Do i need to root my Android phone to capture packets?

有帮助吗?

解决方案

Can i use JPCAP library (Java)?

Not directly. It relies upon JNI, presumably for accessing libpcap. You would need to modify the build process to use Android's NDK. It is conceivable that this would require no code changes, but that's far from certain.

Also, it is possible that the Java code for JPCAP requires classes that are not in Android.

Do i need to root my Android phone to capture packets?

Most likely. Everything else that uses libpcap on Android (e.g., Shark for Root) needs it. Even desktop Linux kinda needs it.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top