Forum Discussion
Furtys
6 years agoHonored Guest
[QUEST] Unable to use NetworkInterface
Hi everybody,
I'm making an app for Oculus Quest who need local networking and a broadcasting system... But I have a big problem...
I need to use the NetworkInterface and especially the NetworkInterface.OperationalStatus and
NetworkInterface.SupportsMulticast. But here is the problem, I can't use these functions. (I also use networkInterface.NetworkInterfaceType and networkInterface.Supports(NetworkInterfaceComponent.IPv4) and it works as expected).
When I use logcat with the Quest, I have errors when one of these functions is called :
The untrusted_app reason made me think it was from a missing permission, but I add all of these permissions to my AndroidManifest and doesn't works better :
I'm making an app for Oculus Quest who need local networking and a broadcasting system... But I have a big problem...
I need to use the NetworkInterface and especially the NetworkInterface.OperationalStatus and
NetworkInterface.SupportsMulticast. But here is the problem, I can't use these functions. (I also use networkInterface.NetworkInterfaceType and networkInterface.Supports(NetworkInterfaceComponent.IPv4) and it works as expected).
When I use logcat with the Quest, I have errors when one of these functions is called :
10-22 09:56:18.144 5269 5269 W UnityMain: type=1400 audit(0.0:19): avc: denied { getattr } for path="/sys/devices/virtual/net/lo/flags" dev="sysfs" ino=27775 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:object_r:sysfs:s0 tclass=file permissive=0
10-22 09:56:18.144 5269 5269 W UnityMain: type=1400 audit(0.0:20): avc: denied { getattr } for path="/sys/class/net/lo" dev="sysfs" ino=27754 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:object_r:sysfs:s0 tclass=lnk_file permissive=0
The untrusted_app reason made me think it was from a missing permission, but I add all of these permissions to my AndroidManifest and doesn't works better :
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.UPDATE_DEVICE_STATS" />
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
<uses-permission android:name="android.permission.CHANGE_WIFI_MULTICAST_STATE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
I also made this little script to ask for the autorisation if the app doesn't have it, but it only asking for the writing permission, no other...
Someone has an idea how to get around this problem ?... I really need to use NetworkInterface and broadcasting between any devices (PC or Quest).
Thanks a lot for your help in coming !
void Start()
{
#if PLATFORM_ANDROID
if (!Permission.HasUserAuthorizedPermission(Permission.ExternalStorageWrite))
{
Permission.RequestUserPermission(Permission.ExternalStorageWrite);
}
if (!Permission.HasUserAuthorizedPermission("android.permission.INTERNET"))
{
Permission.RequestUserPermission("android.permission.INTERNET");
}
if (!Permission.HasUserAuthorizedPermission("android.permission.ACCESS_WIFI_STATE"))
{
Permission.RequestUserPermission("android.permission.ACCESS_WIFI_STATE");
}
if (!Permission.HasUserAuthorizedPermission("android.permission.UPDATE_DEVICE_STATS"))
{
Permission.RequestUserPermission("android.permission.UPDATE_DEVICE_STATS");
}
if (!Permission.HasUserAuthorizedPermission("android.permission.ACCESS_NETWORK_STATE"))
{
Permission.RequestUserPermission("android.permission.ACCESS_NETWORK_STATE");
}
if (!Permission.HasUserAuthorizedPermission("android.permission.CHANGE_WIFI_MULTICAST_STATE"))
{
Permission.RequestUserPermission("android.permission.CHANGE_WIFI_MULTICAST_STATE");
}
if (!Permission.HasUserAuthorizedPermission("android.permission.CHANGE_WIFI_STATE"))
{
Permission.RequestUserPermission("android.permission.CHANGE_WIFI_STATE");
}
#endif
}Someone has an idea how to get around this problem ?... I really need to use NetworkInterface and broadcasting between any devices (PC or Quest).
Thanks a lot for your help in coming !
Replies have been turned off for this discussion
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device
Other Meta Support
Related Content
- 4 years ago
- 1 year agoAnonymous