当前位置: 动力学知识库 > 问答 > 编程问答 >

popup - ICS VpnService pop up dialog

问题描述:

I am trying to write a VPN app using VpnService. I started my app based on the sample ToyVpn. It seems to work fine but I am wondering if there is a way to get rid of the pop up dialog when I click connect. I am hoping that I could just click "connect" and it would start without having to click the "I trust this application..." check box and "Ok".

Thanks.

网友答案:

I don't think it's possible. They seem to be very careful about this class. If you take a look at the documentation you can see it says:

Letting applications intercept packets raises huge security concerns. A VPN application can easily break the network. Besides, two of them may conflict with each other. The system takes several actions to address these issues. Here are some key points:

  • User action is required to create a VPN connection. [emphasis mine]
  • There can be only one VPN connection running at the same time. The existing interface is deactivated when a new one is created.
  • A system-managed notification is shown during the lifetime of a VPN connection.
  • A system-managed dialog gives the information of the current VPN connection. It also provides a button to disconnect. The network is restored automatically when the file descriptor is closed. It also covers the cases when a VPN application is crashed or killed by the system.

Since it says that user action is required to create the VPN connection, I assume they mean this is something you cannot control yourself.

分享给朋友:
您可能感兴趣的文章:
随机阅读: