| Andy McFadden | 0198b14 | 2009-04-02 14:48:56 -0700 | [diff] [blame] | 1 | #!/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. |
| 8 | files=`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 McFadden | bea515b | 2009-04-02 14:54:57 -0700 | [diff] [blame^] | 12 | # |
| 13 | # The dexdump found in older builds does not stop on checksum failures and |
| 14 | # will likely crash. |
| Andy McFadden | 0198b14 | 2009-04-02 14:48:56 -0700 | [diff] [blame] | 15 | for file in $files; do |
| 16 | echo $file |
| 17 | errout=`adb shell "dexdump /data/dalvik-cache/$file > dev/null"` |
| Andy McFadden | bea515b | 2009-04-02 14:54:57 -0700 | [diff] [blame^] | 18 | errcount=`echo $errout | wc -w` > /dev/null |
| 19 | if [ $errcount != "0" ]; then |
| Andy McFadden | 0198b14 | 2009-04-02 14:48:56 -0700 | [diff] [blame] | 20 | echo " Failure in $file: $errout" |
| 21 | fi |
| 22 | done |
| 23 | |
| 24 | exit 0 |
| 25 | |