-
Notifications
You must be signed in to change notification settings - Fork 0
/
CREATE_LOGO.bat
executable file
·93 lines (75 loc) · 4.15 KB
/
CREATE_LOGO.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
:: Created By Gokul NC (Contact me @ http://about.me/GokulNC )
:: Modified By Mr Fox (Contact me @ https://t.me/m_r_fox )
:: WARNING: DO NOT MODIFY THIS SCRIPT UNLESS YOU KNOW WHAT YOU'RE DOING!
:: This is for Redmi Note 10 Pro (sweet) only, please do not try on other devices..
:: For other devices: http://forum.xda-developers.com/android/software-hacking/guide-how-to-create-custom-boot-logo-t3470473
@echo off
echo.
echo.#--------------------------------------------------#
echo.# Redmi Note 10 Pro (sweet) Splash Logo Maker #
echo.# #
echo.# By ********Mr Fox********* #
echo.#--------------------------------------------------#
echo.
echo.
echo.Creating logo.img ........
echo.
echo.
echo.
set output_file=logo.img
set output_file_path=output\%output_file%
set output_zip=flashable_logo.zip
set output_zip_path=output\%output_zip%
setlocal
if not exist "output\" mkdir "output\"
if not exist "temp\" ( mkdir "temp\"& attrib /S /D +h "temp" )
del /Q temp\* 2>NUL
del /Q %output_file_path% 2>NUL
del /Q %output_zip_path% 2>NUL
set resolution=1080x2400
:VERIFY_FILES
set logo_path="not_found"
if exist "pics\logo.jpg" set logo_path="pics\logo.jpg"
if exist "pics\logo.jpeg" set logo_path="pics\logo.jpeg"
if exist "pics\logo.png" set logo_path="pics\logo.png"
if exist "pics\logo.gif" set logo_path="pics\logo.gif"
if exist "pics\logo.bmp" set logo_path="pics\logo.bmp"
if %logo_path%=="not_found" echo.logo picture not found in 'pics' folder.. EXITING&echo.&echo.&pause&exit
set fastboot_path="not_found"
if exist "pics\fastboot.jpg" set fastboot_path="pics\fastboot.jpg"
if exist "pics\fastboot.jpeg" set fastboot_path="pics\fastboot.jpeg"
if exist "pics\fastboot.png" set fastboot_path="pics\fastboot.png"
if exist "pics\fastboot.gif" set fastboot_path="pics\fastboot.gif"
if exist "pics\fastboot.bmp" set fastboot_path="pics\fastboot.bmp"
if %fastboot_path%=="not_found" echo.fastboot picture not found in 'pics' folder.. EXITING&echo.&echo.&pause&exit
set system_corrupt_path="not_found"
if exist "pics\system_corrupt.jpg" set system_corrupt_path="pics\system_corrupt.jpg"
if exist "pics\system_corrupt.jpeg" set system_corrupt_path="pics\system_corrupt.jpeg"
if exist "pics\system_corrupt.png" set system_corrupt_path="pics\system_corrupt.png"
if exist "pics\system_corrupt.gif" set system_corrupt_path="pics\system_corrupt.gif"
if exist "pics\system_corrupt.bmp" set system_corrupt_path="pics\system_corrupt.bmp"
if %system_corrupt_path%=="not_found" echo.system_corrupt picture not found in 'pics' folder.. EXITING&echo.&echo.&pause&exit
:: Create BMP
bin\ffmpeg.exe -hide_banner -loglevel quiet -i %logo_path% -pix_fmt rgb24 -s %resolution% -y "temp\logo_1.bmp" > NUL
bin\ffmpeg.exe -hide_banner -loglevel quiet -i %fastboot_path% -pix_fmt rgb24 -s %resolution% -y "temp\logo_2.bmp" > NUL
bin\ffmpeg.exe -hide_banner -loglevel quiet -i %logo_path% -pix_fmt rgb24 -s %resolution% -y "temp\logo_3.bmp" > NUL
bin\ffmpeg.exe -hide_banner -loglevel quiet -i %system_corrupt_path% -pix_fmt rgb24 -s %resolution% -y "temp\logo_4.bmp" > NUL
:: Create the full logo.img by concatenating header and all BMP files
copy /b "bin\header.bin"+"temp\logo_1.bmp"+"bin\footer.bin"+"temp\logo_2.bmp"+"bin\footer.bin"+"temp\logo_3.bmp"+"bin\footer.bin"+"temp\logo_4.bmp"+"bin\footer.bin" %output_file_path% >NUL
if exist %output_file_path% ( echo.SUCCESS!&echo. %output_file% created in "output" folder
) else ( echo.PROCESS FAILED.. Try Again&echo.&echo.&pause&exit )
echo.&echo.&set /P INPUT=Do you want to create a flashable zip? [yes/no]
If /I "%INPUT%"=="y" goto :CREATE_ZIP
If /I "%INPUT%"=="yes" goto :CREATE_ZIP
echo.&echo.&echo Flashable ZIP not created..&echo.&echo.&pause&exit
:CREATE_ZIP
copy /Y bin\New_Logo.zip %output_zip_path% >NUL
cd output
..\bin\7za a %output_zip% %output_file% >NUL
cd..
if exist %output_zip_path% (
echo.&echo.&echo.SUCCESS!
echo.Flashable zip file created in "output" folder
echo.You can flash the '%output_zip%' from any custom recovery like TWRP
) else ( echo.&echo.&echo Flashable ZIP not created.. )
echo.&echo.&pause&exit