Support prop hacking on older Android

This commit is contained in:
osm0sis
2024-01-08 16:43:38 -04:00
parent 5aea2e877f
commit 93ac718229

View File

@@ -12,7 +12,11 @@ resetprop_hexpatch() {
[ "$NEWVALUE" = "$CURVALUE" -a ! "$FORCE" ] && return 1
local NEWLEN=${#NEWVALUE}
local PROPFILE="/dev/__properties__/$(resetprop -Z "$NAME")"
if [ -f /dev/__properties__ ]; then
local PROPFILE=/dev/__properties__
else
local PROPFILE="/dev/__properties__/$(resetprop -Z "$NAME")"
fi
local NAMEOFFSET=$(echo $(strings -t d "$PROPFILE" | grep "$NAME") | cut -d ' ' -f 1)
#<hex 2-byte change counter><flags byte><hex length of prop value><prop value + nul padding to 92 bytes><prop name>