All Projects → stooone → wakelock-source-hunter

stooone / wakelock-source-hunter

Licence: other
A small script you can run on your root-ed Android phone to find out the source of wakelocks.

Programming Languages

shell
77523 projects

Projects that are alternatives of or similar to wakelock-source-hunter

chromiumUpdater
Downloads Chromium for Android and keeps it updated
Stars: ✭ 69 (+137.93%)
Mutual labels:  root
root-docker
Docker recipes for ROOT
Stars: ✭ 23 (-20.69%)
Mutual labels:  root
KtSh
Execute shell commands on Android or the JVM
Stars: ✭ 615 (+2020.69%)
Mutual labels:  root
avd-root
Root permissions for Android Virtual Devices
Stars: ✭ 112 (+286.21%)
Mutual labels:  root
BatteryCalibration
not maintained - [NEEDS ROOT] Calibrate your battery
Stars: ✭ 20 (-31.03%)
Mutual labels:  root
spark-root
Apache Spark Data Source for ROOT File Format
Stars: ✭ 28 (-3.45%)
Mutual labels:  root
AutoAirplaneMode
✈️ Automatic Aiplane Mode for Android
Stars: ✭ 15 (-48.28%)
Mutual labels:  root
ThemeApplyTools
MIUI 无 root 主题工具
Stars: ✭ 31 (+6.9%)
Mutual labels:  root
Root-Checker
Displays all root related info(Device Rooted, Root Available, Root Path, Root given, Busy Box installation) of an Android Device. Fully implemented in Jetpack compose using Material 3 dynamic theming and also has a separate implementation in xml with MDC 3.
Stars: ✭ 21 (-27.59%)
Mutual labels:  root
Latest-adb-fastboot-installer-for-windows
A Simple Android Driver installer tool for windows (Always installs the latest version). Sponsored by https://sendletter.org, the Cheapest way to Send Letters
Stars: ✭ 242 (+734.48%)
Mutual labels:  root
GJZS
搞机助手·R(原「搞机助手重制版」)
Stars: ✭ 584 (+1913.79%)
Mutual labels:  root
A71-Hidden-Mods
A magisk module adding some mods to your Galaxy A71 systemlessly.
Stars: ✭ 16 (-44.83%)
Mutual labels:  root
DIRT
Digital Imaging of Root Traits: Extract trait measurements from images of monocot and dicot roots.
Stars: ✭ 20 (-31.03%)
Mutual labels:  root
Droid-Explorer
Cross-platform root file explorer for Android phones.
Stars: ✭ 34 (+17.24%)
Mutual labels:  root
the-roots-home
I am not root, this is a hugo theme.
Stars: ✭ 29 (+0%)
Mutual labels:  root
i-am-root-nuget-package
📦🏴‍☠️ NuGet package that shows we can run arbitrary code from any NuGet package
Stars: ✭ 22 (-24.14%)
Mutual labels:  root
root painter
RootPainter: Deep Learning Segmentation of Biological Images with Corrective Annotation
Stars: ✭ 28 (-3.45%)
Mutual labels:  root
openvpn-unroot
Run OpenVPN without root privileges
Stars: ✭ 27 (-6.9%)
Mutual labels:  root
b374k-mini
PHP Webshell with handy features.
Stars: ✭ 28 (-3.45%)
Mutual labels:  root
jobofferbackend
This project is a real-world example of DDD in a backend application It applies the concept of Entity, Value Object, Root, Aggregate, Services, Repositories and Ubiquitous Language.
Stars: ✭ 15 (-48.28%)
Mutual labels:  root

wakelock-source-hunter

This is a small script you can run on your root-ed Android phone to find out the source of wakelocks.

The main logic is to watch the wakelock happening and one-by-one disable the user installed apps and wait if the wakelock occurence drops. This way one can find the source of the wakelocks. One can do this manually but it is easyer to do this by a simple script.

The script does 30 second tests and counts the selected wakelock during that period. It first does 3 baseline checks with all apps enabled, then one-by-one disables then re enables the apps and prints the wakelock count during the test period.

Usage

Use this script at your own risk, I take no responsibility for any damages to your phone! Don't use it if you don't understand what is does!

  • You must use BetterBatteryStats to find out what wakelock bothers you
  • Backup/note down your app shortcuts on your launcher (if you disable an app it is removed from the launcher), or you can switch to an alternative launcher and then back this way your usual launcher's app shourtcuts will be preserved
  • Edit the script and set WAKELOCK= to your wakelock of choise
  • Start a shell on your phone (I recommend JuiceSSH for "local device" connection)
  • su to gain root
  • Start the script by bash wakelock-source-hunter.sh (should also work with mksh)
  • Interpret and do experiments by the results

Note: all environments are different, I can't guarantee they this will work in your. If you get an error message try another terminal emulator. (I use JuiceSSH.)

Example

I was fighting with the IPA_RM12 and IPA_WS wakelock. I've googled for a long time but the only info I was able to find out that it is the Qualcomm Linux Modem's wakelock, so it has some connection with the mobile communication. So something is using the mobie net in the background constantly but not that hard that I can spot it by network usage. I know there would be other ways to find out the source of network traffic, for example by monitoring the network, but it would be more of a pain and this way I've built a more useful tool for future use. My phone was ok for hours but then somethign happened and those two wakelocks kept it awake around 50% screen off time, only reboot helped. So some app must stuck somehow and causes it.

~$ su
:/storage/emulated/0 # bash wakelock-source-hunter.sh
Parent app is com.sonelli.juicessh, will skip it during the tests.

I will count IPA_WS wakelocks during disabling apps one-by-one. But before I'll make some baseline with all apps enabled. Please wait...

        32 Baseline
         8 Baseline
        17 Baseline
         9 net.oneplus.weather
        28 com.alibaba.aliexpresshd
         9 com.google.android.apps.docs.editors.docs
        32 com.ichi2.anki
         0 com.otpmobil.simple
         0 com.niksoftware.snapseed
         0 com.oneplus.soundrecorder
         3 com.italki.app
         1 com.devhd.feedly^C

As you can see after disabling com.otpmobil.simple the wakelocks vanished, and after re enabling it didn't returned, so the app was doing some background job what stuck sometines and caused the wakelocks for me. I deleted it and my wakelock issue is done. As you can see not all the wakelocks wanished, buy since it is a mobile network related wakelock it's not a problem.

Please send success stories to: stone at midway dot hu

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].