diff options
author | osm0sis <osm0sis@outlook.com> | 2018-01-19 01:58:49 -0400 |
---|---|---|
committer | osm0sis <osm0sis@outlook.com> | 2018-01-19 01:58:49 -0400 |
commit | 83df1e3df15409521f6e44776687dba2bbfe8f92 (patch) | |
tree | 8fc9375640be2bf13edd1abd144a60af7e746dbf /META-INF/com | |
parent | 4308266480275d5a4ec02578b08dde3cf14b95c9 (diff) |
Backend: only replace getprop if needed (and do so more robustly)
Diffstat (limited to 'META-INF/com')
-rwxr-xr-x | META-INF/com/google/android/update-binary | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/META-INF/com/google/android/update-binary b/META-INF/com/google/android/update-binary index d2c53a7..765d5e1 100755 --- a/META-INF/com/google/android/update-binary +++ b/META-INF/com/google/android/update-binary @@ -14,7 +14,13 @@ ui_print() { } show_progress() { echo "progress $1 $2" > $OUTFD; } file_getprop() { grep "^$2=" "$1" | cut -d= -f2; } -getprop() { test -e /sbin/getprop && /sbin/getprop $1 || file_getprop /default.prop $1; } +if [ ! "$(getprop 2>/dev/null)" ]; then + getprop() { + local propval="$(file_getprop /default.prop $1 2>/dev/null)"; + test "$propval" || local propval="$(file_getprop /system/build.prop $1 2>/dev/null)"; + test "$propval" && echo "$propval" || echo ""; + } +fi; cleanup() { rm -rf /tmp/anykernel; } debugging() { case $(basename "$ZIPFILE" .zip) in |