This repository was archived by the owner on Feb 13, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcustomize.sh
More file actions
50 lines (44 loc) · 1.83 KB
/
customize.sh
File metadata and controls
50 lines (44 loc) · 1.83 KB
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
#!/bin/sh
timeout=10 #change value to change timeout
ui_print "╔════════════════════════════════════════╗"
ui_print "║ Yet Another Bootloop Protector ║"
ui_print "╚════════════════════════════════════════╝"
ui_print ""
ui_print " 🔧 Choose SystemUI Monitor Mode"
ui_print "-----------------------------------------"
ui_print " 🔼 Press VOLUME UP => ENABLE"
ui_print " 🔽 Press VOLUME DOWN => DISABLE"
ui_print "-----------------------------------------"
ui_print " Waiting for your choice ( ${timeout}s timeout )..."
ui_print ""
#ref "https://github.com/Magisk-Modules-Alt-Repo/YetAnotherBootloopProtector/issues/2#issue-3012688788"
while true; do
event=$(timeout ${timeout} getevent -qlc 1 2>/dev/null)
exitcode=$?
if [ "$exitcode" -eq 124 ] || [ "$exitcode" -eq 143 ]; then
# Magisk BusyBox `timeout` returned 143 (SIGTERM), Android toybox ( /system/bin/timeout ) returned 124.
ui_print "- No key pressed. Defaulting to DISABLED."
touch /data/adb/systemui.monitor.disable
break
fi
if echo "$event" | grep -q "KEY_VOLUMEUP"; then
ui_print "✅ SystemUI Monitor enabled."
rm -f /data/adb/systemui.monitor.disable 2>/dev/null
break
elif echo "$event" | grep -q "KEY_VOLUMEDOWN"; then
ui_print "❌ SystemUI Monitor disabled."
touch /data/adb/systemui.monitor.disable
break
fi
done
ui_print ""
mkdir -p "/data/adb/service.d"
mv "$MODPATH/.status.sh" "/data/adb/service.d"
chmod +x "/data/adb/service.d/.status.sh"
yabp=/data/adb/YABP
mkdir -p "$yabp"
cp -n "$MODPATH/allowed-modules.txt" "$yabp/"
cp -n "$MODPATH/allowed-scripts.txt" "$yabp/"
set_perm_recursive "$MODPATH" 0 0 0755 0644
ui_print ""
ui_print "[*] Installation complete!"