OSDN Git Service

update-binary: Fix 4.3+ version check
authorKevin Cernekee <cernekee@gmail.com>
Fri, 15 Nov 2013 05:55:36 +0000 (21:55 -0800)
committerKevin Cernekee <cernekee@gmail.com>
Fri, 15 Nov 2013 05:55:36 +0000 (21:55 -0800)
In Bug #194 a check for 4.3+ was added, but checking major and minor
separately would yield an incorrect result on e.g. v5.0.  Fix this.

Superuser/assets/update-binary

index 76423c0..f56f3e7 100755 (executable)
@@ -62,7 +62,7 @@ MAJ=${VERSION%%.*}
 MIN=${VERSION#*.}
 MIN=${MIN//.*}
 
-if [ "$MAJ" -ge 4 -a "$MIN" -ge 3 ]
+if [ "${MAJ}${MIN}" -ge 43 ]
 then
   # on 4.3+, the daemon need not be setuid.
   chmod 0755 /system/xbin/su