From 005f9ac1ac756a0c59450c16761bd1c5de1cb78c Mon Sep 17 00:00:00 2001 From: rockbot Date: Wed, 18 Dec 2013 17:12:31 -0800 Subject: [PATCH] changes md5 module for more efficient md5hashing --- lib/devices/android/android-common.js | 5 ++--- package.json | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/devices/android/android-common.js b/lib/devices/android/android-common.js index 5e43014a9c5..e013aabe0be 100644 --- a/lib/devices/android/android-common.js +++ b/lib/devices/android/android-common.js @@ -4,7 +4,7 @@ var logger = require('../../server/logger.js').get('appium') , status = require("../../server/status.js") , fs = require('fs') , path = require('path') - , md5 = require('MD5') + , md5 = require('md5calculator') , async = require('async'); var logTypesSupported = { @@ -167,9 +167,8 @@ androidCommon.installApp = function(cb) { }; androidCommon.getAppMd5 = function(cb) { - fs.readFile(this.apkPath, function(err, buffer) { + md5(this.apkPath, function (err, md5Hash) { if (err) return cb(err); - var md5Hash = md5(buffer); logger.info("MD5 for app is " + md5Hash); cb(null, md5Hash); }.bind(this)); diff --git a/package.json b/package.json index 994c8381174..4ee940b561b 100644 --- a/package.json +++ b/package.json @@ -69,7 +69,7 @@ "adm-zip" : "~0.4.3", "ws": "0.4.31", "socket.io" : "~0.9.16", - "MD5" : "~1.1.0", + "md5calculator" : "~0.0.3", "through": "~2.3.4", "date-utils": "~1.2.14", "bytes": "~0.2.1"