modified splash.img dont work? try logo.img_Maker for Mi5

Cynob

Member
Nov 20, 2016
19
12
0
Hello everybody

First i dont own a Mi5 but in the newer version of the MIUI V8 Android 7 there is the problem that
a modified splash.img does not change the bootlogo which is shown on boot.
A friend of me (**@[email protected]**) asked if i could try my luck to get a new bootlogo on his phone. So i screwed around build a kernel and tried and tested... till i opened the logo.img file from the rom with a hex editor and tried to understand its header data.
With help from **GokulNC** i figured out how the file is build ( Thank you for that Goku! )
So i was able to rebuild the file with a modified script.
It seems to work!
But i could only test it at Hoschis phone so please feel free to write if something do not work or if there are errors or bugs.

For Windows i edited Gokus tool that it reads 5 pictures from its "pics" folder. ( put your pictures there and name them logo1.png till logo5.png )
I am not familiar with the windows powershell ( ok i wasnt with python either... ) so if somebody could write it better please tell me.
I tested it in a virtual machine with windows7 and was logged in as admin ( if somebody want to know ).

Instead i wrote a tool with a gui for linux. You can use one picture for all or set every single one.
You can adjust the resolution of each picture if you like.
I tested it on Mint and on a nacked virtualized Ubuntu.

Both tools can build a update.zip to easily install your new bootlogo.



How to use Logo_img_Maker for Linux
download the Logo_img_Maker_Linux.tar and untar it to your homefolder.
In the Logo_img_Maker_Linux folder check that the makeLogo.sh script is marked executeable.
Now start the Script with a double click ( run in terminal ) or start it with "./makeLogo.sh"

On start the script check if all necessary additional software is installed and if not try to install it with the apt-get tool.
To run the script succesful following programms are needed:
python; python-imaging; python-pit; imagemagick; zenity; zip

If a error occur the script shows it in the terminal window and maybe ask for your superuser password to install the missing things.
You can also run: "sudo apt-get install python python-imaging python-pit imagemagick zenity zip -y" first to set up your system.

How it works:
At first you see a Welcome screen. Click ok to get to a file selection dialog where you can select the .png file which will get your new bootlogo.
After that you can adjust the resolution if you like. Your original picture dont get edited (the script copy it first to a temporary folder).
If you dont want to let the "keep_size" radiobutton active and only press ok then.

So now you can decide if you want to use the selected picture for all slots in the logo.img file or to put a different for every single slot.
If you want more to know about it read "logo.img explained" in this readme

If you select
one4all:
your before selected picture get used for logo Nr.1
The Script resizes the other 4 to 161x321 to save space on disc

add more:
you have to select the other 4 pictures one after another and set its size like you did with the first one. Of course the sizes can differ
for each picture.

When you are done with one of the two options the logo.img get build.

If that was successful you will get asked if you want to generate a update.zip for your custom recovery.
If you dont want to the logo.img can be found in the output folder.
If you click yes the flashable zip get generated in the output folder too.


How to use Logo_img_Maker for Windows

I only have Windows in a virtual machine to test it but it should work.
I have had it running with the administrator account and it build well... some others had proplems.

Download the Logo_img_Maker_Windows.rar and unrar it
then put your 5 .png pictures in the pic folder and rename them to logo1.png logo2.png logo.3png logo4.png logo5.png
start the CREATE_LOGO.bat to build your logo.img / update.zip after that

Ok i have took this script directly from **GokuINC**s work. the only difference is
that the batchscript estimates logo1.png till logo5.png directly and dont ask if there is a file.

The direct link to **GokuINC**s work:
https://forum.xda-developers.com/mi-5/how-to/guide-how-to-create-custom-splash-t3425054


logo.img explained:

the original logo.img header got explained by **GokulNC** from xda-developers.com - big thanks
- without him this all could not have been possible!


The header from ori file is:

SPLASH!!
Width (of 5 pictures)
Height (of 5 pictures)
SUPPORT_RLE24_COMPRESSIONT (of 5 pictures) (1 means it is RLE encoded, 0 means RGB24)
Payload size/4096 (of 5 pictures)
(Offset/4096)-1 (of 5 pictures)

And the funny thing my script do:

SPLASH!!
Width (of 5 pictures)
Height (of 5 pictures)
SUPPORT_RLE24_COMPRESSIONT (of 5 pictures) (1 means it is RLE encoded, 0 means RGB24)
(Offset/4096)-1 (of 5 pictures)


and it works on "MIUI V8 Android 7" with a Mi5 (gemini)
I first tried to rebuild it like Gokus example ( and of course - in the hex editor it was clear the same as in the original logo.img ..
ok different sizes but all was calculatebale and logical)
but it didnt work....
So i poked around and got this working solution - tested on **@[email protected]**s Mi5
There are many things that arent clear as they should - but it works somehow ;)


It shows the bootlogo equal if you boot to your system or your recovery.
I dont know really if the 5 pictures are all the same but different sizes or if they are different.
The original resolutions are:

logo picture 1 = 161x321
logo picture 2 = 558x992
logo picture 3 = 178x350
logo picture 4 = 1080x1920
logo picture 5 = 1080x1920


Update 04.06.2017 :
Windows tool now v0.2 = fixed installer script


XDA:DevDB Information
Mi5_logo_img_Maker, Tool/Utility for the Xiaomi Mi 5

Contributors
Cynob, GokulNC, @[email protected]

Version Information
Status: Testing

Created 2017-05-09
Last Updated 2017-05-09
 

Attachments

Last edited:

uvera00

Senior Member
Sep 24, 2013
256
253
0
Novi Sad
logo2 to logo5 seems useless
Only shows logo1 which doesn't show as 1080x1920 (if provided image), instead it shows as 1080x100
This is the logo i made for it

 
Last edited:

Cynob

Member
Nov 20, 2016
19
12
0
logo2 to logo5 seems useless
Only shows logo1 which doesn't show as 1080x1920 (if provided image), instead it shows as 1080x100
This is the logo i made for it
Strange thing... i would understand if nothing is working but your pic 1080x100 sized? ok ... i have took your pic and build the logo.img - can you give it a try if it behave the same?
Where do the logo2.png till logo5.png got shown?

öhm i need more posts to upload files - i have saved your logo.img in the first contribution as update.zip
 
Last edited:

uvera00

Senior Member
Sep 24, 2013
256
253
0
Novi Sad
Strange thing... i would understand if nothing is working but your pic 1080x100 sized? ok ... i have took your pic and build the logo.img - can you give it a try if it behave the same?
Where do the logo2.png till logo5.png got shown?

öhm i need more posts to upload files - i have saved your logo.img in the first contribution as update.zip
Well it is estimated to be about 1080x100 by eye, i will try to take a shot of it. It was built with Windows tool and i will try to test your one, will inform asap

logo2 to logo5 no where to be seen, cant check with stock recovery logo

---------- Post added at 09:30 AM ---------- Previous post was at 09:12 AM ----------

Here is the picture of the boot logo, sorry for potato webcam picture

As you can see it is trimmed to 1080x something about 100-200 px
 
Last edited:

Cynob

Member
Nov 20, 2016
19
12
0
The proplem is: the original logo.img has 5 pictures in it. I dont know where the other 4 pics get shown. They are there in the file but dont know where they are used.
 

Cynob

Member
Nov 20, 2016
19
12
0
News:

I rewrote the logo_gen.py to make a file with only one picture inside and deactivated the RLE compression = wont work.

Ok but i think i found out why some png images work and some others not.
Its because some information in the png header itself.
If you have a picture which wont work try:

Open Gimp image editor (https://www.gimp.org/)
Now open your existing png file.
Then use the "export as" function from dropdown menu
give it a "newname".png and click on export

Now you will get to a screen showing the export properties
deactivate every option and set the compression rate to 0

after that click "export" to generate a new picture which can be used for generating a logo.img
best result i got was when i used the same picture and copied it to logo2.png....>>logo5.png

Next step will be to edit the tools that they do it on their own :)

for testing which filesettings for the png will do it i have uploaded some test objects to github: https://github.com/Cynob/Mi5_logo_image_Maker/tree/master/logo_img_testing
feel free to download and test which one will work or not - if you want to help :)
 
  • Like
Reactions: @[email protected]

uvera00

Senior Member
Sep 24, 2013
256
253
0
Novi Sad
and have you tried some of the files?
The proplem is: not every picture gives a working logo.img. i want to know if its the pictures header fault or if it relay on the alpha channel and so on.
None of those working on
firmware_miui_7.5.4_dev.zip
None of these working because i was flashing it into splash instead of logo, will try again in a sec

Okay so only glogo03 (one with something like inverted gradient of colors background) seems to be scaled down, something like scaled down to size of others glogo if you know what i mean...

Only one image in the logo.img file right? There was no fastboot image, was same as boot logo

No difference between logos so i suppose fastboot flash logo logo.img worked for every one as returned in CMD prompt :)
 
Last edited:
  • Like
Reactions: Cynob

Cynob

Member
Nov 20, 2016
19
12
0
None of those working on


None of these working because i was flashing it into splash instead of logo, will try again in a sec

Okay so only glogo03 (one with something like inverted gradient of colors background) seems to be scaled down, something like scaled down to size of others glogo if you know what i mean...

Only one image in the logo.img file right? There was no fastboot image, was same as boot logo

No difference between logos so i suppose fastboot flash logo logo.img worked for every one as returned in CMD prompt :)
Ok good - so the tool works if i understand you :)
only with picture glogo3 there was it shown wrong.

and yes the command "fastboot flash logo logo.img" is the right one.

Is in original logo.img a other logo for fastboot than at normal system boot?