Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vendor detection not working on android 11 #118

Open
5hahryar opened this issue Jan 17, 2022 · 6 comments
Open

Vendor detection not working on android 11 #118

5hahryar opened this issue Jan 17, 2022 · 6 comments

Comments

@5hahryar
Copy link

Hello, because of the new restrictions on android for accessing the ARP table and ip commands, the mac address and vendor detection do not work any more. Is there any way to fix this issue? I've noticed some apps have found a way to work around this.

@csicar
Copy link
Owner

csicar commented Jan 18, 2022

Yeah. Good point. I'll try to fix this

csicar added a commit that referenced this issue Jan 18, 2022
@5hahryar
Copy link
Author

These are the ways that I've tried and failed:

  1. Set the target SDK on 29 and below, which solves the problem but any app that uses this method can no longer be published on google play.
  2. Using raw sockets in order to read the ethernet frame of packets and find the destination mac address; looks like it cannot be done because sending these kinds of packets needs root access.
  3. Using protocols like UPNP, NetBios, NSD, mDNS, ... which are very useful sometimes to gather additional data from the network, but none provide the desired information.
  4. Using SNMP; I came across this protocol when I was capturing packets that "Fing" sends throughout the network on port 161. I'm not sure if it is being used to gather mac address info or some other type of data. just consider this as a possible solution.

@csicar
Copy link
Owner

csicar commented Jan 18, 2022

In my PR i chose the 1. approach. I'm not publishing to google play atm, so luckily I don't need to care about googles rules.

Ning already has a custom mDNS system (because the android buildin system is slow and unreliable). There seem to be some bugs in parsing the DNS-Records resulting in some response data not being understood by Ning.

looks like it cannot be done because sending these kinds of packets needs root access.

If I would require root access, reading from /proc/arp would also be possible

Option 4 founds interesting. I have never heard of SNMP, so I might look into that

@Android-X13
Copy link

Vendor detection has lately (during the past couple weeks?) stopped working for me on Android 10.

@apollo1220
Copy link

Even with the targetSdk set to 29 this doesn't work on Android 13
Looks like SNMP isn't enabled by default on most devices, so that must not be what Fing is relying on (which Fing does still work on Android 13)

@apollo1220
Copy link

I found this library which replacing the attempt to read /proc/net/arp with this and then changing index 3 to 4 when mapping gets it working for Android 13 as long as you continue to target sdk 29

https://github.com/fulvius31/ip-neigh-sdk30

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants