summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xMETA-INF/com/google/android/update-binary30
1 files changed, 19 insertions, 11 deletions
diff --git a/META-INF/com/google/android/update-binary b/META-INF/com/google/android/update-binary
index e149a28..94f1510 100755
--- a/META-INF/com/google/android/update-binary
+++ b/META-INF/com/google/android/update-binary
@@ -27,7 +27,7 @@ ui_printfile() {
show_progress() { echo "progress $1 $2" > $OUTFD; }
file_getprop() { $bb grep "^$2=" "$1" | $bb cut -d= -f2-; }
int2ver() {
- if [ "$1" -eq "$1" ] 2>/dev/null; then
+ if [ "$1" -eq "$1" ] 2>/dev/null; then
echo "$1.0.0";
elif [ ! "$(echo "$1" | $bb cut -d. -f3)" ]; then
echo "$1.0";
@@ -165,11 +165,15 @@ unset LD_PRELOAD;
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)";
+ local propdir propfile propval;
+ for propdir in / /system_root /system /vendor /odm /product; do
+ for propfile in default.prop build.prop; do
+ test "$propval" || propval="$(file_getprop $propdir/$propfile $1 2>/dev/null)";
+ done;
+ done;
test "$propval" && echo "$propval" || echo "";
}
-elif [ ! "$(getprop ro.product.device 2>/dev/null)" -a ! "$(getprop ro.build.product 2>/dev/null)" ]; then
+elif [ ! "$(getprop ro.product.device 2>/dev/null)" -a ! "$(getprop ro.build.product 2>/dev/null)" -a ! "$(getprop ro.vendor.product.device 2>/dev/null)" -a ! "$(getprop ro.vendor.build.product 2>/dev/null)" ]; then
getprop() {
($(which getprop) | $bb grep "$1" | $bb cut -d[ -f3 | $bb cut -d] -f1) 2>/dev/null;
}
@@ -177,14 +181,18 @@ fi;
if [ "$(file_getprop anykernel.sh do.devicecheck)" == 1 ]; then
ui_print "Checking device...";
- device=$(getprop ro.product.device);
- product=$(getprop ro.build.product);
+ device=$(getprop ro.product.device 2>/dev/null);
+ product=$(getprop ro.build.product 2>/dev/null);
+ vendordevice=$(getprop ro.vendor.product.device 2>/dev/null);
+ vendorproduct=$(getprop ro.vendor.build.product 2>/dev/null);
for testname in $(file_getprop anykernel.sh 'device.name.*'); do
- if [ "$device" == "$testname" -o "$product" == "$testname" ]; then
- ui_print "$testname" " ";
- match=1;
- break;
- fi;
+ for devicename in $device $product $vendordevice $vendorproduct; do
+ if [ "$devicename" == "$testname" ]; then
+ ui_print "$testname" " ";
+ match=1;
+ break 2;
+ fi;
+ done;
done;
if [ ! "$match" ]; then
abort " " "Unsupported device. Aborting...";