banner



How To Set Proxy Settings In Android

If you're a mobile engineer, during both development and testing you probably employ some of the well-nigh common tools out in that location to debug, intercept or rewrite your network calls, like Charles Proxy or Fiddler.

You will as well probably find the procedure of setting upwardly the proxy in your devices quite annoying: go to Settings > Network Settings > Select your WiFi network > Change Network > Add proxy. Every. Unmarried. Fourth dimension. Phew!

If y'all're working with a gear up of dissimilar devices, you probably also noticed small differences between Android versions, manufacturers, etc., that might add or modify the steps you take for setting up the proxy.

There's a pocket-size adb control you can run from your Terminal to enable a global proxy on your connected device:

          adb shell settings put global http_proxy YOUR_IP:YOUR_PORT        

But this won't give y'all any visual indicator to know whether the device is using a proxy or not. Information technology as well requires the device to be connected to a computer with adb installed every unmarried time y'all want to enable or disable the proxy… which probably makes using this workaround not the most ideal solution.

Well, I have good news for you.

Introducing Proxy Toggle

Proxy Toggle is a small utility application compatible with Android 5.0 and above that volition allow you to quickly enable and disable your proxy settings, as well as unifying and simplifying the process across platform versions, devices, manufacturers, etc.

Proxy Toggle allows y'all to configure your global proxy with ane tap

Easy setup: just add your desired IP and port, enable the proxy and voilà! all done, your whole device will be proxied.

Making information technology even easier

I know this is all exciting news. But I besides experience that having to open the app every fourth dimension y'all want to enable the proxy might be also a long procedure… right?

That's why I besides added two optional shortcuts for you to use: a home screen widget and a quick settings tile.

Home Screen Widget

This shortcut's very helpful for enabling and disabling your terminal used proxy quickly from your home screen.

To add the widget, yous'd normally long-press your home screen (depending on your launcher), select Add Widget and whorl down on your app list until you see the Proxy Toggle widget.

The habitation screen widget volition configure the last used proxy automatically

That's it! Toggle your proxy on and off with a single tap!

Quick Settings Tile

If your device is running Android seven.0 or higher, you'll have access to another amazing shortcut: a Quick Settings Tile. This shortcut will live inside your Notification Drawer, side by side to some other handy shortcuts like WiFi, Location, Bluetooth, Airplane Style, etc.

To enable information technology, merely expand your Navigation Drawer, click on the Edit icon and drag the Proxy Toggle icon wherever yous want to place it.

In one case enabled, the quick settings tile is a bully shortcut for toggling your proxy

Done! Y'all can toggle on and off your proxy without even leaving the current app!

Annotation: if yous have any ongoing network calls, they might accept a few seconds to complete and update with the new setting.

All that glitters is non golden

Although the app perfectly accomplishes its goal and makes our life easier, there's a couple of caveats that I want to highlight most this shiny app.

Using organization restricted permissions

The app will make apply of Settings.Global. Since this is a arrangement setting, it'south unremarkably a read-only setting. This small inconvenience is bypassed by granting the app WRITE_SECURE_SETTINGS restricted permission.

Note: this is a protected permission that only Arrangement apps should be granted. Be extra careful when you grant this permission for apps from unknown sources.

I know this might enhance some concerns, and I sympathize them.
That's why I decided to open-source the projection: to prove that it's completely safe to grant this permission, as yous volition have complete command and knowledge of what's going on backside the scenes.

Granting arrangement restricted permissions

Since this is a restricted permission, we can't request information technology on runtime as we would normally do, and then yous'll demand to manually grant information technology from our computer.

If you just desire to install the app without edifice it from Android Studio, at that place'south a small script that volition be bundled with the app. Simply download the zero file and execute the installAndGrantPermission.sh script.
Alternatively, you tin manually install the app past running adb install -yard App.apk on your Final.

To grant this permission in one case the app is already installed, connect the device to your computer and execute the following control on your Terminal:

          adb shell pm grant com.kinandcarta.create.proxytoggle android.permission.WRITE_SECURE_SETTINGS        

Be careful when uninstalling the app

Sadly, equally developers, we can't run whatsoever code when the app is being uninstalled. Therefore, uninstalling the app with the proxy enabled will permanently leave your device with this setup (as information technology's a Settings.Global configuration!).

You should make certain the proxy is disabled before uninstalling the app. Since nosotros can't guarantee this is going to happen, there's also the uninstallAndCleanUp.sh script for making certain everything is in a clean land after uninstalling the app.

Alternatively, you could run the following commands on your Concluding to clean upwards the proxy setting:

          adb beat out settings delete global http_proxy
adb shell settings delete global global_http_proxy_host
adb crush settings delete global global_http_proxy_port

Convenience at your fingertips

Proxy Toggle makes information technology easier to set up a global proxy on any Android telephone, besides as providing dissimilar shortcuts for enabling and disabling the proxy with a single tap on the screen. I promise this tool will exist as useful to your team every bit it'south been to our internal apps team, both developers and testers!

Y'all can download the latest version from here, or clone the project from Github.

Many cheers to the unique and amazing Flor Novello for her invaluable aid with the app design!

How To Set Proxy Settings In Android,

Source: https://medium.com/kinandcartacreated/how-to-easily-proxy-your-android-device-e2ba907de4d9

Posted by: laniganbeetunt.blogspot.com

0 Response to "How To Set Proxy Settings In Android"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel