Automated Phone Security

Because I am an engineer and I like to ‘think’ my way out of doing repetitive tasks by hand, I wondered how I could lock and unlock my Android phone automatically. Having just purchased the Moto 360, I was curious if I could use it and it’s bluetooth connection to my phone for this purpose. Enter the apps Tasker, Trigger, and Secure Settings.

Purpose:

Setup an Android phone and the Moto 360 where the Moto 360 is used to unlock/deactivate the password for the phone. In other words, be able to leave your phone on your desk, walk away, and the phone automatically locks when you leave Bluetooth range. Likewise, whenever you get back it would unlock itself after the bluetooth connection is restored.


Disclaimer: Most of this was adapted from Adafruit’s walk-through on NFC unlocking of your phone. That walk-through can be found here.

Be sure to install and open Tasker first. This way, when installing the other apps, they are aware of it’s existence and populate the appropriate menu items and options. While it isn’t free, it is definitely worth it as it’s uses are limited only by how many crazy applications you can come up with for it.

Before continuing, be sure to install the other two apps and open them so that each program is aware of their existence on your phone.

tasker

trigger

Secure Settings

Tasker

Within the Tasker app, there will be two different ‘tasks’. One I called Clear Password and the other called Relock

Tasks

These tasks are run whenever something triggers them (Yep, you guessed it. That’s where Trigger comes in). To add a task, simply press the ‘+’ symbol at the bottom of the app and give it a name. From there, you add actions which are the series of events that will run whenever the task is triggered.

ClearPassword

These are the actions for the Clear Password task. Again, taken mostly, if not entirely, from the Adafruit walkthrough. I won’t go into much detail here as the Tasker app is fairly intuitive to the crowd of people that probably own a Moto 360 (See Adafruit tutorial for details if you get stuck).

See below for screen grabs of the Secure Settings for this task:

pinDisable

keyguardDisable

And moving on to the Relock task.

Relock

Very similar to the task above, the Relock task sets out to undo all the stuff that the Clear Password task did. The IF statement checks that it is currently in the unlocked state before locking the phone.

Again, below is an image for the Secure Settings screen:

passPinSecure

Trigger

In order for Trigger to be able to use the Moto 360 as a ‘trigger’, make sure you’ve paired your Moto 360 with your phone already so that it is in the device history.

Under My Tasks, tap the ‘+’ icon to add a new trigger. Add a new Bluetooth trigger that looks for your Moto 360 (The name will probably have some seemingly random numbers after it) and triggers When Connected To. Press next and then you can add restrictions if you don’t want this to be active all the time (i.e. only at work, just the weekends, etc.)

Pressing next will bring you to a Task screen. Here is where you’ll tell it to run the tasks that were defined above. Press the ‘+’ sign and scroll down to the Tasker category and select Tasker Task. It will prompt you for the exact name of the task (unfortunately it doesn’t have the visibility into the Tasker app to auto populate). In my case, the name was Clear Password since we want the app to remove the lock whenever it connects to the Moto 360. You can then name the task and press done.

The second and final Trigger is to Relock the phone. It’s a similar process, but when adding the Bluetooth Trigger, instead of selecting When Connected, select When Disconnected From. Everything else is the same as above except the task will be the name of the task for relocking your phone, in my case it was Relock.