我正在尝试使用 VpnService 编写一个 VPN 应用程序。我基于示例 ToyVpn 启动了我的应用程序。它似乎工作正常,但我想知道当我单击连接时是否有办法摆脱弹出对话框。我希望我可以单击“连接”,它会启动而无需单击“我信任此应用程序...”复选框和“确定”。
谢谢。
我正在尝试使用 VpnService 编写一个 VPN 应用程序。我基于示例 ToyVpn 启动了我的应用程序。它似乎工作正常,但我想知道当我单击连接时是否有办法摆脱弹出对话框。我希望我可以单击“连接”,它会启动而无需单击“我信任此应用程序...”复选框和“确定”。
谢谢。
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:
Since it says that user action is required to create the VPN connection, I assume they mean this is something you cannot control yourself.