6

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?)

  • 1
    Have you tried Automate plugin? Some folks have had success with it? I think it can drop-down the notification tray and play pre-recorded gestures. – Firelord Feb 6 '17 at 19:00
  • @Firelord AFAIR toggling airplane mode was moved out of user-space with some JellyBean version (4.2 IIRC), so I doubt any automation app can do that without root. But I might be wrong. – Izzy Feb 6 '17 at 20:01
  • 1
    @Izzy true, but Automate provides an option to record user's activity and play it as an automation. That is to say, you can record dropping down notification tray, going to quick tiles and toggling Airplane mode tile. That Automate can record and play. – Firelord Feb 7 '17 at 10:43
  • 1
    @Firelord I've missed that part, true – it's rather "macro recording and replay", that might indeed work. Which makes that stupid "security protection" look even more stupid (I never understood why that decision wasn't left to the user). – Izzy Feb 7 '17 at 11:01
  • There should be @beeshyams posting a MacroDroid answer under this question :) – iBug Oct 7 '17 at 7:09
1

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)

enter image description here

  • 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 >> Plugin >> AutoInput >> Unlock screen (note: some screen lock options are still not supported e.g fingerprint but its worth a try)

Acknowledgements

1

You can achieve that with Tasker + Auto input combo or another third-party application called Airplane Mode PRO ($1.78). Alernatively get Schedule Airplane Mode

Airplane Mode PRO allows you to set up various automatic triggers for Android's Airplane Mode. This app is the only one that also works on Android versions higher than Jellybean 4.2, such as Jellybean 4.3, Lollipop 5.0 and Marshmallow 6.0 and still does NOT require a rooted device.

Features:

• Support for automation and third-party launchers

• Separate shortcuts for toggling, enabling and disabling

• Toggle via a notification

• Enable airplane mode while a specific app is running

• Enable / Disable at a specific time

• Toggle when charger is dis/connected

• Enable when a certain battery percentage is reached (Any percentage can be set)

• Enable when a certain battery temperature is reached

• Toggle via a home screen shortcut (One click only)

enter image description here enter image description here

Note: The workaround requires screen to be on

enter image description here

Disclaimer !! Iam by no means affiliated with that application(s) but came across it, so I thought it was a good workaround to the addressed problem.

  • 1
    I will hopefully post a less controversial method with Tasker + AutoInput by a bit busy now :( – xavier_fakerat Sep 7 '17 at 4:56
  • When I try to open the link to Airplane Mode PRO, I see "We're sorry, the requested URL was not found on this server.". Does it mean that app was deleted from Google Play? – ks1322 Mar 23 at 20:07
  • @ks1322 check the new link or alternatively try the other app – xavier_fakerat Mar 24 at 20:24
0

If you prefer a simple shell script

Edit [ IGNORE THIS WRONG ANSWER, IT'S FOR ROOT ACCESS]

Just read the non-root part of question again.

Turn on "Show Touches" in Developer Options and write down the exact locations for

  • Status bar before sliding down

  • Status bar after opened ( slide to point )

  • Airplane mode toggle

  • Data Toggle ( Optional )

Once you have all coordinates you can build a script (.sh)

Heres one i used,

echo 'Swipe Down Notification'
input swipe 400 40 450 580 1000
echo 'Swipe Down Quick Actions'
input swipe 400 40 450 580 1000
echo 'Toggle Airplane Mode'
input tap 280 573
echo 'Wait for toggle'
sleep 10.0
echo 'Repeat for new IP Address'
input swipe 400 40 450 580 1000
input swipe 400 40 450 580 1000
input tap 280 573
echo 'FINISHED IP REFRESH'
sleep 2.0

Swipe start is X400,Y40 end is X450,Y580 duration is 1s.

Using the obove .sh command (input) you can do a lot of the user actions including entering text, opening applications with am start etc ..

others are

END A CALL
 input keyevent 6

 PRESS HOME
 input keyevent 3

 OPEN CAMERA
 input keyevent 27

 PRESS MENU
 input keyevent 82

 ENTER NUMBER (1)
 input keyevent 8

 ENTER SOME TEXT Hi i am some... SEPERATOR  %s
 input text 'Hi%si%sam%ssome%stext%sto%sbe%swritten%sby%suser'

 SWIPE FORMAT IS, START POINT - END POINT - msDURATION
  input swipe 500 800 500 800 5000

Why is it so dangerous to programmatically control a safety feature ? Imagine being on a plane going to Hawaii, and all of a sudden your application decides to turn Airplane mode OFF mid flight, it interferes with the radio signal of the plane and you end up in Mexico ??

Haha, Also it refreshes your connection with the radio tower your receiving a signal from, it changes your IP Adress and gives you a new network ID, this could be abused also and therefore it's best to not allow programmatic access for the user.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.