AI 144290: Older versions of dexdump plow on after a checksum failure and usually
  crash.  Watch for any activity on stderr instead of looking for an
  error message.
  BUG=1758365

Automated import of CL 144290
diff --git a/tools/dexcheck b/tools/dexcheck
index a4f7399..6495d50 100755
--- a/tools/dexcheck
+++ b/tools/dexcheck
@@ -9,11 +9,14 @@
 
 # Check each file in turn.  This is much faster with "dexdump -c", but that
 # was added post-cupcake.
+#
+# The dexdump found in older builds does not stop on checksum failures and
+# will likely crash.
 for file in $files; do
 	echo $file
 	errout=`adb shell "dexdump /data/dalvik-cache/$file > dev/null"`
-	echo $errout | grep ERROR > /dev/null
-	if [ $? -eq 0 ]; then
+	errcount=`echo $errout | wc -w` > /dev/null
+	if [ $errcount != "0" ]; then
 		echo "  Failure in $file: $errout"
 	fi
 done