Friday, 4 July 2014

Make an anti-theft app for android phone yourself without any coding

Things you needed for this project . Please read the previous post for more details

  1. Tasker app . Download it from Play Store
  2. Secure settings plugin for Tasker – Free 
  3. App Factory plugin – Free 
So basically what i need is a way to lock the phone by means of an sms . Further the phone should remain locked till the correct code is entered . In addition i want to get the picture of the thief , taken without his knowledge , and send it to me by mms or upload it to dropbox . For all these things to happen , i have to make the phone understand that it is in wrong hands . I can go for a lock screen or a sim card change alert . I use a dual sim phone and hence sim card change alert could evoke false response . So i am going with the good old lock screen method . So let us start making the app. To know how to build apps in  Tasker , click here .
Step 1
Create a new project . Give a name. I named it as Buster
Add a State . State > Display Unlocked .
Add a new task . Give it a name .I named it as Secure.  Now add actions . Display > Lock
Choose a code to unlock . You can select whether you want a cancel button and also whether the lock is in full screen or not .
Now add a new state . State > Plugin > secure settings
Click on the pencil button to enter configuration and choose Failed Login Attempts
Choose the number of wrong attempts possible. I choose 3 and then click  on the save ( Floppy disc button) .
Go back and add a new task . Task >Media>Take Photo
Choose Front camera , give a file name and choose chronological in Naming Sequence.
Tick the Insert In Gallery option and also Discreet (To take photo without intruders attention ).
Step 2
Now the primary objective is completed . But what is the purpose if the photos were to remain in the phone itself ? So we have to create a new task to send the captured image to us . I also want to get the location of the phone send to me . Also you can set a task to send you a message from the phone , if the sim card is changed or tampered .
You can either create a new state or add a new task to the existing profile. I choose to add a new task to the profile Secure .
In the Task edit , add a new action. Choose Misc > Get Location
In this window you can select whether you need GPS based location or net or both. I choose both . You can select a time out for the service.
Now add another action. Phone > Send SMS
Give a phone number to which you want the location and photos to be send .  In the message  i want to include the location of the phone. So i type “Phone is currently in the co-ordinates %LOC ”  .
Now i want the photo captured to be send to me. When i tested this on my phone , i found that Tasker gives you an option to compose mms with the photo attached , but not to send it . So basically it means the photo will remain in the phone itself. But i have an option to upload the photo to my drop box account . For this i have to turn the mobile data on and also turn the auto sync on .
So i added a new action .   Net > Mobile Data > On
To turn auto sync on Net > Auto Sync > ON
This should do the work .
Step 3
OPTIONAL :  Lock down down your device remotely via an sms . Go to the Task edit . Add new action > Display > Lock . Choose a long code difficult to crack . Now go to the bottom of that window , you will see an IF with a + . Click the +  . Choose from the tag  ‘Text Body ‘ or enter %SMSRB  . Click on the button next to it and choose ‘Matches’ . Now enter your code to unlock the screen. It must be the same as entered earlier.   Now you can lock the phone by sending an sms with the code as your message body .
I can have two scenarios here . One :  the thief is using my sim card itself ( atleast for now ) . It won’t be an issue in sending the lock sms . But what if he changed my sim . So now i have to set the app to check the serial number of the sim and compare it with the serial number of new sim. If there is a difference , then the app should send a message to a pre-installed number . Once you receive the message , you can send the lock sms .
Your app is ready to build . Please read the previous post to know how to build an app .
Once your app is build , you can install it in your phone. Please note that this app cannot be distributed for obvious reasons unless it is in your family , because the phone number you set to send the sms can’t changed once it is build . Also the app doesn’t have any user interface , for that  you have to create scenes in Tasker .
So what do you think ? I would like to hear your opinion . Please like me and share your comments . Happy to help :)

No comments:

Post a Comment