-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathservice.sh
34 lines (26 loc) · 1.31 KB
/
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
#!/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
# no longer assume "$MAGISKTMP=/sbin/.magisk" if Android 11 or later
#
# This script will be executed in service mode
#
MODDIR=${0%/*}
# MAGISKPATH=$(magisk --path)
# MAGISKTMP=$MAGISKPATH/.magisk
. "$MODDIR/service-functions.sh"
. "$MODDIR/service-optimizer.sh"
#
# 1. Enable thermal control, Camera service (interfering in jitters on audio outputs), Selinux enforcing, Doze (battery optimizations)
# and Logd service or not, respectively ("yes" or "no").
# 2. Disable clearest tone ("yes" or "no"), perhaps for sensitive Bluetooth earphones.
EnableThermalControl="no"
EnableCameraService="no"
EnableSelinuxEnforcing="no"
EnableDoze="no"
EnableLogdService="no"
DisableClearestTone="no"
# sleep more than 30 secs (waitAudioServer) needed for "settings" commands
# to become effective and another kernel tunables setting process completion in an orphan process
(((waitAudioServer; remountFile "$MODDIR"; optimizeOS $EnableThermalControl $EnableCameraService $EnableSelinuxEnforcing \
$EnableDoze $EnableLogdService $DisableClearestTone) 0<&- &>"/dev/null" &) &)