1. Are you ready for the Galaxy S20? Here is everything we know so far!

Unable to Start Driver from Android App

Discussion in 'Android Apps & Games' started by arjun.laxman, Feb 3, 2011.

  1. arjun.laxman

    arjun.laxman Lurker
    Thread Starter

    Hi,
    I am writing an Android Application for the first time. I need to start a Tun driver from Android App. I have two shared libraries created. One is JNI shared library and the other is the cross-compiled library which actually does creating of a tunneling module,assigning IP Address, starting the tun driver and configuring by setting the IP address and setting up a route for it.
    After getting server IP address and server port through App, I call JNI function to start tun module. The JNI library in turn calls the function in the cross-compiled library which actually does the job.
    But the issue is the permission to start the device files. I faced issue while creating a socket, so I set the permission android.permission.INTERNET in AndroidManifest.xml. I was able to create socket and DHCP too worked. Now, I am facing an issue to start the Tun driver. I am able to open the device file "/dev/tun" but unable to set the properties to it by calling ioctl(fd, TUNSETIFF, &ifr) due to Permission problems.
    If I make the cross-compiled library an executable and start it on ADB shell prompt of the mobile phone using SU permissions, it works perfectly fine. But through Android App, I am not able to do so due to some permission issue. I have tried giving all sorts of permissions in AndroidManifest.xml file, but no progress. I am stuck with this problem for days and any help will be greatly appreciated.

    Thanks in advance.

    Regards,
    Arjun
     



    1. Download the Forums for Android™ app!


      Download

       
Loading...
Similar Threads - Unable Start Driver
  1. jhall68w
    Replies:
    5
    Views:
    494
  2. Ajrox22
    Replies:
    9
    Views:
    538
  3. MarcoGalaxyA10
    Replies:
    1
    Views:
    1,222
  4. FaustBottomText
    Replies:
    3
    Views:
    1,203
  5. xarzu
    Replies:
    2
    Views:
    1,144
  6. GlitchedFolx
    Replies:
    16
    Views:
    3,070
  7. aj4yourhelp
    Replies:
    0
    Views:
    1,170
  8. Ian Preddy
    Replies:
    13
    Views:
    5,601
  9. Magixsword
    Replies:
    0
    Views:
    1,067
  10. kumaranil13k
    Replies:
    0
    Views:
    2,717

Share This Page

Loading...