Real 0.01% hardware-precision decimal battery percentages (49.27% / 49,2%) across Android SystemUI, Lock Screen, Always On Display, and Settings.
Built natively for Samsung One UI 9 (Android 17) on Galaxy S26 Ultra, with multi-OEM hardware fuel-gauge probes and classic AOSP hooks.
Live pill padding adjustment (-15% to +40%) resizes the native Jetpack Compose status-bar battery capsule in real time without restarting SystemUI:
Compact (-15% padding · 148 px) |
Default (0% padding · 162 px) |
Wide (+40% padding · 228 px) |
|---|---|---|
![]() |
![]() |
![]() |
- True Hardware Fuel-Gauge Precision (
0.01%) — Reads raw capacity registers directly from kernelsysfsnodes (batt_read_raw_soc,capacity_raw,soc_decimal) rather than timer-guessing or faking decimals. - Native Samsung One UI 9 Compose Pill — Dynamically expands
BatteryLayoutState.totalWidthPx, balances icon-to-text padding, optically centers Canvas typography, and flushes updates via ComposeSnapshot.sendApplyNotifications()for sub-frame latency while the screen is on. - System-Wide Battery Coverage:
- Status Bar & Quick Settings Header —
SamsungBatteryComposeView,SamsungBatteryMeterDrawable, and AOSPBatteryMeterView.updatePercentText - Charging Popup Chip & Lock Screen Now Bar —
SamsungBatteryStatusChipandChargerNowBarView - Lock Screen & Notifications —
KeyguardIndicationControllerandChargingNotificationTextFormatter - Always On Display (AOD) —
com.samsung.android.uniform.widget.battery.*andChargingInfoView - Settings & Device Care —
BatteryLevelPreferenceController,BatteryInfoProgressView(smooth float progress + Spanned text), AOSPBatteryInfo, and battery-scopedSettingsLib Utils.formatPercentage
- Status Bar & Quick Settings Header —
- Zero-Reboot Live Customization:
- Switch between
0.1%tenths and0.01%hundredths - Choose dot (
49.27%) or comma (49,27%) decimal separator - Keep
100%clean at full charge (optional) - Adjust pill padding (
-15%to+45%), pill font scale (75%to105%), and screen-on refresh rate (250 ms,500 ms,1 s,2 s)
- Switch between
- One-Tap Root Setup & Diagnostic Inspector:
- Live hardware telemetry dashboard (voltage, power wattage, temperature, OS vs. hardware delta sparkline, SOC rate
%/min) - Auto-discovers fuel-gauge SELinux file labels and installs a persistent KernelSU / Magisk / APatch module (
/data/adb/modules/decimal_battery_sysfs) - Exports a ready-to-paste Markdown diagnostic report (
SYSTEM -> Copy Diagnostic Report)
- Live hardware telemetry dashboard (voltage, power wattage, temperature, OS vs. hardware delta sparkline, SOC rate
Decimal Battery selects the highest-resolution readable source on your kernel in priority order:
- Samsung
sec_battery/max77775(Primary on Samsung Galaxy) Applies the exact kernel scaling formula frommax77775_fg_get_scaled_capacity:percent = clamp(batt_read_raw_soc * 10.0 / batt_capacity_max, 0.0, 100.0) - Qualcomm / Maxim / Pixel / Multi-OEM
capacity_raw&soc_decimalProbes/sys/class/power_supply/{battery,bms,maxfg,max1720x_battery,fg,fuelgauge,qcom-battery}and auto-calibrates raw register scaling (÷100.0,÷256.0for Q8.8 RepSOC,÷10.0, or÷1000.0) against Android's reported integercapacity. - Universal
charge_counter / charge_fullFallback Readscharge_counter(µAh) andcharge_fullviasysfsorBatteryManagerwhen raw SOC registers are unavailable.
| ROM / Device | Status | What Works | Limitations / Notes |
|---|---|---|---|
| Samsung One UI 9 (Android 17) Tested on Galaxy S26 Ultra ( SM-S948B) |
Verified | Full Compose status bar & QS pill, live pill padding, charging chip, Now Bar, Lock Screen charging text, AOD, Settings & Device Care | — |
| Samsung One UI 7 / 8 | Experimental | SamsungBatteryMeterDrawable, AOD, Device Care, Settings BatteryLevelPreferenceController |
Compose status bar classes are specific to One UI 9 builds and have not been tested on One UI 7/8 |
| AOSP / LineageOS / Pixel (Android 13–17) | Experimental (Hooks Unverified on Device) | Classic BatteryMeterView.updatePercentText, BatteryInfo, SettingsLib Utils.formatPercentage, and capacity_raw / charge_counter readers |
Newer Pixel Compose UnifiedBattery glyph-path icons do not render a TextView percentage and are not hooked yet |
| HyperOS / MIUI / ColorOS / OxygenOS | Partial / Untested | Companion telemetry dashboard + generic capacity_raw / soc_decimal probing |
Heavily customized OEM SystemUI battery views usually need dedicated hook PRs — share your Diagnostic Report in an OEM Support Issue |
- Root: KernelSU / KernelSU Next, Magisk, or APatch
- Xposed Framework: Vector or LSPosed (API 82+)
- Install the latest APK from GitHub Releases (
com.mahanytt.decimalbattery). - Enable & Scope in Vector / LSPosed:
- Enable Decimal Battery
- Scope
com.android.systemui(pluscom.android.settings, andcom.samsung.android.app.aodservice+com.samsung.android.loolon Samsung) - Or open Decimal Battery and tap Auto-Enable in Vector if
/data/adb/lspd/cliis installed
- Unlock Sysfs & Restart SystemUI:
- Tap Unlock Hardware Fuel Gauge inside the app (applies live SELinux read-only rules and installs
/data/adb/modules/decimal_battery_sysfsso permissions survive reboots) - Tap Restart SystemUI in the SYSTEM tab
- Tap Unlock Hardware Fuel Gauge inside the app (applies live SELinux read-only rules and installs
- Status pill shows whole numbers or integer fallback?
Tap SYSTEM -> Unlock Hardware Fuel Gauge and check whether
Direct Sysfs Accessturns green (Unlocked (0.01%)). If your kernel stores raw SOC under a different node name, expand Power Supply Inspector and open an OEM Support Request. - Sliders or formatting toggles don't update immediately?
Ensure Decimal Battery itself (
com.mahanytt.decimalbattery) andcom.android.systemuiare both enabled in Vector/LSPosed soXSharedPreferencesandACTION_SETTINGS_CHANGEDstay synced. - Note on APK Signatures:
v1.1.0was signed with the fallback build key until a dedicated release keystore secret is configured in GitHub Actions. Future releases signed with a dedicated keystore will require uninstalling and reinstalling once if Android reports a signature mismatch.
Requires JDK 21 and Android SDK 37.2 (minSdk 33, targetSdk 37).
git clone https://github.com/MahanYTT/DecimalBattery.git
cd DecimalBattery
./gradlew :app:assembleDebug :app:assembleReleaseOptional release signing environment variables (supported both locally and via GitHub Actions repository secrets):
| Variable / Secret | Purpose |
|---|---|
KEYSTORE_BASE64 (CI only) |
Base64-encoded .jks / .keystore decoded to KEYSTORE_PATH on runner |
KEYSTORE_PATH |
Path to local release keystore file |
KEYSTORE_PASSWORD |
Keystore store password |
KEY_ALIAS |
Signing key alias |
KEY_PASSWORD |
Signing key password |
Licensed under the MIT License.


