Is there any way to programmatically turn on airplane mode on non-rooted android? I used to use Tasker tasks to turn airplane mode on and off automatically when I needed it. Now, it seems, this requires root. But rooting my phone bans me from using Android Pay or any other SafetyNet-locked app. (The latest updates to SafetyNet even detect the new systemless root, and may even be triggered by an unlocked bootloader even on an unrooted phone.)

Is there any way I can reliably turn airplane mode on and off with Tasker or some other automated tool, without losing access to Android Pay?

(Bonus question: why on earth does Google consider turning on airplane mode to be such a dangerous feature that it's banned entirely on non-rooted devices?)
As I promised before to post an alternative option using Tasker and AutoInput plugin, here is the proceedure:


Firstly create and profile that suits your needs (i.e when to trigger airplane mode e.g at a specific time etc)


Task


Create a new task "New Task + "
You can name this Task Airplane_mode or anything.
Click "+" to add new Action


A1: Settings  ➡ Airplane Mode Settings

We need to add a task wait action for just about 1 or 2 seconds (to allow screen to load in time).

A2: Task ➡ Wait [Seconds:2]

A3: Plugin ➡ Auto input ➡  Action [ Go to the "Airplane Mode Settings" screen in your Android settings.


Swipe down on the notification bar and touch the "Add" button in the AutoInput notification.
Touch the "Airplane Mode" setting
Touch "Accept" in the notification and go back to Tasker. There select the "Airplane Mode" text and accept (tap on tick) these settings. 


A4: (Going back to original screen) Add an "AutoInput Global Actions" Tasker action. Plugin ➡ AutoInput ➡ Global action [Select the "Back" option]. Accept the setting (tap on the tick)




Tap back to exit from this task
Save this task and exit


Nb: This require screen to be unlocked as the previous workaround

Edit


AutoInput has a built-in option to unlock screen if it is disabled in tasker. Simply add this action to the top in the task:


A1: Go to new action &gt;&gt; Plugin &gt;&gt; AutoInput &gt;&gt; Unlock screen (note: some screen lock options are still not supported e.g fingerprint but its worth a try)

Acknowledgements


Toggle Airplane Mode At 1:20 PM