-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCREATE_LOGO.sh
139 lines (119 loc) · 3.95 KB
/
CREATE_LOGO.sh
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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
# Created By neo_subhamoy (Contact me @ https://neosubhamoy.com)
# Created By Gokul NC (Contact me @ https://about.me/GokulNC )
# Created By Pzqqt (Contact me @ https://t.me/Pzqqt )
# WARNING: DO NOT MODIFY THIS SCRIPT UNLESS YOU KNOW WHAT YOU'RE DOING!
# This is for POCO X3 Pro (vayu) device 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
#!/bin/bash
echo ""
echo "#--------------------------------------------------#"
echo "# POCO X3 Pro (vayu) Logo Image Maker #"
echo "# #"
echo "# By ** neo_subhamoy ^& Gokul NC ^& Pzqqt ** #"
echo "#--------------------------------------------------#"
echo ""
echo ""
echo "Creating logo.img ........"
echo ""
echo ""
echo ""
output_file="logo.img"
output_file_path="output/${output_file}"
output_zip="flashable_logo.zip"
output_zip_path="output/${output_zip}"
resolution="1080x2400"
# CREATE FOLDERS AND DELETE OLD FILES
mkdir -p output
mkdir -p temp
rm -f temp/*
rm -f "$output_file_path"
rm -f "$output_zip_path"
# VERIFY FILES
logo_path="not_found"
for ext in jpg jpeg png gif bmp; do
if [ -e "pics/logo.${ext}" ]; then
logo_path="pics/logo.${ext}"
break
fi
done
fastboot_path="not_found"
for ext in jpg jpeg png gif bmp; do
if [ -e "pics/fastboot.${ext}" ]; then
fastboot_path="pics/fastboot.${ext}"
break
fi
done
system_corrupt_path="not_found"
for ext in jpg jpeg png gif bmp; do
if [ -e "pics/system_corrupt.${ext}" ]; then
system_corrupt_path="pics/system_corrupt.${ext}"
break
fi
done
if [ "$logo_path" == "not_found" ]; then
echo "Logo picture not found in 'pics' folder.. EXITING"
echo ""
echo ""
read -p "Press Enter to exit..."
exit
fi
if [ "$fastboot_path" == "not_found" ]; then
echo "Fastboot picture not found in 'pics' folder.. EXITING"
echo ""
echo ""
read -p "Press Enter to exit..."
exit
fi
if [ "$system_corrupt_path" == "not_found" ]; then
echo "System corrupt picture not found in 'pics' folder.. EXITING"
echo ""
echo ""
read -p "Press Enter to exit..."
exit
fi
# Create BMP
ffmpeg -hide_banner -loglevel quiet -i "$logo_path" -pix_fmt rgb24 -s "$resolution" -y "temp/logo_1.bmp" > /dev/null
ffmpeg -hide_banner -loglevel quiet -i "$fastboot_path" -pix_fmt rgb24 -s "$resolution" -y "temp/logo_2.bmp" > /dev/null
ffmpeg -hide_banner -loglevel quiet -i "$logo_path" -pix_fmt rgb24 -s "$resolution" -y "temp/logo_3.bmp" > /dev/null
ffmpeg -hide_banner -loglevel quiet -i "$system_corrupt_path" -pix_fmt rgb24 -s "$resolution" -y "temp/logo_4.bmp" > /dev/null
# Create the full logo.img by concatenating header and all BMP files
cat "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"
if [ -e "$output_file_path" ]; then
echo "SUCCESS!"
echo "$output_file created in 'output' folder"
else
echo "PROCESS FAILED.. Try Again"
echo ""
echo ""
read -p "Press Enter to exit..."
exit
fi
read -p "Do you want to create a flashable zip? [yes/no] " INPUT
if [ "$INPUT" == "y" ] || [ "$INPUT" == "yes" ]; then
create_zip=true
else
echo ""
echo "Flashable ZIP not created.."
echo ""
echo ""
read -p "Press Enter to exit..."
exit
fi
if [ "$create_zip" == true ]; then
cp "bin/New_Logo.zip" "$output_zip_path" > /dev/null
cd output || exit
7za a "$output_zip" "$output_file" > /dev/null
cd ..
if [ -e "$output_zip_path" ]; then
echo ""
echo "SUCCESS!"
echo "Flashable zip file created in 'output' folder"
echo "You can flash the '$output_zip' from any custom recovery like TWRP/OrangeFox"
else
echo ""
echo "Flashable ZIP not created.."
fi
fi
echo ""
echo ""
read -p "Press Enter to exit..."