[tool][mod][OP6T] Splash screen modification [linux]

foobar66

Senior Member
Jan 8, 2011
1,755
1,751
133
Brussels
First, most - if not all - the credits go to @makers_mark.
Please read https://forum.xda-developers.com/oneplus-6/themes/wip-splash-screen-image-injector-t3800836 for technical details. I have just tried this on our OP6T and made slight modifications to the source code of the application.

This linux tool allows you to extract splash screen images from a raw dump of the LOGO partition.
You can then modify the images to your liking and repack them into a raw LOGO partition.
You do need at least basic linux knowledge/skill and you must have a working adb. If you don't know what this is, then this is not a thread for you.

Note: it should be very easy to compile the program under Windows and use it from Windows ... but I do not use Windows myself, I am a linux guy ... feel free to (re)use this and compile under Windows. Instructions below should be reasonably similar if you use PowerShell on Windows.

Note that the phone has 2 LOGO partitions ... more about that below.

Attached zip file contains the following:
- original.logo.bin (raw extract from the original 6T LOGO partition)
- lodepng.c, lodepng.h, OP6logo.c (C source of the utility)
- op6 (linux executable, compiled from source code)
- 0.png, 1.png, ..., 27.png (png splash screen files extracted with the tool from the original.logo.bin)

How to compile the utility (if you would want to do that yourself): download attached zip file, create a new directory and unzip the downloaded zip file into that directory. Then compile from source:
Code:
> mkdir splash
> cd splash
> unzip splash.zip
> cc *.c -o op6
After this you will have an executable called "op6". The zip file already contains a compiled op6, so you do not necessarily need to compile it yourself.

How to use:

1) First, make a raw dump of the LOGO partition. To do that, reboot your phone into twrp (see for example https://oneplus.gadgethacks.com/how-to/install-twrp-recovery-your-oneplus-6t-0190296/ for instructions). With the phone in twrp, open a linux shell, then do:
Code:
> adb shell
# dd if=/dev/block/bootdevice/by-name/LOGO_a of=/data/original.logo.bin
# exit
> adb pull /data/original.logo.bin
You should now have a file called "original.logo.bin" which is exactly 16MB in size. Copy this file to the directory which contains your op6 tool. Also make a backup of the file so you have a copy of the stock LOGO partition.

2) Second, extract (using the op6 tool) the png images from the raw logo dump. To do that, open a linux shell, then do:
Code:
> cd splash
> ./op6 -i original.logo.bin -d
You should see output like:
Code:
#01: Offset:0, Header=SPLASH!!, Width=1080, Height=1920, Data Length=245032, Special=1, Name=0.png, Metadata=, 6220800 decoded bytes
#02: Offset:249856, Header=SPLASH!!, Width=536, Height=60, Data Length=9162, Special=1, Name=1.png, Metadata=, 96480 decoded bytes
#03: Offset:266240, Header=SPLASH!!, Width=1080, Height=1920, Data Length=187698, Special=1, Name=2.png, Metadata=, 6220800 decoded bytes
#04: Offset:458752, Header=SPLASH!!, Width=1080, Height=1920, Data Length=55422, Special=1, Name=3.png, Metadata=, 6220800 decoded bytes
#05: Offset:520192, Header=SPLASH!!, Width=1080, Height=1920, Data Length=187698, Special=1, Name=4.png, Metadata=, 6220800 decoded bytes
#06: Offset:712704, Header=SPLASH!!, Width=392, Height=66, Data Length=6744, Special=1, Name=5.png, Metadata=, 77616 decoded bytes
#07: Offset:724992, Header=SPLASH!!, Width=487, Height=69, Data Length=8478, Special=1, Name=6.png, Metadata=, 100809 decoded bytes
#08: Offset:741376, Header=SPLASH!!, Width=1080, Height=1920, Data Length=119304, Special=1, Name=7.png, Metadata=, 6220800 decoded bytes
#09: Offset:868352, Header=SPLASH!!, Width=1080, Height=2160, Data Length=279186, Special=1, Name=8.png, Metadata=, 6998400 decoded bytes
#10: Offset:1155072, Header=SPLASH!!, Width=536, Height=60, Data Length=9162, Special=1, Name=9.png, Metadata=, 96480 decoded bytes
#11: Offset:1171456, Header=SPLASH!!, Width=1080, Height=2160, Data Length=193798, Special=1, Name=10.png, Metadata=, 6998400 decoded bytes
#12: Offset:1372160, Header=SPLASH!!, Width=1080, Height=2160, Data Length=61522, Special=1, Name=11.png, Metadata=, 6998400 decoded bytes
#13: Offset:1441792, Header=SPLASH!!, Width=1080, Height=2160, Data Length=193798, Special=1, Name=12.png, Metadata=, 6998400 decoded bytes
#14: Offset:1642496, Header=SPLASH!!, Width=392, Height=66, Data Length=6744, Special=1, Name=13.png, Metadata=, 77616 decoded bytes
#15: Offset:1654784, Header=SPLASH!!, Width=487, Height=69, Data Length=8478, Special=1, Name=14.png, Metadata=, 100809 decoded bytes
#16: Offset:1671168, Header=SPLASH!!, Width=1080, Height=2160, Data Length=125402, Special=1, Name=15.png, Metadata=, 6998400 decoded bytes
#17: Offset:1802240, Header=SPLASH!!, Width=1080, Height=2280, Data Length=303732, Special=1, Name=16.png, Metadata=, 7387200 decoded bytes
#18: Offset:2113536, Header=SPLASH!!, Width=536, Height=60, Data Length=9162, Special=1, Name=17.png, Metadata=, 96480 decoded bytes
#19: Offset:2129920, Header=SPLASH!!, Width=1080, Height=2280, Data Length=196846, Special=1, Name=18.png, Metadata=, 7387200 decoded bytes
#20: Offset:2334720, Header=SPLASH!!, Width=1080, Height=2280, Data Length=64572, Special=1, Name=19.png, Metadata=, 7387200 decoded bytes
#21: Offset:2404352, Header=SPLASH!!, Width=1080, Height=2280, Data Length=196848, Special=1, Name=20.png, Metadata=, 7387200 decoded bytes
#22: Offset:2609152, Header=SPLASH!!, Width=392, Height=66, Data Length=6744, Special=1, Name=21.png, Metadata=, 77616 decoded bytes
#23: Offset:2621440, Header=SPLASH!!, Width=487, Height=69, Data Length=8478, Special=1, Name=22.png, Metadata=, 100809 decoded bytes
#24: Offset:2637824, Header=SPLASH!!, Width=1080, Height=2280, Data Length=128452, Special=1, Name=23.png, Metadata=, 7387200 decoded bytes
#25: Offset:2772992, Header=SPLASH!!, Width=1080, Height=2340, Data Length=312118, Special=1, Name=24.png, Metadata=, 7581600 decoded bytes
#26: Offset:3092480, Header=SPLASH!!, Width=536, Height=60, Data Length=9162, Special=1, Name=25.png, Metadata=, 96480 decoded bytes
#27: Offset:3108864, Header=SPLASH!!, Width=1080, Height=2340, Data Length=198370, Special=1, Name=26.png, Metadata=, 7581600 decoded bytes
#28: Offset:3313664, Header=SPLASH!!, Width=1080, Height=2340, Data Length=66096, Special=1, Name=27.png, Metadata=, 7581600 decoded bytes
You should now 28 png files in the directory called "0.png", "1.png", ..., "27.png".

3) Third, check the images. Install an image viewer (for example "eog") on your linux distribution and then do:
Code:
> eog *.png
You will be able to view the splash screens one by one (with eog). The png's are also part of attached zip file.

4) Modify any of the png files to your liking. For example, you can use the linux "gimp" image processing tool. But note that you MUST keep the width and height of the images the same as the original sizes.

5) Repack the modified images. To do that, open a linux shell and do:
Code:
> cd splash
> ./op6 -i original.logo.bin -j 0
You will see output like:
Code:
Resolution	Offset		Name
-------------------------------------------------------------
1080x1920	0		0.png
536x60		249856		1.png
1080x1920	266240		2.png
1080x1920	458752		3.png
1080x1920	520192		4.png
392x66		712704		5.png
487x69		724992		6.png
1080x1920	741376		7.png
1080x2160	868352		8.png
536x60		1155072		9.png
1080x2160	1171456		10.png
1080x2160	1372160		11.png
1080x2160	1441792		12.png
392x66		1642496		13.png
487x69		1654784		14.png
1080x2160	1671168		15.png
1080x2280	1802240		16.png
536x60		2113536		17.png
1080x2280	2129920		18.png
1080x2280	2334720		19.png
1080x2280	2404352		20.png
392x66		2609152		21.png
487x69		2621440		22.png
1080x2280	2637824		23.png
1080x2340	2772992		24.png
536x60		3092480		25.png
1080x2340	3108864		26.png
1080x2340	3313664		27.png

______________________________________
Original filesize: 	16.00 MB
Modified filesize: 	3.23 MB
-------------------------------------------------------------
And you should have a file called "modified.logo.bin".

6) To flash the new splash screens, reboot your phone back into twrp. Then open a linux shell and do:
Code:
> adb push modified.logo.bin /data/
> adb shell
# dd if=/data/original.logo.bin of=/dev/block/bootdevice/by-name/LOGO_a
# sync
# sync
# reboot
With the last command, your phone will reboot and if all is well you should see your modified splash screens.

If you want to return to stock, just follow step 6 but flash original.logo.bin file.

What's the story with the 2 partitions? 6T uses the A/B partitioning scheme. Read this thread: https://forum.xda-developers.com/oneplus-6/how-to/guide-noobs-guide-to-b-partitions-op6-t3816123, if you want more details.

The LOGO partitions are called: LOGO_a and LOGO_b. In the commands above I have used always LOGO_a but obviously you can use LOGO_b as well.

How do you know which partition (A or B) your phone is booting from? Well, that i easy to find out. Boot your phone normally. Open a linux shell and then do:
Code:
> adb shell
$ getprop ro.boot.slot_suffix
And it will say "_a" or "_b" depending on the partition which your phone is booting from. So that determines whether you have to flash LOGO_a or LOGO_b.

Enjoy.

Note: attached there is also a example.zip file with a original.logo.bin file inside. This is an example where the splash screens from One+ have been replaced by black screens with the Google logo. You can straight flash that into the LOGO_a and/or LOGO_b partitions. I have attached also a bootanimation.zip (black Google pixel style) which plays very nicely with this. The bootanimation.zip file should go into /system/media/ on your device.
 

Attachments

Last edited:

foobar66

Senior Member
Jan 8, 2011
1,755
1,751
133
Brussels
Big thanks for the proper credit @foobar66. I do not have the time anymore to even find/dissect bootloaders/partitions these days, and thanks for your documentation. I have seen several people walk away with my free information and dedicated work like they didn't steal it and try and make them self a name (I guess). Thank you!:)
No problem ... that is only normal, decent and polite behavior. We are here to share and learn on XDA.
The program did not work initially on the original.logo.bin from the 6T (segmentation fault). I made a few small mods to the code to make it work.
 

foobar66

Senior Member
Jan 8, 2011
1,755
1,751
133
Brussels
Great work. I was waiting for this.
Quick question: any idea about the unlocked bootloader image location ?
Edit: works fine.
No not precisely, but here is the list of partitions with their names:

Code:
0 lrwxrwxrwx 1 root root 15 1970-01-01 08:50 ALIGN_TO_128K_1 -> /dev/block/[email protected]
0 lrwxrwxrwx 1 root root 15 1970-01-01 08:50 ALIGN_TO_128K_2 -> /dev/block/[email protected]
0 lrwxrwxrwx 1 root root 16 1970-01-01 08:50 ImageFv -> /dev/block/[email protected]
0 lrwxrwxrwx 1 root root 16 1970-01-01 08:50 LOGO_a -> /dev/block/[email protected]
0 lrwxrwxrwx 1 root root 16 1970-01-01 08:50 LOGO_b -> /dev/block/[email protected]
0 lrwxrwxrwx 1 root root 15 1970-01-01 08:50 abl_a -> /dev/block/[email protected]
0 lrwxrwxrwx 1 root root 16 1970-01-01 08:50 abl_b -> /dev/block/[email protected]
0 lrwxrwxrwx 1 root root 16 1970-01-01 08:50 aging -> /dev/block/[email protected]
0 lrwxrwxrwx 1 root root 15 1970-01-01 08:50 aop_a -> /dev/block/[email protected]
0 lrwxrwxrwx 1 root root 16 1970-01-01 08:50 aop_b -> /dev/block/[email protected]
0 lrwxrwxrwx 1 root root 16 1970-01-01 08:50 apdp -> /dev/block/[email protected]
0 lrwxrwxrwx 1 root root 15 1970-01-01 08:50 bluetooth_a -> /dev/block/[email protected]
0 lrwxrwxrwx 1 root root 16 1970-01-01 08:50 bluetooth_b -> /dev/block/[email protected]
0 lrwxrwxrwx 1 root root 16 1970-01-01 08:50 boot_a -> /dev/block/[email protected]
0 lrwxrwxrwx 1 root root 16 1970-01-01 08:50 boot_b -> /dev/block/[email protected]
0 lrwxrwxrwx 1 root root 15 1970-01-01 08:50 cdt -> /dev/block/[email protected]
0 lrwxrwxrwx 1 root root 16 1970-01-01 08:50 cmnlib64_a -> /dev/block/[email protected]
0 lrwxrwxrwx 1 root root 16 1970-01-01 08:50 cmnlib64_b -> /dev/block/[email protected]
0 lrwxrwxrwx 1 root root 16 1970-01-01 08:50 cmnlib_a -> /dev/block/[email protected]
0 lrwxrwxrwx 1 root root 16 1970-01-01 08:50 cmnlib_b -> /dev/block/[email protected]
0 lrwxrwxrwx 1 root root 16 1970-01-01 08:50 config -> /dev/block/[email protected]
0 lrwxrwxrwx 1 root root 15 1970-01-01 08:50 ddr -> /dev/block/[email protected]
0 lrwxrwxrwx 1 root root 16 1970-01-01 08:50 devcfg_a -> /dev/block/[email protected]
0 lrwxrwxrwx 1 root root 16 1970-01-01 08:50 devcfg_b -> /dev/block/[email protected]
0 lrwxrwxrwx 1 root root 16 1970-01-01 08:50 devinfo -> /dev/block/[email protected]
0 lrwxrwxrwx 1 root root 16 1970-01-01 08:50 dip -> /dev/block/[email protected]
0 lrwxrwxrwx 1 root root 15 1970-01-01 08:50 dsp_a -> /dev/block/[email protected]
0 lrwxrwxrwx 1 root root 16 1970-01-01 08:50 dsp_b -> /dev/block/[email protected]
0 lrwxrwxrwx 1 root root 16 1970-01-01 08:50 dtbo_a -> /dev/block/[email protected]
0 lrwxrwxrwx 1 root root 16 1970-01-01 08:50 dtbo_b -> /dev/block/[email protected]
0 lrwxrwxrwx 1 root root 15 1970-01-01 08:50 frp -> /dev/block/[email protected]
0 lrwxrwxrwx 1 root root 15 1970-01-01 08:50 fsc -> /dev/block/[email protected]
0 lrwxrwxrwx 1 root root 15 1970-01-01 08:50 fsg -> /dev/block/[email protected]
0 lrwxrwxrwx 1 root root 16 1970-01-01 08:50 fw_4j1ed_a -> /dev/block/[email protected]
0 lrwxrwxrwx 1 root root 16 1970-01-01 08:50 fw_4j1ed_b -> /dev/block/[email protected]
0 lrwxrwxrwx 1 root root 16 1970-01-01 08:50 fw_4u1ea_a -> /dev/block/[email protected]
0 lrwxrwxrwx 1 root root 16 1970-01-01 08:50 fw_4u1ea_b -> /dev/block/[email protected]
0 lrwxrwxrwx 1 root root 16 1970-01-01 08:50 fw_ufs3_a -> /dev/block/[email protected]
0 lrwxrwxrwx 1 root root 16 1970-01-01 08:50 fw_ufs3_b -> /dev/block/[email protected]
0 lrwxrwxrwx 1 root root 16 1970-01-01 08:50 fw_ufs4_a -> /dev/block/[email protected]
0 lrwxrwxrwx 1 root root 16 1970-01-01 08:50 fw_ufs4_b -> /dev/block/[email protected]
0 lrwxrwxrwx 1 root root 16 1970-01-01 08:50 fw_ufs5_a -> /dev/block/[email protected]
0 lrwxrwxrwx 1 root root 16 1970-01-01 08:50 fw_ufs5_b -> /dev/block/[email protected]
0 lrwxrwxrwx 1 root root 16 1970-01-01 08:50 fw_ufs6_a -> /dev/block/[email protected]
0 lrwxrwxrwx 1 root root 16 1970-01-01 08:50 fw_ufs6_b -> /dev/block/[email protected]
0 lrwxrwxrwx 1 root root 16 1970-01-01 08:50 fw_ufs7_a -> /dev/block/[email protected]
0 lrwxrwxrwx 1 root root 16 1970-01-01 08:50 fw_ufs7_b -> /dev/block/[email protected]
0 lrwxrwxrwx 1 root root 16 1970-01-01 08:50 fw_ufs8_a -> /dev/block/[email protected]
0 lrwxrwxrwx 1 root root 16 1970-01-01 08:50 fw_ufs8_b -> /dev/block/[email protected]
0 lrwxrwxrwx 1 root root 15 1970-01-01 08:50 hyp_a -> /dev/block/[email protected]
0 lrwxrwxrwx 1 root root 16 1970-01-01 08:50 hyp_b -> /dev/block/[email protected]
0 lrwxrwxrwx 1 root root 16 1970-01-01 08:50 keymaster_a -> /dev/block/[email protected]
0 lrwxrwxrwx 1 root root 16 1970-01-01 08:50 keymaster_b -> /dev/block/[email protected]
0 lrwxrwxrwx 1 root root 15 1970-01-01 08:50 keystore -> /dev/block/[email protected]
0 lrwxrwxrwx 1 root root 16 1970-01-01 08:50 limits -> /dev/block/[email protected]
0 lrwxrwxrwx 1 root root 16 1970-01-01 08:50 logdump -> /dev/block/[email protected]
0 lrwxrwxrwx 1 root root 16 1970-01-01 08:50 logfs -> /dev/block/[email protected]
0 lrwxrwxrwx 1 root root 15 1970-01-01 08:50 mdtp_a -> /dev/block/[email protected]
0 lrwxrwxrwx 1 root root 16 1970-01-01 08:50 mdtp_b -> /dev/block/[email protected]
0 lrwxrwxrwx 1 root root 15 1970-01-01 08:50 mdtpsecapp_a -> /dev/block/[email protected]
0 lrwxrwxrwx 1 root root 16 1970-01-01 08:50 mdtpsecapp_b -> /dev/block/[email protected]
0 lrwxrwxrwx 1 root root 16 1970-01-01 08:50 minidump -> /dev/block/[email protected]
0 lrwxrwxrwx 1 root root 15 1970-01-01 08:50 misc -> /dev/block/[email protected]
0 lrwxrwxrwx 1 root root 15 1970-01-01 08:50 modem_a -> /dev/block/[email protected]
0 lrwxrwxrwx 1 root root 16 1970-01-01 08:50 modem_b -> /dev/block/[email protected]
0 lrwxrwxrwx 1 root root 15 1970-01-01 08:50 modemst1 -> /dev/block/[email protected]
0 lrwxrwxrwx 1 root root 15 1970-01-01 08:50 modemst2 -> /dev/block/[email protected]
0 lrwxrwxrwx 1 root root 16 1970-01-01 08:50 msadp -> /dev/block/[email protected]
0 lrwxrwxrwx 1 root root 16 1970-01-01 08:50 odm_a -> /dev/block/[email protected]
0 lrwxrwxrwx 1 root root 16 1970-01-01 08:50 odm_b -> /dev/block/[email protected]
0 lrwxrwxrwx 1 root root 15 1970-01-01 08:50 oem_dycnvbk -> /dev/block/[email protected]
0 lrwxrwxrwx 1 root root 15 1970-01-01 08:50 oem_stanvbk -> /dev/block/[email protected]
0 lrwxrwxrwx 1 root root 16 1970-01-01 08:50 op1 -> /dev/block/[email protected]
0 lrwxrwxrwx 1 root root 15 1970-01-01 08:50 op2 -> /dev/block/[email protected]
0 lrwxrwxrwx 1 root root 15 1970-01-01 08:50 param -> /dev/block/[email protected]
0 lrwxrwxrwx 1 root root 15 1970-01-01 08:50 persist -> /dev/block/[email protected]
0 lrwxrwxrwx 1 root root 16 1970-01-01 08:50 qupfw_a -> /dev/block/[email protected]
0 lrwxrwxrwx 1 root root 16 1970-01-01 08:50 qupfw_b -> /dev/block/[email protected]
0 lrwxrwxrwx 1 root root 16 1970-01-01 08:50 reserve1 -> /dev/block/[email protected]
0 lrwxrwxrwx 1 root root 16 1970-01-01 08:50 reserve2 -> /dev/block/[email protected]
0 lrwxrwxrwx 1 root root 16 1970-01-01 08:50 sec -> /dev/block/[email protected]
0 lrwxrwxrwx 1 root root 16 1970-01-01 08:50 splash -> /dev/block/[email protected]
0 lrwxrwxrwx 1 root root 16 1970-01-01 08:50 spunvm -> /dev/block/[email protected]
0 lrwxrwxrwx 1 root root 15 1970-01-01 08:50 ssd -> /dev/block/[email protected]
0 lrwxrwxrwx 1 root root 16 1970-01-01 08:50 sti -> /dev/block/[email protected]
0 lrwxrwxrwx 1 root root 16 1970-01-01 08:50 storsec_a -> /dev/block/[email protected]
0 lrwxrwxrwx 1 root root 16 1970-01-01 08:50 storsec_b -> /dev/block/[email protected]
0 lrwxrwxrwx 1 root root 16 1970-01-01 08:50 system_a -> /dev/block/[email protected]
0 lrwxrwxrwx 1 root root 16 1970-01-01 08:50 system_b -> /dev/block/[email protected]
0 lrwxrwxrwx 1 root root 16 1970-01-01 08:50 toolsfv -> /dev/block/[email protected]
0 lrwxrwxrwx 1 root root 15 1970-01-01 08:50 tz_a -> /dev/block/[email protected]
0 lrwxrwxrwx 1 root root 16 1970-01-01 08:50 tz_b -> /dev/block/[email protected]
0 lrwxrwxrwx 1 root root 16 1970-01-01 08:50 userdata -> /dev/block/[email protected]
0 lrwxrwxrwx 1 root root 16 1970-01-01 08:50 vbmeta_a -> /dev/block/[email protected]
0 lrwxrwxrwx 1 root root 16 1970-01-01 08:50 vbmeta_b -> /dev/block/[email protected]
0 lrwxrwxrwx 1 root root 16 1970-01-01 08:50 vendor_a -> /dev/block/[email protected]
0 lrwxrwxrwx 1 root root 16 1970-01-01 08:50 vendor_b -> /dev/block/[email protected]
0 lrwxrwxrwx 1 root root 15 1970-01-01 08:50 xbl_a -> /dev/block/[email protected]
0 lrwxrwxrwx 1 root root 15 1970-01-01 08:50 xbl_b -> /dev/block/[email protected]
0 lrwxrwxrwx 1 root root 15 1970-01-01 08:50 xbl_config_a -> /dev/block/[email protected]
0 lrwxrwxrwx 1 root root 15 1970-01-01 08:50 xbl_config_b -> /dev/block/[email protected]
I am just guessing it might be xbl_a and xbl_config_a ... but I am not sure.
 
  • Like
Reactions: AnoopKumar

foobar66

Senior Member
Jan 8, 2011
1,755
1,751
133
Brussels
xbl is the eXtensible bootloader. A 64bit elf. Does it contain images ? is it possible ?
Hmm ... very difficult. ELF is the executable and linking format. I guess the images are static binaries which get included in the code as hex arrays or part of the ELF file's "data" section. Theoretically possible but I would not start on it ... will take a lot of time to find out.
 
  • Like
Reactions: Jsilver73

clarkcant

Senior Member
Jul 19, 2017
163
24
0
New York
Thanks for taking the time to put this together.
Does anyone have instructions for how to do this on Windows? The only access I have to Linux is through Chrome OS which is still too finicky to get all if this done with.
 

AnoopKumar

Senior Member
Jan 16, 2012
565
765
133
Kerala
Thanks for taking the time to put this together.
Does anyone have instructions for how to do this on Windows? The only access I have to Linux is through Chrome OS which is still too finicky to get all if this done with.
See the attachment. Just rename your LOGO.img to logo.img

Code:
op6t -i logo.img -d   //to extract splash images
op6t -i logo.img -j 0   //repack with changes
For OnePlus 6T replace 24.png and 27.png
 

Attachments

Last edited: