Merge pull request #2170 from paymand/fast_reset_remote_apk

Make sure the app is always signed *before* getting the MD5 hash.
This commit is contained in:
Jonathan Lipps
2014-03-25 11:46:40 -07:00

View File

@@ -401,14 +401,14 @@ androidCommon.installApp = function (cb) {
return cb();
}
this.remoteApkExists(function (err, remoteApk) {
// err is set if the remote apk doesn't exist so don't check it.
this.adb.isAppInstalled(this.args.appPackage, function (err, installed) {
if (installed && this.args.fastReset && remoteApk) {
this.resetApp(cb);
} else if (!installed || (this.args.fastReset && !remoteApk)) {
this.adb.checkAndSignApk(this.args.app, this.args.appPackage, function (err) {
if (err) return cb(err);
this.adb.checkAndSignApk(this.args.app, this.args.appPackage, function (err) {
if (err) return cb(err);
this.remoteApkExists(function (err, remoteApk) {
// err is set if the remote apk doesn't exist so don't check it.
this.adb.isAppInstalled(this.args.appPackage, function (err, installed) {
if (installed && this.args.fastReset && remoteApk) {
this.resetApp(cb);
} else if (!installed || (this.args.fastReset && !remoteApk)) {
this.adb.mkdir(this.remoteTempPath(), function (err) {
if (err) return cb(err);
this.getRemoteApk(function (err, remoteApk, md5Hash) {
@@ -427,10 +427,10 @@ androidCommon.installApp = function (cb) {
}.bind(this));
}.bind(this));
}.bind(this));
}.bind(this));
} else {
cb();
}
} else {
cb();
}
}.bind(this));
}.bind(this));
}.bind(this));
};