Hey there,
so after recent problems with toggle data plugin/magisk for switching mobile data i decided to get toggles for mobile data and gps without other tools than tasker.
After some readings here and on stackoverflow i managed to get solutions for both without 3rd party apps.
So here it goes:
Mobile data toggle
Type - > RUN SHELL (use root)
Command:
Code:
setenforce permissive;
svc data enable; (or disable for off)
setenforce enforcing;
GPS location provider toggle
Type - > RUN SHELL (use root)
Command:
(for high accuracy)
Code:
settings put secure location_providers_allowed +gps;
settings put secure location_providers_allowed +network;
(for batery saving from high accuracy)
Code:
settings put secure location_providers_allowed -gps;
(for completly off from high accuracy)
Code:
settings put secure location_providers_allowed -gps;
settings put secure location_providers_allowed -network;
the toggle of mobile data will probably work with other solution for 2g toggle posted around here.
Solution tested on HTC10 with Nougat 7.0.
Hope it helps.
Plomiwn said:
Hey there,
so after recent problems with toggle data plugin/magisk for switching mobile data i decided to get toggles for mobile data and gps without other tools than tasker.
After some readings here and on stackoverflow i managed to get solutions for both without 3rd party apps.
<text removed from quote>
Click to expand...
Click to collapse
You tested this in Android 7.0,in 2017. I can confirm this still works in 9.0, on my OP6 running OOS :good:
Nothing beats shell commands - so damn effective, love them :highfive:
Kind Regards
TwinAdk
Here is the XML file for toggling GPS :highfive:
Run the task when needed, it take the current GPS status into consideration. The XML should be imported into Tasker.
Errors are logged to the clipboard (respecting existing content), and a flashing message will provide you with the result of the shell commands.
Full location is enabled (triangulation via GPS, wifi networks and cell towers).
This draws the most power but gives you the best location fix.
The Autolocation app is recommended for GPS tricks, and Autolocation for location-aware tasker tricks. None of these two apps can flip the GPS switch though... Previously I used the Secure settings app (AWESOME app) - but sadly it crashes constantly on later android versions (8 and 9 in my experience) - and all alternatives costs money.
Now we can flip that GPS switch ourselves. Why didn't I look into this earlier :silly:
God I love Android! :victory:
Kind Regards
TwinAdk
This is awesome.
I've been searching for a solution for Android Pie and this works perfect for me.
Plomiwn said:
Hey there,
so after recent problems with toggle data plugin/magisk for switching mobile data i decided to get toggles for mobile data and gps without other tools than tasker.
After some readings here and on stackoverflow i managed to get solutions for both without 3rd party apps.
So here it goes:
Mobile data toggle
Type - > RUN SHELL (use root)
Command:
Code:
setenforce permissive;
svc data enable; (or disable for off)
setenforce enforcing;
When I made a task in Tasker with this code when task is run my phone are restart and the task is disappear. It is normal?
Click to expand...
Click to collapse
gonzolex said:
Plomiwn said:
Hey there,
so after recent problems with toggle data plugin/magisk for switching mobile data i decided to get toggles for mobile data and gps without other tools than tasker.
After some readings here and on stackoverflow i managed to get solutions for both without 3rd party apps.
So here it goes:
Mobile data toggle
Type - > RUN SHELL (use root)
Command:
Code:
setenforce permissive;
svc data enable; (or disable for off)
setenforce enforcing;
When I made a task in Tasker with this code when task is run my phone are restart and the task is disappear. It is normal?
Click to expand...
Click to collapse
You don't need root to do that.
Just give permission to task via adb:
adb shell pm grant net.dinglisch.android.taskerm android.permission.WRITE_SECURE_SETTINGS
and you can active/deactivate secure settings by native action of tasker.
Click to expand...
Click to collapse
Guys anyway to switch between location modes in Tasker.
I'm rooted and GPS on/off doesn't seem to work.
That would be because gps on/off no longer exists. You need to switch locating mode to high accuracy or device only from battery saving.
IMHO, it's easiest to do this using AutoTools' secure setting. This task on the AutoTools forum would get you started.
It can also be done by modifying the secure setting entry using a tasker shell command such as:
This command disables:
settings put secure location_providers_allowed ' '
This command enables:
settings put secure location_providers_allowed gps,wifi,network
You should read through Not Enough Tech's shell commands post to get an idea what's happening with this type of command.
Hi.
I would like to know how to turn tethering on and off on Android 8 (Oreo). I followed the instructions: I installed the plugin toggle tethering and rebooted the system, but when I activate the task me this error appears:
12.50.56/E FIRE PLUGIN: Toggle Tethering / com.twofortyfouram.locale.intent.action.FIRE_SETTING: 3 bundle keys
12.50.56/E Toggle Tethering: plugin comp: com.matejdro.taskertethercontrol/com.matejdro.taskertethercontrol.TaskerReceiver
12.50.56/E add wait type Plugin1 time 7
12.50.56/E add wait type Plugin1 done
12.50.56/E add wait task
12.50.56/E Error: null
12.50.56/E java.lang.reflect.InvocationTargetException: null
java.lang.NullPointerException: OnStartTetheringCallback cannot be null.
Can somebody help me?
I would love to know the answer to this as well
thebaum said:
i would love to know the answer to this as well
Click to expand...
Click to collapse
yes i have same proble need support
Before any app could toggle tethering, it must work manually. That is what you'll need to sort out first.
Then the app had to be updated for changes.
If you are able to manually toggle tethering, you probably can use AutoInput to toggle it until apps catch up to O.
"Good judgment comes from experience, and a lot of that comes from bad judgment." - Will Rogers
I was looking for a way to auto hide the navbar without rooting the phone and I found this app:
https://play.google.com/store/apps/details?id=in.tsdo.elw
If you grant the app permission with adb shell, it can hide the navbar in the apps you choose.
Maybe this is useful for some.
Emui already has a hide feature built into it. I use this everyday.??
No nav bar
Without using 3rd party app you can do this directly from EMUI settings:
Settings > Smart assistance > System navigation > Navigation bar > Switch on Navigation bar.
mhamdto said:
Without using 3rd party app you can do this directly from EMUI settings:
Settings > Smart assistance > System navigation > Navigation bar > Switch on Navigation bar.
Click to expand...
Click to collapse
The app that I linked auto-hides the navbar.
Is your advise doing the same?
tr1cky1 said:
The app that I linked auto-hides the navbar.
Is your advise doing the same?
Click to expand...
Click to collapse
I'm afraid that it doesn't auto hides it and you still have to click on the small arrow to hide it manually.
mhamdto said:
I'm afraid that it doesn't auto hides it and you still have to click on the small arrow to hide it manually.
Click to expand...
Click to collapse
At least with the app that I linked, it auto hides the nav bar and that is what I wanted because I didn't want to always press a button to hide the navbar.
You got that right :good:
I wish they would add this feature to the status bar.
Connorsdad said:
I wish they would add this feature to the status bar.
Click to expand...
Click to collapse
If you mean the notification bar...then use Nova Prime and you can hide it and swipe down to show it. :victory:
I like the stock launcher
Is there any way to have expanded desktop (hiding the notification bar) without changing launcher?
jaseman said:
If you mean the notification bar...then use Nova Prime and you can hide it and swipe down to show it. :victory:
Click to expand...
Click to collapse
wisemanwizz said:
Is there any way to have expanded desktop (hiding the notification bar) without changing launcher?
Click to expand...
Click to collapse
In my case, mate 10 normal, I use the FPS as navigation (home, back, recent) so I hide nav buttons and notification bar in all apps except home (where I can see notifications, battery and time) using this adb shell command (root is not necessary):
Hide navigation/notification bar on all apps but home launcher
settings put global policy_control immersive.full=apps,-com.huawei.android.launcher
Return to default behavior:
settings put global policy_control null*
Sorry for being such a newb but how do I run that command?
I downloaded an app from the play store and executed it the way I thought would work but nothing happened.
Connorsdad said:
Sorry for being such a newb but how do I run that command?
I downloaded an app from the play store and executed it the way I thought would work but nothing happened.
Click to expand...
Click to collapse
Probably you downloaded and used terminal emulator.
These commands doesn't work on terminal unless you are root.
So, to use adb shell command you need:
Download and install Minimal ADB and Fastboot - https://forum.xda-developers.com/showthread.php?t=2317790
Enable developer options on your mate 10 (go to "Settings > System > About phone" and touch a few times over "Build Number").
Under the now visible developer options (go to "Settings > System > Developer options") you should enable USB debugging.
Open a windows command prompt and navigate to the directory where you have installed Minimal ADB and Fastboot, you should see adb.exe within this directory.
If so, type "adb devices" on your windows command prompt and hit enter.
It'll start adb daemon and no devices will be listed under "List of devices attached".
Now connect your USB cable to PC and to your Mate 10 (it is recommend to have Huawei hisuite installed to have the proper drivers).
If your pc identified your device correctly, a prompt will appear on your mate 10 asking you to allow the USB debugging connection. Hit Allow.
Now, type again "adb devices" on your windows command prompt and hit enter.
An ID should appear under "List of devices attached". If not, you should double check driver and confirm that "USB debugging" is ON in Developer options and reconnect USB cable on Mate 10.
If you see the ID, now type "adb shell" on prompt and hit Enter. You should see a prompt with a $ sign on your windows command prompt.
There you can type the commands from previous post.
superandroid2011 said:
Probably you downloaded and used terminal emulator.
These commands doesn't work on terminal unless you are root.
So, to use adb shell command you need:
Download and install Minimal ADB and Fastboot - https://forum.xda-developers.com/showthread.php?t=2317790
Enable developer options on your mate 10 (go to "Settings > System > About phone" and touch a few times over "Build Number").
Under the now visible developer options (go to "Settings > System > Developer options") you should enable USB debugging.
Open a windows command prompt and navigate to the directory where you have installed Minimal ADB and Fastboot, you should see adb.exe within this directory.
If so, type "adb devices" on your windows command prompt and hit enter.
It'll start adb daemon and no devices will be listed under "List of devices attached".
Now connect your USB cable to PC and to your Mate 10 (it is recommend to have Huawei hisuite installed to have the proper drivers).
If your pc identified your device correctly, a prompt will appear on your mate 10 asking you to allow the USB debugging connection. Hit Allow.
Now, type again "adb devices" on your windows command prompt and hit enter.
An ID should appear under "List of devices attached". If not, you should double check driver and confirm that "USB debugging" is ON in Developer options and reconnect USB cable on Mate 10.
If you see the ID, now type "adb shell" on prompt and hit Enter. You should see a prompt with a $ sign on your windows command prompt.
There you can type the commands from previous post.
Click to expand...
Click to collapse
Thanks for your help
I use the dot for navigation, is it possible to keep this ?
If not what is FPS ?
Connorsdad said:
Thanks for your help
I use the dot for navigation, is it possible to keep this ?
If not what is FPS ?
Click to expand...
Click to collapse
Yes, "DOT" works normal.
FPS = FingerPrint Scanner, in case of mate 10 normal, I use the front FPS the same way as the "DOT".
superandroid2011 said:
Yes, "DOT" works normal.
FPS = FingerPrint Scanner, in case of mate 10 normal, I use the front FPS the same way as the "DOT".
Click to expand...
Click to collapse
Sorry, I mean can I have the DOT on the screen all the time (Stock behaviour) instead of having to swipe down from the top ?
I want to disable the nav and status bar due to screen burn on every device I've ever owned.
Connorsdad said:
Sorry, I mean can I have the DOT on the screen all the time (Stock behaviour) instead of having to swipe down from the top ?
I want to disable the nav and status bar due to screen burn on every device I've ever owned.
Click to expand...
Click to collapse
I test here and DOT stays fixed even with hidden nav and status bar.
Screen burn? Do you have the Normal or the Pro version?
Mate 10 Pro is OLED and can suffer from screen burn.
Mate 10 non PRO is LCD and is safe from screen burn.
superandroid2011 said:
I test here and DOT stays fixed even with hidden nav and status bar.
Screen burn? Do you have the Normal or the Pro version?
Mate 10 Pro is OLED and can suffer from screen burn.
Mate 10 non PRO is LCD and is safe from screen burn.
Click to expand...
Click to collapse
Ah, DOT dissapears for me unless I pull down the status bar :/
I have the PRO.
Still, better than it was before, thanks a lot for helping