1. Download our Official Android App: Forums for Android!

Phone rooted, still can't enable or disable mobile data

Discussion in 'Android Apps & Games' started by Plecto123, May 17, 2016.

  1. Plecto123

    Plecto123 Newbie
    Thread Starter
    Rank:
    None
    Points:
    15
    Posts:
    20
    Joined:
    Mar 15, 2016

    Mar 15, 2016
    20
    0
    15
    Male
    Secure settings is installed and Tasker is set to disable mobile data when I shake the phone, but Tasker says "An error occurred while executing action". I've also enabled "Device Admistratior" for Secure Settings although I don't know if that would matter. What's wrong? :(
     

    Advertisement

  2. Thom

    Thom  
    VIP Member
    Rank:
     #21
    Points:
    1,318
    Posts:
    12,016
    Joined:
    Feb 16, 2011

    Feb 16, 2011
    12,016
    4,978
    1,318
    Male
    Software Developer
    Keene, NH USA
    Whenever you make a change you need to exit with a save before exit. It is the only way in Tasker to be sure that all aspects of what you are updating are known to all sections of Tasker. Whenever you get a "weird" result it is almost always because one element did not get changed with the update.

    You can also restart Tasker sometimes this makes a difference.

    You can also reboot the system sometimes this makes a difference.

    ... Thom
     
  3. Plecto123

    Plecto123 Newbie
    Thread Starter
    Rank:
    None
    Points:
    15
    Posts:
    20
    Joined:
    Mar 15, 2016

    Mar 15, 2016
    20
    0
    15
    Male
    Rebooting didn't seem to make a difference :(
     
  4. lareya

    lareya Lurker
    Rank:
    None
    Points:
    6
    Posts:
    7
    Joined:
    Feb 24, 2011

    Feb 24, 2011
    7
    3
    6
    Female
    To be clear, you are trying it in secure settings plug-in within Tasker? I ask, because some folks don't quite understand how to use plugins.
     
  5. Plecto123

    Plecto123 Newbie
    Thread Starter
    Rank:
    None
    Points:
    15
    Posts:
    20
    Joined:
    Mar 15, 2016

    Mar 15, 2016
    20
    0
    15
    Male
    Yes. Plug-in -> Secure Settings -> Actions -> Mobile data -> off.
     
  6. Svampsson

    Svampsson Lurker
    Rank:
    None
    Points:
    5
    Posts:
    5
    Joined:
    Apr 17, 2016

    Apr 17, 2016
    5
    0
    5
    I am also getting that error message every time I run the task, but it still toggles the data.

    I am on 5.0 though.
     
  7. electricpete

    electricpete Android Expert
    Rank:
     #62
    Points:
    393
    Posts:
    2,073
    Joined:
    Jan 7, 2012

    Jan 7, 2012
    2,073
    1,029
    393
    Male
    Electrical Engineer
    Make sure you check "use root" if that is in the dialogue

    Go into SU and make sure Tasker is allowed to get root.

    But still might not work because secure settings sometimes has problems with newer root.
    So next step is forget secure settings and use tasker run shell with linux shell commands:
    Run Shell: svc data enable ... with "use root" checked (turns data on)
    Run Shell: svc data disable ... with "use root" checked (turns data off)

    The above doesn't rely on secure settings and really should work (works fine for me).

    If all else fails for this command or other root commands, try temporarily disabling secure linux enforcing by doing this before attempting to turn data on/off
    run shell setenforce permissive (use root)

    ... and this after changing data state:
    run shell setenforce enforcing (use root)
    (you are more vulnerable to a range of attacks in permissive mode so it's important to set it back to enforcing when you're done).

    A great thread on using linux/tasker shell commands instead of secure settings here:
    https://www.reddit.com/r/tasker/comments/4goz99/how_to_replace_some_secure_settings_actions_with/
    In particular everything in the long list of settings for system, global, and secure are all available from shell command.
     
    #7 electricpete, May 18, 2016
    Last edited: May 18, 2016
    vosg and Thom like this.
  8. Plecto123

    Plecto123 Newbie
    Thread Starter
    Rank:
    None
    Points:
    15
    Posts:
    20
    Joined:
    Mar 15, 2016

    Mar 15, 2016
    20
    0
    15
    Male
    Thanks electricpete, worked like a charm! Tasker is not mentioned in SU by the way, I guess that might be the issue? Secure settings has root access though.
     
  9. electricpete

    electricpete Android Expert
    Rank:
     #62
    Points:
    393
    Posts:
    2,073
    Joined:
    Jan 7, 2012

    Jan 7, 2012
    2,073
    1,029
    393
    Male
    Electrical Engineer
    If you were able to get it to work with shell command, then tasker has no problem with root access. I would think it shows up with a green or grey icon in the su app list though (like my screenshot attached).

    The problem I heard is that secure settings is not being updated as android and chainfire's su app evolve. So parts of SS are breaking and it won't get any better unless the SS dev gets involved again. Hence the interest on Reddit for alternate ways to accomplish these things. Also it's good for our security to reduce the use of non open source root apps whenever possible.
     

    Attached Files:

Share This Page

Loading...