S Battery Tweaker
5.4 · GitHub
More about this app
Enable or disable fast charging mode on Samsung devices when the battery temperature reaches a certain point
S Battery Tweaker
A simple app to prolong battery longevity by limiting charge rate/suspending charge based on temperature.
Requirements
Root access or Shizuku. If none of these are possible, see setup instruction below.
Setting up for OneUI 5 and below
Grant all the permissions and install the provider app when prompted.
Setting up for OneUI 6.0+ (No root)
If you have Shizuku, the app will automatically install the settings database provider. This is only done once.
If you have a PC and adb, you may install this app by running this adb command:
adb install --bypass-low-target-sdk-block settings-database-provider-v1.1-cli.apk
External Libraries:
- Root utilities - https://github.com/topjohnwu/libsu
- Time range picker - https://github.com/Droppers/TimeRangePicker
- Multi waves - https://github.com/scwang90/MultiWaveHeader
- OneUI design library - https://github.com/tribalfs/oneui-design
- SESL Jetpack modules - https://github.com/tribalfs/sesl-androidx
- SESL Material components - https://github.com/tribalfs/sesl-material-components-android
- OneUI icons - https://github.com/OneUIProject/oneui-icons
Build Requirements:
- Android Studio
- Github personal access token with
read:packagepermission (put yourGITHUB_USERNAMEandGITHUB_PASSWORD(personal access token) to Environment Variables (Windows) or PATH (Linux))
Did you like my work?
Any donation is much appreciated!
How Shizuku is used
Can toggle fast charging and idle bypass, manage refresh rates and install helper via `settings put`, sysfs and `pm install` through Shizuku.
This is an AI-assisted analysis of Shizuku-related usages in the app's public source code. It is best effort, so it may not catch every single usage.
How this app uses Shizuku
S Battery Tweaker uses Shizuku to run privileged shell commands that control Samsung charging hardware and protected settings. All commands use fixed arguments built by the app, not freeform user input.
- Toggle fast charging: automatically disables or re-enables wired
adaptive_fast_chargingand wireless fast charging based on battery temperature, charge level, schedule and cooldown timer, applied with thesettings putshell command through Shizuku. - Control kernel charging switch: reads and writes
/sys/class/sec/switch/afc_disablewhen the fast charging setting is not exposed, to check status and switch fast charging on or off. - Manage idle bypass charging: pauses charging and powers the phone directly by writing
pass_throughandprotect_batterywithsettings putand by reading and writing/sys/class/power_supply/battery/batt_full_capacity. - Show battery health: reads
/sys/class/power_supply/battery/fg_fullcapnomand the full capacity file through Shizuku to display remaining capacity and bypass support. - Adjust refresh rate: lowers
min_refresh_rateandpeak_refresh_ratewhen the screen is off and restores them when the screen turns on, applied withsettings putthrough Shizuku. - Install settings helper: installs the bundled settings database provider APK with
pm installthrough Shizuku on newer Android versions. - Restart app: restarts the app itself with
am force-stopafter helper install or permission changes to apply the new state.
Android APIs or commands used
settings put
pm installam force-stoplscatecho
Notable details
On older Android versions the helper app can install through the normal package installer without Shizuku. Many settings writes first try the normal system settings API or the helper provider, using Shizuku only when those fail.
Changelog
What's new for version 5.4
Changes:
- Improved user interface consistency
- Improved drain monitor accuracy and computation
- Fixed charge rate adjustment for AOSP-based ROMs
- Fixed settings database provider installation (#21)
- Fixed crashes on Android 11 (#12)
- Added feature to force lowest refresh rate on screen off
Due to my old signing key being accidentally deleted, you should uninstall the old version and install this new release. No need to set it up again.
Permissions
13 permissions requested