-
Notifications
You must be signed in to change notification settings - Fork 23
/
service.sh
32 lines (19 loc) · 900 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
#!/system/bin/sh
# Do NOT assume where your module will be located.
# ALWAYS use $MODDIR if you need to know where this script and module is placed.
# This will make sure your module will still work if Magisk change its mount point in the future
MODDIR=${0%/*}
# This script will be executed in late_start service mode. More info in the main Magisk thread
# Detach Apps from Market by hinxnz
#Modify the necessary varible MODDIR with magisk provided varible eg. /data/adb/modules/Detach
#sed -i -e "s/^MODDIR.*$/MODDIR=${MODDIR}/" "$MODDIR/Detach"
MAGMOD=$MODDIR
#Let boot status
# Wait till boot has completed'
(while [ "$(getprop sys.boot_completed | tr -d '\r')" != "1" ]; do sleep 20; done
if [ `getprop sys.boot_completed` = 1 ]; then
#Reserved for crond schedule
#prevent recursive run
su -c sh "$MAGMOD/main.sh" > "$MAGMOD/first_detach_result.txt" 2>&1
fi
)