Implement JNI calls on VpnService class for Android native app

Closed

Our daemon (vpn client) is compiled on Android NDK successfully, but there are issues to use tun driver on non-rooted devices and launch our app as service. We want to use VpnService class, which is provided on Android from version 4.0.

We have a tunnel library written on C. This is a library which handles all tunnel device related stuff (creating tunnel device, setting ip/routes/dns server for tunnel device, sending packets to tunnel device which are received by vpn library, reading packets from tunnel device which should be sent by vpn library to server). Here is part of libtun/libtun.h header:

int tun_open_withip(const char *tun_dev, const char *ip, unsigned netbits,

int mtu, in_addr_t srv_ip);

void tun_close(int tun_fd);

int tun_write(int tun_fd, char *buf, size_t len);

ssize_t tun_read(int tun_fd, char *buf, size_t len);

int tun_is_available(void);

int tun_set_routes(in_addr_t gateway, in_addr_t server);

int tun_restore_routes(void);

int tun_set_dns(in_addr_t dns_server);

int tun_restore_dns(void);

These functions are called by our daemon ran on Android when they need to perform some of these actions. We have Linux (desktop, Windows and Mac OS X) versions. Your task is to analyze what they are doing and provide Android version of these functions. You should use Android VPNService API for this. Using Linux native calls is not acceptable, because they are requiring rooted device, but most of users do not root their device.

VPNService API is only available from Java code, but not from NDK. So you should write some java code and then call it from these C functions. If some portion of code could be both written in Java or in C, please write it in C. Java should be used only when it is not possible to use C for something.

Android can kill any process at any time if it is not running as service. Our daemon should run this way. So, second task is to write code which starts daemon as service using android Services API.

We'd like to use #ifdef ANDROID in libtun and place android versions of the functions to separate file.

Thank you.

Skills: Android, C Programming, Java

See more: android vpnservice, vpnservice android, android vpnservice app, vpnservice class, java vpn api, android vpnservice native, android native vpn, windows on android, what is android os, vpn service for linux, vpn on android, vpn for android, vpn client for android, versions of android, run windows on android, run android on windows, root your android, root for android, rooted android, root android device, part time driver, linux on android, linux for android, java on android, java for android

Project ID: #5040448

8 freelancers are bidding on average $20/hour for this job

qitsol

Awards winning apps. Android & IPad http://www.capturatalk.com/ Award winning app - IPhone https://itunes.apple.com/au/app/am-dinner/id641904571?mt=8 Vehicle barcode scanner for ios, web .. aecvt.atlanti More

$25 USD / hour
(24 Reviews)
6.9
vonguyen

Hello. This is simple project. I have all skill to complete your project. Please let me have chance to start cooperating with you. Thanks, Vo Nguyen

$15 USD / hour
(20 Reviews)
5.1
AllwynS

I am Allwyn, Mobile Application Developer. I have 4+ years of Exp in the same field and my applications are available in both App Store and Android Market. I have keen knowledge on : XCode, Objective-C, Cocoas, Tita More

$16 USD / hour
(7 Reviews)
5.1
waheni

Let me help you **********************************************************************************************************************

$22 USD / hour
(5 Reviews)
4.1
gaodi0501

15+yeas devleoper expert in ndk and android and for our first time corporation no need for previously pay and you can make you first pay after first time we update you

$15 USD / hour
(1 Review)
3.9
weexcelindia123

Hi, Thanks for posting this project. I have gone through initial project description and analyzed all your initial needs and I can assure you that I can easily work on this project as per your specifications. More

$20 USD / hour
(1 Review)
3.4
technoplanet

---------JUST CHECK ATLEAST ONE APP FROM PORTFOLIO, U'll LOVE IT------------------ Dear sir, Hope you are doing good. I will not take much of your time and will show you the category wise works. Resturant a More

$25 USD / hour
(8 Reviews)
1.5
codeware123

Hello, I have gone through your project’s initial requirements with the help of the job posting you have placed. And I think I have requisite experience and expertise to complete your project successfully. I am very More

$26 USD / hour
(0 Reviews)
0.0
getveltrod12

Hi, Veltrod Software services is a global software consulting company specialized in providing Mobile applications, Social media frameworks and eCommerce solutions. Leveraging best-in-class people, processes, and t More

$20 USD / hour
(1 Review)
0.0
indiescie

Hi, i have started a personal project related to VpnService, and Android Services myself which is on the go. I have the idea on creating the first Intrusion Detection System for Android. For this solution all the TC More

$20 USD / hour
(0 Reviews)
0.0