Jellybean 4.2 是否有连接到已定义 VPN 的意图?
(已修改...现在我正在运行 JB,并且仍然遇到与一年多前相同的问题)
我在我的 Xoom 和 Xoom 上安装了 Jellybean (4.2) Galaxy S3 (CM10.1),我正在尝试编写一个 Tasker 插件,以便在 wi-fi 连接激活时自动连接到 PPTP 或 L2TP VPN。
与以前版本的 Android 不同,ICS 最终允许使用保存的用户名和密码来定义 VPN。密码,所以看起来基本上一切都已准备就绪,可以支持新的公共意图,这意味着“尝试连接到 ${vpn}”。但是,如果存在这样的意图,我还没有找到任何相关文档。有人可以指出我正确的方向吗? (包名称、要搜索的神奇短语等)?
(revised... now I'm running JB, and still have the same problem that I did more than a year ago)
I have Jellybean (4.2) installed on my Xoom & Galaxy S3 (CM10.1), and I'm trying to write a Tasker plug-in to automatically connect to a PPTP or L2TP VPN whenever a wi-fi connection becomes active.
Unlike previous versions of Android, ICS finally allows VPNs to be defined with saved username & password, so it looks like basically everything is in place to support a new public Intent that means, "Attempt connection to ${vpn}". However, if such an intent exists, I haven't found any documentation for it. Can someone please point me in the right direction? (package name, magic phrase to search for, etc)?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您指的是永远在线 VPN 吗?它不适用于意图,至少不适用于从应用程序生成的意图。它使用 VPN 配置文件。在“设置”应用程序中创建 VPN 配置文件时。可以将其设置为始终打开。当建立网络连接时,ConnectivityManager 将自动启动配置文件描述的 VPN 连接。连接管理器使用密钥
LOCKDOWN_VPN
显式检查密钥库中是否存在凭证。如果它们存在,它将加载配置文件。唯一使用的意图是初始化 LockdownVPn 实例。它注册一个接收器,并在收到一个意图后,如果我没记错的话,这是一个系统广播,一旦接收到意图,接收器就会被取消注册。您必须查看 ConnectivityManager 和 Vpn 以及 LockdownVpn 的源代码以获取更多详细信息。而且 PPTP 不能在永远在线的情况下工作。将配置文件添加为始终在线 VPN 配置文件时,PPTP 配置文件将被显式过滤掉。但 L2TP 和 IPSEC 可以工作。希望有帮助。
Are you referencing Always-On VPN? It doesn't work with intents at least not intents generated from apps. It uses vpn profiles. When a vpn profile is created in the Settings app. It can be set as always on. The ConnectivityManager will then automatically launch the vpn connection described by the profile when a network connection is established. The connectivity manager explicitly checks for the presence of credentials in the keystore with the key
LOCKDOWN_VPN
. If they are present it will load the profile. The only intents that are used are in the initializing of the LockdownVPn instance. It registers a receiver and upon receipt an intent, which is a system broadcast if I remember correctly, the receiver is then unregistered once the intent has been received. You would have to look in the source for the ConnectivityManager and Vpn and LockdownVpn for more details. Also PPTP doesn't work with always-on. PPTP profiles are explicitly filtered out when adding a profile as an Always-On Vpn Profile. L2TP and IPSEC work though.Hope that helps.