Don't rely on external shasum program to calculate sum of the APK.
This commit is contained in:
@@ -10,6 +10,7 @@ import 'dart:math';
|
|||||||
|
|
||||||
import 'package:logging/logging.dart';
|
import 'package:logging/logging.dart';
|
||||||
import 'package:path/path.dart' as path;
|
import 'package:path/path.dart' as path;
|
||||||
|
import 'package:crypto/crypto.dart';
|
||||||
|
|
||||||
import 'application_package.dart';
|
import 'application_package.dart';
|
||||||
import 'build_configuration.dart';
|
import 'build_configuration.dart';
|
||||||
@@ -695,9 +696,10 @@ class AndroidDevice extends Device {
|
|||||||
}
|
}
|
||||||
|
|
||||||
String _getSourceSha1(ApplicationPackage app) {
|
String _getSourceSha1(ApplicationPackage app) {
|
||||||
String sha1 =
|
var sha1 = new SHA1();
|
||||||
runCheckedSync(['shasum', '-a', '1', '-p', app.localPath]).split(' ')[0];
|
var file = new File(app.localPath);
|
||||||
return sha1;
|
sha1.add(file.readAsBytesSync());
|
||||||
|
return CryptoUtils.bytesToHex(sha1.close());
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ dependencies:
|
|||||||
shelf: ^0.6.2
|
shelf: ^0.6.2
|
||||||
test: ">=0.12.4+5 <0.12.5"
|
test: ">=0.12.4+5 <0.12.5"
|
||||||
yaml: ^2.1.3
|
yaml: ^2.1.3
|
||||||
|
crypto: ^0.9.1
|
||||||
|
|
||||||
dev_dependencies:
|
dev_dependencies:
|
||||||
mockito: "^0.10.1"
|
mockito: "^0.10.1"
|
||||||
|
|||||||
Reference in New Issue
Block a user