Does Jellybean 4.2 have an intention to connect to an already defined VPN?

(revised ... now I am running JB and still have the same problem as over a year ago)

I have Jellybean (4.2) installed on my Xoom and Galaxy S3 (CM10.1), and I'm trying to write a Tasker plugin to automatically connect to a PPTP or L2TP VPN whenever a wi-fi connection becomes active.

Unlike previous versions of Android, ICS finally allows you to define a VPN with a saved username and password, so it seems that basically everything is needed to support the new public intention, which means "Attempting to connect to $ {vpn}." However, if such an intention exists, I did not find any documentation for it. Can someone point me in the right direction? (package name, search magic phrase, etc.)?

+6
source share
1 answer

Are you referring to Always-On VPN? It does not work with intentions, at least without intentions created by applications. It uses vpn profiles. When the vpn profile is created in the Settings app. It can be installed as always on. Then the ConnectivityManager will automatically start the vpn connection described by the profile when the network connection is established. The connection manager explicitly checks for credentials in the keystore with the key LOCKDOWN_VPN . If they are present, he will download the profile. The only intentions that are used are to initialize the LockdownVPn instance. It registers the receiver and upon receipt of the intent, which is a system broadcast, if I remember correctly, the receiver is then unregistered after receiving the intent. For more information, you will need to find the source for ConnectivityManager and Vpn and LockdownVpn. Also, PPTP does not work with always on. PPTP profiles are explicitly filtered out when a profile is added to an Always-On Vpn profile. L2TP and IPSEC work.

Hope this helps.

+1
source

Source: https://habr.com/ru/post/906767/


All Articles