3

I am googling since a week, but didn't found any information on how to monitor the /proc/net/{tcp,tcp6,udp,udp6...} files in Android.

There are couple of threads in the stackoverflow, but are linux platform related and not related to android
1) How to detect changes in /proc/net/ files?
2) How can i match each /proc/net/tcp entry to each opened socket?
3) Monitor the IP addresses from connections being made from all apps using the network without rooting the Android phone

Any help will be of great use. Even when I tried implementing the inotify function in c, I was getting event only when I cat the "/proc/net/tcp" file. Not getting when it is updated.

Suman
  • 4,221
  • 7
  • 44
  • 64
  • In case you don't find anything: netlink might send some info that you need. Btw. what info do you want to monitor? – domen Jun 30 '15 at 14:08
  • 1
    @domen, I wanted to monitor any application is trying to access the internet. For example, if new entry has been added to the these /proc/net files, then it means that an application with UID (Part or the /proc/net table entry) is trying to access the internet. I tried using netlink sockets but netlink sockets are being disabled in the latest version of Android (https://stackoverflow.com/questions/27148536/netlink-implementation-for-the-android-ndk) – Suman Jul 01 '15 at 06:17

0 Answers0