-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathservice.sh
36 lines (30 loc) · 880 Bytes
/
service.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
#!/system/bin/sh
# Check the switch status and create/delete the whitelist file accordingly
MODDIR=${0%/*}
# Checking if the module switch is enabled
is_module_enable() {
if [[ -e "${MODDIR}/disable" ]] || [[ -e "${MODDIR}/remove" ]]; then
return 1 # Disabled
else
return 0 # Enabled
fi
}
# Executing the switch
whitelist_switch() {
while true; do
# Check module enable/disable status
is_module_enable
if [ $? -eq 0 ]; then
# Module is enabled, create whitelist file if it doesn't exist
touch /data/adb/shamiko/whitelist
echo "Whitelist file created."
else
# Module is disabled, delete whitelist file if it exists
rm /data/adb/shamiko/whitelist
echo "Whitelist file deleted."
fi
sleep 5 # Sleep for 5 seconds before checking again
done
}
# Start the switch monitoring
whitelist_switch