View Single Post
Old August 1st, 2010, 02:52 PM   #1 (permalink)
scary alien
not really so scary
Thread Author (OP)
 
scary alien's Avatar
 
Join Date: Mar 2010
Location: Indy
Posts: 17,298
 
Device(s): LG Nexus 5, Samsung Galaxy Nexus, Asus Nexus 7, Moto Droid X, HTC Droid Eris
Carrier: T-Mobile

Thanks: 32,675
Thanked 14,906 Times in 7,295 Posts
Default verify your file's MD5 checksums! (now with app!)

verify your file's MD5 checksums!

Its always a good idea to validate a file's MD5 checksum before and after you download it (and after placing it on your /sdcard). Reputable sites/sources should publish the MD5 sums for the files hosted there. Beware of those that do not. Verifying the MD5 sum of the file that you've downloaded ensures that you have a full, complete, and uncorrupted version of the file.

Note: erisuser1 has some excellent points about when and why an MD5 sum would (and would not necessarily) be applicable. Read this very informative post for more information: http://androidforums.com/all-things-root-eris/127861-universal-eris-root-dummies-7.html#post1296149

--- edit 8/11/2010 --- Okay, so I realized that not everyone could actually verify their MD5 checksums directly on their phone via the method I originally published below. So, I decided to create my own Android application to do this. Here's the result of that effort. Many thanks to jcase over at XDA for helping me get started doing this by providing me a sample project and some starter code he had on-hand.

*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
edit 3/29/2011:

My AFV (Android File Verifier) app (free in the Android Market)
is the successor to the following checksum app and has a much
better UI and more features
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*


Download my (free) v2.2 app: MD5-Checksum-v2.2.apk
(MD5 checksum: 3aec3fd4cae8f200db8457894ae4193f)

Here's the app details (click 'Show' to view):




Here are some screenshots:

md5checksum - screenshot 1.jpgmd5checksum - screenshot 2.jpgmd5checksum - screenshot 3.jpgmd5checksum - screenshot 4.jpgmd5checksum - screenshot 5.jpgmd5checksum - screenshot 6.jpg

Note: during my testing, I realized/discovered you can actually view a file's MD5 checksum using Astro File Manager (i.e., via viewing a file's details). So, you don't really need this application but my version also calculates SHA1 checksums and was pretty fun to develop .

Enjoy and let me know if you have any questions. --- edit 8/11/2010 ---

You have several different options for doing this (note: all of these examples use the file gscript.zip (that I placed in the /sdcard/download directory) referenced in the http://androidforums.com/all-things-root-eris/127861-universal-eris-root-dummies.html thread):


Checking Directly On Your Phone

You actually now have several options for checking MD5 sums on your phone:

- via my free app (MD5-Checksum-v2.2.apk) [gratuitous/shamelss plug ]; download and manually install

- via ManD5 Lite (free app in the Market) [this app did not work for me at the time I first posted this thread; it does work, wonderfully, now]

- via Astro File Manager (long-press your file and select 'Details')

- via Android Terminal Emulator [note: not all phones can do this since the md5sum utility may not be present/installed] by typing "md5sum filename" (you might need to long-press the menu key to bring-up the keyboard)

 
Checking Via The Android Software Development Kit (SDK)

1. Download and install the Android SDK

2. Start-up Windows Command Prompt (or Terminal for Macs)

3. Change to the SDK's tools directory

4. Enter adb shell md5sum /sdcard/download/gscript.zip
Code:
C:\>
c:\>cd c:\android-sdk-windows\tools
C:\android-sdk-windows\tools>adb shell md5sum /sdcard/download/gscript.zip
92796a8c6e61e8f1ee36e315c0acae7d /sdcard/download/gscript.zip
note: you can also invoke the md5sum utility from an adb-launched shell:
Code:
C:\android\android-sdk-windows\tools>adb shell
# md5sum /sdcard/download/gscript.zip
md5sum /sdcard/download/gscript.zip
92796a8c6e61e8f1ee36e315c0acae7d /sdcard/download/gscript.zip 
# exit
Checking from Windows

Obtain the Windows Command Line version of an MD5 sum utility:

1. In the browser of your (Windows) PC, navigate to http://www.md5summer.org/download.html

2. About three-fourths of the way down the page, find the "DOS Command Line MD5sum utility".

3. Right-click and download this version (should be http://www.md5summer.org/md5sum.zip)

4. After downloading, extract the md5sum.exe file to your Android SDK's tools directory. That way, you'll have a home for all of the tools that you use for rooting.

5. To run it, just launch the Windows Command Prompt and change (cd) to your Android SDK's tools directory.

6. Type md5sum.exe c:\temp\gscript.zip

7. For example:
Code:
C:\Documents and Settings> cd c:\android\android-sdk-windows\tools
C:\android\android-sdk-windows\tools>md5sum.exe c:\temp\gscript.zip
\92796a8c6e61e8f1ee36e315c0acae7d *c:\\temp\\gscript.zip
Checking from a Mac

Courtesy of doogald's post below:

Things are a bit easier from a Mac, since there is no utility that you need ro find or download. To check from the terminal on a mac:

- [optional] change directory to the location of the file for which you would like to check. For example, cd ~/Downloads

- use the openssl command to check, using the following syntax: openssl md5 pathtofile

For example, openssl md5 gscript.zip
scary alien is online now  
Last edited by scary alien; March 29th, 2011 at 12:09 PM. Reason: updated app to v2.2
Reply With Quote
The Following User Says Thank You to scary alien For This Useful Post:
KarateExplosion6 (August 3rd, 2010)