{"id":20811242,"url":"https://github.com/mlgmxyysd/magic-splash-wand","last_synced_at":"2025-05-07T09:17:06.007Z","repository":{"id":107830634,"uuid":"416801826","full_name":"MlgmXyysd/Magic-Splash-Wand","owner":"MlgmXyysd","description":"Tool for unpacking and packaging splash image for Qualcomm \u0026 OPlus Qualcomm devices","archived":false,"fork":false,"pushed_at":"2024-04-14T19:56:30.000Z","size":48,"stargazers_count":45,"open_issues_count":5,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-05-07T09:16:54.951Z","etag":null,"topics":["android","bootlogo","customization","development","hacktoberfest","oneplus","oplus","oppo","php","qcom","qualcomm","realme","splash","splashscreen","tool"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MlgmXyysd.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"patreon":"MlgmXyysd","custom":["https://paypal.me/MlgmXyysd","https://afdian.net/@MlgmXyysd"]}},"created_at":"2021-10-13T15:37:37.000Z","updated_at":"2025-05-05T09:07:57.000Z","dependencies_parsed_at":"2024-11-17T20:40:45.786Z","dependency_job_id":"84a80e86-5a05-4c4d-97a5-1f1df4b102b7","html_url":"https://github.com/MlgmXyysd/Magic-Splash-Wand","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MlgmXyysd%2FMagic-Splash-Wand","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MlgmXyysd%2FMagic-Splash-Wand/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MlgmXyysd%2FMagic-Splash-Wand/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MlgmXyysd%2FMagic-Splash-Wand/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MlgmXyysd","download_url":"https://codeload.github.com/MlgmXyysd/Magic-Splash-Wand/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252847568,"owners_count":21813461,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","bootlogo","customization","development","hacktoberfest","oneplus","oplus","oppo","php","qcom","qualcomm","realme","splash","splashscreen","tool"],"created_at":"2024-11-17T20:38:44.107Z","updated_at":"2025-05-07T09:17:05.840Z","avatar_url":"https://github.com/MlgmXyysd.png","language":"PHP","funding_links":["https://patreon.com/MlgmXyysd","https://paypal.me/MlgmXyysd","https://afdian.net/@MlgmXyysd"],"categories":[],"sub_categories":[],"readme":"# Magic Splash Wand\r\n![Version: 1.2](https://img.shields.io/badge/Version-1.2-brightgreen?style=for-the-badge) ![OPlus Version: 1.2](https://img.shields.io/badge/Version-OPlus%201.2-brightgreen?style=for-the-badge)\r\n\r\nMagic Splash Wand is a set of scripts for unpacking and packaging the splash screen of Qualcomm series devices on boot, powered by PHP.\r\n\r\n- Magic Splash!! Wand\r\n\r\nTool for unpacking and packaging splash image for Qualcomm devices.\r\n\r\n- Magic Splash Logo! Wand\r\n\r\nTool for unpacking and packaging splash image for OPlus Qualcomm devices.\r\n\r\n## How to use\r\n1. Download and install PHP 8.1.0+ for your system from the [official website](https://www.php.net/downloads).\r\n2. Enable GD extension in `php.ini`.\r\n3. Open the terminal and use PHP interpreter to execute the [script](splash.php) or [script (for oplus)](splash_oplus.php) with the usage.\r\n4. Wait for the script to run.\r\n\r\n## Workaround\r\nWhile cracking the BootLoader of OPPO Watch 2 eSIM Series, I got interested in its Splash. It's format is not quite the same as the [script provided by Qualcomm](https://git.codelinaro.org/clo/la/device/qcom/common/-/blob/LA.VENDOR.14.3.0.r1-11500-lanai.0/display/logo/logo_gen.py).\r\n\r\nAfter analysis, it contains multiple logos and store information with the structure below:\r\n```\r\nSplash Payload (0x0)\r\n│\r\n├── Header [0x200] (0x0)\r\n│   │\r\n│   ├──(header structure) [0xC] (0x0)\r\n│   │   │\r\n│   │   │      *** Splash Identity ***\r\n│   │   │\r\n│   │   ├── char[0x8] magic;      \u003c--- magic header, \"SPLASH!!\"\r\n│   │   │\r\n│   │   │      *** Content Identity ***\r\n│   │   │\r\n│   │   └── unsigned number;    \u003c--- number of logos, little endian\r\n│   │\r\n│   ├──(logo structure) [0x14] (0xC)\r\n│   │   │\r\n│   │   │      *** Content 1 Information ***\r\n│   │   │\r\n│   │   ├── unsigned width;     \u003c--- image's width, little endian\r\n│   │   ├── unsigned height;    \u003c--- image's height, little endian\r\n│   │   ├── unsigned type;      \u003c--- flag for compression, 0: Raw Image; 1: RLE24 Compressed Image\r\n│   │   ├── unsigned blocks;    \u003c--- block size, real size / 512\r\n│   │   └── unsigned offset;    \u003c--- offset of image's content, little endian\r\n│   │\r\n│   ├──(logo structure) [0x14] (0x20)\r\n│   │   │\r\n│   │   │      *** Content 2 Information ***\r\n│   │   │\r\n│   │   ├── unsigned width;\r\n│   │   ├── unsigned height;\r\n│   │   ├── unsigned type;\r\n│   │   ├── unsigned blocks;\r\n│   │   └── unsigned offset;\r\n│   │\r\n│   ├──(logo structure) [0x14] (0x34)\r\n│   │   │\r\n│   │   │      *** Content N Information ***\r\n│   │   ├── ...\r\n│   │   └── ...\r\n│   │\r\n│   └── ...\r\n│\r\n└── Payload data (0x200)\r\n    │\r\n    │      *** Content 1 data ***\r\n    │\r\n    ├── (data)     \u003c--- image's content\r\n    │\r\n    │      *** Content 1 data ***\r\n    │\r\n    ├── (data)\r\n    │\r\n    │      *** Content N data ***\r\n    │\r\n    ├── ...\r\n    └── ...\r\n```\r\nThe original script was so old that it didn't even support Python 3.x. It's a pain to retrofit on top of it.\r\n\r\nOut of distaste for Python syntax, I rewrote the script in PHP and added unpacking support.\r\n\r\n-- Update --\r\n\r\nQualcomm devices from OPlus (OPPO/OnePlus/Realme) use a different but similar format to the above.\r\n\r\nCombined with the Qualcomm structure, the analysis resulted in the following structure:\r\n```\r\nSplash Payload (0x0)\r\n│\r\n├── Padding [0x4000] (0x0)    \u003c--- padding before the header, usually empty\r\n│\r\n├── Header [0x4000] (0x4000)\r\n│   │\r\n│   ├──(header structure) [0x120] (0x4000)\r\n│   │   │\r\n│   │   │      *** Splash Identity ***\r\n│   │   │\r\n│   │   ├── char[0xB] magic;     \u003c--- magic header, \"SPLASH LOGO!\"\r\n│   │   ├── char[0x40] desc1;    \u003c--- description of this splash file (1)\r\n│   │   ├── char[0x40] desc2;    \u003c--- description of this splash file (2)\r\n│   │   ├── char[0x40] desc3;    \u003c--- description of this splash file (3)\r\n│   │   ├── char[0x40] desc4;    \u003c--- description of this splash file (4)\r\n│   │   │\r\n│   │   │      *** Content Identity ***\r\n│   │   │\r\n│   │   ├── unsigned number;      \u003c--- number of logos, little endian\r\n│   │   ├── unsigned version;     \u003c--- version of this splash image, little endian, current 4\r\n│   │   ├── unsigned width;       \u003c--- screen width, little endian\r\n│   │   ├── unsigned height;      \u003c--- screen height, little endian\r\n│   │   └── unsigned compress;    \u003c--- flag for compression, 0: Raw Image; 1: GZIP Compressed Image\r\n│   │\r\n│   ├──(logo structure) [0x80] (0x4120)\r\n│   │   │\r\n│   │   │      *** Content 1 Information ***\r\n│   │   │\r\n│   │   ├── unsigned offset;       \u003c--- offset of image's content, little endian\r\n│   │   ├── unsigned real_size;    \u003c--- content real size (decompressed if GZIP compressed)\r\n│   │   ├── unsigned data_size;    \u003c--- payload data size\r\n│   │   └── char[0x74] name;       \u003c--- content file name, extension is \".bmp\"\r\n│   │\r\n│   ├──(logo structure) [0x80] (0x41A0)\r\n│   │   │\r\n│   │   │      *** Content 2 Information ***\r\n│   │   │\r\n│   │   ├── unsigned offset;\r\n│   │   ├── unsigned real_size;\r\n│   │   ├── unsigned data_size;\r\n│   │   └── char[0x74] name;\r\n│   │\r\n│   ├──(logo structure) [0x80] (0x4220)\r\n│   │   │\r\n│   │   │      *** Content N Information ***\r\n│   │   ├── ...\r\n│   │   └── ...\r\n│   │\r\n│   └── ...\r\n│\r\n└── Payload data (0x8000)\r\n    │\r\n    │      *** Content 1 data ***\r\n    │\r\n    ├── (data)    \u003c--- image's content\r\n    │\r\n    │      *** Content 1 data ***\r\n    │\r\n    ├── (data)\r\n    │\r\n    │      *** Content N data ***\r\n    │\r\n    ├── ...\r\n    └── ...\r\n```\r\n\r\nCompression format was changed from RLE24 to GZIP (magic number `1F 8B 08 00`). Device is confirmed to be able to load content at the maximum compression level.\r\n\r\nHave fun :)\r\n\r\n## TO-DOs\r\n- Magic Splash!! Wand\r\n\t- [ ] Add supports for Raw package method\r\n\t- [x] ~~Add supports for AVIF, GD2, GD, TGA, WBMP, WEBP, XBM, XPM, etc. image formats~~\r\n- Magic Splash Logo! Wand\r\n\t- [x] ~~Add supports for AVIF, GD2, GD, GIF, JPEG, PNG, TGA, WBMP, WEBP, XBM, XPM, etc. image formats~~\r\n\r\n## Changelog\r\n- Magic Splash!! Wand\r\n\t- v1.2:\r\n\t\t- Add supports for AVIF, GD2, GD, TGA, WBMP, WEBP, XBM, XPM, etc. image formats.\r\n\t\t- Optimized code logic.\r\n\t\t- Upgraded PHP requirement to 8.1.0.\r\n\t- v1.1:\r\n\t\t- Implemented repack feature.\r\n\t- v1.0:\r\n\t\t- Support splash screen format Qualcomm devices\r\n- Magic Splash Logo! Wand\r\n\t- v1.2:\r\n\t\t- Optimized log output.\r\n\t- v1.1:\r\n\t\t- Add supports for AVIF, GD2, GD, GIF, JPEG, PNG, TGA, WBMP, WEBP, XBM, XPM, etc. image formats.\r\n\t- v1.0:\r\n\t\t- Support splash screen format for OPlus (OPPO/OnePlus/Realme) Qualcomm devices\r\n\r\n## License\r\nNo license, you are only allowed to use this project. All rights are reserved by [MeowCat Studio](https://github.com/MeowCat-Studio), [Meow Mobile](https://github.com/Meow-Mobile) and [NekoYuzu (MlgmXyysd)](https://github.com/MlgmXyysd).\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmlgmxyysd%2Fmagic-splash-wand","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmlgmxyysd%2Fmagic-splash-wand","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmlgmxyysd%2Fmagic-splash-wand/lists"}