Method to pass username and password in VpnService.Builder

前端 未结 2 465
佛祖请我去吃肉
佛祖请我去吃肉 2021-02-05 05:37

I am developing the application in which I want to use VPN network. to create VPN network in device we need to configure it from (settings-wireless and network-VPN settings) men

相关标签:
2条回答
  • 2021-02-05 06:00

    It is possible using internal android.jar(com.android.internal) and hidden(@hide) API. Refer the below link:

    How to programmatically create a new VPN interface with Android 4.0?

    0 讨论(0)
  • 2021-02-05 06:05

    The VpnService you are talking about is not what you think. It's just a framework for you to create your own VPN solution. Once established, you'll get all communication on the network (IP) layer and you can do anything you want with it, e.g., encrypt it and send it to your server - the example for this is the ToyVpn project found in /samples/android-14/ directory. You also need a your own server side code to do the decryption and the necessary routing of the traffic.

    Unfortunately you can't set the built-in android VPN programmatically. The best you can do is to show a dialog to the user explaining how to set it and then pop up the system settings with the correct screen showing.

    0 讨论(0)
提交回复
热议问题