stealthcopter / AndroidNetworkTools

Set of useful android network tools
Apache License 2.0
1.39k stars 282 forks source link

Getting FileNotFoundException on android 10 #70

Closed radheyshyamjat closed 4 years ago

radheyshyamjat commented 4 years ago

java.io.FileNotFoundException: /proc/net/arp: open failed: EACCES (Permission denied) 2020-04-15 12:23:35.039 23238-23295/app.ping W/System.err: at libcore.io.IoBridge.open(IoBridge.java:496) 2020-04-15 12:23:35.039 23238-23295/app.ping W/System.err: at java.io.FileInputStream.(FileInputStream.java:159) 2020-04-15 12:23:35.039 23238-23295/app.ping W/System.err: at java.io.FileInputStream.(FileInputStream.java:115) 2020-04-15 12:23:35.039 23238-23295/app.ping W/System.err: at java.io.FileReader.(FileReader.java:58) 2020-04-15 12:23:35.039 23238-23295/app.ping W/System.err: at com.stealthcopter.networktools.ARPInfo.getLinesInARPCache(ARPInfo.java:126) 2020-04-15 12:23:35.039 23238-23295/app.ping W/System.err: at com.stealthcopter.networktools.ARPInfo.getAllIPAndMACAddressesInARPCache(ARPInfo.java:104) 2020-04-15 12:23:35.039 23238-23295/app.ping W/System.err: at com.stealthcopter.networktools.SubnetDevices$1.run(SubnetDevices.java:188) 2020-04-15 12:23:35.039 23238-23295/app.ping W/System.err: at java.lang.Thread.run(Thread.java:919) 2020-04-15 12:23:35.039 23238-23295/app.ping W/System.err: Caused by: android.system.ErrnoException: open failed: EACCES (Permission denied) 2020-04-15 12:23:35.039 23238-23295/app.ping W/System.err: at libcore.io.Linux.open(Native Method) 2020-04-15 12:23:35.039 23238-23295/app.ping W/System.err: at libcore.io.ForwardingOs.open(ForwardingOs.java:167) 2020-04-15 12:23:35.040 23238-23295/app.ping W/System.err: at libcore.io.BlockGuardOs.open(BlockGuardOs.java:252) 2020-04-15 12:23:35.040 23238-23295/app.ping W/System.err: at libcore.io.ForwardingOs.open(ForwardingOs.java:167) 2020-04-15 12:23:35.040 23238-23295/app.ping W/System.err: at android.app.ActivityThread$AndroidOs.open(ActivityThread.java:7255) 2020-04-15 12:23:35.040 23238-23295/app.ping W/System.err: at libcore.io.IoBridge.open(IoBridge.java:482)

stealthcopter commented 4 years ago

@radheyshyamjat Sorry about that, this is fixed in the latest source code but I need to push out a new release, I'll get that done today!

stealthcopter commented 4 years ago

Should be resolved by updating to the latest library version 0.4.5.3

radheyshyamjat commented 4 years ago

Thanks @stealthcopter providing instant reply

YoannHe commented 3 years ago

Hello, I have the same error as well, FileNotFoundException for /proc/net/arp There is no fix for Android 10 ?

momilc commented 3 years ago

Me too !!

xiandanin commented 3 years ago

I am using 0.4.5.3, but this problem still occurs

implementation 'com.github.stealthcopter:AndroidNetworkTools:0.4.5.3'
java.io.FileNotFoundException: /proc/net/arp: open failed: EACCES (Permission denied)
    at libcore.io.IoBridge.open(IoBridge.java:496)
    at java.io.FileInputStream.<init>(FileInputStream.java:159)
    at java.io.FileInputStream.<init>(FileInputStream.java:115)
    at java.io.FileReader.<init>(FileReader.java:58)
    at com.stealthcopter.networktools.ARPInfo.getLinesInARPCache(ARPInfo.java:125)
    at com.stealthcopter.networktools.ARPInfo.getAllIPAndMACAddressesInARPCache(ARPInfo.java:101)
    at com.stealthcopter.networktools.SubnetDevices$1.run(SubnetDevices.java:166)
    at java.lang.Thread.run(Thread.java:919)
Caused by: android.system.ErrnoException: open failed: EACCES (Permission denied)
    at libcore.io.Linux.open(Native Method)
    at libcore.io.ForwardingOs.open(ForwardingOs.java:167)
    at libcore.io.BlockGuardOs.open(BlockGuardOs.java:252)
    at libcore.io.ForwardingOs.open(ForwardingOs.java:167)
    at android.app.ActivityThread$AndroidOs.open(ActivityThread.java:7459)
    at libcore.io.IoBridge.open(IoBridge.java:482)
    ... 7 more
jayesh83 commented 3 years ago

Yes! The issue is intact. @stealthcopter Can you please check that out once again?