Implement JNI calls on VpnService class for Android native app

CLOSED
Bids
10
Avg Bid (USD)
$20 / hr
Project Budget (USD)
$15 - $25 / hr

Project Description:
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.

Hours of work: Unspecified Project Duration: < 1 săptămână Skills required:
Android, C Programming, Java
About the employer:
Verified
Public Clarification Board
Bids are hidden by the project creator. Log in as the employer to view bids or to bid on this project.
You will not be able to bid on this project if you are not qualified in one of the job categories. To see your qualifications click here.


$25 / hr
Hours: 40 hr/ week
$15 / hr
Hours: 20 hr/ week
$16 / hr
Hours: 50 hr/ week
Hire waheni
$22 / hr
Hours: 30 hr/ week
$15 / hr
Hours: 1 hr/ week
$20 / hr
Hours: 20 hr/ week
Hire technoplanet
$25 / hr
Hours: 40 hr/ week
Hire codeware123
$26 / hr
Hours: 2 hr/ week
$20 / hr
Hours: 50 hr/ week
Hire indiescie
$20 / hr
Hours: 40 hr/ week