blob: 6495d50bcecb9587e5afa86667febc62dfbee01b [file] [log] [blame]
Andy McFadden0198b142009-04-02 14:48:56 -07001#!/bin/bash
2#
3# This requires read permission on /data/dalvik-cache. On an eng build this
4# works, on userdebug you will need to "adb root", or "su" followed by
5# "chmod 777 /data/dalvik-cache".
6
7# Get the list of files. Use "sed" to drop the trailing carriage return.
8files=`adb shell "cd /data/dalvik-cache; echo *" | sed -e s/.$//`
9
10# Check each file in turn. This is much faster with "dexdump -c", but that
11# was added post-cupcake.
Andy McFaddenbea515b2009-04-02 14:54:57 -070012#
13# The dexdump found in older builds does not stop on checksum failures and
14# will likely crash.
Andy McFadden0198b142009-04-02 14:48:56 -070015for file in $files; do
16 echo $file
17 errout=`adb shell "dexdump /data/dalvik-cache/$file > dev/null"`
Andy McFaddenbea515b2009-04-02 14:54:57 -070018 errcount=`echo $errout | wc -w` > /dev/null
19 if [ $errcount != "0" ]; then
Andy McFadden0198b142009-04-02 14:48:56 -070020 echo " Failure in $file: $errout"
21 fi
22done
23
24exit 0
25