Questions tagged [android-vpn-service]
101 questions
2
votes
1 answer
How to stop a VpnService that was called with prepare() and startService()?
I't trying to implement a local VpnService to have my app do some tasks, but I'm a little confused as to how to stop it one it started. The VpnService class and client activity are based on this repo:
https://github.com/hexene/LocalVPN
The caller…

DmitryB
- 119
- 1
- 2
- 13
2
votes
1 answer
Protecting Socket when using Netty4 on Android with VPNservice
I am trying to use the built-in VpnService in Android to capture traffic and send it to a remote server. I am trying to use Netty, but it seems that I have come to an impasse.
In order to send data from the phone to the server I need to call…

chen hao
- 21
- 2
1
vote
0 answers
How to get active VPN package name in Android
I'm struggling to find a way to determine the package name of the active VPN profile in Android.
Is there an API for this that is supported at the API 33 level?

spartygw
- 3,289
- 2
- 27
- 51
1
vote
0 answers
VPN disconnects when removing from recent apps on Xiaomi devices
In my case I implemented CakeVpn (https://github.com/ashraf789/Cake-VPN) application as second module of project.
In original version from google play there's no problem with removing from recent.
And there's a problem on Xiaomi devices with my app…

Виталий Сорокин
- 43
- 5
1
vote
0 answers
How to exlude multi applications when implementing VPN?
I am implementing VPN on my Android App.
I"m using this method to exlude proccess i don't want to go trow my tunnel :
builder.addDisallowedApplication(getPackageName());
builder.addDisallowedApplication("com.android.settings");
…

Jesus Dimrix
- 4,378
- 4
- 28
- 62
1
vote
0 answers
Problems making a "proxy" for Android with VPNService
For some reason I can't understand, when I'm parsing the buffer values, I almost never get the version as 4 (which would be the default for IPv4), and most of the time I get some random value like 10 or 0 instead. The same is true with the protocol,…

DiaDeTedio
- 31
- 2
1
vote
0 answers
ToyVPN Example with username and password credentials (PPTP)
I have this ToyVpn sample project and I want to test it.
and in order to connect to the vpn the ToyVPN needs:
(Server IP, Server port, Shared Secret)
but the proxy format that I have is different:
(Server IP, port, username, password)
it is known as…

Davie105
- 11
- 2
1
vote
0 answers
Android create a L2TP/IPSEC connection
Hello Android Community!
How can I setup a L2TP/IPSEC connection on android using this IPSEC/IKEV2 library ?
I didn't found any documentation about it. Also I am only able to setup a VPN connection using Open VPN but I want a solution for IPSEC…

MayankChoudhary
- 41
- 6
1
vote
1 answer
how to log/check network traffic through my vpn service app in android
I have read https://developer.android.com/guide/topics/connectivity/vpn but i have a few questions about it:
am i creating a vpn client according to the code i have pasted below, if so, where is the vpn server?
My vpn service is working(as i can…

mittal_sahil
- 33
- 6
1
vote
0 answers
VPN service: Tunnel interface write() from native lib does not fwd pkt to end applications
I am coding an app with a native (C/C++) lib to create a tunnel interface and inspect read/write pkts prior to forwarding via the actual physical interface. I am interfacing via JNI to create and manage tunnel as described in the documentation at:…

nsim
- 11
- 1
1
vote
0 answers
Create L2TP/IPSec VPN Client in Android Programically
I am working on an Android app using Android Studio and what I am trying to do is building a simple VPN client that implements and L2TP protocols.
I have googled and searched here in Stack Overflow and I have looked at the Android SDK VPN sample…

Noman Aziz
- 75
- 1
- 7
1
vote
0 answers
How to develop an android app that retrieves all the browsing information using VPN api?
Note: The app that I am trying to build will go into production. This is not for just practicing
I am trying to develop an app that needs to retrieve the websites visited by the user on an android device. Additionally, I want to retrieve the content…

premji012
- 31
- 3
1
vote
1 answer
Starting Android VPN service that is not rooted anywhere
I am looking to replicate the Ookla Speedtest displaying of data usage per application via the Android VPN service.
It appears they start a VPN service however they state that it is not routed through their servers.
How can this be done as you…

Seb
- 31
- 1
- 2
1
vote
0 answers
i want to read bytes from vpninterface and then write back to it
i have setup a vpn service and then configure a vpn interface.
private void setupVPN() {
try {
if (vpnInterface == null) {
Builder builder = new Builder();
builder.addAddress(VPN_ADDRESS, 32);
…

mani k
- 11
- 1
1
vote
0 answers
How to know when Android VPN prepare is ready without Activity?
When you want to start Vpn we can do :
VpnService.prepare(activity)
Then :
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
super.onActivityResult(requestCode, resultCode, data)
if (requestCode ==…

Jesus Dimrix
- 4,378
- 4
- 28
- 62