Skip to content

Instantly share code, notes, and snippets.

@MrCarb0n
Last active May 15, 2022 15:20
Show Gist options
  • Save MrCarb0n/1f3be90056ff8c238fc15ba8acb13f0a to your computer and use it in GitHub Desktop.
Save MrCarb0n/1f3be90056ff8c238fc15ba8acb13f0a to your computer and use it in GitHub Desktop.
Yellow flashlight disabler for RedmiNote4 / mido
#!/system/bin/sh
# Yellow flashlight disabler for RedmiNote4 (mido)
# Author: Tiash (@MrCarb0n) <MrCarb0n@proton.me>
# Gist: https://gist.github.com/1f3be90056ff8c238fc15ba8acb13f0a
F=/data/adb/service.d/YellowFlashDisabler.sh
echo "#!/system/bin/sh
# Yellow flashlight disabler for RedmiNote4 (mido)
# Author: Tiash (@MrCarb0n) <MrCarb0n@proton.me>
# Gist: https://gist.github.com/1f3be90056ff8c238fc15ba8acb13f0a
# Check if boot completed (in seconds)
while [ \"\$(getprop sys.boot_completed)\" != \"1\" ]; do
sleep 1
done
# Decrease value to "0" to disable yellow flash
for i in led:torch_1 led:flash_1
do
echo 0 > /sys/class/leds/\$i/max_brightness
done
# Execution done!
exit 0" > $F && chmod +x $F && sh $F
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment