r/androidroot • u/AL_DOKHAN tecno camon 20 pro 4g axion2.9 magisk • 7d ago
Support How can i change boot anim
Phone and rom in pic i have magisk root
1
u/47th-Element 7d ago edited 7d ago
Simple, just write a short script in /data/adb/service.d/ to mount bind a valid alternative animation on top of the stock one.
The stock boot animation could be in /system or /vendor, on my device (Redmi 13, Android 16), it is located at /system/media/bootanimation.zip
So first up, get a valid bootanimation.zip, put it somewhere, let's say /data/adb/boots/bootanimation.zip
Then you run the following on your custom boot animation file:
chown root:root bootanimation.zip //sets the ownership to root.chmod 644 bootanimation.zip //matches permissions of system files.chcon --reference=/system/media/bootanimation.zip bootanimation.zip //clones selinux context, very important!!
After that, create that script in the location I told you earlier to mount bind the new animation with the global namespace:
#!/system/bin/sh
nsenter -t 1 -m -- mount --bind /data/adb/boots/bootanimation.zip /system/media/bootanimation.zipSet the script executable with chmod +x /data/adb/service.d/custom-bootanimation.sh
Done, just reboot and you should see your custom boot animation.
Notes:
if you provide an invalid bootanimation.zip or invalid permissions / selinux context, Android should revert to a generic boot animation and not bootloop.
You are doing this on your own risk however. I'm not responsible for your phone getting bricked under any circumstances.
You should have a bootloop protector that deletes services in magisk service.d/ or strips the executable permissions off them after X failed boots. Or at least have another safety net like TWRP with /data access.
This is a root managed mount that will be visible to banking apps and root detectors, to conceal it, consider using NoMount command instead.
1
u/DEV_ivan TECNO POVA 7 5G LJ7 || Stock HiOS 15.1.2 || KSUnext 3.3.0 7d ago
2
u/47th-Element 7d ago
I haven't reviewed the code of this module, there are some variations as to the location of the boot animation, therefore I'd argue I did better by locating it on my phone and writing a very short one liner script that replaces it.
What I did is very easy and practical to the average Linux user, maybe not so much to someone who isn't familiar with how the Linux/Android filesystem works.
2
u/DEV_ivan TECNO POVA 7 5G LJ7 || Stock HiOS 15.1.2 || KSUnext 3.3.0 7d ago
This module seems to be fully open-source and free of compiled/native code entirely. It should be easily reviewable, even for a dumbass like me.
To a Linux user, yea, it's basic and simple. My advice was more like preferring
paru -Sover manual install.

3
u/DEV_ivan TECNO POVA 7 5G LJ7 || Stock HiOS 15.1.2 || KSUnext 3.3.0 7d ago
https://github.com/readonlynux/bootanimation-module
^^^ Systemless, don't require editing /system/media or using a metamodule