Home:ALL Converter>Restrict applications from using VPN programatically on Android

Restrict applications from using VPN programatically on Android

Ask Time:2017-08-21T23:21:11         Author:Sarthak Garg

Json Formatter

I have created a VPN Profile on my Android device. Now, I would like to create an Android application to manage (restrict and allow) which applications can access this VPN Profile.

So far, I've looked at Android's VPN Service which allows us to manage which applications can access the VPN Service but I am unable to correlate how this solution fits in with an already created VPN Profile.

Author:Sarthak Garg,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/45800719/restrict-applications-from-using-vpn-programatically-on-android
ecdsa :

There is no relation betweeen the VpnService API and VPN connections you create in Android's built-in VPN client. When using the VpnService API you'll have to implement a VPN protocol yourself and tunnel data read from the TUN device, which is created via the API, and back again (or use a library that implements a VPN protocol that does this for you), only then can you restrict apps from using the VPN using VpnService.Builder's addDisallowedApplication() method.\n\nYou can also look for VPN apps in the app store that already use this API and support excluding (or including) apps that may use the VPN.",
2017-08-23T07:15:43
yy