Hello World.
Tommy here. This time I have a nifty little trick for you guys.
This took a little creative thinking but I think I got it pretty good. I was chatting with some Team Ramen Noodles guys and someone asked how an AOSP botanimaiton zip can be flashed on a Sense ROM. This was the lightbulb moment
Instructions for dev:
Download from link below.
Place the file "bootanimation.zip" inside the update.zip. I put a placeholder so you would know where to replace it.
Optionally, you can put a sound "android_audio.mp3". If you don't want it, then just leave it out. Not necessary.
When you open it up, you will see two place holder files, "bootanimaion.zip__HERE" and "android_audo.mp3__HERE". You can delete them if you want, but they don't do anything. Just for reference.
Files must be named "bootanimation.zip" and "android_audio.zip", otherwise won't work.
The script "tt_uni_boot" looks for the animation and sound in the rom, and replaces it depending on what it finds.
This works on AOSP, Sense, Sprint, HTC, and Verizion
The update.zip below is what you should use as your base if you want to make your bootanimation universal for all roms.
Also, if anyone wants to flash it as is, it contains this lovely animation:
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Original Thread Here for HTC Animation
Universal Bootanimation update.zip v0.0.1 - January 08, 2012
Enjoy!
Please report feedback. I and dean_fx tested it before I posted, but if you want different feature or something like that let me know.
Tommy
edit1.
And in case anyone wants to adapt my script, I am more than happy to share. Just give a little credit
Sharing means caring. And collaborative efforts yield better results.
Code:
#!/system/bin/bash
#tommytomatoe
#universal animation flasher
# creating logfile "lockscreen" on sdcard
log=sdcard/bootanimation.log
touch $log
# mounting system as R/W
busybox mount -o remount,rw /system
echo "/system mounted as R/W" > $log
echo "" >> $log
# doing some checks
# bootanimation locatioon
if busybox [ -e /system/customize/resource/bootanimation.zip ]; then
BOOT_ANI=/system/customize/resource/bootanimation.zip
elif busybox [ -e /data/local/bootanimation.zip ]; then
BOOT_ANI=/data/local/bootanimation.zip
elif busybox [ -e /system/media/bootanimation.zip ]; then
BOOT_ANI=/system/media/bootanimation.zip
elif busybox [ -e /system/customize/resource/spc_bootanimation.zip ]; then
BOOT_ANI=/system/customize/resource/spc_bootanimation.zip
elif busybox [ -e /data/local/spc_bootanimation.zip ]; then
BOOT_ANI=/data/local/spc_bootanimation.zip
elif busybox [ -e /system/media/spc_bootanimation.zip ]; then
BOOT_ANI=/system/media/spc_bootanimation.zip
elif busybox [ -e /system/customize/resource/VZW_bootanimation.zip ]; then
BOOT_ANI=/system/customize/resource/VZW_bootanimation.zip
elif busybox [ -e /data/local/VZW_bootanimation.zip ]; then
BOOT_ANI=/data/local/VZW_bootanimation.zip
elif busybox [ -e /system/media/VZW_bootanimation.zip ]; then
BOOT_ANI=/system/media/VZW_bootanimation.zip
elif busybox [ -e /system/customize/resource/hTC_bootanimation.zip ]; then
BOOT_ANI=/system/customize/resource/hTC_bootanimation.zip
elif busybox [ -e /data/local/hTC_bootanimation.zip ]; then
BOOT_ANI=/data/local/hTC_bootanimation.zip
elif busybox [ -e /system/media/hTC_bootanimation.zip ]; then
BOOT_ANI=/system/media/hTC_bootanimation.zip
else
echo "Bootanimation does not exist" >> $log
exit 1
fi
# bootanimation sound location
if busybox [ -e /system/customize/resource/android_media.mp3 ]; then
BOOT_SOUND=/system/customize/resource/android_media.mp3
elif busybox [ -e /data/local/android_media.mp3 ]; then
BOOT_SOUND=/data/local/android_media.mp3
elif busybox [ -e /system/media/android_media.mp3 ]; then
BOOT_SOUND=/system/media/android_media.mp3
elif busybox [ -e /system/customize/resource/android_audio.mp3 ]; then
BOOT_SOUND=/system/customize/resource/android_audio.mp3
elif busybox [ -e /data/local/android_audio.mp3 ]; then
BOOT_SOUND=/data/local/android_audio.mp3
elif busybox [ -e /system/media/android_audio.mp3 ]; then
BOOT_SOUND=/system/media/android_audio.mp3
elif busybox [ -e /system/customize/resource/SPC_animation_final.mp3 ]; then
BOOT_SOUND=/system/customize/resource/SPC_animation_final.mp3
elif busybox [ -e /data/local/SPC_animation_final.mp3 ]; then
BOOT_SOUND=/data/local/SPC_animation_final.mp3
elif busybox [ -e /system/media/SPC_animation_final.mp3 ]; then
BOOT_SOUND=/system/media/SPC_animation_final.mp3
else
echo "Bootanimation sound does not exist" >> $log
fi
echo "$BOOT_ANI" >> $log
echo "$BOOT_SOUND" >> $log
echo "" >> $log
# moving animation
busybox mv -f /data/local/tmp/bootanimation.zip $BOOT_ANI
if busybox [ -e /data/local/tmp/bootanimation.zip ] ; then
buxybox rm -f /data/local/tmp/bootanimation.zip
fi
if busybox [ -e $BOOT_ANI ] ; then
echo "SUCCESS! Bootanimation moved to $BOOT_ANI" >> $log
else
echo "FAILURE! Bootanimation not moved to $BOOT_ANI" >> $log
fi
echo "" >> $log
# moving busybox mv -f /data/local/tmp/bootanimation.zip $BOOT_ANI
busybox mv -f /data/local/tmp/android_audio.mp3 $BOOT_SOUND
if busybox [ -e /data/local/tmp/android_audio.mp3 ] ; then
buxybox rm -f /data/local/tmp/android_audio.mp3
fi
if busybox [ -e $BOOT_SOUND ] ; then
echo "SUCCESS! Bootanimation sound moved to $BOOT_SOUND" >> $log
else
echo "FAILURE! Bootanimation sound moved to $BOOT_SOUND" >> $log
fi
echo "" >> #log
echo "Universal Bootanimation Flasher Commencing" >> $log
Sent from my PC36100 using Tapatalk
The bottom of that post was Spanish to me
Sent from my HTC Droid Incredible using xda premium
Alton (Halo 2) said:
The bottom of that post was Spanish to me
Sent from my HTC Droid Incredible using xda premium
Click to expand...
Click to collapse
Lol
Sent from my PC36100 using Tapatalk
7th (#) line you splled location wrong in your script...maybe it still works... I don't know how this stuff works, I just use it
hovercraftdriver said:
7th (#) line you splled location wrong in your script...maybe it still works... I don't know how this stuff works, I just use it
Click to expand...
Click to collapse
Good eye
It isn't affected. In bash and shell the character # ignores all values that appear after it on the same line.
I'll still fix it later
Sent from my PC36100 using Tapatalk
LOL I spelled "spelled" wrong anyway...
hovercraftdriver said:
LOL I spelled "spelled" wrong anyway...
Click to expand...
Click to collapse
Lol. Double fail (you and me)
sent from my HP touchpad
tommytomatoe said:
Hello World.
Tommy here. This time I have a nifty little trick for you guys.
This took a little creative thinking but I think I got it pretty good. I was chatting with some Team Ramen Noodles guys and someone asked how an AOSP botanimaiton zip can be flashed on a Sense ROM. This was the lightbulb moment
Instructions for dev:
Download from link below.
Place the file "bootanimation.zip" inside the update.zip. I put a placeholder so you would know where to replace it.
Optionally, you can put a sound "android_audio.mp3". If you don't want it, then just leave it out. Not necessary.
When you open it up, you will see two place holder files, "bootanimaion.zip__HERE" and "android_audo.mp3__HERE". You can delete them if you want, but they don't do anything. Just for reference.
Files must be named "bootanimation.zip" and "android_audio.zip", otherwise won't work.
The script "tt_uni_boot" looks for the animation and sound in the rom, and replaces it depending on what it finds.
This works on AOSP, Sense, Sprint, HTC, and Verizion
The update.zip below is what you should use as your base if you want to make your bootanimation universal for all roms.
Also, if anyone wants to flash it as is, it contains this lovely animation:
Original Thread Here for HTC Animation
Universal Bootanimation update.zip v0.0.1 - January 08, 2012
Enjoy!
Please report feedback. I and dean_fx tested it before I posted, but if you want different feature or something like that let me know.
Tommy
edit1.
And in case anyone wants to adapt my script, I am more than happy to share. Just give a little credit
Sharing means caring. And collaborative efforts yield better results.
Code:
#!/system/bin/bash
#tommytomatoe
#universal animation flasher
# creating logfile "lockscreen" on sdcard
log=sdcard/bootanimation.log
touch $log
# mounting system as R/W
busybox mount -o remount,rw /system
echo "/system mounted as R/W" > $log
echo "" >> $log
# doing some checks
# bootanimation locatioon
if busybox [ -e /system/customize/resource/bootanimation.zip ]; then
BOOT_ANI=/system/customize/resource/bootanimation.zip
elif busybox [ -e /data/local/bootanimation.zip ]; then
BOOT_ANI=/data/local/bootanimation.zip
elif busybox [ -e /system/media/bootanimation.zip ]; then
BOOT_ANI=/system/media/bootanimation.zip
elif busybox [ -e /system/customize/resource/spc_bootanimation.zip ]; then
BOOT_ANI=/system/customize/resource/spc_bootanimation.zip
elif busybox [ -e /data/local/spc_bootanimation.zip ]; then
BOOT_ANI=/data/local/spc_bootanimation.zip
elif busybox [ -e /system/media/spc_bootanimation.zip ]; then
BOOT_ANI=/system/media/spc_bootanimation.zip
elif busybox [ -e /system/customize/resource/VZW_bootanimation.zip ]; then
BOOT_ANI=/system/customize/resource/VZW_bootanimation.zip
elif busybox [ -e /data/local/VZW_bootanimation.zip ]; then
BOOT_ANI=/data/local/VZW_bootanimation.zip
elif busybox [ -e /system/media/VZW_bootanimation.zip ]; then
BOOT_ANI=/system/media/VZW_bootanimation.zip
elif busybox [ -e /system/customize/resource/hTC_bootanimation.zip ]; then
BOOT_ANI=/system/customize/resource/hTC_bootanimation.zip
elif busybox [ -e /data/local/hTC_bootanimation.zip ]; then
BOOT_ANI=/data/local/hTC_bootanimation.zip
elif busybox [ -e /system/media/hTC_bootanimation.zip ]; then
BOOT_ANI=/system/media/hTC_bootanimation.zip
else
echo "Bootanimation does not exist" >> $log
exit 1
fi
# bootanimation sound location
if busybox [ -e /system/customize/resource/android_media.mp3 ]; then
BOOT_SOUND=/system/customize/resource/android_media.mp3
elif busybox [ -e /data/local/android_media.mp3 ]; then
BOOT_SOUND=/data/local/android_media.mp3
elif busybox [ -e /system/media/android_media.mp3 ]; then
BOOT_SOUND=/system/media/android_media.mp3
elif busybox [ -e /system/customize/resource/android_audio.mp3 ]; then
BOOT_SOUND=/system/customize/resource/android_audio.mp3
elif busybox [ -e /data/local/android_audio.mp3 ]; then
BOOT_SOUND=/data/local/android_audio.mp3
elif busybox [ -e /system/media/android_audio.mp3 ]; then
BOOT_SOUND=/system/media/android_audio.mp3
elif busybox [ -e /system/customize/resource/SPC_animation_final.mp3 ]; then
BOOT_SOUND=/system/customize/resource/SPC_animation_final.mp3
elif busybox [ -e /data/local/SPC_animation_final.mp3 ]; then
BOOT_SOUND=/data/local/SPC_animation_final.mp3
elif busybox [ -e /system/media/SPC_animation_final.mp3 ]; then
BOOT_SOUND=/system/media/SPC_animation_final.mp3
else
echo "Bootanimation sound does not exist" >> $log
fi
echo "$BOOT_ANI" >> $log
echo "$BOOT_SOUND" >> $log
echo "" >> $log
# moving animation
busybox mv -f /data/local/tmp/bootanimation.zip $BOOT_ANI
if busybox [ -e /data/local/tmp/bootanimation.zip ] ; then
buxybox rm -f /data/local/tmp/bootanimation.zip
fi
if busybox [ -e $BOOT_ANI ] ; then
echo "SUCCESS! Bootanimation moved to $BOOT_ANI" >> $log
else
echo "FAILURE! Bootanimation not moved to $BOOT_ANI" >> $log
fi
echo "" >> $log
# moving busybox mv -f /data/local/tmp/bootanimation.zip $BOOT_ANI
busybox mv -f /data/local/tmp/android_audio.mp3 $BOOT_SOUND
if busybox [ -e /data/local/tmp/android_audio.mp3 ] ; then
buxybox rm -f /data/local/tmp/android_audio.mp3
fi
if busybox [ -e $BOOT_SOUND ] ; then
echo "SUCCESS! Bootanimation sound moved to $BOOT_SOUND" >> $log
else
echo "FAILURE! Bootanimation sound moved to $BOOT_SOUND" >> $log
fi
echo "" >> #log
echo "Universal Bootanimation Flasher Commencing" >> $log
Sent from my PC36100 using Tapatalk
Click to expand...
Click to collapse
tommy that is the exact bootanimation I am trying to change in supermagic preview 0.0.0.6 ..... I've d/l so many boot animations I have lost track. Where in supermagic preview is the original bootanimation script, that I have to replace, and what do I call it's replacement?
Thanks
RascalDoc said:
tommy that is the exact bootanimation I am trying to change in supermagic preview 0.0.0.6 ..... I've d/l so many boot animations I have lost track. Where in supermagic preview is the original bootanimation script, that I have to replace, and what do I call it's replacement?
Thanks
Click to expand...
Click to collapse
Just follow the instructions on the post.
Download this zip.
Download your desired bootanimation.
Rename the bootanimation "bootabimation.zip".
Replace the one inside the zip from me with the one you renamed in the step above.
Put zip in pshoe and flash.
This zip will automatically find the current bootanimation and replace it for you. The one I included in the zip is just a placeholder so you know what to replace.
For future reference in classic it is in /system/customize/resource/spc_bootanimation.zip
Sent from my PC36100 using Tapatalk
Tommy
couldn't find the zip (I did find it later) but I renamed as prescribed the boot animation and placed it where you said to place it and lo and behold .... It Works It Works!!!!!!
Thanks.
Doc W.
RascalDoc said:
couldn't find the zip (I did find it later) but I renamed as prescribed the boot animation and placed it where you said to place it and lo and behold .... It Works It Works!!!!!!
Thanks.
Doc W.
Click to expand...
Click to collapse
Woot woot!!!
Sent from my PC36100 using Tapatalk
i would like to use your animation as an animated background in notification area.
http://forum.xda-developers.com/showthread.php?t=1309130
i will give you credit of course.
synisterwolf said:
i would like to use your animation as an animated background in notification area.
http://forum.xda-developers.com/showthread.php?t=1309130
i will give you credit of course.
Click to expand...
Click to collapse
Go for it!
Sent from my PC36100 using Tapatalk
ermm. The download link is down? I would really like to use your update.zip for my bootanimation(With credits of course). Thanks in advance
Let me find the file on ny computer
Sent from my PG86100 using Tapatalk 2
Dont want to be pushy or anything, but can you find the file?
Sent from my HTC EVO 3D X515m using XDA
Related
milestone 1 on cm7 0.08-11.04.24 7.0.1 , i have one ext3 partition on my sdcard, everything was working fine,
but after upgrading to cm7.1.0 RC0 11.05.03 yesterday , i can't move the dalvik-cache to ext partition any longer.
even if i do this
mv /data/dalvik-cache /sddata/dalvik-cache
ln -s /sd-ext/dalvik-cache/ /data/dalvik-cache
next time phone reboots, it delete my link and create dalvik-cache directory in "internal storage" while not on my ext3 partition
when i boot into OR 3.3 , the ext3 partition is mounted as /sddata
if i boot into phone ui, the ext3 partition is mounted as /sd-ext
i tiried linking to both directory , none of them works
anyone knows how to do it ?
[edit] after updating to 7.1.0 RC5 11.05.20, the file update-07app2ext-dalvik.on.ext.zip provided by zeppelin doesn't work , ahhhhh.
You will need to edit the 07app2ext file in /system/etc/init.d
Yep.
I did this yesterday actually since my internal storage was getting too low for my liking.
From github, the earlier 07app2ext:
Code:
#!/system/bin/sh
if [ "$SD_EXT_DIRECTORY" = "" ];
then
SD_EXT_DIRECTORY=/sd-ext
fi
if [ "`egrep -q $SD_EXT_DIRECTORY /proc/mounts;echo $?`" != "0" ];
then
echo "$SD_EXT_DIRECTORY not mounted.. skipping a2sd"
exit
fi
for dir in app app-private dalvik-cache;do
if [ "`egrep -q \"/data/${dir}\" /proc/mounts;echo $?`" != "0" ];
then
if [ ! -e "${SD_EXT_DIRECTORY}/${dir}" ];
then
install -m 771 -o 1000 -g 1000 -d ${SD_EXT_DIRECTORY}/${dir}
fi
if [ -L "/data/${dir}" ];
then
rm /data/${dir}
install -m 771 -o 1000 -g 1000 -d /data/${dir}
fi
if [ "${dir}" = "dalvik-cache" ];
then
if [ ! -L "/data/${dir}" ];
then
rm -rf /data/${dir}
install -m 771 -o 1000 -g 1000 -d /data/${dir}
fi
fi
if [ "${dir}" = "app" -o "${dir}" = "app-private" ];
then
for app in `find /data/${dir} -type f -iname "*.apk" -o -iname "*.zip"`;do
mv ${app} ${SD_EXT_DIRECTORY}/${dir}/
done
fi
mount -o bind ${SD_EXT_DIRECTORY}/${dir}/ /data/${dir}
fi
done
chmod 755 /system/etc/init.d/07app2ext
chown -R 0.2000 /system/etc/init.d
sleep 1
I just started using s2e from the market, its working so far
zeppelinrox said:
Yep.
I did this yesterday actually since my internal storage was getting too low for my liking.
From github, the earlier 07app2ext:
Code:
#!/system/bin/sh
if [ "$SD_EXT_DIRECTORY" = "" ];
then
SD_EXT_DIRECTORY=/sd-ext
fi
if [ "`egrep -q $SD_EXT_DIRECTORY /proc/mounts;echo $?`" != "0" ];
then
echo "$SD_EXT_DIRECTORY not mounted.. skipping a2sd"
exit
fi
for dir in app app-private dalvik-cache;do
if [ "`egrep -q \"/data/${dir}\" /proc/mounts;echo $?`" != "0" ];
then
if [ ! -e "${SD_EXT_DIRECTORY}/${dir}" ];
then
install -m 771 -o 1000 -g 1000 -d ${SD_EXT_DIRECTORY}/${dir}
fi
if [ -L "/data/${dir}" ];
then
rm /data/${dir}
install -m 771 -o 1000 -g 1000 -d /data/${dir}
fi
if [ "${dir}" = "dalvik-cache" ];
then
if [ ! -L "/data/${dir}" ];
then
rm -rf /data/${dir}
install -m 771 -o 1000 -g 1000 -d /data/${dir}
fi
fi
if [ "${dir}" = "app" -o "${dir}" = "app-private" ];
then
for app in `find /data/${dir} -type f -iname "*.apk" -o -iname "*.zip"`;do
mv ${app} ${SD_EXT_DIRECTORY}/${dir}/
done
fi
mount -o bind ${SD_EXT_DIRECTORY}/${dir}/ /data/${dir}
fi
done
chmod 755 /system/etc/init.d/07app2ext
chown -R 0.2000 /system/etc/init.d
sleep 1
Click to expand...
Click to collapse
It works on MIUI?
I think so.
It's based on CM7, yeah?
If people are using app2ext on MIUI then I'd say yes.
If it has an 07app2ext file, then it's 100% guaranteed.
What I did was I replaced the 07app2ext file in the update zip with the one above so when it gets flashed I don't have to do anything.
It has an 07app2ext file, so a replace with this and my app2ext didnt work anymore...
There is my older app2ext code:
Code:
#!/system/bin/sh
if [ "$SD_EXT_DIRECTORY" = "" ];
then
SD_EXT_DIRECTORY=/sd-ext
fi
if [ "`egrep -q $SD_EXT_DIRECTORY /proc/mounts;echo $?`" != "0" ];
then
echo "$SD_EXT_DIRECTORY not mounted.. skipping a2sd"
exit
fi
if [ -L "/data/dalvik-cache" ];
then
rm /data/dalvik-cache
install -m 771 -o 1000 -g 1000 -d /data/dalvik-cache
fi
if [ -e "${SD_EXT_DIRECTORY}/dalvik-cache" ];
then
rm -rf ${SD_EXT_DIRECTORY}/dalvik-cache
fi
for dir in app app-private;do
if [ "`egrep -q \"/data/${dir}\" /proc/mounts;echo $?`" != "0" ];
then
if [ ! -e "${SD_EXT_DIRECTORY}/${dir}" ];
then
install -m 771 -o 1000 -g 1000 -d ${SD_EXT_DIRECTORY}/${dir}
fi
if [ -L "/data/${dir}" ];
then
rm /data/${dir}
install -m 771 -o 1000 -g 1000 -d /data/${dir}
fi
if [ "${dir}" = "app" -o "${dir}" = "app-private" ];
then
for app in `find /data/${dir} -type f -iname "*.apk" -o -iname "*.zip"`;do
mv ${app} ${SD_EXT_DIRECTORY}/${dir}/
done
fi
mount -o bind ${SD_EXT_DIRECTORY}/${dir}/ /data/${dir}
fi
done
ah... sometimes that happens...
If you were to put that in the MIUI update zip and flash it, it will work.
I don't know why that happens.
When it happened to me I couldnt figure it out either since I made sure the permissions stayed the same. Maybe it would work as a standalone flashable zip but I have never made one.
Zeppe, can you send me your 07app2ext and tell me what permissions it have? I have 500 mb in the ext partition but i can load it to maximum 'cause my internal storage get full. Now i have about 80 apps, and only 22mb left in the internal storage.
Attached.
Permissions are the same as other files in ect/init.d
xxx
xox
ooo
But when I did it manually, it didn't work
edit... try the attached update.zip... it just might work
either way, the file is in there.
BAZINGA! lol!! It works!!! Thanks a lot zeppelin!
heh
Sent from my Milestone using Tapatalk
zeppelinrox said:
Attached.
Permissions are the same as other files in ect/init.d
xxx
xox
ooo
But when I did it manually, it didn't work
edit... try the attached update.zip... it just might work
either way, the file is in there.
Click to expand...
Click to collapse
zeppelinrox, can I apply this update on CM7 RC10? Is it safe to do it?
I want to move my dalvik cache to ext2 because my internal storage its almost full (less than 20MB free).
Yes its fine.
It's a mod of an overclock flashable zip so when you flash it, it gives an overclock related message.
You can also replace the app2ext script in the cm7 update with the one in this zip file with 7zip and without extracting the cm7 update.
I just leave it in AOR's update folder tho.
So when I flash a rom, I flash this too
Sent from my Milestone using Tapatalk
Thanks for this script, it works perfectly.
I've applied the update from AOR and after move any app from SD to ext2 and reboot, CM7 moves dalvik cache for that apps to ext2.
Now, I suppose any time I update the ROM then before reboot I need to apply this script again.
Sent from my Milestone using XDA App
Yes as an update would probably overwrite this app2ext script
Sent from my Milestone using Tapatalk
Hello World.
Tommy here. This time I have a nifty little trick for you guys.
This took a little creative thinking but I think I got it pretty good. I was chatting with some Team Ramen Noodles guys and someone asked how an AOSP botanimaiton zip can be flashed on a Sense ROM. This was the lightbulb moment
Instructions for dev:
Download from link below.
Place the file "bootanimation.zip" inside the update.zip. I put a placeholder so you would know where to replace it.
Optionally, you can put a sound "android_audio.mp3". If you don't want it, then just leave it out. Not necessary.
When you open it up, you will see two place holder files, "bootanimaion.zip__HERE" and "android_audo.mp3__HERE". You can delete them if you want, but they don't do anything. Just for reference.
Files must be named "bootanimation.zip" and "android_audio.zip", otherwise won't work.
The script "tt_uni_boot" looks for the animation and sound in the rom, and replaces it depending on what it finds.
This works on AOSP, Sense, Sprint, HTC, and Verizion
The update.zip below is what you should use as your base if you want to make your bootanimation universal for all roms.
Also, if anyone wants to flash it as is, it contains this lovely animation:
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Original Thread Here
Universal Bootanimation update.zip v0.0.1 - January 08, 2012
Tested on HTC Supersonic EVO 4g and HTC Droid Incredible
Enjoy!
Please report feedback. I and dean_fx tested it before I posted, but if you want different feature or something like that let me know.
The particular flash I posted might not work for every device out there. It is up to the dev/themer to adapt accordingly. But chances are HTC devices should work out the box. I provided the script below so feel free to adapt!
Tommy
edit1.
And in case anyone wants to adapt my script, I am more than happy to share. Just give a little credit
Sharing means caring. And collaborative efforts yield better results.
Code:
#!/system/bin/bash
#tommytomatoe
#universal animation flasher
# creating logfile "lockscreen" on sdcard
log=sdcard/bootanimation.log
touch $log
# mounting system as R/W
busybox mount -o remount,rw /system
echo "/system mounted as R/W" > $log
echo "" >> $log
# doing some checks
# bootanimation locatioon
if busybox [ -e /system/customize/resource/bootanimation.zip ]; then
BOOT_ANI=/system/customize/resource/bootanimation.zip
elif busybox [ -e /data/local/bootanimation.zip ]; then
BOOT_ANI=/data/local/bootanimation.zip
elif busybox [ -e /system/media/bootanimation.zip ]; then
BOOT_ANI=/system/media/bootanimation.zip
elif busybox [ -e /system/customize/resource/spc_bootanimation.zip ]; then
BOOT_ANI=/system/customize/resource/spc_bootanimation.zip
elif busybox [ -e /data/local/spc_bootanimation.zip ]; then
BOOT_ANI=/data/local/spc_bootanimation.zip
elif busybox [ -e /system/media/spc_bootanimation.zip ]; then
BOOT_ANI=/system/media/spc_bootanimation.zip
elif busybox [ -e /system/customize/resource/VZW_bootanimation.zip ]; then
BOOT_ANI=/system/customize/resource/VZW_bootanimation.zip
elif busybox [ -e /data/local/VZW_bootanimation.zip ]; then
BOOT_ANI=/data/local/VZW_bootanimation.zip
elif busybox [ -e /system/media/VZW_bootanimation.zip ]; then
BOOT_ANI=/system/media/VZW_bootanimation.zip
elif busybox [ -e /system/customize/resource/hTC_bootanimation.zip ]; then
BOOT_ANI=/system/customize/resource/hTC_bootanimation.zip
elif busybox [ -e /data/local/hTC_bootanimation.zip ]; then
BOOT_ANI=/data/local/hTC_bootanimation.zip
elif busybox [ -e /system/media/hTC_bootanimation.zip ]; then
BOOT_ANI=/system/media/hTC_bootanimation.zip
else
echo "Bootanimation does not exist" >> $log
exit 1
fi
# bootanimation sound location
if busybox [ -e /system/customize/resource/android_media.mp3 ]; then
BOOT_SOUND=/system/customize/resource/android_media.mp3
elif busybox [ -e /data/local/android_media.mp3 ]; then
BOOT_SOUND=/data/local/android_media.mp3
elif busybox [ -e /system/media/android_media.mp3 ]; then
BOOT_SOUND=/system/media/android_media.mp3
elif busybox [ -e /system/customize/resource/android_audio.mp3 ]; then
BOOT_SOUND=/system/customize/resource/android_audio.mp3
elif busybox [ -e /data/local/android_audio.mp3 ]; then
BOOT_SOUND=/data/local/android_audio.mp3
elif busybox [ -e /system/media/android_audio.mp3 ]; then
BOOT_SOUND=/system/media/android_audio.mp3
elif busybox [ -e /system/customize/resource/SPC_animation_final.mp3 ]; then
BOOT_SOUND=/system/customize/resource/SPC_animation_final.mp3
elif busybox [ -e /data/local/SPC_animation_final.mp3 ]; then
BOOT_SOUND=/data/local/SPC_animation_final.mp3
elif busybox [ -e /system/media/SPC_animation_final.mp3 ]; then
BOOT_SOUND=/system/media/SPC_animation_final.mp3
else
echo "Bootanimation sound does not exist" >> $log
fi
echo "$BOOT_ANI" >> $log
echo "$BOOT_SOUND" >> $log
echo "" >> $log
# moving animation
busybox mv -f /data/local/tmp/bootanimation.zip $BOOT_ANI
if busybox [ -e /data/local/tmp/bootanimation.zip ] ; then
buxybox rm -f /data/local/tmp/bootanimation.zip
fi
if busybox [ -e $BOOT_ANI ] ; then
echo "SUCCESS! Bootanimation moved to $BOOT_ANI" >> $log
else
echo "FAILURE! Bootanimation not moved to $BOOT_ANI" >> $log
fi
echo "" >> $log
# moving busybox mv -f /data/local/tmp/bootanimation.zip $BOOT_ANI
busybox mv -f /data/local/tmp/android_audio.mp3 $BOOT_SOUND
if busybox [ -e /data/local/tmp/android_audio.mp3 ] ; then
buxybox rm -f /data/local/tmp/android_audio.mp3
fi
if busybox [ -e $BOOT_SOUND ] ; then
echo "SUCCESS! Bootanimation sound moved to $BOOT_SOUND" >> $log
else
echo "FAILURE! Bootanimation sound moved to $BOOT_SOUND" >> $log
fi
echo "" >> #log
echo "Universal Bootanimation Flasher Commencing" >> $log
how to assemble and disassemble boot.img on this phone?
Stock jb 4.1 uses kernel.bin.md5, cm uses boot.img
I tried many times but never managed (there's a script somewhere in this section but didn't work either for me)
Why do you want to unpack it?
Sent from Italy using Tapatalk
Toni5830 said:
Stock jb 4.1 uses kernel.bin.md5, cm uses boot.img
I tried many times but never managed (there's a script somewhere in this section but didn't work either for me)
Why do you want to unpack it?
Sent from Italy using Tapatalk
Click to expand...
Click to collapse
I want to insert a file init.rc service service
Code:
shelld /system/xbin/shelld
class main
I fear you need to compile kernel from sources..(I can compile stock kernel but don't know how to compile cm one )
Sent from Italy using Tapatalk
Toni5830 said:
I fear you need to compile kernel from sources..(I can compile stock kernel but don't know how to compile cm one )
Sent from Italy using Tapatalk
Click to expand...
Click to collapse
no I do not need to be collected from source
lolo696 said:
no I do not need to be collected from source
Click to expand...
Click to collapse
It depends how it is compiled. I think Frapeti told that some later versions will have possibiliti to be decompiled. I am not into kernels, not sure how and does this version now can be decompiled. And boot.img is only on CM - on stock we have kernel.bin.md5.
Actually kernel.bin.md5 is the zImage renamed with an md5 checksum. There is boot.img in stock too. Boot.img usually contains the zImage and the ramdisk. But in our device the ramdisk is packed in the zImage, this makes the boot.img un-unpackable. So kernel.bin.md5 (the zImage) can be renamed to boot.img because it's the same. I hope you understood this. I tried to explain in the simplest way
and you can follow any responses to add service init.rc ?
Sent from my GT-I9070 using xda app-developers app
Look at post #5, there's an attached file to unpack kernel, but never worked for me..some say it works
http://forum.xda-developers.com/showthread.php?t=2115337
Sent from Italy using Tapatalk
But in our device the ramdisk is packed in the zImage, this makes the boot.img un-unpackable.
Click to expand...
Click to collapse
Read this from KINGbabasula post.
I'm quite sure I can read -.-
Quoting Cocafe:
#!/bin/bash
# This is an update version of the script found at
# http://forum.xda-developers.com/wiki/index.php?title=Extract_initramfs_from_zImage
#
# The problem with that script is that the gzip magic number occasionally occur
# naturally, meaning that some non-compressed files get uncompressed.
DEBUG=
TEMP_DIR=/tmp
KERNEL_FILE=kernel
KERNEL_GZIP_FILE=kernel.gz
INITRAMFS_FILE=initramfs.cpio
INITRAMFS_DIR=initramfs_root
# DO NOT MODIFY BELOW THIS LINE
[ -z $1 ] && exit 1 || zImage=$1
[ ! -e $1 ] && exit 1
#GET CURRENT DIR
CURRENT_DIR=`pwd`
function pre_clean()
{
[ -z $DEBUG ] || echo "-D- Function: pre_clean()"
[ -e $INITRAMFS_FILE ] && ( [ -z $DEBUG ] || echo "-D- Deleting $INITRAMFS_FILE"; rm -f $INITRAMFS_FILE )
[ -e $INITRAMFS_DIR ] && ( [ -z $DEBUG ] || echo "-D- Deleting $INITRAMFS_DIR"; rm -rf $INITRAMFS_DIR )
[ -z $DEBUG ] || echo
}
function ungzip_kernel()
{
#========================================================
# find start of gziped kernel object in the zImage file:
#========================================================
[ -z $DEBUG ] || echo "-D- Function: ungzip_kernel()"
pos=`grep -P -a -b -m 1 --only-matching '\x1F\x8B\x08' $zImage | cut -f 1 -d :`
echo "-I- Extracting gzip'd kernel image from file: $zImage (start = $pos)"
if [ ! -z $pos ]; then
dd if=$zImage of=$TEMP_DIR/$KERNEL_GZIP_FILE bs=1 skip=$pos 2>/dev/null >/dev/null
gunzip -qf $TEMP_DIR/$KERNEL_GZIP_FILE
else
echo "-E- Compressed kernel image not found"; exit 1
fi
[ -z $DEBUG ] || echo
}
function search_cpio()
{
#========================================================
# Determine cpio compression type:
#========================================================
[ -z $DEBUG ] || echo "-D- Function: search_cpio()"
for x in gzip bzip lzma none; do
case $x in
bzip)
csig='\x{31}\x{41}\x{59}\x{26}\x{53}\x{59}'
ucmd='bunzip2 -q'
fext='.bz2'
;;
gzip)
csig='\x1F\x8B\x08'
ucmd='gunzip -q'
fext='.gz'
;;
lzma)
csig='\x{5D}\x{00}\x..\x{FF}\x{FF}\x{FF}\x{FF}\x{FF}\x{FF}'
ucmd='unlzma -q'
fext='.lzma'
;;
none)
csig='070701'
ucmd=
fext=
;;
esac
#========================================================================
# Search for compressed cpio archive
#========================================================================
search=`grep -P -a -b -m 1 --only-matching $csig $TEMP_DIR/$KERNEL_FILE | cut -f 1 -d : | head -1`
pos=${search:-0}
if [ ${pos} -gt 0 ]; then
if [ ${pos} -le ${cpio_compressed_start:-0} ] || [ -z $cpio_compressed_start ];then
cpio_compressed_start=$pos
compression_name=$x
compression_signature=$csig
uncompress_cmd=$ucmd
file_ext=$fext
[ -z $DEBUG ] || echo "-D- Checking for compression type: $compression_name | signature: $compression_signature | in file: $TEMP_DIR/$KERNEL_FILE | offset = $pos"
fi
fi
done
[ $compression_name = "bzip" ] && cpio_compressed_start=$((cpio_compressed_start - 4))
echo "-I- CPIO compression type detected = $compression_name | offset = $cpio_compressed_start"
[ -z $DEBUG ] || echo
}
function extract_cpio()
{
[ -z $DEBUG ] || echo "-D- Function: extract_cpio()"
if [ ! $compression_name = "none" ]; then
echo "-I- Extracting $compression_name'd compressed CPIO image from kernel image (offset = $cpio_compressed_start)"
[ -z $DEBUG ] || echo "-D- dd if=$TEMP_DIR/$KERNEL_FILE of=$TEMP_DIR/$INITRAMFS_FILE$file_ext bs=1 skip=$cpio_compressed_start; $uncompress_cmd $TEMP_DIR/$INITRAMFS_FILE$file_ext"
dd if=$TEMP_DIR/$KERNEL_FILE of=$TEMP_DIR/$INITRAMFS_FILE$file_ext bs=1 skip=$cpio_compressed_start 2>/dev/null >/dev/null
$uncompress_cmd -q $TEMP_DIR/$INITRAMFS_FILE$file_ext
else
echo "-I- Extracting non-compressed CPIO image from kernel image (offset = $cpio_compressed_start)"
[ -z $DEBUG ] || echo "-D- dd if=$TEMP_DIR/$KERNEL_FILE of=$TEMP_DIR/${INITRAMFS_FILE}${file_ext} bs=1 skip=$cpio_compressed_start 2>/dev/null >/dev/null"
dd if=$TEMP_DIR/$KERNEL_FILE of=$TEMP_DIR/${INITRAMFS_FILE}${file_ext} bs=1 skip=$cpio_compressed_start 2>/dev/null >/dev/null
fi
[ -z $DEBUG ] || echo
}
function uncompress_cpio()
{
#==========================================================================
# find start and end of the "cpio" initramfs image inside the kernel object:
# ASCII cpio header starts with '070701'
# The end of the cpio archive is marked with an empty file named TRAILER!!!
#==========================================================================
[ -z $DEBUG ] || echo "-D- Function: uncompress_cpio()"
if [ ! $compress_type = "none" ]; then
start=`grep -a -b -m 1 --only-matching '070701' $TEMP_DIR/$INITRAMFS_FILE | head -1 | cut -f 1 -d :`
end=`grep -a -b -m 1 --only-matching 'TRAILER!!!' $TEMP_DIR/$INITRAMFS_FILE | head -1 | cut -f 1 -d :`
if [ ! -z $start ] || [ ! -z $end ]; then
#11 bytes = length of TRAILER!!! zero terminated string, fixes premature end of file warning in CPIO
end=$((end + 14))
[ -z $DEBUG ] || echo "-D- Kernel start = $start"
[ -z $DEBUG ] || echo "-D- Kernel end = $end"
count=$((end - start))
if (($count < 0)); then
echo "-E- Couldn't match start/end of the initramfs image."
exit 1
fi
echo "-I- Extracting initramfs image from file: $inputfile (start = $start, end = $end)"
dd if=$TEMP_DIR/$INITRAMFS_FILE of=$CURRENT_DIR/$INITRAMFS_FILE bs=1 skip=$start count=$count 2>/dev/null >/dev/null
INITRAMFS_FILE=$CURRENT_DIR/$INITRAMFS_FILE
else
echo "-E- No CPIO image found in $inputfile."
fi
else
echo "-I- CPIO already uncompressed."
fi
[ -z $DEBUG ] || echo
}
function expand_cpio_archive()
{
[ -z $DEBUG ] || echo "-D- Function: expand_cpio_archive()"
echo "-I- Expanding CPIO archive: $INITRAMFS_FILE to $INITRAMFS_DIR."
if [ -e $TEMP_DIR/$INITRAMFS_FILE ]; then
mkdir $INITRAMFS_DIR
cd $INITRAMFS_DIR
cpio --quiet -i --make-directories --preserve-modification-time --no-absolute-filenames -F $TEMP_DIR/$INITRAMFS_FILE 2>/dev/null
fi
[ -z $DEBUG ] || echo
}
function clean_up()
{
[ -z $DEBUG ] || echo "-D- Deleting $TEMP_DIR/$KERNEL_FILE"; rm -f $TEMP_DIR/$KERNEL_FILE
[ -z $DEBUG ] || echo "-D- Deleting $TEMP_DIR/$INITRAMFS_FILE"; rm -f $TEMP_DIR/$INITRAMFS_FILE
[ -z $DEBUG ] || echo "-D- Deleting $TEMP_DIR/$INITRAMFS_FILE$file_ext"; rm -f $TEMP_DIR/$INITRAMFS_FILE$file_ext
}
reset
pre_clean
ungzip_kernel
search_cpio
extract_cpio
uncompress_cpio
expand_cpio_archive
clean_up
Click to expand...
Click to collapse
Save this QUOTE as a file name unpack_initramfs.sh
Use:
./unpack_initramfs.sh kernel.bin.md5
Click to expand...
Click to collapse
-I- Extracting gzip'd kernel image from file: kernel.bin.md5 (start = 18528)
-I- CPIO compression type detected = none | offset = 219120
-I- Extracting non-compressed CPIO image from kernel image (offset = 219120)
-I- CPIO already uncompressed.
-I- Expanding CPIO archive: initramfs.cpio to initramfs_root.
Click to expand...
Click to collapse
Then you should have stock ramdisk
Click to expand...
Click to collapse
Worked for Cocafe but never worked for me:/ maybe because Cocore-e's compression is now set to lzo
Last 2 things then I'll leave:
1) Frapeti said next cm kernel will be possible to unpack (check dual boot thread)
2) I don't know how to repack it
Sent from Italy using Tapatalk
Toni5830 said:
I'm quite sure I can read -.-
Quoting Cocafe:
Worked for Cocafe but never worked for me:/ maybe because Cocore-e's compression is now set to lzo
Last 2 things then I'll leave:
1) Frapeti said next cm kernel will be possible to unpack (check dual boot thread)
2) I don't know how to repack it
Sent from Italy using Tapatalk
Click to expand...
Click to collapse
I never saw before that script
Here you can find how to unpack and repack a "normal" boot.img with tools for cygwin too https://github.com/KINGbabasula/boot.img-tools
Hello. I found same questions in other topics, but couldn't find answer.
I would like run script from /system/su.d folder:
Code:
#!/system/bin/sh
echo 0 > /sys/fs/selinux/enforce
or
Code:
#!/system/bin/sh
setenforce 0
and I even tried to run test script:
Code:
#!/system/bin/sh
touch /data/local/tmp/test.txt
echo "test" >> /data/local/tmp/test.txt
But no one of them works. I tried different names for files, gave different chmod (644,700,755). Nothing helps me to run script.
Mb somebody can give me advice what's problem can be?
Phone: Xperia Z3c, MM, systemless SuperSU
On other phone (Xperia M5) this all works fine.
I have a the same problem with a different file in /system/su.d,
Code:
#!/system/bin/sh
logfile0=/data/local/tmp/exfat_mount.log
#logfile=$logfile0
logfile=/dev/null
if [ -e $logfile0 ]; then
logfile=$logfile0
fi
echo '******' $(date) '******' >> $logfile
echo 'id: ' $(id) >> $logfile 2>&1
if [ x$SECONDARY_STORAGE == x ]; then
SECONDARY_STORAGE=/storage/sdcard1
fi
device=/dev/block/mmcblk1p1
echo "Starting for $device" >> $logfile
while read line; do
words=($line)
if [ ${words[0]} == $device ]; then
echo "Error: $device already mounted:" >> $logfile
echo "$line" >> $logfile
exit 1
fi
if [ ${words[1]} == $SECONDARY_STORAGE ]; then
echo "Error: SECONDARY_STORAGE already in use:" >> $logfile
echo "$line" >> $logfile
exit 1
fi
done < /proc/mounts
binpath=/system/xbin
probe=$binpath/probe
if [ ! -e $probe ]; then
echo "Error: $probe not found!" >> $logfile
exit 1
fi
FS=($($probe $device))
echo "$device file system:" ${FS[0]} >> $logfile
# ***** Setup tools for different file systems:
if [ ${FS[0]} == "exFAT" ]; then
echo "$device is exFAT" >> $logfile
mount=$binpath/mount.exfat
if [ -f $mount ]; then
links=( "mkfs.exfat" "fsck.exfat" "dumpexfat" "exfatfsck" "exfatlabel" "mkexfatfs" "mount.exfat-fuse" )
for l in "${links[@]}"
do
if [ ! -e $binpath/$l ]; then
mount -o remount,rw /
ln -s $mount $binpath/$l
echo "Created symlink $binpath/$l" >> $logfile
fi
done
fi
fsck=$binpath/exfatfsck
fsck_ops=
elif [ ${FS[0]} == "NTFS" ]; then
echo "$device is NTFS" >> $logfile
mount=$binpath/ntfs-3g
fsck=$binpath/ntfsfix
fsck_ops='-n'
else
echo "Error: $device is not supported!" >> $logfile
exit 1
fi
# ***** Check if we have required tools.
if [ ! -e $mount ]; then
echo "Error: $mount not found!" >> $logfile
exit 1
fi
if [ ! -e $fsck ]; then
echo "Error: $fsck not found!" >> $logfile
exit 1
fi
# ***** Mount for rw only if the file system is not damaged.
options_ro="ro,uid=1023,gid=1023,umask=0000"
options_rw="rw,uid=1023,gid=1023,umask=0000,noatime"
mnt_cmd="$mount -o $options_rw $device /mnt/media_rw/sdcard1"
$fsck $fsck_ops $device >> $logfile 2>&1
if [ $? != 0 ]; then
mnt_cmd="$mount -o $options_ro $device /mnt/media_rw/sdcard1"
fi
echo "$mnt_cmd" >> $logfile
if [ -e /sys/fs/selinux/enforce ]; then
if [ -e /system/xbin/supolicy ]; then
# ***** Set permissions for fuse. Instead, our mounts would be RO for others.
echo "Using supolicy to provide permissions to fuse." >> $logfile
/system/xbin/supolicy --live "allow sdcardd unlabeled dir { append create execute write relabelfrom link unlink ioctl getattr setattr read rename lock mounton quotaon swapon rmdir audit_access remove_name add_name reparent execmod search open }"
/system/xbin/supolicy --live "allow sdcardd unlabeled file { append create write relabelfrom link unlink ioctl getattr setattr read rename lock mounton quotaon swapon audit_access open }"
/system/xbin/supolicy --live "allow unlabeled unlabeled filesystem associate"
/system/xbin/supolicy --live "allow sdcardd unlabeled filesystem { getattr mount remount unmount }"
/system/xbin/supolicy --live "allow vold unlabeled filesystem { getattr mount remount unmount }"
/system/xbin/supolicy --live "allow init unlabeled filesystem { getattr mount remount unmount }"
else
# ***** Turn SELinux to Permissive. Instead, our mounts would be RO for others.
echo "Using setenforce 0 to provide permissions to fuse." >> $logfile
setenforce 0
fi
fi
# ***** Try to mount:
if [ 0 != 0 ]; then
$mount -o $options_rw $device $SECONDARY_STORAGE
echo "Mounted directly" >> $logfile
else
mount -o remount,rw /system
rm -f /system/bin/debuggerd.mine
echo '#!/system/bin/sh' > /system/bin/debuggerd.mine
echo "$mnt_cmd" >> /system/bin/debuggerd.mine
echo 'start fuse_sdcard1' >> /system/bin/debuggerd.mine
chmod 777 /system/bin/debuggerd.mine
stop debuggerd
mv /system/bin/debuggerd /system/bin/debuggerd.its
mv /system/bin/debuggerd.mine /system/bin/debuggerd
start debuggerd
sleep 2
stop debuggerd
mv /system/bin/debuggerd /system/bin/debuggerd.mine
mv /system/bin/debuggerd.its /system/bin/debuggerd
start debuggerd
mount -o remount,ro /system
vdc volume mount $SECONDARY_STORAGE
echo "Mounted via debuggerd" >> $logfile
fi
The file is called 00mountsd and is used to give access to exfat microsd on stock android 5.1 running on a Chuwi Hi10pro tablet with cherry trail z8350 cpu. I used this on a previous version of the tablet and it worked fine although that tablet came with RemixOS.
The file runs without errors when run manually and succeeds at it task
ls -lZ returns this -rwxr-xr-x root root u: object_r:system_file:s0 00mountsd
I'm running SuperSU Free v2.79 everything else works fine.
Any ideas?
The script has been adapted for CM13: https://forum.xda-developers.com/xposed/addon-d-script-xposed-to-survive-cm13-t3268520
Since many things have been changed to get Xposed working on Nougat I guess this script has to be adapted again.
Please share if you find something
Thank you.
I second this. The addon.d script was a godsend in the good 'ol days
Something as this?:
Code:
#!/sbin/sh
#
#
# /system/addon.d/81-Xposed.sh
# During a LineageOS 14.1 upgrade, this script backs up Xposed framework files.
# /system is formatted and reinstalled, then the files are restored.
# Based on Xposed "flash-script.sh" script and https://forum.xda-developers.com/xposed/addon-d-script-xposed-to-survive-cm13-t3268520
export C=/sdcard/xposed_backupdir-1234
backup_file() {
if [ -e "$1" ]; then
if [ ! -L "$1" ]; then
local F="${1##*/}"
local D="${1%/*}"
mkdir -p "$C/$D"
cp -dp "$1" "$C/$D/$F"
else
ui_print "Skipping symbolic link $1"
fi
else
ui_print "NE: $1"
fi
}
restore_file() {
local FILE="${1##*/}"
local DIR="${1%/*}"
if [ -e "$C/$DIR/$FILE" ]; then
if [ "$FILE" == "xposed.prop" ] || [ "$FILE" == "XposedBridge.jar" ]; then
restore_nobackup "/$DIR/$FILE" 0 0 0644
elif [ "$FILE" == "app_process64_xposed" ] || [ "$FILE" == "app_process32_xposed" ]; then
restore_and_link "/$DIR/${FILE%_xposed}" 0 2000 0755 u:object_r:zygote_exec:s0
elif [ "$FILE" == "dex2oat" ] || [ "$FILE" == "patchoat" ]; then
restore_overwrite "/$DIR/$FILE" 0 2000 0755 u:object_r:dex2oat_exec:s0
elif [ "$FILE" == "oatdump" ]; then
restore_overwrite "/$DIR/$FILE" 0 2000 0755
else
restore_overwrite "/$DIR/$FILE" 0 0 0644
fi
else
ui_print "NE: $C/$DIR/$FILE"
fi
}
cp_perm() {
cp -f "$1" "$2" || exit 1
set_perm "$2" $3 $4 $5 $6
}
set_perm() {
chown $2:$3 "$1" || exit 1
chmod $4 "$1" || exit 1
if [ "$5" ]; then
chcon $5 "$1" 2>/dev/null
else
chcon 'u:object_r:system_file:s0' "$1" 2>/dev/null
fi
}
restore_nobackup() {
cp_perm "$C/$1" "$1" $2 $3 $4 $5
}
restore_and_link() {
TARGET="${1}"
XPOSED="${1}_xposed"
BACKUP="${1}_original"
if [ ! -f "$C/$XPOSED" ]; then
return
fi
cp_perm "$C/$XPOSED" "$XPOSED" $2 $3 $4 $5
if [ ! -f "$BACKUP" ]; then
mv "$TARGET" "$BACKUP" || exit 1
ln -s "$XPOSED" "$TARGET" || exit 1
chcon -h 'u:object_r:system_file:s0' "$TARGET" 2>/dev/null
fi
}
restore_overwrite() {
TARGET=$1
BACKUP="${1}.orig"
NO_ORIG="${1}.no_orig"
if [ ! -f "$TARGET" ]; then
touch "$NO_ORIG" || exit 1
set_perm "$NO_ORIG" 0 0 600
elif [ -f "$BACKUP" ]; then
rm -f "$TARGET"
gzip "$BACKUP" || exit 1
set_perm "${BACKUP}.gz" 0 0 600
elif [ ! -f "${BACKUP}.gz" ] && [ ! -f "$NO_ORIG" ]; then
mv "$TARGET" "$BACKUP" || exit 1
gzip "$BACKUP" || exit 1
set_perm "${BACKUP}.gz" 0 0 600
fi
cp_perm "$C/$TARGET" "$TARGET" $2 $3 $4 $5
}
ui_print() {
echo -n -e "ui_print $1\n" >> /proc/self/fd/$OUTFD
echo -n -e "ui_print\n" >> /proc/self/fd/$OUTFD
}
list_files() {
cat <<EOF
/system/xposed.prop
/system/framework/XposedBridge.jar
# For 32bits
/system/bin/app_process32_xposed
/system/bin/dex2oat
/system/bin/oatdump
/system/bin/patchoat
/system/lib/libart.so
/system/lib/libart-compiler.so
/system/lib/libart-disassembler.so
/system/lib/libsigchain.so
/system/lib/libxposed_art.so
# For 64bits
/system/bin/app_process64_xposed 64bit
/system/lib64/libart.so 64bit
/system/lib64/libart-compiler.so 64bit
/system/lib64/libart-disassembler.so 64bit
/system/lib64/libsigchain.so 64bit
/system/lib64/libxposed_art.so 64bit
EOF
}
OSA="32bit"
OUTFD=`ps | grep -v grep | grep -oE "update(.*)" | cut -d" " -f3`
API=$(sed -n "s/^ro.build.version.sdk=//p" /system/build.prop | head -n 1)
ABILONG=$(sed -n "s/^ro.product.cpu.abi=//p" /system/build.prop | head -n 1)
if [ "$API" -ge "21" ]; then
if [ "$ABILONG" = "arm64-v8a" ] || [ "$ABILONG" = "x86_64" ]; then OSA="64bit"; fi;
fi
case "$1" in
backup)
ui_print "Starting to backup Xposed"
list_files | while read FILE ARCH; do
echo $FILE | grep -q '^#'
if [ $? -ne 0 ]; then
if [ $ARCH ] && [ "$ARCH" != "$OSA" ]; then continue; fi;
backup_file "$FILE"
fi
done
ui_print "Ending to backup Xposed"
;;
restore)
ui_print "Starting to restore Xposed"
list_files | while read FILE ARCH; do
echo $FILE | grep -q '^#'
if [ $? -ne 0 ]; then
if [ $ARCH ] && [ "$ARCH" != "$OSA" ]; then continue; fi;
restore_file "$FILE"
fi
done
if [ "$API" -ge "22" ]; then
find /system /vendor -type f -name '*.odex.gz' 2>/dev/null | while read f; do mv "$f" "$f.xposed"; done
fi
rm -rf "${C:?}/"
ui_print "Ending to restore Xposed"
;;
pre-backup)
# Stub
;;
post-backup)
# Stub
;;
pre-restore)
# Stub
;;
post-restore)
# Stub
;;
esac
MariferC said:
Something as this?:
Code:
#!/sbin/sh
#
#
# /system/addon.d/81-Xposed.sh
# During a LineageOS 14.1 upgrade, this script backs up Xposed framework files.
# /system is formatted and reinstalled, then the files are restored.
# Based on Xposed "flash-script.sh" script and https://forum.xda-developers.com/xposed/addon-d-script-xposed-to-survive-cm13-t3268520
export C=/sdcard/xposed_backupdir-1234
backup_file() {
if [ -e "$1" ]; then
if [ ! -L "$1" ]; then
local F="${1##*/}"
local D="${1%/*}"
mkdir -p "$C/$D"
cp -dp "$1" "$C/$D/$F"
else
ui_print "Skipping symbolic link $1"
fi
else
ui_print "NE: $1"
fi
}
restore_file() {
local FILE="${1##*/}"
local DIR="${1%/*}"
if [ -e "$C/$DIR/$FILE" ]; then
if [ "$FILE" == "xposed.prop" ] || [ "$FILE" == "XposedBridge.jar" ]; then
restore_nobackup "/$DIR/$FILE" 0 0 0644
elif [ "$FILE" == "app_process64_xposed" ] || [ "$FILE" == "app_process32_xposed" ]; then
restore_and_link "/$DIR/${FILE%_xposed}" 0 2000 0755 u:object_r:zygote_exec:s0
elif [ "$FILE" == "dex2oat" ] || [ "$FILE" == "patchoat" ]; then
restore_overwrite "/$DIR/$FILE" 0 2000 0755 u:object_r:dex2oat_exec:s0
elif [ "$FILE" == "oatdump" ]; then
restore_overwrite "/$DIR/$FILE" 0 2000 0755
else
restore_overwrite "/$DIR/$FILE" 0 0 0644
fi
else
ui_print "NE: $C/$DIR/$FILE"
fi
}
cp_perm() {
cp -f "$1" "$2" || exit 1
set_perm "$2" $3 $4 $5 $6
}
set_perm() {
chown $2:$3 "$1" || exit 1
chmod $4 "$1" || exit 1
if [ "$5" ]; then
chcon $5 "$1" 2>/dev/null
else
chcon 'u:object_r:system_file:s0' "$1" 2>/dev/null
fi
}
restore_nobackup() {
cp_perm "$C/$1" "$1" $2 $3 $4 $5
}
restore_and_link() {
TARGET="${1}"
XPOSED="${1}_xposed"
BACKUP="${1}_original"
if [ ! -f "$C/$XPOSED" ]; then
return
fi
cp_perm "$C/$XPOSED" "$XPOSED" $2 $3 $4 $5
if [ ! -f "$BACKUP" ]; then
mv "$TARGET" "$BACKUP" || exit 1
ln -s "$XPOSED" "$TARGET" || exit 1
chcon -h 'u:object_r:system_file:s0' "$TARGET" 2>/dev/null
fi
}
restore_overwrite() {
TARGET=$1
BACKUP="${1}.orig"
NO_ORIG="${1}.no_orig"
if [ ! -f "$TARGET" ]; then
touch "$NO_ORIG" || exit 1
set_perm "$NO_ORIG" 0 0 600
elif [ -f "$BACKUP" ]; then
rm -f "$TARGET"
gzip "$BACKUP" || exit 1
set_perm "${BACKUP}.gz" 0 0 600
elif [ ! -f "${BACKUP}.gz" ] && [ ! -f "$NO_ORIG" ]; then
mv "$TARGET" "$BACKUP" || exit 1
gzip "$BACKUP" || exit 1
set_perm "${BACKUP}.gz" 0 0 600
fi
cp_perm "$C/$TARGET" "$TARGET" $2 $3 $4 $5
}
ui_print() {
echo -n -e "ui_print $1\n" >> /proc/self/fd/$OUTFD
echo -n -e "ui_print\n" >> /proc/self/fd/$OUTFD
}
list_files() {
cat <<EOF
/system/xposed.prop
/system/framework/XposedBridge.jar
# For 32bits
/system/bin/app_process32_xposed
/system/bin/dex2oat
/system/bin/oatdump
/system/bin/patchoat
/system/lib/libart.so
/system/lib/libart-compiler.so
/system/lib/libart-disassembler.so
/system/lib/libsigchain.so
/system/lib/libxposed_art.so
# For 64bits
/system/bin/app_process64_xposed 64bit
/system/lib64/libart.so 64bit
/system/lib64/libart-compiler.so 64bit
/system/lib64/libart-disassembler.so 64bit
/system/lib64/libsigchain.so 64bit
/system/lib64/libxposed_art.so 64bit
EOF
}
OSA="32bit"
OUTFD=`ps | grep -v grep | grep -oE "update(.*)" | cut -d" " -f3`
API=$(sed -n "s/^ro.build.version.sdk=//p" /system/build.prop | head -n 1)
ABILONG=$(sed -n "s/^ro.product.cpu.abi=//p" /system/build.prop | head -n 1)
if [ "$API" -ge "21" ]; then
if [ "$ABILONG" = "arm64-v8a" ] || [ "$ABILONG" = "x86_64" ]; then OSA="64bit"; fi;
fi
case "$1" in
backup)
ui_print "Starting to backup Xposed"
list_files | while read FILE ARCH; do
echo $FILE | grep -q '^#'
if [ $? -ne 0 ]; then
if [ $ARCH ] && [ "$ARCH" != "$OSA" ]; then continue; fi;
backup_file "$FILE"
fi
done
ui_print "Ending to backup Xposed"
;;
restore)
ui_print "Starting to restore Xposed"
list_files | while read FILE ARCH; do
echo $FILE | grep -q '^#'
if [ $? -ne 0 ]; then
if [ $ARCH ] && [ "$ARCH" != "$OSA" ]; then continue; fi;
restore_file "$FILE"
fi
done
if [ "$API" -ge "22" ]; then
find /system /vendor -type f -name '*.odex.gz' 2>/dev/null | while read f; do mv "$f" "$f.xposed"; done
fi
rm -rf "${C:?}/"
ui_print "Ending to restore Xposed"
;;
pre-backup)
# Stub
;;
post-backup)
# Stub
;;
pre-restore)
# Stub
;;
post-restore)
# Stub
;;
esac
Click to expand...
Click to collapse
Did you create it? Did you try it on Nougat?
Anyway my custom ROM is no longer updated for Nougat. Hopefully it will work on Oreo.
OSheden said:
Did you create it? Did you try it on Nougat?
Anyway my custom ROM is no longer updated for Nougat. Hopefully it will work on Oreo.
Click to expand...
Click to collapse
Yes I've created it.
Yes I've tested on Nougat (LineageOS 14.1) on a Xiaomi Mi4 and a Moto G 2014, and it works.