nondanee/Nroxy

不支持 Android 10

Open

#7 建立於 2020年3月22日

在 GitHub 查看
 (13 留言) (0 反應) (0 負責人)C (9 fork)github user discovery
help wanted

倉庫指標

Star
 (43 star)
PR 合併指標
 (PR 指標待抓取)

描述

https://developer.android.com/about/versions/10/privacy/changes#proc-net-filesystem

/proc/net 文件系统的访问权限实施了限制

https://github.com/nondanee/Nroxy/blob/7933f070216b2e2e30d36e92e390e9564107089b/app/src/main/cpp/tun2http/ip.c#L321-L333

导致 get_uid 出错

type=1400 audit(0.0:13003): avc: denied { read } for name="tcp" dev="proc" ino=4026532086 scontext=u:r:untrusted_app_27:s0:c512,c768 tcontext=u:object_r:proc_net_tcp_udp:s0 tclass=file permissive=0

需使用 getConnectionOwnerUid(Called from C code)

https://developer.android.com/reference/android/net/ConnectivityManager.html#getConnectionOwnerUid(int,%20java.net.InetSocketAddress,%20java.net.InetSocketAddress)

参考 https://stackoverflow.com/questions/58497492/acccess-to-proc-net-tcp-in-android-q

貢獻者指南