Sunday, February 21, 2016

Tasker: Don't kill official facebook app but...

If you're one of those folks like me who has a love/hate relationship with the official facebook app (hate them but also can't live without them) then keep on reading this post, I may have something for you.

The dreaded facebook app is famous for its battery hogging feature which in return may or may not brings much benefits to us (unless you're into draining your battery). While many articles over in the internet had advised to against installing it but then again the app itself does have some useful features whereby other 3rd party apps can't provide (like direct share into a facebook group).



Like many others out there, I had resorted to seek different solutions but ultimately I have no choice but to crawl back and subject my device for the battery vampire app as sacrifice. But it was today that I asked myself this question, if I can't kill it (it does respawn actually) why not I disable it? So this post is all about disabling your facebook app using Tasker.

What the heck is Tasker?
Tasker is an automation app (period) for Android devices. You can control different actions to be done on your device based on different situations (like time, location, upon charge, upon battery deplete until certain percentage). If given the proper permissions, scenarios and actions, it is a very powerful app for your device which gives you many ways to automate your device according to your lifestyle (like launch Spotify upon connecting to your car Bluetooth and change the device timeout to 10 minutes). I had purchased Tasker for a while but was not able to fully maximise it until recently (whereby the Android systems allows much more control). Coped withq another 3rd party extension app called SECURED
SETTINGS, things gets even more exciting

What are we doing today?
We will be enabling and disabling Facebook app upon toggle. Disabling the app means that the app itself would not be able to stay in memory by any means possible (unless your facebook is rigged with viruses)

Disclaimer: I have not did extensive research on Tasker (yet) and doesn't have the capability to retrieve return codes from task execution. Henceforth, these instructions still work but not as pretty only

What we need?
To start off, here's what you need:-
1. A rooted device
2. Tasker installed https://play.google.com/store/apps/details?id=net.dinglisch.android.taskerm
3. Secured settings installed https://play.google.com/store/apps/details?id=com.intangibleobject.securesettings.plugin

Here are the steps:-
1. Launch Tasker and click on the TASKS tab



2. Let's add a new task, click on the + button below



3. Let's give a name to the task, call it "Toggle FB"



4. Now we need to choose the action for the task. At the search input box, type in "secure" to find secure settings option. Tap on secure settings



5. Now we are brought into secure settings options, tap on the pencil icon on top right



6. Within secure settings, you will have many options. We need the package state option which is within the root actions option. Locate and select it



7. Now we need to choose our lovely Facebook app to configure more options. Tap on the ? Icon to list and select the Facebook app



8. Ensure that the option "Toggle" and "User Disable" is selected



9. Tap on the back button until you're back in Tasker screen



10. Let's add a pulse (wait) as the next step. Click on the + icon at the bottom and type in "wait" as the search action



11. At the wait option, put in 2 seconds as the wait time



12. Next step, we shall add the launch of Facebook app. Click on the + icon at the bottom and choose "App"

Note: If the app is enabled, it will launch, if it's disabled, it will just fail with an error message



13. Select "Launch App" and choose Facebook as the app to launch





14. Once you're all done, you should see 3 actions associated with the task called "Toggle FB". Press back a few times to exit tasker

What's next?

The best step is to toggle enable/disable and launch the facebook app from your launcher.

1. Go to your launcher main screen and add a new widget. Locate and select the tasker widget called shortcut



2. Click and drag the widget to your main screen and then the list of tasker actions will be displayed. Choose "Toggle FB" (the one you created)



2b. As option, you can also choose the icon to be used by clicking on the icon on the bottom right (choose Facebook icon)



Press the back button when you're done to save it.

Testing:

On the first launch, you will disable your facebook app, henceforth you will receive the message as shown



If you tap on the icon again, you will enable your facebook app and it will launch immediately. You also need to understand, this will also removes Facebook from your app drawer upon disable. So don't panic when you can't find the shortcut from your launcher; just tap this icon to enable again. So do tell, if it had been useful to you in our facebook group.