Serious Discussion Optimizer - A shell script to fix your Android battery drain

Ink

Administrator
Thread author
Verified
Staff Member
Well-known
Jan 8, 2011
22,361
When you updated or flashed your device, you probably used up a lot of battery power in the first three or four days. The Android system is the first in the list of systems consumed and has 30–40% of the use! This guide will help to eliminate this problem. Starting with Android version 6 and below, you should have seen a message from the system saying "Optimizing app xx from xx" when you flashed or installed new apps.

You can often watch how the Android system consumes energy more than other applications. This is the result of not allowing the system to optimize. Because optimization was forced in Android 6 and earlier, and it became optional starting with Android 7 and higher, a new option was added to skip this step and optimise applications on the fly (JIT, Just-In-Time) while using applications. At the same time, the initial optimization has not been deleted and only starts if the following conditions are met:
  • the phone is connected to the charger,
  • fully charged,
  • turned on (the phone itself, not the screen),
  • is not used,
  • inactive (like after at least 30 minutes).
So if you dirty flash a lot, you might randomly experience longer app launch times after flashing a ROM, and the only apparent way to fix it was to do a clean flash. I experienced this a few times and decided to investigate and saw that it had something to do with how dex2oat works after you dirty flash (it refuses to optimise properly). What I found fixed the issue was to manually run dex2oat on everything after it booted into the system, and after it finished the process (which could take a super long time depending on how many apps you have), everything went back to its speedy state. And it seems to improve idle drain (high battery usage by the system) because we're forcing tasks that can only run if certain conditions are met, but also sometimes happen unexpectedly while the phone is idle, causing huge idle drain usage.
 

About us

  • MalwareTips is a community-driven platform providing the latest information and resources on malware and cyber threats. Our team of experienced professionals and passionate volunteers work to keep the internet safe and secure. We provide accurate, up-to-date information and strive to build a strong and supportive community dedicated to cybersecurity.

User Menu

Follow us

Follow us on Facebook or Twitter to know first about the latest cybersecurity incidents and malware threats.

Top