Unlock your device using random slider

Recently I've stumbled upon this reddit thread, where user AllanJH designed a lockscreen with Widget Locker that has a bunch of sliders with only 1 slider letting you into your phone. I really like that idea and began implementing it. I made one small deviation from the original post though - I am changing the "valid" slider every hour.

In my opinion, when someone types in a password/pin or opens the phone with a slider in a certain way, people around you can see what you are doing. Thus making all this security nothing more than a mild inconvenience. Because of that, I have decided to come up with a method to make the "valid" slider change based on current time and my "magic" number.

Here how it works. When I am not in a "safe" place (i.e. not at home, or not at my parents', or not in my car), I bring up WidgetLocker with 6 sliders so that my screen looks like this:
As you can see, I have a total of 12 possibilities to "log in" into my phone: 6 sliders to the right and 6 to the left. Since I have a total of 12 possibilities and there are 12 hours in a 12-hour clock, I can easily say that at 1 O'clock, my valid slider is 1 (left to right). At 2 O'Clock - valid slider is 2 (right to left) and so on. While that give you little more security, it is still relatively easy to figure out. This is where the "magic" number comes into play.

Let's say that my "magic" number is 1. Then at 1 O'Clock, my valid slider is #2 (right-to-left). At 2 O'Clock, valid slider is 3. Get the picture?

Here's what you need to get this up and running:
- WidgetLocker Lockscreen
- Secure Settings
- Profile to compute current valid number
- Profile to determine your safety (i.e. at home)
- Profile to detect screen unlock
- 12 tasks (one per slider)
- 1 task that performs the unlocking (or locking) of the device

Disclaimer

I am not responsible if you get locked out of your device.

If you make a mistake while configuring your tasks, you might get locked out. The configuration below works well on my device, but please make sure that you add a backdoor for testing purposes. While I am not to be held responsible if you are to get locked out, I will do my best to help you to regain access to your device.

Task: Unlock Widget Locker

This task is the "brain" behind this operation. It is determining whether user has swiped correct slider based on current time and current "magic number".

Unlock Widget Locker (127)
A1: Variable Set [ Name:%wildCard To:3 Do Maths:Off Append:Off ] 
A2: If [ %par1 Set & %wlHour = %par1 ]
A3: Secure Settings [ Configuration:Clear Password Package:com.intangibleobject.securesettings.plugin Name:Secure Settings Timeout (Seconds):0 ] 
A4: WidgetLocker [ Cmd:Unlock ] 
A5: Else If [ %par1 Set ]
A6: Variable Set [ Name:%FAILEDUNLOCK To:1 Do Maths:Off Append:Off ] 
A7: Secure Settings [ Configuration:Set Pin Package:com.intangibleobject.securesettings.plugin Name:Secure Settings Timeout (Seconds):0 ] 
A8: System Lock 
A9: WidgetLocker [ Cmd:Disable ] 
A10: Secure Settings [ Configuration:Screen & Keyboard Lights On
5 Seconds Package:com.intangibleobject.securesettings.plugin Name:Secure Settings Timeout (Seconds):0 ] 
A11: End If

NOTE: Make sure that you change the "magic number" in step A1 to something you want instead of my 3 :)

Task: Slider Swipe

This is the small task that is calling the Unlock Widget Locker task.

Unlock 1 (152)
A1: Perform Task [ Name:Unlock Widget Locker Priority:%priority Parameter 1 (%par1):1 Parameter 2 (%par2): Return Value Variable: Stop:Off ]
 
Unlock 2 (153)
A1: Perform Task [ Name:Unlock Widget Locker Priority:%priority Parameter 1 (%par1):2 Parameter 2 (%par2): Return Value Variable: Stop:Off ]
 
Unlock 3 (154)
A1: Perform Task [ Name:Unlock Widget Locker Priority:%priority Parameter 1 (%par1):3 Parameter 2 (%par2): Return Value Variable: Stop:Off ]
 
Unlock 4 (155)
A1: Perform Task [ Name:Unlock Widget Locker Priority:%priority Parameter 1 (%par1):4 Parameter 2 (%par2): Return Value Variable: Stop:Off ]
 
Unlock 5 (156)
A1: Perform Task [ Name:Unlock Widget Locker Priority:%priority Parameter 1 (%par1):5 Parameter 2 (%par2): Return Value Variable: Stop:Off ]
 
Unlock 6 (157)
A1: Perform Task [ Name:Unlock Widget Locker Priority:%priority Parameter 1 (%par1):6 Parameter 2 (%par2): Return Value Variable: Stop:Off ]
 
Unlock 7 (158)
A1: Perform Task [ Name:Unlock Widget Locker Priority:%priority Parameter 1 (%par1):7 Parameter 2 (%par2): Return Value Variable: Stop:Off ]
 
Unlock 8 (159)
A1: Perform Task [ Name:Unlock Widget Locker Priority:%priority Parameter 1 (%par1):8 Parameter 2 (%par2): Return Value Variable: Stop:Off ]
 
Unlock 9 (160)
A1: Perform Task [ Name:Unlock Widget Locker Priority:%priority Parameter 1 (%par1):9 Parameter 2 (%par2): Return Value Variable: Stop:Off ]
 
Unlock 10 (161)
A1: Perform Task [ Name:Unlock Widget Locker Priority:%priority Parameter 1 (%par1):10 Parameter 2 (%par2): Return Value Variable: Stop:Off ]
 
Unlock 11 (162)
A1: Perform Task [ Name:Unlock Widget Locker Priority:%priority Parameter 1 (%par1):11 Parameter 2 (%par2): Return Value Variable: Stop:Off ]
 
Unlock 12 (163)
A1: Perform Task [ Name:Unlock Widget Locker Priority:%priority Parameter 1 (%par1):12 Parameter 2 (%par2): Return Value Variable: Stop:Off ]

Profile: Compute current valid number

This profile is executed once per hour. All it does is extracting hour from date command, adding the magic number and capping the sum at 12. For example: 8 + 3 = 11, but 8 + 4 = 0 and 8 + 5 = 1

Profile: Compute Unlock Number (139)
Time: From 00:00 every 1h
Enter: Anon (140)
A1: Run Shell [ Command:date +%l Timeout (Seconds):0 Use Root:Off Store Output In:%wlHour Store Errors In: Store Result In: ] 
A2: Run Shell [ Command:expr %wlHour + %wildCard Timeout (Seconds):0 Use Root:Off Store Output In:%wlHour Store Errors In: Store Result In: ] If [ %wildCard Set ]
A3: Variable Add [ Name:%wlHour Value:0 Wrap Around:12 ]

Profile: Detect Screen Unlock

This profile is going to clear pin code and re-enable the WidgetLocker on successful device unlock

Profile: Successful Login (149)
Event: Display Unlocked
Enter: Anon (150)
A1: Variable Clear [ Name:%FAILEDUNLOCK Pattern Matching:Off ] 
A2: Secure Settings [ Configuration:Clear Password Package:com.intangibleobject.securesettings.plugin Name:Secure Settings Timeout (Seconds):0 ]

Profile To Determine Your Safety

This profile is going to be something that only you know how to do as all of us have different configurations. What I am doing is creating a variable (i.e. %isSafe) that is being incremented for every "safe" profile. For example, if I have profiles: "WiFi Home" and "Cell Tower Home", my %isSafe variable is going to be 2. Of course my exit tasks for above profiles will decrement my %isSafe variable.
Then I have a profile that looks like this:

Profile: Enable WL (142)
State: Variable Value [ %isSafe = 0 | %isSafe < 0 ]
Enter: Anon (143)
A1: Variable Clear [ Name:%isSafe Pattern Matching:Off ] 
A2: WidgetLocker [ Cmd:Enable ] If [ %FAILEDUNLOCK !Set & %isDriving !Set ]
A3: Secure Settings [ Configuration:Set Pin Package:com.intangibleobject.securesettings.plugin Name:Secure Settings Timeout (Seconds):0 ] If [ %FAILEDUNLOCK Set & %isDriving !Set ]

Configuring WidgetLocker

After all these Tasker elements have been successfully added into your Tasker application, we need to set up WidgetLocker. To do that, you will need to:

  1. Launch WidgetLocker
  2. Add your slider widgets
  3. For each slider widget, make each direction react to one of the Unlock tasks. In my configuration, the upper left slider is: Unlock 1 = left-to-right and Unlock 2 = right-to-left
  4. Save you configuration and exit

NOTE: For debugging purposes, add an extra slider that will get you back to "safety" in case your configuration is incorrect. Otherwise you might get locked out of your device.

Conclusion

That is basically the entire setup! Oh, almost forgot. Before you run everything, make sure that you manually set the %wildCard variable. Otherwise Tasker will think that your wild card is 0 and your first unlock attempt will be invalid (which is not a big deal) :)

P.S. Please make sure that you can easily

Hope you'll find this useful!

Comments are always welcomed!

Profile Dependencies: 
Root AccessSecure Settings
WidgetLocker

Comments