ShizuStore

S Battery Tweaker

pascua28

5.4 · GitHub

Download APK
Vendor-specific Android 10+ 3 weeks ago Proprietary
78 ShizuStore
17.7k GitHub
152 Stars
2 MB Size

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.

Screenshot

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:

Build Requirements:

  • Android Studio
  • Github personal access token with read:package permission (put your GITHUB_USERNAME and GITHUB_PASSWORD (personal access token) to Environment Variables (Windows) or PATH (Linux))

Did you like my work?

Any donation is much appreciated!

Crypto: LiteCoin Etherium Bitcoin

Close

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_charging and wireless fast charging based on battery temperature, charge level, schedule and cooldown timer, applied with the settings put shell command through Shizuku.
  • Control kernel charging switch: reads and writes /sys/class/sec/switch/afc_disable when 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_through and protect_battery with settings put and by reading and writing /sys/class/power_supply/battery/batt_full_capacity.
  • Show battery health: reads /sys/class/power_supply/battery/fg_fullcapnom and the full capacity file through Shizuku to display remaining capacity and bypass support.
  • Adjust refresh rate: lowers min_refresh_rate and peak_refresh_rate when the screen is off and restores them when the screen turns on, applied with settings put through Shizuku.
  • Install settings helper: installs the bundled settings database provider APK with pm install through Shizuku on newer Android versions.
  • Restart app: restarts the app itself with am force-stop after helper install or permission changes to apply the new state.

Android APIs or commands used

  • settings put
  • pm install
  • am force-stop
  • ls
  • cat
  • echo

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.

Close

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.

Close

Permissions

13 permissions requested

  • android.permission.FOREGROUND_SERVICE
  • android.permission.FOREGROUND_SERVICE_SPECIAL_USE
  • android.permission.POST_NOTIFICATIONS
  • android.permission.RECEIVE_BOOT_COMPLETED
  • android.permission.WRITE_SETTINGS
  • android.permission.WRITE_SECURE_SETTINGS
  • android.permission.WRITE_SYNC_SETTINGS
  • android.permission.READ_SYNC_SETTINGS
  • android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS
  • com.netvor.settings.tables.provider.permission.SETTINGS_TABLES_PROVIDER
  • android.permission.REQUEST_INSTALL_PACKAGES
  • com.sammy.sbatterytweaks.DYNAMIC_RECEIVER_NOT_EXPORTED_PERMISSION
  • moe.shizuku.manager.permission.API_V23
Close