forked from gloeyisk/universal-gms-doze
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgmsc
31 lines (26 loc) · 696 Bytes
/
gmsc
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
#!/system/bin/sh
#
# Universal GMS Doze by the
# open source loving GL-DP and all contributors;
# Patches Google Play services app and its background
# processes to be able using battery optimization
#
ID="$(id -u)"
NULL="/dev/null"
GMS="com.google.android.gms"
{ R="\e[1;31m" G="\e[1;32m" Y="\e[1;33m" N="\e[0m"; } 2> $NULL
CHK_OPT() {
local OPT="$(dumpsys deviceidle whitelist |
awk -F',' "/$GMS/{print $2;exit}")"
[ -z $OPT ] && echo -e "$G $1 Optimized. $N" ||
echo -e "$R $1 Not Optimized. $N"
}
case $ID in
0)
CHK_OPT "Google Play services is"
;;
*)
echo -e "$Y Superuser (su) rights is needed! $N"
exit 1
;;
esac