[GUIDE][Difficulty: Beginner]Switch phone on/off using a flipcase

Search This thread

Follow_and_Feel

Senior Member
Apr 7, 2014
528
216
Montabaur
Hello guys,

I was totally stunned, when I saw that there's a member lead tasker forum. I love tasker and couldn't imagine a phone without it.
As I want to spread my thoughts here are several profiles coming for you :)


Requirements

  1. Secure Setting


What does the script do?

Simple. It turns on your phone, when you open your flip case (or e.g. take it out of your pocket) and turns it off, when you're on the lockscreen and approximity sensor is cover (e.g. put it back in your pocket and/or close your flip cover).

Let's get started

Profile 1

Code:
[B] 1. State -> Approximity Sensor[/B] [I]check reverse
[/I] 2.[B] Enter task and name it[/B] [I]"turn display on"[/I] for example. Add the action[B] Plug-In --> Secure Settings --> Configuration --> Wake Device[/B].[I](Choose Wake Type Screen Bright; Duration 5 seconds)[/I]

Now exit the task section and add to the contexts of this profile:

- State --> Display State Off
- App --> Dialer App [your phone's dialer app]; Check reverse

Done


Profile 2

Set up a new profile

Code:
[B]State --> Approximity Sensor[/B]
Enter a task and name it for example [I]"display off"[/I], go to plug-ins --> Secure Settings --> Lock device [I]You have to enable device adming and grant Secure setting Device admin privileges[/I]
Exit the task and add to the contexts of this profile

[B]- State --> Variable value[/B]: Conditions %DISPLAYOFF ~ 1
-[B] App --> Dialer App[/B]; [I]Check reverse[/I]

Done


Profile 3


Code:
[B]Event --> Display --> Display on[/B]
Add the task [B]Variables --> Set Variables[/B]: [I]Name %DISPLAYOFF to 1[/I]

Done


Last Profile

Code:
[B]Event --> Display --> Display Unlocked[/B]
Add the task and name it "display unlocked" for example: [B]Variables --> Set variable;[/B] [I]%DISPLAYOFF to 0[/I]

Done!

Please don't forget to enable the proximity sensor under settings-->Display-->Proximity Sensor-->Yes, so the display can be turned on, when proximity sensor is triggered :)

So that's it. Very simple but saves you a lot of time.

Please feel free to post some imrpovement suggestions, thoughts or anything else that comes up your mind. I'd really be happy about it-

Love follow
 
Last edited:

nicesoni_ash

Senior Member
May 26, 2012
6,090
10,950
127.0.0.1
What's the reason of using phone app in this profile? Also it'll be better if you post screenshot as our tasker version looks to be different.

I cannot find Plug-In --> Secure Settings on my Samsung S7, stock rom
Install it from the Play Store.

Sent from my "i9300/1+2" powered by Carbon/Temasek
Fueled by 7000mAh ZeroLemon Battery
 
Last edited:
  • Like
Reactions: svenvaeth

svenvaeth

Senior Member
Dec 27, 2008
164
11
Zurich
Okay, I tried to implement this, but using the 4 profiles does not do anything with my phone. I am using an S7, with stock ROM and Android 6.0.1
Tasker is enabled and shows the flash in the status bar. But it always says that no profile is active. Of course, I enabled the 4 profiles.
 

svenvaeth

Senior Member
Dec 27, 2008
164
11
Zurich
Is there any setting in Tasker I need to enable or change in order to make this running?
The four profiles are already enabled and Tasker is active, showing the little flash in status bar.
But closing the lid or blocking the proximity sensor does not do a thing.

Cheers man for your support.



Hello guys,

I was totally stunned, when I saw that there's a member lead tasker forum. I love tasker and couldn't imagine a phone without it.
As I want to spread my thoughts here are several profiles coming for you :)

Love follow
 
Last edited:

nicesoni_ash

Senior Member
May 26, 2012
6,090
10,950
127.0.0.1
@svenvaeth
First you shouldn't quote the whole op, it looks uglu. Second you already asked the same question just five hours ago, don't repeat your questions at least for 24 hours, that's the forum's ethics. Now wait patiently till someone answer you.

Sent from my "i9300/1+2" powered by Carbon/Temasek
Fueled by 7000mAh ZeroLemon Battery
 
  • Like
Reactions: svenvaeth

Follow_and_Feel

Senior Member
Apr 7, 2014
528
216
Montabaur
Is there any setting in Tasker I need to enable or change in order to make this running?
The four profiles are already enabled and Tasker is active, showing the little flash in status bar.
But closing the lid or blocking the proximity sensor does not do a thing.

Cheers man for your support.

Hey. Yes, there is an option you have to enable within tasker.

Go into Tasker, hit the three dot menu, click on "settings". Under "Display" go to "proximity Sensor" and click on yes. This will allow the sensor to be triggered, when the display is off.
Additionally you can check, if your secure settings "System + Module" is enabled within secure settings.

Please try this and let me know if it works now :)

Cheers follow

EDIT: I'll change this in the OP, too!
 
Last edited:

svenvaeth

Senior Member
Dec 27, 2008
164
11
Zurich
Oh no...I just saw that secure settings needs root access. This I wanted to avoid with the S7. Damn it....

I guess it is related to the issue.


Hey. Yes, there is an option you have to enable within tasker.

Go into Tasker, hit the three dot menu, click on "settings". Under "Display" go to "proximity Sensor" and click on yes. This will allow the sensor to be triggered, when the display is off.
Additionally you can check, if your secure settings "System + Module" is enabled within secure settings.

Please try this and let me know if it works now :)

Cheers follow

EDIT: I'll change this in the OP, too!
 

Follow_and_Feel

Senior Member
Apr 7, 2014
528
216
Montabaur
Oh no...I just saw that secure settings needs root access. This I wanted to avoid with the S7. Damn it....

I guess it is related to the issue.

Yeah. It's kinda my fault that I didn't mention that these profiles need root in order to work. I'm sorry that it won't be running on your phone then :( maybe you stick to one of the apps from the play store, which do pretty much the same.

Cheers follow
 

svenvaeth

Senior Member
Dec 27, 2008
164
11
Zurich
Do I need the Pro Version of Secure Settings? I rooted my device now, could remove bloatware and use root browser, but secure settings shows "no root detected" (?)


Yeah. It's kinda my fault that I didn't mention that these profiles need root in order to work. I'm sorry that it won't be running on your phone then :( maybe you stick to one of the apps from the play store, which do pretty much the same.

Cheers follow
 

Follow_and_Feel

Senior Member
Apr 7, 2014
528
216
Montabaur
Do I need the Pro Version of Secure Settings? I rooted my device now, could remove bloatware and use root browser, but secure settings shows "no root detected" (?)

Use the app "root checker" from google play to verify if root is installed properly. If so, please enable the system+ module in secure settings. No paid version needed
 

svenvaeth

Senior Member
Dec 27, 2008
164
11
Zurich
It says properly installed. It must be properly installed because I could grant root access for other apps.

Use the app "root checker" from google play to verify if root is installed properly. If so, please enable the system+ module in secure settings. No paid version needed


---------- Post added at 08:02 AM ---------- Previous post was at 07:56 AM ----------

8f40d28.png

05539e1.png
 

Follow_and_Feel

Senior Member
Apr 7, 2014
528
216
Montabaur
It says properly installed. It must be properly installed because I could grant root access for other apps.

Well I don't know why Secure Settings isn't working for you (I'm not a dev). Unfortunately the developer has stopped working on the app 2015, so this might be related to it. But maybe you post your problem in the secure settings thread.

I'm really sorry, that it doesn't work on your device and with my little knowledge I'm not able to provide a workaround. Sorry bro :(

EDIT: Just an idea....could you check your super User app, if you really granted Secure Settings root permissions?
 
Last edited:

svenvaeth

Senior Member
Dec 27, 2008
164
11
Zurich
Oh, that's a good point. It does not show Secure Settings in SuperSU app. How can I add it there?


Well I don't know why Secure Settings isn't working for you (I'm not a dev). Unfortunately the developer has stopped working on the app 2015, so this might be related to it. But maybe you post your problem in the secure settings thread.

I'm really sorry, that it doesn't work on your device and with my little knowledge I'm not able to provide a workaround. Sorry bro :(

EDIT: Just an idea....could you check your super User app, if you really granted Secure Settings root permissions?
 

Follow_and_Feel

Senior Member
Apr 7, 2014
528
216
Montabaur
Oh, that's a good point. It does not show Secure Settings in SuperSU app. How can I add it there?

Could you just run a task in tasker, e.g. "Time --> 13:35 (or whatever is close to now) --> Task--> Plug-In --> Secure Settings --> Root Actions --> Airplane mode on"

In fact there should be a prompt which asks you to grant secure settings root permissions. Try this and let me know
 

svenvaeth

Senior Member
Dec 27, 2008
164
11
Zurich
This is really driving me crazy. All the actions that require root are grayed out.

I cannot get the secure settings app to request root access.
No problem with adaway or titanium backup. It works fine.
Just Secure Settings will not send a request.

Could you just run a task in tasker, e.g. "Time --> 13:35 (or whatever is close to now) --> Task--> Plug-In --> Secure Settings --> Root Actions --> Airplane mode on"

In fact there should be a prompt which asks you to grant secure settings root permissions. Try this and let me know
 

Follow_and_Feel

Senior Member
Apr 7, 2014
528
216
Montabaur
This is really driving me crazy. All the actions that require root are grayed out.

I cannot get the secure settings app to request root access.
No problem with adaway or titanium backup. It works fine.
Just Secure Settings will not send a request.

Well I can't help you much. I have no idea why this isn't working for you. Maybe uninstall/reinstall secure settings and try again?
 

Follow_and_Feel

Senior Member
Apr 7, 2014
528
216
Montabaur
It says properly installed. It must be properly installed because I could grant root access for other apps.



---------- Post added at 08:02 AM ---------- Previous post was at 07:56 AM ----------

8f40d28.png

05539e1.png

Hey there. I have some good news and some bad news. The bad news are, that I checked this profile with a similar samsung phone and hat the same error notification like you had in secure settings.

The good news are, that you don't even need secure settings' "System + Module". I rewrote the script and it should actually work on any Samsung phone. Are you still interested?
 

Top Liked Posts

  • There are no posts matching your filters.
  • 2
    Hello guys,

    I was totally stunned, when I saw that there's a member lead tasker forum. I love tasker and couldn't imagine a phone without it.
    As I want to spread my thoughts here are several profiles coming for you :)


    Requirements

    1. Secure Setting


    What does the script do?

    Simple. It turns on your phone, when you open your flip case (or e.g. take it out of your pocket) and turns it off, when you're on the lockscreen and approximity sensor is cover (e.g. put it back in your pocket and/or close your flip cover).

    Let's get started

    Profile 1

    Code:
    [B] 1. State -> Approximity Sensor[/B] [I]check reverse
    [/I] 2.[B] Enter task and name it[/B] [I]"turn display on"[/I] for example. Add the action[B] Plug-In --> Secure Settings --> Configuration --> Wake Device[/B].[I](Choose Wake Type Screen Bright; Duration 5 seconds)[/I]

    Now exit the task section and add to the contexts of this profile:

    - State --> Display State Off
    - App --> Dialer App [your phone's dialer app]; Check reverse

    Done


    Profile 2

    Set up a new profile

    Code:
    [B]State --> Approximity Sensor[/B]
    Enter a task and name it for example [I]"display off"[/I], go to plug-ins --> Secure Settings --> Lock device [I]You have to enable device adming and grant Secure setting Device admin privileges[/I]
    Exit the task and add to the contexts of this profile
    
    [B]- State --> Variable value[/B]: Conditions %DISPLAYOFF ~ 1
    -[B] App --> Dialer App[/B]; [I]Check reverse[/I]

    Done


    Profile 3


    Code:
    [B]Event --> Display --> Display on[/B]
    Add the task [B]Variables --> Set Variables[/B]: [I]Name %DISPLAYOFF to 1[/I]

    Done


    Last Profile

    Code:
    [B]Event --> Display --> Display Unlocked[/B]
    Add the task and name it "display unlocked" for example: [B]Variables --> Set variable;[/B] [I]%DISPLAYOFF to 0[/I]

    Done!

    Please don't forget to enable the proximity sensor under settings-->Display-->Proximity Sensor-->Yes, so the display can be turned on, when proximity sensor is triggered :)

    So that's it. Very simple but saves you a lot of time.

    Please feel free to post some imrpovement suggestions, thoughts or anything else that comes up your mind. I'd really be happy about it-

    Love follow
    1
    What's the reason of using phone app in this profile? Also it'll be better if you post screenshot as our tasker version looks to be different.

    I cannot find Plug-In --> Secure Settings on my Samsung S7, stock rom
    Install it from the Play Store.

    Sent from my "i9300/1+2" powered by Carbon/Temasek
    Fueled by 7000mAh ZeroLemon Battery
    1
    @svenvaeth
    First you shouldn't quote the whole op, it looks uglu. Second you already asked the same question just five hours ago, don't repeat your questions at least for 24 hours, that's the forum's ethics. Now wait patiently till someone answer you.

    Sent from my "i9300/1+2" powered by Carbon/Temasek
    Fueled by 7000mAh ZeroLemon Battery
    1
    I already did that several times. I even bought SuperSU.
    I also contacted the dev, so let's see what the response will be.
    I am gonna post the solution here, in case there is one

    Yeah this would be awesome! I'm really interested in why it isn't working, too :)
    1
    Yeah this would be awesome! I'm really interested in why it isn't working, too :)
    Use the Terminal emulator


    well since secure settings has not been updated, you should run the following commands to get it to work:
    adb shell
    su
    mount -o remount,rw /system
    touch /sbin/su /system/bin/su /system/xbin/su
    mount -o remount,ro /system
    exit
    reboot
    [CREDIT goes to Ingenium13]