Monday, May 9, 2016

Wakelock detector Light

We released "Wakelock detector - Light" version to the Google Play.
This version of WLD is specifically developed for the purpose of running WLD on normal (non-rooted) phones.

For that purpose, we developed a Chrome Extension "Unlocker for WakelockDetector", which connects to your phone through USB ADB connection.
Chrome extension can switch your phone from USB to TCP-IP, so that Wakelock detector Light can connect to its adb for Wakelock stats retrieval.
Also, there is an option to "Grant Battery Stats" in chrome extension, this option has a low chance of working (but it worked on many Android Marshmallow phones). If it works then it is more permanent workaround than the prior workaround.
More details on Workaround PPT

Tuesday, April 12, 2016

Wakelock detector Without Root

In this post, I want to share our achievement on making Wakelock detector(WLD) work without Root.
Since Google had restricted access to battery statistics for third-party apps in Android 4.4 (kitkat), the only way to get wakelock statistics is to Root device. By rooting phone we can install WLD as system app, thus it can work as it worked prior to KitKat.
However, most of users do not want to root their phone, because they might lose warranty or they don't want to get denied from sensitive apps like banking services. There are also other drawbacks of rooting device.
To help these users we tried to make various workarounds. As it was mentioned in previous blog we tried PC version and adb version. PC workaround works only when the phone is connected to PC, and "ADB" workaround was too complicated as it required many steps and was too difficult for non technical users. Also, this adb workaround does not work since Android Marshmallow.

To make ADB workaround easier, we developed a new version of WLD and named it as "Wakelock detector Light". This "Light" version is specifically for Non-Rooted phones, and it requires  less steps than previous adb workaround. It is compatible with Android Marshmallow too.
Less steps means it is easier, but still this workaround requires some technical stuff. If you are interested in tech then it should be no problem.

Here is the link for our tutorial:
Non Root Workaround V2

Monday, July 27, 2015

What happened to Wakelock detector ?

Hello everyone,

I am one of the responsible developers of Wakelock detector (WLD)[1]
Here I am going to share and discuss what had been going on with Wakelock detector in recent years.
First of all, I apologize for language mistakes written in English. I will try to fix mistakes later on when I will have more free time.

As a brief history of our app called "Wakelock detector" , the idea came up from our friend  who had problem with his phone screen being randomly turn on by mysterious apps. So, we decided to detect which app was causing the phone wake up. Later, we stumbled on "BetterBatteryStats"(BBS) which was open-source and it could help to detect partial wake locks. Partial wake lock (also we call it CPU wake lock) is a feature used by Android developers to hold the system awake while screen is off. It would be better if the reader of this blog understands Android wakelocks well. Check this presentation for a knowledge. There are many sources on internet. Anyways, BBS did not have screen wakelocks, and it was more advanced which made it more difficult to understand for many users. So, we decided to simplify the wake lock statistics and concentrate only on wakelocks. We learnt a lot from BBS source code and we were very grateful for that. Their approach was accessing battery statistics (including wake lock stats) via java reflection. It was excellent way to go as it required single "Battery_stats" permission from users.
Everything was going well, the overall rating of WLD in GooglePlay was as high as 4.8 at that time.
But, something unexpected happened in KitKat. Google after they realized that developers could gain app usage information(which leads to some privacy issues) by using non-public API (reflection) they closed the hole. They opened the battery stats access only to system apps. Default battery statistics app of Android is a system app, so it works without problem.
At first, there was no solution for this problem. BBS and GSam came up with the idea to install the app as a system app (by copying to /system/app folder)
We wanted to fix with other solution. Android has a "dumpsys" command, which dumps statistics and the output can be parsed. So, we used "dumpsys batterystats" and parsed output and displayed wake lock statistics. But it still required ROOT access. The good thing about this method was it could run on non-rooted Kitkat devices with a workaround.
The workaround is easy for the people who know what is adb , however, for ordinary users it might be very difficult to accomplish at first time. That is why, we made PC version of Wakelock detector for Windows OS users.
Recently, the Google Play rating of WLD plunged down to 4.2, the reason for that was the users thought that WLD should work without ROOT and some Rooted users who had inappropriate version of SuperSU  was causing problems. Above all, mismanagement was major reason of rating plunge.
Finally, we released 1.8.0 version of WLD, we added a new feature "Install as system app"
This feature requires ROOT, and it copies the apk file of WLD into /system/priv-app folder.
This can be done with other apps too, you can find many helper apps by searching  "Install as system app" in GooglePlay. After installing as system app, the phone needs to rebooted!
Then you can revoke ROOT access, as Root is no more required. It can work fine as it worked pre Kit-Kat OS.
As a conclusion, It is hard to say that Google will open wake lock statistics with public API, and workaround for non rooted users is hard to simplify for ordinary users (although we are looking for different angles to simplify the process) The solution is to Root device, which is not well recommended by manufactures. But achieving excellent battery life takes some courage and effort.

Wakelock Detector Google Play link
Presentation about Wakelock
XDA forum for technical discussions:
How to use Wakelock detector