-
Notifications
You must be signed in to change notification settings - Fork 70
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
ip neighbor command throws exception on android 11 #134
Comments
Sounds like the same issue as #129 To your question, they have tightened things a lot in the newer versions of Android. Here is just one example https://issuetracker.google.com/issues/130103885?pli=1 |
That is true, but like i mentioned Fing is doing fine and they recently published a new version that supports android 11, 12. So do you have any idea on how they are implementing this? like using NDK or something? |
@5hahryar I just verified this, and Fing is effectively using the NDK to implement their "Native ARP" (if you decompile their APK you'll see it implemented in I don't know what would be simplest method to achieve API 30 compatibility : maybe using the NDK to build a modified ip binary only implementing the |
@BayLee4 I tried running a sample code on a raspberry pi 4. It compiled and worked successfully but I had to use sudo. |
@5hahryar Yes, we need a code that can run without root permission (so without having to run as |
@BayLee4 I have no experience in C, is there any documentation that can help? |
@5hahryar None that I can think of unfortunately, but I just finished to make a stripped down version of the Here is the repo, once cloned and in the directory just do (If either |
@BayLee4 Thank you, I executed your code and it looks like it is working perfectly.
|
@5hahryar Nice! Hopefully it will also work on Android with additional work, I never used the NDK though, did you? |
For the record the following code needs an alternative : if (bind(rth->fd, (struct sockaddr *)&rth->local,
sizeof(rth->local)) < 0) {
perror("Cannot bind netlink socket");
return -1;
}
addr_len = sizeof(rth->local); As this is what isn't working currently (API 30 not allowing to bind on |
@BayLee4 I also haven't used NDK but I'll try it on an empty project to figure it out. |
@BayLee4 I created a repository and added all your C files. It fails to build the project with this error: undefined reference to 'rtnl_dump_filter_nc' |
@5hahryar Sure, better not to flood this issue anymore. I'll open an issue in your repository. Regarding the undefined reference issue, this is because you only added the ipneigh.c source file (where all Furthermore I believe it would be simpler to compile |
Hello, I encountered a strange issue. I tried running the app on android 11 it worked fine, then I updated the compile and target SDK versions from 29 to 30 and then after a rebuild I restarted the app. After this change a few exceptions happened, but the main one that I'm concerned with is about running "ip neighbor" command to access the MAC address.
Running this command exits with this error: "Cannot bind netlink socket permission denied"
Now I'm wondering if this is related to the new restrictions on android or it can be fixed in some way?
Side question: Getting the MAC address of devices on network, is it not possible anymore on android? If that is the case, then how fing is doing it?
The text was updated successfully, but these errors were encountered: