Note that there are some explanatory texts on larger screens.

plurals
  1. POjNetPcap on Android: problem with findAllDevs method!
    primarykey
    data
    text
    <p>I've sucessfully compiled jNetPcap as a shared library for Android. I have made a simple application using this code: <a href="http://jnetpcap.com/examples/classic" rel="noreferrer">http://jnetpcap.com/examples/classic</a> to test the API.</p> <p>The problem is that when I call the method findAllDevs and exception is raised with this message: "Can't read list of devices, error issocket: Permission denied"</p> <p>I cannot understand the reason, since I have made a call in the first part of my program so as to get root permissions for my application and I test my application to a rooted phone. When I run the application, a pop up is raised with this message:"SnifferApp has been granted Superuser permissions" and then the exception occurs.</p> <p>Any ideas?</p> <p>Here is a piece of my code:</p> <pre><code>Process p = Runtime.getRuntime().exec("su"); /*try { Thread.sleep(10000); } catch (InterruptedException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } // do nothing for 1000 miliseconds (1 second) */ try { System.loadLibrary(JNETPCAP_LIBRARY_NAME); } catch (UnsatisfiedLinkError e) { System.out.println("Native code library failed to load.\n" + e); } /*************************************************************************** * First get a list of devices on this system **************************************************************************/ int r = Pcap.findAllDevs(alldevs, errbuf); r = Pcap.findAllDevs(alldevs, errbuf); if (r == Pcap.NOT_OK || alldevs.isEmpty()) { tv.append("Can't read list of devices, error is" + errbuf .toString()); setContentView(tv); return; } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload