Skip to content

Instantly share code, notes, and snippets.

@DerGoogler
Created March 21, 2022 16:35
Show Gist options
  • Save DerGoogler/c777fa4d58afdd375a3b8ce6dc587a17 to your computer and use it in GitHub Desktop.
Save DerGoogler/c777fa4d58afdd375a3b8ce6dc587a17 to your computer and use it in GitHub Desktop.
Fake Shell Android Charger. Battery state will automatically reseted after successfully execution.
################################
# 2022 (c) Der_Googler #
# Fake Shell Android Charger #
################################
i=1
while [ $i -le 100 ]
do
# Change the battery steps every by one
cmd battery set level $i
echo "Battery level => $i"
# Sleep to avoid an direct set
sleep 0.3
i=$(($i+1))
done
echo "Battery state will be rested in 2 sec."
# Sleep after successfully execution
sleep 2
echo "Reset battery state"
# Reset the battery to the default sate
cmd battery reset
echo "Battery state successfully rested"
@DerGoogler
Copy link
Author

Note: This script requires Root (SuperUser) access and the cmd binary for Android. Without this will not work.

Please make sure you're on the SuperUser level while you executes this script.

@DerGoogler
Copy link
Author

Magisk Module here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment