Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/amrikarisma/autoboot-oncharge-android
How to enable automatic booting of your Android device when it's connected to a charger or USB.
https://github.com/amrikarisma/autoboot-oncharge-android
Last synced: about 1 month ago
JSON representation
How to enable automatic booting of your Android device when it's connected to a charger or USB.
- Host: GitHub
- URL: https://github.com/amrikarisma/autoboot-oncharge-android
- Owner: amrikarisma
- Created: 2024-08-03T17:04:14.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2024-08-07T15:57:19.000Z (5 months ago)
- Last Synced: 2024-08-07T19:08:08.366Z (5 months ago)
- Language: Shell
- Size: 9.77 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Autoboot On Charge for Android
How to enable automatic booting of your Android device when it's connected to a charger or USB.### Requirements
- Rooted by Magisk
- Backup boot.img before start### Patch & Flash
Boot into TWRP recovery and connect your device to your computer, connect to ADB shell and run the following commands:
```
mkdir /sdcard/autoboot
dd if=/dev/block/bootdevice/by-name/boot of=/sdcard/autoboot/boot.img
```
Create file auto boot on same folder with boot.img
```
nano /sdcard/autoboot/autoboot.init.rc
```
Then enter the script below:
```
on charger
setprop ro.bootmode "normal"
setprop sys.powerctl "reboot"
```
Execute the following commands:
```
/data/adb/magisk/magiskboot unpack boot.img
/data/adb/magisk/magiskboot cpio ramdisk.cpio \
"mkdir 0700 overlay.d" \
"add 0700 overlay.d/autoboot.init.rc autoboot.init.rc"
/data/adb/magisk/magiskboot repack boot.img boot_patched_autoboot.img
/data/adb/magisk/magiskboot cleanup
```
Flashing patch to boot.img. Run the following commands:
```
dd if=/sdcard/autoboot/boot_patched_autoboot.img of=/dev/block/bootdevice/by-name/boot
````### Done
Power off your device and connect it to a charger or USB. Your device should boot automatically.### Tested
- Redmi 4x
- Redmi Note 4
- soon### Credits
- https://github.com/anasfanani/magisk-autoboot
- https://xdaforums.com/t/module-magisk-autoboot-auto-power-on-android-when-charger-connected.4645951/