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

贡献者指南