How to Change Preferred Network Type with Tasker [No Root]

In January of this year, Tasker made a significant announcement that it would allow users to perform core system tasks on Android without root privilege. Sounds like a fascinating idea, and to be blunt, the new changes have made things a lot easier for users who are still on the fence against rooting their devices. So, in this article, I bring you a comprehensive look at how Tasker is able to perform system-level tasks without root privileges. And to demonstrate this, I will show you how you can change your preferred network type with Tasker without root permission. Having said all that, let’s now go through the article and learn the steps in detail.

Change preferred network type with Tasker

Here, we’ve listed all the sections so you can jump to the relevant part in a jiffy. First, we explain the new permissions, then move on to the steps. Even if you are new to Android automation, you can follow this guide and learn how to use Tasker more effectively.

  1. ADB permissions explained
  2. Grant ADB Permissions (Single Process)
  3. Change preferred network type with Tasker

Automate Network Switching on Android

ADB permissions explained

Before we go through the steps, I want to discuss the new ADB permissions that you will grant in this tutorial. the first is WRITE_SECURE_SETTINGS which allows an application read or write secure system settings. This permission is not available for third-party applications, so you need ADB to manually allow Tasker to interact with system settings.

Next is the ADB WiFi permission. It is a sensitive type of permission and users are generally discouraged from granting this permission. What this permission does is permanently open a port on your Android device that can be accessed by any other app installed on your smartphone. That said, you will always get a security prompt before an application can access that port. then if you get a USB debug prompt out of nowhere — that you have NOT manually invoked — then cancel it instantly. Malicious apps can use this port to control your device if allowed.

Now let’s get to what this permission does. Well as I said above the command actively keeps the port open on your device and Tasker uses it to send ADB shell commands within the device itself. The wireless ADB feature is intended for PC-smartphone wireless tethering, but here, Tasker uses it internally (through the open port) to send ADB commands without the need for a PC. And that’s why you can perform tasks in Tasker that previously required root permission.

So, to summarize, DO NOT pass the debug permission if a prompt appears out of nowhere. Only if you manually invoked the command, just allow. In case you want to remove all ADB authorizations, you can do so in Settings -> About Phone -> Developer Options -> Revoke USB Debug Authorization. Also, you can disable “Wireless ADB Debugging” to permanently disable the port.

Grant ADB Permissions (Single Process)

1. First, install the Tasker app ($3.49) on your Android device. It’s a paid app, but worth the price.

2. Next, configure ADB on your computer and connect your Android device to the computer. To verify the connection, run adb devices in the Terminal/CMD window and press enter. If you return a serial number then you’re good to go.

Grant ADB Permissions (Single Process)

3. Now, you need to run the below command to grant Write Secure Settings permission to Tasker. This will not return any outputbut changes will be made.

adb shell pm grant android.permission.WRITE_SECURE_SETTINGS

Grant ADB Permissions (Single Process)

4. Next, you need to grant ADB WiFi permission. Run the command below and hit enter. A prompt will appear on your Android device. Make sure to activate “Always allow from this computer” and then tap “Allow”.

adb tcpip 5555

Grant ADB Permissions (Single Process)

5. Once this is done, disconnect your device from the computer. You have granted all the necessary permissions and now everything can be done on the Android device.

Change preferred network type with Tasker

Now that you’ve learned and granted all the necessary permissions, let’s go through a simple example: change the preferred network type on Android devices with Tasker. You guys can do other things too, like turn mobile data on/off, airplane mode, WiFi and more. However, for this article, we will stick to this simple guide.

1. Open Tasker and grant the application initial permissions. After that, go to the “Tasks” and tap the “+” button. Choose a name here, for example I set “4G” and then tap the “Done” button.

Change preferred network type with Tasker

2. Then tap the “+” button and search for “network”. Here, open “mobile network type“.

Change preferred network type with Tasker

3. Then open the drop-down menu and choose “4G” or whatever your network type preference is. Now go back and you have successfully created a task. If you like, you can add more operations to a task. For example, I disable WiFi also when I turn on 4G.

Change preferred network type with Tasker

4. Just to complete the tutorial, I’m doing another task called “2G/3G” so I can easily switch between network types. Follow the same steps as above: Tap the “+” button and create a task. Then search for network and choose “2G and 3G” from the drop-down menu.

Change preferred network type with Tasker

5. You’re almost done. You can test the tasks by tapping the “Play button” in the lower left corner. If the network changes as per the configuration, you are good to go.

How to change preferred network type with Tasker (no root)

6. You can also create a profile and automate the task based on time, home WiFi connection and other conditions. However, here I am not automating the task, but creating a toggle in the Quick Settings menu. Open “Tasker” and go to “preferences“. Here, switch to the “Action” tab.

Change preferred network type with Tasker

7. Now under Quick Settings Tasks, tap the “search” button and choose the task. Do the same for another task as well.

Change preferred network type with Tasker

8. Finally, open the Quick Settings panel and tap the edit button. Here, look for Tasker toggles and move them to the Quick Settings menu. And there it is. You can simply tap the button to activate the task and change the network type instantly. Keep in mind, due to some bug, both toggles always appear active, but this is not the case. You need to tap on it to activate the task.

Change preferred network type with Tasker

Learn new ADB permissions and change preferred network type with Tasker on Android

So that’s all. You only need to enable two ADB permissions and you will be able to perform many operations with Tasker that previously required root. All you have to do is: don’t grant debug permission to random prompts. Also, you can toggle system settings, control overlays, manage permissions directly from Tasker without needing root. Anyway, that’s all for us. If you are experiencing any issues, comment below and let us know. We will certainly try to help you.

Leave a Reply

Your email address will not be published.