[HTC Sensation] rainiere:
Hi everybody. This is my first post on this amazing forum.

I've been doing all kinds of things on my Sensation (different ROMs, cooking up stuff at the Ultimate Online Kitchen etc.), and I love doing them!

Inspired by the work of TrueBlue_Drew I decided to write my own splash screen backup / flash utlility. It's working so well that I figured I should share with you all.

So here it is. Unpack the zip to a folder of your choosing, connect your (Rooted, S-Off) device and doubleclick on mysplash.cmd. It's pretty noob proof. Just follow the instructions on screen.

Make sure your own splash image is called 'splash.png' and that its pixel dimensions are 540x960 (qHD). Put it in the 'images-here' folder before flashing.

There will also be a 'splash.png' file in this folder after a backup operation.

The batch file itself contains explanatory comments, and you are free to make your own modifications.

I hope you enjoy using this utility as much as I do! :)

Here's the actual code in the script file itself:

@echo off

:: *********************************************************************************************
:: * Inspired by TrueBlue_Drew's EZ Splash Screen Flasher and Image Converter *
:: * Which can be found at http://xdaforums.com/showpost.php?p=11393915&postcount=1 *
:: * *
:: * Totally reworked and adapted for HTC Sensation by rainiere *
:: * Version: 1112.3 (don't forget the version parameter in the parameter section!) *
:: * *******************************************************************************************

title MySplash - Splash screen backup and flash program for HTC Sensation
color 0A
mode con: cols=57 lines=23

:: ================================================================================
:: Before doing anything, make sure there's a connection first

echo Waiting for connection...
adb wait-for-device >NUL
echo ...device is connected!

:: Wait 2 seconds with this neat trick
:: An explanation can be read here: http://groups.google.com/group/alt.msdos.batch.nt/msg/804a9fa0f5864558

ping -n 3 127.0.0.1 >NUL

:: ================================================================================
:: Parameter section. Carefull editing here!

set version=1112.3
set imagefolder=images-here
set dimensions=540x960

:: ================================================================================
:: Display the menu

:menu

cls

echo.
echo MySplash version %version%
echo.
echo [b]ackup the current splash screen
echo [f]lash a new splash screen
echo [q]uit
echo.

set action=""
set /p action="Enter a choice: "
echo.

if %action%==b goto backup
if %action%==f goto flash
if %action%==q goto quit
if %action%=="" goto menu

goto menu

:: ================================================================================
:: Backing up the splash screen

:backup

echo Transferring splash image to sdcard...

:: The splash image resides in the mmcblk0p14 partition
:: More info at http://xdaforums.com/showpost.php?p=15641532&postcount=1

adb shell dd if=/dev/block/mmcblk0p14 of=/mnt/sdcard/splash.img >NUL

echo Moving splash image to image folder...

adb pull /sdcard/splash.img %imagefolder% >NUL 2>&1
:: Deleting file on the sdcard
adb shell rm /sdcard/splash.img >NUL

echo Converting splash image to png format...

ffmpeg -f rawvideo -pix_fmt rgb565 -s %dimensions% -i %imagefolder%\splash.img -f image2 -pix_fmt rgb24 %imagefolder%\splash.png >NUL 2>&1

del %imagefolder%\splash.img >NUL 2>&1

:: open the image folder for easy access

start %imagefolder%

echo.
echo Done!
ping -n 6 127.0.0.1 >NUL
goto menu

:: ================================================================================
:: Flash a new splash image to the device

:flash

if exist %imagefolder%\splash.png goto pngOK

echo There is no splash.png file in the '%imagefolder%' folder!
ping -n 3 127.0.0.1 >NUL

start %imagefolder%

goto menu

:pngOK

echo Converting png image to splash image format...

ffmpeg -y -i %imagefolder%\splash.png -f rawvideo -pix_fmt rgb565 %imagefolder%\splash.img >NUL 2>&1
del %imagefolder%\splash.png >NUL 2>&1

echo Booting into fastboot mode...

adb reboot bootloader

echo.
echo WAIT until the device is in fastboot mode!
echo ONLY when in fastboot mode, press any key to continue...
echo.
pause >NUL

echo Flashing splash image...

fastboot flash splash1 %imagefolder%\splash.img

del %imagefolder%\splash.img >NUL 2>&1

echo.
echo Done! The device will now be rebooted...

fastboot reboot >NUL 2>&1

echo Waiting for reboot to complete...

adb wait-for-device >NUL
goto menu

:: ================================================================================
:: Cleanup and exit

:quit

echo Goodbye!

adb kill-server

set action=
set dimensions=
set imagefolder=
set version=

ping -n 3 127.0.0.1 >NUL