Skip to content

Commit e33dde5

Browse files
authored
Update README.md
1 parent fb974f7 commit e33dde5

1 file changed

Lines changed: 42 additions & 19 deletions

File tree

README.md

Lines changed: 42 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,68 @@
11
# BatteryRemapper (LSPosed Module)
2-
BatteryRemapper is a lightweight, headless Xposed/LSPosed module designed for custom Android environments. It recalibrates the operating system's battery reporting scale, mapping a physical battery range of **20% – 80%** directly into a displayed **0% – 100%** layer.
3-
By limiting your operational battery cycle to these thresholds, this module dramatically slows down chemical aging and extends the longevity of your device's physical lithium-ion battery.
2+
3+
BatteryRemapper is a lightweight, headless Xposed/LSPosed module designed for modern, highly customized Android environments. It recalibrates the operating system's battery reporting scale, mapping a physical battery range of **20% – 80%** directly into a displayed **0% – 100%** layer.
4+
5+
By constraining your operational cycle to these healthy thresholds, this module dramatically slows down chemical aging and extends the longevity of your device's physical lithium-ion battery.
6+
47
---
8+
59
## 🚀 Features
10+
611
* **Linear Scale Remapping:** Compresses a physical 60% battery capacity swing (20% to 80%) into a seamless, user-facing 0% to 100% display layer.
712
* **Dynamic Intent Interception:** Hooks deeply into the `Intent.getIntExtra` layer within the System UI, making it highly compatible with modern, heavily modified custom AOSP ROMs.
8-
* **30-Second Shutdown Countdown:** When your physical battery drops to 20% (showing 0% on screen), a system-level alert dialog pops up with a 30-second countdown.
9-
* **Smart Charger Abort:** Plugging in your charger at any point during the 30-second countdown instantly cancels the countdown and dismisses the alert dialog.
10-
* **Headless Design:** Runs completely background-driven with no app drawer icon or unnecessary battery drain.
13+
* **Smart Hysteresis Battery Saver Automation:** Automatically manages your Android Battery Saver profile based on your remapped percentages to eliminate constant state-toggling:
14+
* **Triggers ON:** Automatically forces Battery Saver mode **ON** the moment your remapped scale drops to **20% or below**.
15+
* **Triggers OFF:** Automatically forces Battery Saver mode **OFF** when your remapped scale charges past **50%**.
16+
* **Hysteresis Dead-Zone:** Keeps the existing power state completely stable between **21% – 50%** when unplugged to prevent power-flickering.
17+
* **Charging Bypass:** Instantly kills and disables Battery Saver mode the moment a charger (AC/USB/Wireless) is connected, allowing unthrottled charging performance.
18+
* **30-Second Shutdown Countdown:** When your physical battery drops to your absolute limit of 20% (showing 0% on screen), a system-level alert dialog pops up with a 30-second countdown.
19+
* **Smart Charger Abort:** Plugging in your charger at any point during the 30-second countdown instantly cancels the shutdown sequence and dismisses the alert dialog.
20+
* **Pure SystemUI Execution:** Runs with zero root shell overhead (`su`) or permanent kernel-level RAM corruption by executing completely within the trusted `com.android.systemui` scope.
21+
1122
---
23+
1224
## ⚙️ LSPosed Setup Configuration
13-
To ensure the module functions correctly, you must configure its scope properly inside the LSPosed Manager app.
14-
### Which Application to Target:
25+
26+
To ensure the module functions correctly, you must configure its scope properly inside your LSPosed / Vector Manager interface.
27+
28+
### Target Scope:
1529
* [x] **System UI** (`com.android.systemui`)
30+
1631
> [!IMPORTANT]
17-
> **DO NOT** check "System Framework" (`android`).
18-
> This module is intentionally scoped to the System UI process. This guarantees that your status bar, widgets, and lock screen graphics display your custom 0-100% scale, while the underlying core Android kernel still knows the actual physical battery metrics to manage safe hardware operations.
32+
> This module is engineered to run inside the System UI process. This ensures that your status bar, quick setting tiles, and lock screen graphics safely reflect your custom 0-100% scale, while your device's core Android system server still maintains accurate tracking of physical metrics.
33+
1934
---
35+
2036
## 📈 How the Math Works
37+
2138
Because the module maps a 60-point physical range into a 100-point display range, every **1% change in physical battery** translates to roughly **1.66% change on your screen**.
2239

23-
| Actual Physical Battery | Displayed Status Bar Battery | Notes |
40+
| Actual Physical Battery | Displayed Status Bar Battery | Current Behavior & States |
2441
| :--- | :--- | :--- |
2542
| **80% and above** | `100%` | Upper charge ceiling cap |
2643
| **65%** | `75%` | Intermediate remapped value |
27-
| **58%** | `63%` | Intermediate remapped value |
28-
| **25%** | `8%` | Low battery threshold |
44+
| **51%** | `51%` | Battery Saver turns **OFF** if unplugged |
45+
| **25%** | `8%` | Low battery threshold **Battery Saver is ON** |
2946
| **20% and below** | `0%` | Triggers the 30-second shutdown countdown |
3047

3148
---
49+
3250
## ⚠️ Drawbacks & Warnings
33-
* **Stepped Percentage Drops:** Because of the compressed mathematical mapping, your status bar percentage will occasionally skip digits (e.g., jumping directly from 77% to 75%). This is completely normal behavior.
34-
* **Third-Party App Mismatches:** Apps that pull battery data directly from the system hardware layer or the Android kernel (such as AccuBattery, physical hardware monitors, or custom terminal scripts) will still read the true physical percentage rather than your remapped scale.
35-
* **Bootloop Protection Failsafe:** The automatic power-off sequence relies on the system `PowerManager`. If a custom ROM strictly blocks the drawing of the countdown UI dialog, a native safety mechanism will still trigger a graceful power shutdown to protect the cell from falling below your physical 20% limit.
51+
52+
* **Stepped Percentage Drops:** Because of the compressed mathematical mapping, your status bar percentage will occasionally skip digits (e.g., jumping directly from 77% to 75%). This is intended, native mathematical behavior.
53+
* **Kernel Supply Access:** Apps that pull battery data bypassing the Java framework directly from the Linux kernel file node layer (`/sys/class/power_supply/battery/capacity`) will still read the true physical percentage rather than your remapped scale.
54+
3655
---
56+
3757
## 📱 Supported Devices & Environment
38-
* **Root Requirement:** Magisk or KernelSU with a functioning Zygisk environment.
39-
* **Framework Requirement:** LSPosed (Zygisk release).
40-
* **Tested Architecture:** Designed and verified on custom AOSP architectures, specifically tested on **crDroid 12.9** running on the **Redmi Note 12 Pro 5G** platform.
41-
* **ROM Compatibility:** Highly compatible with heavily modified status bar engines (e.g., Evolution X, crDroid, Infinity X) that deploy custom battery styles like Circles, Dotted Icons, and Text indicators.
58+
59+
* **Environment Requirement:** Functioning Zygisk environment via Magisk or KernelSU.
60+
* **Framework Requirement:** LSPosed / Vector Framework.
61+
* **Target Architecture:** Verified on modern **Android 16** AOSP architectures (specifically tested on custom implementations like **Evolution X** and **crDroid** builds).
62+
* **ROM Compatibility:** Fully compatible with heavily modified status bar engines that deploy custom battery styles like Circles, Dotted Icons, Landscape pills, and Text indicators.
63+
4264
---
65+
4366
## 💬 Contact & Support
4467

4568
[![Telegram](https://img.shields.io/badge/Telegram-%230088cc?style=plastic&logo=telegram&logoColor=white)](https://t.me/dhangofa)

0 commit comments

Comments
 (0)