Android Code Snippet Net Scanner

Today I had a few free minutes and I wanted to create a network scanner to identify the IPs present in the subnet. Then you could add other functions if you wanted.
FOR Android <= 9

1762465119642.png
 

Attachments

  • NetScan.zip
    10.8 KB · Views: 12
Last edited:

JohnC

Expert
Licensed User
Longtime User
I am getting the error:

B4X:
java.io.FileNotFoundException: /proc/net/arp: open failed: EACCES (Permission denied)

I even tried setting targetSdkVersion="28", which usualy fixes this issue.

BTW, is your phone rooted? I ask because you use the variable name "su" (as in "Super User") on the line that is generating the error.
 
Last edited:

Star-Dust

Expert
Licensed User
Longtime User
I am getting the error:

B4X:
java.io.FileNotFoundException: /proc/net/arp: open failed: EACCES (Permission denied)

I even tried setting targetSdkVersion="28", which usualy fixes this issue.

BTW, is your phone rooted? I ask because you use the variable name "su" (as in "Super User") on the line that is generating the error.
This code works up to Android 9, devices with higher versions does not work.
I tried with an old Samsung S8 and it works. I will do further testing with other devices
 
Last edited:

JohnC

Expert
Licensed User
Longtime User
I am running Android 10, so according to ChatGPT:

Android 10 (Q) introduced a restriction: apps running on devices with Android 10+ cannot read /proc/net (which includes /proc/net/arp). When you try File.ReadString("/proc/net/", "arp") the kernel/SELinux returns EACCES (Permission denied) and B4A raises the Java FileNotFoundException. That’s exactly the exception you see.
 
Top