6

I want to capture network data packets on android app. Do you have any suggestions or source code to help me understand if this is possible?

John Conde
  • 217,595
  • 99
  • 455
  • 496
Kadir GÜZEL
  • 141
  • 1
  • 1
  • 11

3 Answers3

5

Without root you will have to use a pass-thru method.

  1. Setup your PC/Mac to share your wired connection through the wireless adapter
  2. Connect to the wireless adapter with your Android device
  3. Run wireshark
Error 454
  • 7,255
  • 2
  • 33
  • 48
  • I want to capture network data packets on my android device by my app.Not pc only device.I want to list which sites users are connected on device. Thanks – Kadir GÜZEL Aug 09 '12 at 09:59
  • 1
    And that's what I've just explained how to do. Unless you have root, you can't trace packets. Your only choice is what I've listed above which lets you sniff packets that your android device is sending out by sending traffic through the PC. – Error 454 Aug 09 '12 at 16:36
  • Thank you for helping. I have to super user. – Kadir GÜZEL Aug 10 '12 at 00:40
0

most apps that filter/sniff/account network traffic in android without root use the loopback vpn trick, where you setup a vpn and inspect the traffic (or whatever you want)

for sniffer, check tpacketcapture, but i don't think you have the source... try to contact then, or check fdroid for a similar open source app

higuita
  • 2,127
  • 20
  • 25
0

This should be just man-in-the-middle approach - think about setting up a proxy.

nickolay
  • 3,643
  • 3
  • 32
  • 40