I am writing system app, which sets global http proxy via
Settings.Global.putString(getContentResolver(), Settings.Global.HTTP_PROXY, "127.0.0.1");
How can I revert this change?
This don't work:
Settings.Global.putString(getContentResolver(), Settings.Global.HTTP_PROXY, null);
Any ideas?
Thanks in advance
At the bottom of the screen, click Show advanced settings… This will bring up the Windows Internet Options. Click the Connections tab and then LAN Settings. In the Proxy server settings, uncheck the box that says Use a proxy server for your LAN.
Global Proxy ConfigurationExecutes a proxy autoconfiguration script to determine the best proxy to use to retrieve a specified URL.
Andrews answer works but only for rooted devices, here's my solution for non-rooted devices.
I added the proxy with the following command:
adb shell settings put global http_proxy <ip>:<port>
Update: To remove it you can use the following command (thanks to Rohit Patel for providing this):
adb shell settings put global http_proxy :0
To remove it I used these commands:
adb shell settings delete global http_proxy
adb shell settings delete global global_http_proxy_host
adb shell settings delete global global_http_proxy_port
Restart the device and you should be good to go
Below is the normal command to remove proxy settings which will be applied without device reboot. You can use it in your script or app relatively.
adb shell settings put global http_proxy :0
You don't need to run all three of those commands. It will work with just the one command above. All proxy settings will be removed instantly.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With