csicar / Ning

Network-Scanner for Android
226 stars 35 forks source link

Doesn't work on Android 6 #39

Open 2011 opened 3 years ago

2011 commented 3 years ago

I don't know how much you tested Ning with the various versions of Android, but while it works fine on my Android 7, 8, 9, and 10 devices (don't have anything with Android 11 yet), it simply doesn't work at all on an Android 6 device. The network scan never returns anything, and the "Swipe down to scan the network" remains on the screen.

csicar commented 3 years ago

I'd be happy to get Ning working on Android 6. Any pointers to why Ning does not work on Android 6 would be appreciated. For example the LogCat output.

2011 commented 3 years ago

Looked through some of the logs. It seems like the problem begins with an inability to identify the local network.

[01-02 03:26:05.360 7323:7367 D/de.csicar.ning.ScanRepository$Companion]
NetworkInterfaces: [NetworkResult(address=/192.168.0.2, prefix=26, interfaceName=wlan0, displayName=wlan0)]

[01-02 03:26:05.400 7323:7367 D/de.csicar.ning.ScanRepository$Companion]
new network scan added: Network(networkId=3, baseIp=/0.13.82.124, mask=26, scanId=3, interfaceName=wlan0, bssid=MacAddress(address=11:11:11:11:11:11), ssid="ssid")

I have masked the mac address and ssid name, but the app actually came up with that address, which has no relation to any known address (on the other devices, the corresponding log entry shows the network address).

I get eight of these:

[01-02 03:26:05.416 472:608 D/NsdService]
Exceeded max outstanding requests mChannel com.android.internal.util.AsyncChannel@5afae00
mMessenger android.os.Messenger@6d14639
mResolvedService null
clientId 1 mDnsId 22 type 393217
clientId 2 mDnsId 23 type 393217
clientId 3 mDnsId 24 type 393217
clientId 4 mDnsId 25 type 393217
clientId 5 mDnsId 26 type 393217
clientId 6 mDnsId 27 type 393217
clientId 7 mDnsId 28 type 393217
clientId 8 mDnsId 29 type 393217
clientId 9 mDnsId 30 type 393217
clientId 10 mDnsId 31 type 393217

The app apparently does find the router and one other device (out of about a dozen) on the network, but nothing ever gets displayed. Then the process stops.

[01-02 03:26:05.580 7323:7478 D/de.csicar.ning.scanner.ArpScanner]
found entry in 'ip neight': ArpEntry(ip=/192.168.0.1, hwAddress=MacAddress(address=00:00:00:00:00:00))

[01-02 03:26:05.580 7323:7478 D/de.csicar.ning.scanner.ArpScanner]
found entry in 'ip neight': ArpEntry(ip=/192.168.0.3, hwAddress=MacAddress(address=22:22:22:22:22:22))

[01-02 03:26:11.610 472:1705 I/ActivityManager]
Killing 7323:de.csicar.ning/u0a162 (adj 9): remove task

[01-02 03:26:11.652 472:737 I/WindowState]
WIN DEATH: Window{4d708e7 u0 de.csicar.ning/de.csicar.ning.MainActivity}
csicar commented 3 years ago

From the logs, it look like Ning is actually finding devices and just not displaying them. Also Killing 7323:de.csicar.ning/u0a162 (adj 9): remove task does not sound right