RikkaApps / WADB

A simple switch for adb (Android Debug Bridge) over network.
https://play.google.com/store/apps/details?id=moe.haruue.wadb
Apache License 2.0
578 stars 77 forks source link

Fixed IP shown as '0.0.0.0' when using hotspot instead of WLAN #25

Closed alexVinarskis closed 2 years ago

alexVinarskis commented 2 years ago

Issue: when not connected to WiFi, and using Hotspot/AP instead, it was possible to connect to phone, however WADB would show '0.0.0.0' as IP. It was required to identify default gateway from computer, and use that IP address to connect.

Solution: use root shell to pull IP address of AP device. Iff no there is no WLAN connection (0.0.0.0 was about to be shown), default gateway of AP is shown instead (if any)

Bonus: altered app's interface to display both WLAN and AP IPs, if both are available (notification and tile still still show WLAN only, otherwise fallback to AP)

Tested on Pixel 5 Android 12L.

haruue commented 2 years ago

Great idea & LGTM. Thank you for this pull request.