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 Nov 28, 2023
1 parent 00df139 commit 74756c4
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 17 deletions.
12 changes: 5 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## Overview
- Patches Google Play Services, Google Play, Galaxy Store - apps and certain processes/services to be able to use battery optimization
- Support API 23 or later
- Support Magisk and KernelSU

## Troubleshootings
- Command-line for check optimization (in general):
Expand All @@ -15,7 +16,7 @@ There's a line written `Whitelist (except idle) system apps:`
> dumpsys deviceidle
```
- Command-line for fix delayed incoming messages issue:
If delayed incoming messages issue still persist, move Google Play Services app to Not Optimized battery usage.
If the issue still persist, move the app to Not Optimized battery usage.
```
> su
> cd /data/data
Expand All @@ -28,9 +29,6 @@ If delayed incoming messages issue still persist, move Google Play Services app
```

## Credits
- [@topjohnwu](https://github.com/topjohnwu)
Magisk - Magisk Module Template
- [@MrCarb0n](https://github.com/MrCarb0n)
Script / syntax helper
- [@gloeyisk](https://github.com/gloeyisk)
Universal Gms Doze
- topjohnwu / Magisk - Magisk Module Template
- gloeyisk / Universal Gms Doze
- JumbomanXDA, MrCarb0n / Script fixer and helper
22 changes: 19 additions & 3 deletions customize.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,22 @@ set -x
# GMS-GP-GS Doze
# Patches Google Play Services, Google Play, Galaxy Store - apps and certain processes/services to be able to use battery optimization

# Check root environment
VER=`grep_prop version $MODPATH/module.prop`
VERCODE=`grep_prop versionCode $MODPATH/module.prop`
ui_print " ID: $MODID"
ui_print " Version: $VER"
ui_print " VersionCode: $VERCODE"
if [ "$KSU" == true ]; then
ui_print " KSUVersion: $KSU_VER"
ui_print " KSUVersionCode: $KSU_VER_CODE"
ui_print " KSUKernelVersionCode: $KSU_KERNEL_VER_CODE"
else
ui_print " MagiskVersion: $MAGISK_VER"
ui_print " MagiskVersionCode: $MAGISK_VER_CODE"
fi
ui_print " "

# Check Android API
[ $API -ge 23 ] ||
abort "- Unsupported API version: $API"
Expand All @@ -27,7 +43,7 @@ PRM6="allow-in-power-save-except-idle package=$APP4"
PRM7="allow-in-power-save package=$APP5"
NULL="/dev/null"
}
ui_print "- Finding system XML"
ui_print "- Searching default XML files"
SYS_XML="$(
SXML="$(find /system_ext/* /system/* /product/* \
/vendor/* -type f -iname '*.xml' -print)"
Expand All @@ -49,7 +65,7 @@ done
# Merge patched files under /system dir
for P in product vendor; do
if [ -d $MODPATH/$P ]; then
ui_print "- Moving files to module dir"
ui_print "- Moving files to module directory"
mkdir -p $MODPATH/system/$P
mv -f $MODPATH/$P $MODPATH/system/
fi
Expand All @@ -68,7 +84,7 @@ done
)"

PATCH_MX() {
ui_print "- Finding conflicting XML"
ui_print "- Searching conflicting XML"
for MX in $MOD_XML; do
MOD="$(echo "$MX" | awk -F'/' '{print $5}')"
ui_print " $MOD: $MX"
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.1",
"versionCode": 11,
"zipUrl": "https://github.com/pumPCin/gms-gp-gs-doze/releases/download/1.1/gms-gp-gs-doze_1.1.zip"
"version": "1.2",
"versionCode": 12,
"zipUrl": "https://github.com/pumPCin/gms-gp-gs-doze/releases/download/1.2/gms-gp-gs-doze_1.2.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.1
versionCode=11
version=1.2
versionCode=12
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
2 changes: 1 addition & 1 deletion service.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ NULL="/dev/null"

# Disable collective device administrators
for U in $(ls /data/user); do
for C in $GMS1 $GMS2; do
for C in $GMS1 $GMS2 $GMS3; do
pm disable --user $U "$APP1/$APP1.$C" &> $NULL
done
done
Expand Down
2 changes: 1 addition & 1 deletion uninstall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ NULL="/dev/null"

# Enable collective device administrators
for U in $(ls /data/user); do
for C in $GMS1 $GMS2; do
for C in $GMS1 $GMS2 $GMS3; do
pm enable --user $U "$APP1/$APP1.$C" &> $NULL
done
done
Expand Down

0 comments on commit 74756c4

Please sign in to comment.