Closed brlin-tw closed 2 weeks ago
The USB tethering mode is looking for an interface identified as RNDIS.
Do you have access to an Android Studio environment?
If you do, you can build a simple test app and copy the code from RNDISServer.kt in the function resolveRNDISNetwork
This function goes through all of the various internet devices and attempts to pick the one labelled RNDIS, maybe yours is something different that I also need to look for?
@pyamsoft
This function goes through all of the various internet devices and attempts to pick the one labelled RNDIS, maybe yours is something different that I also need to look for?
I hooked up a debugger and it seems that the NetworkInterface.getNetworkInterfaces()
call returns null
on my phone.
I'm going to rebuild the app and try to verify it again just to be sure, after building ktor which took ages for some reason:
You can use the upstream ktor if you don't need to use the preferred network feature.
If you change the ktor dep back to upstream, I think you just have to change the 2 lines where I call connectWithConfiguration to connect
Thanks for getting deep in the code here!
If you device is returning null for this, I'll need a different API to enumerated the devices
@pyamsoft
If you device is returning null for this, I'll need a different API to enumerated the devices
After successfully building TetherFi from the source I can verify that the NetworkInterface.getNetworkInterfaces()
call returns proper results, just not the ones we were expecting:
The ncm0
interface seems to be the one that is responsible for USB network sharing.
I can verify that changing the "EXPECTED_RNDIS_NAME_PREFIX" string value to "ncm" I can successfully launch the hotspot.
Awesome find, thank you
I will patch the code to look for both interface name prefixes
I hooked up a debugger and it seems that the
NetworkInterface.getNetworkInterfaces()
call returnsnull
on my phone.
No longer reproduced on either emulator/phone, likely a false alarm.
I have added support for the ncm
prefix, and will look at making another production release hopefully sometime next week.
Thank you for your contribution to the project!
Version 51 is in production testing and includes the ncm change.
The phone is connected to the PC, and the USB network sharing mode is enabled, but the hotspot failed to start with the following error:
Developer log:
Additional information
TetherFi
49 from Google Play
Android
14 (AP2A.240905.003)
Phone
Google Pixel 8 Pro