0

According to Android docs, the VpnService.Builder.setHttpProxy method has been added in API level 29. Which is fine. But the setHttpProxy method needs and object for ProxyInfo class, which is deprecated in API level 22.

Now I need to use the buildPacProxy method of the ProxyInfo class, which isn't working for me.

Can anyone please help me set a PAC URI to the VPN service by any alternate way? My end goal is to apply a PAC Uri to the device, which will monitor all the device traffic. I was thinking of using a VPN to apply the PAC Uri, bu creating a fake VPN, which does not connect to any server.

Any help would be appreciated.

Mayur More
  • 951
  • 2
  • 15
  • 37

1 Answers1

0

In response to the first part of your question, android.net.ProxyInfo is currently not actually marked deprecated (see the source file in the master branch). In fact, it was "undeprecated" in 2015, see this commit.

So this looks just like an error in the documentation.

ecdsa
  • 542
  • 3
  • 12
  • Thanks for the explanation. But I am more concerned about how can I set the PAC uri to the device level. I tried setting pac to vpn and it worked on emulator, although, the same code did not work on the actual device (I have been using android 10 device). – Mayur More Mar 14 '20 at 07:43