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.

Links:
Wakelock Detector Google Play link
 - https://play.google.com/store/apps/details?id=com.uzumapps.wakelockdetector
Presentation about Wakelock
 - http://goo.gl/7WgGz
XDA forum for technical discussions:
http://forum.xda-developers.com/showthread.php?t=2179651
How to use Wakelock detector
http://www.slideshare.net/ahikmat1/manual-for-wakelock-detector

81 comments:

  1. hi boss
    how to unintall this software?
    i gave root permission and now i can't uninstall it.
    please help

    ReplyDelete
    Replies
    1. I uninstalled the app from Titanium backup and then booted in Recovery>Wiped Dalvik Cache & Cache>Rebooted to system...It worked for me.

      Delete
    2. there is an option to revoke from system app in the latest version.
      sorry for late reply.

      Delete
    3. Titanium backup hung on restoring WD (system app). I then uninstall/install from play store but it wasn't working and can't be uninstalled. I finally follow Yogesh steps to remove the bad installation.

      Delete
  2. i think because of it i can't install Google play and other google services.

    ReplyDelete
  3. can you please help me to uninstall it
    thanks

    ReplyDelete
  4. This comment has been removed by the author.

    ReplyDelete
  5. Hey guys,

    is it available for android 6? I can install it from Play store but no app is listed in WLD.

    Thanks for helping

    ReplyDelete
  6. Since it doesn't work on Marshmallow, how would I uninstall the system app? Similar apps have an "uninstall" option.

    ReplyDelete
    Replies
    1. Yes it works on Android 6.0.

      I uninstalled the app from Titanium backup and then booted in Recovery>Wiped Dalvik Cache & Cache>Reeboted to system...It worked for me.

      When you reinstall the app, do not install it as system app.

      Delete
  7. I installed the app but it's not working. I don't want to root my phone so how can it work without that??

    ReplyDelete
    Replies
    1. Hi,
      we developed a workaround,
      follow this tutorial
      http://goo.gl/Yqdh2F

      Delete
  8. Good question Rebecca ..im the same I don't want to root on my phone how do I / we work around it ?

    ReplyDelete
    Replies
    1. Hi,
      we developed a workaround,
      follow this tutorial:
      http://goo.gl/Yqdh2F
      a bit geeky, but you might have a fun doing it.

      Delete
  9. Hi, how is it supposed to run in Android 6.0?. I have root, and after install as system app and reboot, when I open the application I always get an error that say It can not run in this moment....
    thanks

    ReplyDelete
    Replies
    1. please send us more details to our email at uzumapps@gmail.com
      your phone model and app version etc.
      thank you

      Delete
  10. wonderful post. keep it up thanks for sharing such a nice Apps and post. keep it up

    ReplyDelete
  11. I'm new to rooting but I would like to learn. So please no rude comments as this question may seem stupid to some. Has anyone found a successful root for the straight talk core prime sm-s820l? If so could someone point me in the right direction. I've heard rooting a cdma device is impossible but also I've heard it can be done. Id like to root in order to run apps like this on my device at all times.

    ReplyDelete
  12. Hi,
    you can try non root version,
    we developed a workaround,
    follow this tutorial:
    http://goo.gl/Yqdh2F
    a bit geeky, but you might have a fun doing it.

    ReplyDelete
  13. In Android Marshmallow, the system adb is removed. the workaround is not possible.

    But, for some android phones (like Galaxy S6), we can use PC's adb to grant permissions without ROOT.
    It works like: adb -d shell pm grant com.uzumapps.wakelockdetector android.permission.BATTERY_STATS

    Successfully executed, but WLD still tells me to install as system app. Could this be a bug in WLD?

    ReplyDelete
    Replies
    1. yes, you are right,
      it is possible to run WLD after granting permission.
      but it seems this workaround does not work in all devices.

      we will support this Workaround too!
      it needs some little work.
      Thank you for your mentioning this workaround.

      Delete
    2. Does the chrome tool perform the same thing as this from the pc?
      adb -d shell pm grant com.uzumapps.wakelockdetector android.permission.BATTERY_STATS

      The chrome tool description should explain exactly what it's going to do and offer a manual method (using adb on the pc). This will make the tool look less suspicious.

      Delete
  14. My phone keeps on lagging so I need your help

    ReplyDelete
  15. Hi what does it mean to root it on your phone

    ReplyDelete
  16. Hi what does it mean to root it on your phone

    ReplyDelete
  17. Does this work on Android 7? I got it to add battery_stats on Android 6, but no luck with Android 7? How about how to do it for Android 7 using adb? I have used adb to add permissions to other packages...Thanks!

    ReplyDelete
  18. Does this work on Android 7? I got it to add battery_stats on Android 6, but no luck with Android 7? How about how to do it for Android 7 using adb? I have used adb to add permissions to other packages...Thanks!

    ReplyDelete
  19. By using this app will it wipe my personal data from device?

    ReplyDelete
    Replies
    1. no, it only shows advanced battery stats which cannot be seen in default android

      Delete
  20. CA fonctionne vraiment mais il faut bien l'installert

    ReplyDelete
  21. Phone: OnePlus One - ROM: TugaPowerROM N21.0 (LineageOS, based on Android 7.1.1, rooted with MagiskSU). When I try to install app as system it gave me: "An error occurred mounting system rw. Aborted". Any suggestion?

    ReplyDelete
    Replies
    1. I've been getting the same error on a Nexus 6p stock rooted with Magisk.

      Delete
  22. Can't install as system app :(
    Was working b4 on magisk nougat 7.1.1
    Now giving mount rw error nougat 7.1.2
    Magisk

    ReplyDelete
  23. I am attempting to mount as system with root via Magisk and getting cannot mount /system as rw

    ReplyDelete
  24. This comment has been removed by the author.

    ReplyDelete
  25. Hi. I installed the app from play in my non rooted note 8 and tried to Grant permission via adb about it doesn't seem to find a package named com.uzumapps.wakelockdetector.noroot

    ReplyDelete
  26. This app not responding asking for permission.

    ReplyDelete
  27. hi boss
    how to unintall this software?
    i Have root permission and now i can't uninstall it.
    please help

    ReplyDelete
  28. Plz Bro Root Permission Accepted����

    ReplyDelete
  29. clbk doang . nokia xl androir ram 1gb batre awet banget minus tombol volume coplok ga ngaruh masih bisa siap cek selebih nya no minus mahar 300rb nego bensin japri 082122270830

    ReplyDelete
  30. Try this apps is fix may battery drain fast problem..

    ReplyDelete
  31. ดึคดะรีเดะรร

    ReplyDelete
  32. Hi everybody, i use (rather try to use) WLD lite/noroot. After the workaround it shows stats, but the app gives me an error "Failed to perform this task at the moment, try again later" when I leave my phone off overnight. What to do? Thx in advance

    ReplyDelete
  33. does anyone know what privapp settings to use so modern lineageos can boot with apps in the privapp folder? If you manage to put the app there without /system/etc/permissions/ whitelist, you wont boot

    ReplyDelete
  34. Harrah's Cherokee Casino Resort - OK Casino Guide
    Harrah's Cherokee 라이브스코어 Casino Resort in Cherokee, North 토토 사이트 추천 Carolina is a 34-story skyscraper in 바카라 사이트 casinopan Cherokee, North Carolina, U.S.A.. หาเงินออนไลน์ View detailed profile 슬롯 나라 pictures and

    ReplyDelete
  35. Как пользоваться расскажите пожалуйста ничего не могу настроить?

    ReplyDelete