Skip to content

A lightweight tool to manually set and control battery charging current on rooted Android or Linux devices via sysfs. Useful for testing, tuning fast charging, or prolonging battery health.

License

Notifications You must be signed in to change notification settings

DX4GREY/set-charge-current

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Set Charge Current

A simple C program to set the charging current for your device by modifying the constant_charge_current_max value in the sysfs directory. Ideal for rooted Android devices or Linux systems where manual tuning of charge current is needed.

Features

  • Set charging current dynamically (in milliamps).
  • Automatically manages file permissions for safe writes.
  • Compatible with Android (Termux) and standard Linux.
  • Includes Makefile with install, uninstall, info, and run targets.

Requirements

  • Root Access — Required to modify sysfs charging parameters.
  • Linux or Android — Works on rooted Android (via Termux) or any Linux-based system.

Installation

git clone https://github.com/DX4GREY/set-charge-current.git
cd set-charge-current
make

Optional: Install binary system-wide

make install

This will detect your OS and install to the correct location:

  • Android (Termux): ~/../usr/bin
  • Linux: /usr/local/bin

Optional: Create magisk module.

 make magisk_module

Select a predefined Magisk module template to create a custom module for Android devices. This allows seamless integration with Magisk for managing charging current settings.

Usage

sudo ./setcurrent <current_in_mA>

Example:

sudo ./setcurrent 2000  # Sets charging current to 2000 mA (2A)

Help

./setcurrent help

Uninstall

make uninstall

Clean up build files

make clean

Troubleshooting

  • Permission Denied: Make sure to run the binary as root (sudo) and ensure your device allows sysfs writes.
  • Invalid Argument: Your hardware might not support the value you're trying to set. Try lower values like 1000, 1500, etc.

License

This project is licensed under the MIT License. See the LICENSE file for details.

About

A lightweight tool to manually set and control battery charging current on rooted Android or Linux devices via sysfs. Useful for testing, tuning fast charging, or prolonging battery health.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published