Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
pumPCin authored Oct 30, 2023
1 parent 0ca8ff6 commit 00df139
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 11 deletions.
13 changes: 9 additions & 4 deletions customize.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,23 @@ ui_print "- Patching XML files"
APP1="\"com.google.android.gms"\"
APP2="\"com.android.vending"\"
APP3="\"com.sec.android.app.samsungapps"\"
APP4="\"com.samsung.android.app.updatecenter"\"
APP5="\"com.samsung.android.video"\"
PRM1="allow-in-power-save package=$APP1"
PRM2="allow-in-data-usage-save package=$APP1"
PRM3="allow-in-power-save-except-idle package=$APP2"
PRM4="allow-in-power-save package=$APP3"
PRM5="allow-in-power-save package=$APP4"
PRM6="allow-in-power-save-except-idle package=$APP4"
PRM7="allow-in-power-save package=$APP5"
NULL="/dev/null"
}
ui_print "- Finding system XML"
SYS_XML="$(
SXML="$(find /system_ext/* /system/* /product/* \
/vendor/* -type f -iname '*.xml' -print)"
for S in $SXML; do
if grep -qE "$PRM1|$PRM2|$PRM3|$PRM4" $ROOT$S 2> $NULL; then
if grep -qE "$PRM1|$PRM2|$PRM3|$PRM4|$PRM5|$PRM6|$PRM7" $ROOT$S 2> $NULL; then
echo "$S"
fi
done
Expand All @@ -38,7 +43,7 @@ for SX in $SYS_XML; do
mkdir -p "$(dirname $MODPATH$SX)"
cp -af $ROOT$SX $MODPATH$SX
ui_print " Patching: $SX"
sed -i "/$PRM1/d;/$PRM2/d;/$PRM3/d;/$PRM4/d" $MODPATH/$SX
sed -i "/$PRM1/d;/$PRM2/d;/$PRM3/d;/$PRM4/d;/$PRM5/d;/$PRM6/d;/$PRM7/d" $MODPATH/$SX
done

# Merge patched files under /system dir
Expand All @@ -56,7 +61,7 @@ done
MOD_XML="$(
MXML="$(find /data/adb/* -type f -iname "*.xml" -print)"
for M in $MXML; do
if grep -qE "$PRM1|$PRM2|$PRM3|$PRM4" $M; then
if grep -qE "$PRM1|$PRM2|$PRM3|$PRM4|$PRM5|$PRM6|$PRM7" $M; then
echo "$M"
fi
done
Expand All @@ -67,7 +72,7 @@ PATCH_MX() {
for MX in $MOD_XML; do
MOD="$(echo "$MX" | awk -F'/' '{print $5}')"
ui_print " $MOD: $MX"
sed -i "/$PRM1/d;/$PRM2/d;/$PRM3/d;/$PRM4/d" $MX
sed -i "/$PRM1/d;/$PRM2/d;/$PRM3/d;/$PRM4/d;/$PRM5/d;/$PRM6/d;/$PRM7/d" $MX
done
}

Expand Down
6 changes: 3 additions & 3 deletions module.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "1.0",
"versionCode": 10,
"zipUrl": "https://github.com/pumPCin/gms-gp-gs-doze/releases/download/1.0/gms-gp-gs-doze_1.0.zip"
"version": "1.1",
"versionCode": 11,
"zipUrl": "https://github.com/pumPCin/gms-gp-gs-doze/releases/download/1.1/gms-gp-gs-doze_1.1.zip"
}
4 changes: 2 additions & 2 deletions module.prop
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
id=gms-gp-gs-doze
name=GMS-GP-GS Doze
version=1.0
versionCode=10
version=1.1
versionCode=11
author=pumPCin
description=Patches Google Play Services, Google Play, Galaxy Store - apps and certain processes/services to be able to use battery optimization
updateJson=https://raw.githubusercontent.com/pumPCin/gms-gp-gs-doze/master/module.json
9 changes: 7 additions & 2 deletions post-fs-data.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,26 @@ set -o standalone
APP1="\"com.google.android.gms"\"
APP2="\"com.android.vending"\"
APP3="\"com.sec.android.app.samsungapps"\"
APP4="\"com.samsung.android.app.updatecenter"\"
APP5="\"com.samsung.android.video"\"
PRM1="allow-unthrottled-location package=$APP1"
PRM2="allow-ignore-location-settings package=$APP1"
PRM3="allow-in-power-save package=$APP1"
PRM4="allow-in-data-usage-save package=$APP1"
PRM5="allow-in-power-save-except-idle package=$APP2"
PRM6="allow-in-power-save package=$APP3"
PRM7="allow-in-power-save package=$APP4"
PRM8="allow-in-power-save-except-idle package=$APP4"
PRM9="allow-in-power-save package=$APP5"
NULL="/dev/null"
}

{
find /data/adb/* -type f -iname "*.xml" -print |
while IFS= read -r XML; do
for X in $XML; do
if grep -qE "$PRM1|$PRM2|$PRM3|$PRM4|$PRM5|$PRM6" $X 2> $NULL; then
sed -i "/$PRM1/d;/$PRM2/d;/$PRM3/d;/$PRM4/d;/$PRM5/d;/$PRM6/d" $X
if grep -qE "$PRM1|$PRM2|$PRM3|$PRM4|$PRM5|$PRM6|$PRM7|$PRM8|$PRM9" $X 2> $NULL; then
sed -i "/$PRM1/d;/$PRM2/d;/$PRM3/d;/$PRM4/d;/$PRM5/d;/$PRM6/d;/$PRM7/d;/$PRM8/d;/$PRM9/d" $X
fi
done
done
Expand Down
2 changes: 2 additions & 0 deletions service.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ done
dumpsys deviceidle whitelist -com.google.android.gms &> $NULL
dumpsys deviceidle whitelist -com.android.vending &> $NULL
dumpsys deviceidle whitelist -com.sec.android.app.samsungapps &> $NULL
dumpsys deviceidle whitelist -com.samsung.android.app.updatecenter &> $NULL
dumpsys deviceidle whitelist -com.samsung.android.video &> $NULL

exit 0
)
2 changes: 2 additions & 0 deletions uninstall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ done
dumpsys deviceidle whitelist +com.google.android.gms &> $NULL
dumpsys deviceidle whitelist +com.android.vending &> $NULL
dumpsys deviceidle whitelist +com.sec.android.app.samsungapps &> $NULL
dumpsys deviceidle whitelist +com.samsung.android.app.updatecenter &> $NULL
dumpsys deviceidle whitelist +com.samsung.android.video &> $NULL

exit 0
)
Expand Down

0 comments on commit 00df139

Please sign in to comment.