This repository has been archived by the owner on Oct 27, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
/
install.sh
193 lines (175 loc) · 8.27 KB
/
install.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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
SKIPMOUNT=false
PROPFILE=false
POSTFSDATA=false
LATESTARTSERVICE=false
REPLACE="
"
print_modname() {
ui_print ""
ui_print "••••••••••••••••••••••••••"
ui_print " Extra Themed Icons"
ui_print "••••••••••••••••••••••••••"
ui_print ""
ui_print "• Module by Syoker"
ui_print "• TeamFiles Icons by TeamFiles"
ui_print "• Lawnicons by Lawnchair Team"
ui_print ""
sleep 2
}
android_check() {
if (( $API < 31 )); then
ui_print "• Sorry, you need Android 12 or later to use this module."
ui_print ""
sleep 2
exit 1
fi
}
volume_keytest() {
ui_print "• Volume Key Test"
ui_print " Please press any key volume:"
(timeout 5 /system/bin/getevent -lc 1 2>&1 | /system/bin/grep VOLUME | /system/bin/grep " DOWN" > "$TMPDIR"/events) || return 1
return 0
}
volume_key() {
while (true); do
/system/bin/getevent -lc 1 2>&1 | /system/bin/grep VOLUME | /system/bin/grep " DOWN" > "$TMPDIR"/events
if $(cat "$TMPDIR"/events 2>/dev/null | /system/bin/grep VOLUME >/dev/null); then
break
fi
done
if $(cat "$TMPDIR"/events 2>/dev/null | /system/bin/grep VOLUMEUP >/dev/null); then
return 1
else
return 0
fi
}
install_lawnicons() {
if [ -f "/system/product/overlay/ThemedIconsOverlay.apk" ]; then
if [ -f "/system/product/overlay/ThemedIconsPixelOverlay.apk" ]; then
if [ -f "/system/product/overlay/PixelLauncherIconsOverlay/PixelLauncherIconsOverlay.apk" ]; then
mkdir -p $MODPATH/system/product/overlay
cp -f $MODPATH/system/product/overlay/lawnicons.apk $MODPATH/system/product/overlay/ThemedIconsOverlay.apk
cp -f $MODPATH/system/product/overlay/lawnicons.apk $MODPATH/system/product/overlay/ThemedIconsPixelOverlay.apk
mkdir -p $MODPATH/system/product/overlay/PixelLauncherIconsOverlay
cp -f $MODPATH/system/product/overlay/lawnicons.apk $MODPATH/system/product/overlay/PixelLauncherIconsOverlay/PixelLauncherIconsOverlay.apk
else
mkdir -p $MODPATH/system/product/overlay
cp -f $MODPATH/system/product/overlay/lawnicons.apk $MODPATH/system/product/overlay/ThemedIconsOverlay.apk
cp -f $MODPATH/system/product/overlay/lawnicons.apk $MODPATH/system/product/overlay/ThemedIconsPixelOverlay.apk
fi
else
if [ -f "/system/product/overlay/PixelLauncherIconsOverlay/PixelLauncherIconsOverlay.apk" ]; then
mkdir -p $MODPATH/system/product/overlay
cp -f $MODPATH/system/product/overlay/lawnicons.apk $MODPATH/system/product/overlay/ThemedIconsOverlay.apk
mkdir -p $MODPATH/system/product/overlay/PixelLauncherIconsOverlay
cp -f $MODPATH/system/product/overlay/lawnicons.apk $MODPATH/system/product/overlay/PixelLauncherIconsOverlay/PixelLauncherIconsOverlay.apk
else
mkdir -p $MODPATH/system/product/overlay
cp -f $MODPATH/system/product/overlay/lawnicons.apk $MODPATH/system/product/overlay/ThemedIconsOverlay.apk
fi
fi
else
if [ -f "/system/product/overlay/ThemedIconsPixelOverlay.apk" ]; then
if [ -f "/system/product/overlay/PixelLauncherIconsOverlay/PixelLauncherIconsOverlay.apk" ]; then
mkdir -p $MODPATH/system/product/overlay
cp -f $MODPATH/system/product/overlay/lawnicons.apk $MODPATH/system/product/overlay/ThemedIconsPixelOverlay.apk
mkdir -p $MODPATH/system/product/overlay/PixelLauncherIconsOverlay
cp -f $MODPATH/system/product/overlay/lawnicons.apk $MODPATH/system/product/overlay/PixelLauncherIconsOverlay/PixelLauncherIconsOverlay.apk
else
mkdir -p $MODPATH/system/product/overlay
cp -f $MODPATH/system/product/overlay/lawnicons.apk $MODPATH/system/product/overlay/ThemedIconsPixelOverlay.apk
fi
else
if [ -f "/system/product/overlay/PixelLauncherIconsOverlay/PixelLauncherIconsOverlay.apk" ]; then
mkdir -p $MODPATH/system/product/overlay/PixelLauncherIconsOverlay
cp -f $MODPATH/system/product/overlay/lawnicons.apk $MODPATH/system/product/overlay/PixelLauncherIconsOverlay/PixelLauncherIconsOverlay.apk
else
mkdir -p $MODPATH/system/product/overlay
cp -f $MODPATH/system/product/overlay/lawnicons.apk $MODPATH/system/product/overlay/ThemedIconsOverlay.apk
fi
fi
fi
}
install_teamfiles_icons() {
if [ -f "/system/product/overlay/ThemedIconsOverlay.apk" ]; then
if [ -f "/system/product/overlay/ThemedIconsPixelOverlay.apk" ]; then
if [ -f "/system/product/overlay/PixelLauncherIconsOverlay/PixelLauncherIconsOverlay.apk" ]; then
mkdir -p $MODPATH/system/product/overlay
cp -f $MODPATH/system/product/overlay/teamfilesicons.apk $MODPATH/system/product/overlay/ThemedIconsOverlay.apk
cp -f $MODPATH/system/product/overlay/teamfilesicons.apk $MODPATH/system/product/overlay/ThemedIconsPixelOverlay.apk
mkdir -p $MODPATH/system/product/overlay/PixelLauncherIconsOverlay
cp -f $MODPATH/system/product/overlay/teamfilesicons.apk $MODPATH/system/product/overlay/PixelLauncherIconsOverlay/PixelLauncherIconsOverlay.apk
else
mkdir -p $MODPATH/system/product/overlay
cp -f $MODPATH/system/product/overlay/teamfilesicons.apk $MODPATH/system/product/overlay/ThemedIconsOverlay.apk
cp -f $MODPATH/system/product/overlay/teamfilesicons.apk $MODPATH/system/product/overlay/ThemedIconsPixelOverlay.apk
fi
else
if [ -f "/system/product/overlay/PixelLauncherIconsOverlay/PixelLauncherIconsOverlay.apk" ]; then
mkdir -p $MODPATH/system/product/overlay
cp -f $MODPATH/system/product/overlay/teamfilesicons.apk $MODPATH/system/product/overlay/ThemedIconsOverlay.apk
mkdir -p $MODPATH/system/product/overlay/PixelLauncherIconsOverlay
cp -f $MODPATH/system/product/overlay/teamfilesicons.apk $MODPATH/system/product/overlay/PixelLauncherIconsOverlay/PixelLauncherIconsOverlay.apk
else
mkdir -p $MODPATH/system/product/overlay
cp -f $MODPATH/system/product/overlay/teamfilesicons.apk $MODPATH/system/product/overlay/ThemedIconsOverlay.apk
fi
fi
else
if [ -f "/system/product/overlay/ThemedIconsPixelOverlay.apk" ]; then
if [ -f "/system/product/overlay/PixelLauncherIconsOverlay/PixelLauncherIconsOverlay.apk" ]; then
mkdir -p $MODPATH/system/product/overlay
cp -f $MODPATH/system/product/overlay/teamfilesicons.apk $MODPATH/system/product/overlay/ThemedIconsPixelOverlay.apk
mkdir -p $MODPATH/system/product/overlay/PixelLauncherIconsOverlay
cp -f $MODPATH/system/product/overlay/teamfilesicons.apk $MODPATH/system/product/overlay/PixelLauncherIconsOverlay/PixelLauncherIconsOverlay.apk
else
mkdir -p $MODPATH/system/product/overlay
cp -f $MODPATH/system/product/overlay/teamfilesicons.apk $MODPATH/system/product/overlay/ThemedIconsPixelOverlay.apk
fi
else
if [ -f "/system/product/overlay/PixelLauncherIconsOverlay/PixelLauncherIconsOverlay.apk" ]; then
mkdir -p $MODPATH/system/product/overlay/PixelLauncherIconsOverlay
cp -f $MODPATH/system/product/overlay/teamfilesicons.apk $MODPATH/system/product/overlay/PixelLauncherIconsOverlay/PixelLauncherIconsOverlay.apk
else
mkdir -p $MODPATH/system/product/overlay
cp -f $MODPATH/system/product/overlay/teamfilesicons.apk $MODPATH/system/product/overlay/ThemedIconsOverlay.apk
fi
fi
fi
}
on_install() {
android_check
unzip -o "$ZIPFILE" 'system/*' -d $MODPATH >&2
if volume_keytest; then
ui_print " Key test function complete"
ui_print ""
sleep 2
ui_print "• Do you want to install?"
ui_print " Volume up(+): TeamFiles Icons"
ui_print " Volume down(-): Lawnicons"
SELECT=volume_key
if "$SELECT"; then
ui_print " Install Lawnicons"
ui_print ""
install_lawnicons
sleep 2
else
ui_print " Install TeamFiles Icons"
ui_print ""
install_teamfiles_icons
sleep 2
fi
else
ui_print " You have not pressed any key, aborting installation."
ui_print ""
sleep 2
exit 1
fi
ui_print "- Deleting package cache"
rm $MODPATH/system/product/overlay/lawnicons.apk
rm $MODPATH/system/product/overlay/teamfilesicons.apk
rm -rf /data/system/package_cache/*
}
set_permissions() {
set_perm_recursive $MODPATH 0 0 0755 0644
}