nondanee/Nroxy

不支持 Android 10

Open

#7 aperta il 22 mar 2020

Vedi su GitHub
 (13 commenti) (0 reazioni) (0 assegnatari)C (9 fork)github user discovery
help wanted

Metriche repository

Star
 (43 star)
Metriche merge PR
 (Metriche PR in attesa)

Descrizione

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

Guida contributor