-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.status.sh
34 lines (31 loc) · 1.43 KB
/
.status.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
MODULE_DIR="/data/adb/modules/YetAnotherBootloopProtector"
SYSTEMUI_MONITOR_DISABLE="/data/adb/systemui.monitor.disable"
MODULE_PROP="$MODULE_DIR/module.prop"
REQUIRED_FILES="\
$MODULE_DIR/action.sh \
$MODULE_DIR/service.sh \
$MODULE_DIR/post-fs-data.sh \
$MODULE_DIR/uninstall.sh"
# Check if required module files exist, disable module if missing
for file in $REQUIRED_FILES; do
if [ ! -f "$file" ]; then
grep -v "^description=" "$MODULE_PROP" > "$MODULE_PROP.tmp"
echo "description= ⚠️ Warning : Module is corrupted. Please reinstall." >> "$MODULE_PROP.tmp"
mv "$MODULE_PROP.tmp" "$MODULE_PROP"
touch "$MODULE_DIR/disable"
exit 0
fi
done
if [ -f "$MODULE_DIR/disable" ]; then
grep -v "^description=" "$MODULE_PROP" > "$MODULE_PROP.tmp"
echo "description= SystemUI Monitor ❌ | Bootloop Monitor ❌ | ⚠️ Module is Disabled " >> "$MODULE_PROP.tmp"
mv "$MODULE_PROP.tmp" "$MODULE_PROP"
elif [ -f "$SYSTEMUI_MONITOR_DISABLE" ]; then
grep -v "^description=" "$MODULE_PROP" > "$MODULE_PROP.tmp"
echo "description= SystemUI Monitor ❌ | Bootloop Monitor ✅ | Module is Working ✨" >> "$MODULE_PROP.tmp"
mv "$MODULE_PROP.tmp" "$MODULE_PROP"
else
grep -v "^description=" "$MODULE_PROP" > "$MODULE_PROP.tmp"
echo "description= SystemUI Monitor ✅ | Bootloop Monitor ✅ | Module is Working ✨" >> "$MODULE_PROP.tmp"
mv "$MODULE_PROP.tmp" "$MODULE_PROP"
fi