calabash-android 0.9.4 → 0.9.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 11d0bc339c6953b539999891fd97b7b7a9c28ed4d3d3156532ca74e8398dc4bd
4
- data.tar.gz: 22683a5d2c73e3b1b99f4bf9de5a8ab65e6a9f8ad2ca2d6c4cc7dfd29f0ee784
3
+ metadata.gz: 9fbc879cc380dc19b04c288fda6862a907bee38e37dc48926cccb97313731618
4
+ data.tar.gz: 4d2cebeba99e5008f0a8d6efa50c0dbe6e8ce290a09c4bd9588561331a0e127a
5
5
  SHA512:
6
- metadata.gz: 369b3ef1b6276ef5d79e10460f9058f86e9b6e138b68f36d00105d68263c85034efec218898556a6140b38b92f9591608e1454175ac8f33ec9bdafaf52785504
7
- data.tar.gz: b0523322d6d25fe58a2a6c5845966e8784c03663e41fdafc416a8dbe0b3abc7c7e8631548f98541ffbc72e4e5005972925e280f0d0afb5d7f9adbe98fc2c6f34
6
+ metadata.gz: bc6b9fe1cbdda7e5a646418f93096f6eb441cfcb5b7751cd96ddf78d69d9742fea1dfd7c06fd0af8c865f4c55650ada69daea01e973b30d3f9c74a61066f0730
7
+ data.tar.gz: 0d6f624b4ab2fd09ade749660061e53b13f2b7b38ffe43ba3a2015fc5a837e5f03cde01c9735508833175ae02955187eb5ebec365714c6ca4963a2ff5e577238
@@ -38,6 +38,12 @@ module Calabash
38
38
  end
39
39
  end
40
40
 
41
+ # @!visibility private
42
+ # Returns true if the server / client version check can be skipped
43
+ def self.skip_version_check?
44
+ ENV["SKIP_VERSION_CHECK"] == "1"
45
+ end
46
+
41
47
  # @!visibility private
42
48
  # Returns true if debugging is enabled.
43
49
  def self.debug?
@@ -2,7 +2,7 @@ class JavaKeystore
2
2
  attr_reader :errors, :location, :keystore_alias, :password, :fingerprint
3
3
  attr_reader :signature_algorithm_name
4
4
 
5
- def initialize(location, keystore_alias, password)
5
+ def initialize(location, keystore_alias, password, key_password = nil)
6
6
  raise "No such keystore file '#{location}'" unless File.exists?(File.expand_path(location))
7
7
  log "Reading keystore data from keystore file '#{File.expand_path(location)}'"
8
8
 
@@ -36,6 +36,7 @@ class JavaKeystore
36
36
  @location = location
37
37
  @keystore_alias = keystore_alias
38
38
  @password = password
39
+ @key_password = key_password
39
40
  log "Key store data:"
40
41
  log keystore_data
41
42
  @fingerprint = extract_sha1_fingerprint(keystore_data)
@@ -56,7 +57,26 @@ class JavaKeystore
56
57
  log "Signing using the signature algorithm: '#{signing_algorithm}'"
57
58
  log "Signing using the digest algorithm: '#{digest_algorithm}'"
58
59
 
59
- unless system_with_stdout_on_success(Calabash::Android::Dependencies.jarsigner_path, '-sigfile', 'CERT', '-sigalg', signing_algorithm, '-digestalg', digest_algorithm, '-signedjar', dest_path, '-storepass', password, '-keystore', location, apk_path, keystore_alias)
60
+ cmd_args = {
61
+ '-sigfile' => 'CERT',
62
+ '-sigalg' => signing_algorithm,
63
+ '-digestalg' => digest_algorithm,
64
+ '-signedjar' => dest_path,
65
+ '-storepass' => password,
66
+ '-keystore' => location,
67
+ }
68
+
69
+ unless @key_password.nil?
70
+ cmd_args['-keypass'] = @key_password
71
+ end
72
+
73
+ cmd_args = cmd_args.flatten
74
+ cmd_args << apk_path
75
+ cmd_args << keystore_alias
76
+
77
+ result = system_with_stdout_on_success(Calabash::Android::Dependencies.jarsigner_path, *cmd_args)
78
+
79
+ unless result
60
80
  raise "Could not sign app: #{apk_path}"
61
81
  end
62
82
  end
@@ -92,7 +112,7 @@ class JavaKeystore
92
112
  end
93
113
 
94
114
  def self.get_keystores
95
- if keystore = keystore_from_settings
115
+ if keystore = keystore_from_settings
96
116
  [ keystore ]
97
117
  else
98
118
  [
@@ -113,7 +133,7 @@ class JavaKeystore
113
133
  fail_if_key_missing(keystore, "keystore_alias")
114
134
  keystore["keystore_location"] = File.expand_path(keystore["keystore_location"])
115
135
  log("Keystore location specified in #{File.exist?(".calabash_settings") ? ".calabash_settings" : "calabash_settings"}.")
116
- JavaKeystore.new(keystore["keystore_location"], keystore["keystore_alias"], keystore["keystore_password"])
136
+ JavaKeystore.new(keystore["keystore_location"], keystore["keystore_alias"], keystore["keystore_password"], keystore['key_password'])
117
137
  end
118
138
 
119
139
  def self.fail_if_key_missing(map, key)
@@ -763,8 +763,6 @@ module Calabash module Android
763
763
  raise msg
764
764
  end
765
765
 
766
- log "Checking client-server version match..."
767
-
768
766
  begin
769
767
  server_version = server_version()
770
768
  rescue
@@ -777,19 +775,33 @@ module Calabash module Android
777
775
 
778
776
  client_version = client_version()
779
777
 
780
- unless server_version == client_version
781
- msg = ["Calabash Client and Test-server version mismatch."]
782
- msg << "Client version #{client_version}"
783
- msg << "Test-server version #{server_version}"
784
- msg << "Expected Test-server version #{client_version}"
785
- msg << "\n\nSolution:\n\n"
786
- msg << "Run 'reinstall_test_server' to make sure you have the correct version"
787
- msg_s = msg.join("\n")
788
- log(msg_s)
789
- raise msg_s
790
- end
778
+ if Calabash::Android::Environment.skip_version_check?
779
+ log(%Q[
780
+ Client version #{client_version}
781
+ Test-server version #{server_version}
782
+
783
+ ])
784
+ $stdout.flush
785
+ else
786
+ log "Checking client-server version match..."
791
787
 
792
- log("Client and server versions match (client: #{client_version}, server: #{server_version}). Proceeding...")
788
+ if server_version != client_version
789
+ raise(%Q[
790
+ Calabash Client and Test-server version mismatch.
791
+
792
+ Client version #{client_version}
793
+ Test-server version #{server_version}
794
+ Expected Test-server version #{client_version}
795
+
796
+ Solution:
797
+
798
+ Run 'reinstall_test_server' to make sure you have the correct version
799
+
800
+ ])
801
+ else
802
+ log("Client and server versions match (client: #{client_version}, server: #{server_version}). Proceeding...")
803
+ end
804
+ end
793
805
 
794
806
  block.call if block
795
807
 
@@ -1,5 +1,5 @@
1
1
  module Calabash
2
2
  module Android
3
- VERSION = "0.9.4"
3
+ VERSION = "0.9.5"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: calabash-android
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.4
4
+ version: 0.9.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonas Maturana Larsen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-07-13 00:00:00.000000000 Z
11
+ date: 2018-07-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cucumber