Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
381 views
in Technique[技术] by (71.8m points)

android - How to use ConnectivityManager.getConnectionOwnerUid() to access /proc/net/tcp

In my Android app I was reading ip addresses of other applications from /proc/net/tcp, but since android Q it is restricted to read from this file.

val br = RandomAccessFile("/proc/net/tcp", "r")

So I found out this question Acccess to /proc/net/tcp in Android Q where ConnectivityManager.getConnectionOwnerUid() suggested to access the ip addresses, but I can't understand how to use this API, there is no proper documentation for it. How I can use it?

And where should I get local and remote InetSocketAddresses?

public int getConnectionOwnerUid (int protocol, InetSocketAddress local, InetSocketAddress remote)

question from:https://stackoverflow.com/questions/65883080/how-to-use-connectivitymanager-getconnectionowneruid-to-access-proc-net-tcp

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...