[ONE Android Development] updateing:
I haven't had enough to get a One now, but I'm pretty interested in the phone. Yesterday I saw a thread on Chinese forum, saying that LOGO.bin contains the image shown in fastboot mode, and thus everyone can choose his preferred image (like CM's) even if he uses ColorOS. So I tried to extract the bitmap from LOGO.bin and replace it with my own picture.

Now I've succeed PARTIALLY in identifying the BIN file format and extracting the images. There's no enough time to dig into replacing the pictures though, but I think it won't be hard.

Here is what I find, for those "aggressive" themers and ROM devs who want custom boot splash screen:

The BIN file starts with the following structure:

struct SPLASHHEADERINDEX {
char magic_code[8]; // = { 'S', 'P', 'L', 'A', 'S', 'H', '!', '!' };
int img_width;
int img_height;
int reserved; // What's this? I haven't figured that out.
int img_offset[6];
char padding[468]; // The header is 512 bytes. Thanks [MENTION=5757424]chillstep1998[/MENTION] !
};

Right after this structure, the raw data of boot splash image begins. Every pixel is described by 3 bytes in B-G-R order. The pixels begin at the upper left corner and then stored in the order of left to right & up to down. You can read (img_width * img_height * 3) bytes and write them into a BMP file. NOTE that BMP files require 4-pixel alignment for every horizontal row (Google that for details, otherwise you will get a "Broken image" info in image viewers) In order to avoid this problem, I wrote a simple program in VB.NET and used Bitmap.SetPixel and Bitmap.Save to solve it.

This is the VB code for this procedure. (I can't do GUI programs in C++...)

Dim bmp As New Bitmap(img_width, img_height)
Dim color As Color
For y = 0 To img_height - 1
For x = 0 To img_width - 1
b = fs.ReadByte 'fs is the FileStream of BIN file. Already sought to correct offset.
g = fs.ReadByte
r = fs.ReadByte
If b = -1 Then b = 0
If g = -1 Then g = 0
If r = -1 Then r = 0
color = color.FromArgb(r, g, b)
bmp.SetPixel(x, y, color)
Next
Next

There are some zeros after (img_width * img_height * 3) bytes. I don't know what's for...

Then let's look at the other images. Their offsets are in the img_offset array of SPLASHHEADERINDEX. They have headers like this:

struct SPLASHHEADERNONINDEX {
char magic_code[8]; // "SPLASH!!" without \0
int img_width;
int img_height;
int reserved; //Still don't know
char padding[492];
};

Right after the structure is the raw data. Process that as mentioned above.

The image at img_offset[0] is the one shown in fastboot mode

[1] is AT current test (original Chinese: AT电流测试. What's AT?)

[2] is RF test

[3] is WLAN test

[4] is charging

[5] is low battery warning

Previews for new images are coming soon...

However: there is one bug: the images extracted are "mis-placed". You need to move 0x0 to 164xHEIGHT (163xHEIGHT maybe) area to the right side of the image to get the correct pic. The images extracted from ColorOS' LOGO.bin are listed as follows:

SPOILER:

[0]

[1]

[2]

[3]

[4]

[5]

Boot splash

Does anyone know the cause of this mis-place problem? Although that can be solved easily in the code, but it's not very reliable. Maybe it's related to the "reserved" member?

Since the format is rather simple, modding and repacking will be easy. When I get some free time I'll make a tool for this...