3 Commits

Author SHA1 Message Date
Chris Renshaw
1afd4278be Avoid potential issues from greedy matching 2025-06-28 01:19:15 -03:00
Chris Renshaw
77d5ccdc99 Cosmetic changes to match other cut usage 2025-06-28 01:06:52 -03:00
Chris Renshaw
a2f726b633 Improve overlay AndroidManifest.xml parsing, support PixelOS 15 2025-06-28 00:52:06 -03:00
2 changed files with 2 additions and 2 deletions

View File

@@ -47,7 +47,7 @@ resetprop_hexpatch() {
local PROPFILE="/dev/__properties__/$(resetprop -Z "$NAME")"
fi
[ ! -f "$PROPFILE" ] && return 3
local NAMEOFFSET=$(echo $(strings -t d "$PROPFILE" | grep "$NAME") | cut -d ' ' -f 1)
local NAMEOFFSET=$(echo $(strings -t d "$PROPFILE" | grep "$NAME") | cut -d\ -f1)
#<hex 2-byte change counter><flags byte><hex length of prop value><prop value + nul padding to 92 bytes><prop name>
local NEWHEX="$(printf '%02x' "$NEWLEN")$(printf "$NEWVALUE" | od -A n -t x1 -v | tr -d ' \n')$(printf "%$((92-NEWLEN))s" | sed 's/ /00/g')"

View File

@@ -39,7 +39,7 @@ for APP in $(grep -v '^#' $LIST); do
APK=$(readlink -f $APP);
fi
if [ -s "$APK" ]; then
PKGNAME=$(unzip -p $APK AndroidManifest.xml | tr -d '\0' | grep -oE 'android.*http' | sed -e 's/android//' -e 's/.application//' -e 's/*http//' | cut -c2-)
PKGNAME=$(unzip -p $APK AndroidManifest.xml | tr -d '\0' | grep -oE 'android.*overlay' | strings | tr -d '\n' | sed -e 's/^android//' -e 's/application//' -e 's;*http.*res/android;;' -e 's/manifest//' -e 's/overlay$//' | grep -oE '[[:alnum:].-_].*overlay' | cut -d\ -f2)
if [ "$PKGNAME" ] && grep -q "overlay package=\"$PKGNAME" $CFG; then
HIDECFG=$MODPATH$PREFIX$CFG
if [ ! -f "$HIDECFG" ]; then