Commit 24fe7efa authored by Nathan Kerr's avatar Nathan Kerr

Don't rely on external shasum program to calculate sum of the APK.

parent 21f91bda
......@@ -10,6 +10,7 @@ import 'dart:math';
import 'package:logging/logging.dart';
import 'package:path/path.dart' as path;
import 'package:crypto/crypto.dart';
import 'application_package.dart';
import 'build_configuration.dart';
......@@ -695,9 +696,10 @@ class AndroidDevice extends Device {
}
String _getSourceSha1(ApplicationPackage app) {
String sha1 =
runCheckedSync(['shasum', '-a', '1', '-p', app.localPath]).split(' ')[0];
return sha1;
var sha1 = new SHA1();
var file = new File(app.localPath);
sha1.add(file.readAsBytesSync());
return CryptoUtils.bytesToHex(sha1.close());
}
@override
......
......@@ -19,6 +19,7 @@ dependencies:
shelf: ^0.6.2
test: ">=0.12.4+5 <0.12.5"
yaml: ^2.1.3
crypto: ^0.9.1
dev_dependencies:
mockito: "^0.10.1"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment