fastlane_core 0.42.1 → 0.43.0

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
  SHA1:
3
- metadata.gz: d6ae47502eb6f4fd060ccff03860f7be861d26af
4
- data.tar.gz: 57fa04e37deddbe98fa6b528c2208078d0633c4f
3
+ metadata.gz: 3e1f8f4483072a22729df956093d77ccb7038a42
4
+ data.tar.gz: c7f140b5b470fb9cdc552fb51f4403073fbb2178
5
5
  SHA512:
6
- metadata.gz: 60e64b52867a8338f2a67effd996e23266766bf5ae95a8030d423bd2000a0c7707fab04b02391a7d7e1bac930e74af2e3251a8faaf5db14390d2f5f9642609c2
7
- data.tar.gz: b6facb77b2a12c5d31ce062c7827ea12e079105bcb8ba596b39b7fc98e970369662036291b8c1f3e46930cc158d88dc287cdedb9a4c824bd25b8a9f135fee4e2
6
+ metadata.gz: 222d88fa8160bb9ec77d991c772007862e0959066a14fbf18bdd1f46f6f2ddbbcf76356d46e6c533fdbf4868cb83f81980167d94be539f08d1e565befaa1fe7d
7
+ data.tar.gz: 50d7d27a770fa0dce3c36a5841079afcb00ea5c6e914439406606950edb62a95ed963bca7f65f435112728e5a22ce628f2daa271ec005235d54f945246d4e01f
@@ -73,7 +73,7 @@ module FastlaneCore
73
73
  keychains = Helper.backticks(command, print: $verbose).split("\n")
74
74
  unless keychains.empty?
75
75
  # Select first keychain name from returned keychains list
76
- return keychains[0].strip.tr('"', '').split(File::SEPARATOR)[-1]
76
+ return keychains[0].strip.tr('"', '')
77
77
  end
78
78
  end
79
79
  return ""
@@ -12,6 +12,10 @@ module FastlaneCore
12
12
  class TransporterTransferError < StandardError
13
13
  end
14
14
 
15
+ # Used internally
16
+ class TransporterRequiresApplicationSpecificPasswordError < StandardError
17
+ end
18
+
15
19
  # Base class for executing the iTMSTransporter
16
20
  class TransporterExecutor
17
21
  ERROR_REGEX = />\s*ERROR:\s+(.+)/
@@ -61,6 +65,10 @@ module FastlaneCore
61
65
  UI.important(@warnings.join("\n"))
62
66
  end
63
67
 
68
+ if @errors.join("").include?("Sign in with the app-specific")
69
+ raise TransporterRequiresApplicationSpecificPasswordError
70
+ end
71
+
64
72
  if @errors.count > 0
65
73
  UI.error(@errors.join("\n"))
66
74
  end
@@ -85,7 +93,7 @@ module FastlaneCore
85
93
 
86
94
  # Check if it's a login error
87
95
  if $1.include? "Your Apple ID or password was entered incorrectly" or
88
- $1.include? "This Apple ID has been locked for security reasons"
96
+ $1.include? "This Apple ID has been locked for security reasons"
89
97
 
90
98
  unless Helper.is_test?
91
99
  CredentialsManager::AccountManager.new(user: @user).invalid_credentials
@@ -245,6 +253,8 @@ module FastlaneCore
245
253
  end
246
254
 
247
255
  class ItunesTransporter
256
+ TWO_STEP_HOST_PREFIX = "deliver.appspecific"
257
+
248
258
  # This will be called from the Deliverfile, and disables the logging of the transporter output
249
259
  def self.hide_transporter_output
250
260
  @hide_transporter_output = !$verbose
@@ -265,10 +275,22 @@ module FastlaneCore
265
275
  # we can't default to using the better direct Java invocation strategy for those versions.
266
276
  use_shell_script ||= Helper.xcode_version.start_with?('6.')
267
277
  use_shell_script ||= !ENV['FASTLANE_ITUNES_TRANSPORTER_USE_SHELL_SCRIPT'].nil?
268
- data = CredentialsManager::AccountManager.new(user: user, password: password)
269
278
 
279
+ # First, see if we have an application specific password
280
+ data = CredentialsManager::AccountManager.new(user: user,
281
+ prefix: TWO_STEP_HOST_PREFIX)
270
282
  @user = data.user
271
- @password = data.password
283
+ @password ||= data.password(ask_if_missing: false)
284
+
285
+ if @password.to_s.length == 0
286
+ # No specific password found, just using the iTC/Dev Portal one
287
+ # default to the given password here
288
+ data = CredentialsManager::AccountManager.new(user: user,
289
+ password: password)
290
+ @user = data.user
291
+ @password ||= data.password
292
+ end
293
+
272
294
  @transporter_executor = use_shell_script ? ShellScriptTransporterExecutor.new : JavaTransporterExecutor.new
273
295
  end
274
296
 
@@ -285,7 +307,13 @@ module FastlaneCore
285
307
  command = @transporter_executor.build_download_command(@user, @password, app_id, dir)
286
308
  UI.verbose(@transporter_executor.build_download_command(@user, 'YourPassword', app_id, dir))
287
309
 
288
- result = @transporter_executor.execute(command, ItunesTransporter.hide_transporter_output?)
310
+ begin
311
+ result = @transporter_executor.execute(command, ItunesTransporter.hide_transporter_output?)
312
+ rescue TransporterRequiresApplicationSpecificPasswordError => ex
313
+ handle_two_step_failure(ex)
314
+ return download(app_id, dir)
315
+ end
316
+
289
317
  return result if Helper.is_test?
290
318
 
291
319
  itmsp_path = File.join(dir, "#{app_id}.itmsp")
@@ -307,23 +335,27 @@ module FastlaneCore
307
335
  # @raise [Deliver::TransporterTransferError] when something went wrong
308
336
  # when transfering
309
337
  def upload(app_id, dir)
310
- dir = File.join(dir, "#{app_id}.itmsp")
338
+ actual_dir = File.join(dir, "#{app_id}.itmsp")
311
339
 
312
340
  UI.message("Going to upload updated app to iTunes Connect")
313
341
  UI.success("This might take a few minutes, please don't interrupt the script")
314
342
 
315
- command = @transporter_executor.build_upload_command(@user, @password, dir)
316
-
317
- UI.verbose(@transporter_executor.build_upload_command(@user, 'YourPassword', dir))
343
+ command = @transporter_executor.build_upload_command(@user, @password, actual_dir)
344
+ UI.verbose(@transporter_executor.build_upload_command(@user, 'YourPassword', actual_dir))
318
345
 
319
- result = @transporter_executor.execute(command, ItunesTransporter.hide_transporter_output?)
346
+ begin
347
+ result = @transporter_executor.execute(command, ItunesTransporter.hide_transporter_output?)
348
+ rescue TransporterRequiresApplicationSpecificPasswordError => ex
349
+ handle_two_step_failure(ex)
350
+ return upload(app_id, dir)
351
+ end
320
352
 
321
353
  if result
322
354
  UI.success("-" * 102)
323
355
  UI.success("Successfully uploaded package to iTunes Connect. It might take a few minutes until it's visible online.")
324
356
  UI.success("-" * 102)
325
357
 
326
- FileUtils.rm_rf(dir) unless Helper.is_test? # we don't need the package any more, since the upload was successful
358
+ FileUtils.rm_rf(actual_dir) unless Helper.is_test? # we don't need the package any more, since the upload was successful
327
359
  else
328
360
  handle_error(@password)
329
361
  end
@@ -333,6 +365,25 @@ module FastlaneCore
333
365
 
334
366
  private
335
367
 
368
+ # Tells the user how to get an application specific password
369
+ def handle_two_step_failure(ex)
370
+ a = CredentialsManager::AccountManager.new(user: @user,
371
+ prefix: TWO_STEP_HOST_PREFIX)
372
+ if a.password(ask_if_missing: false).to_s.length > 0
373
+ # user already entered one.. delete the old one
374
+ UI.error("Application specific password seems wrong")
375
+ UI.error("Please make sure to follow the instructions")
376
+ a.remove_from_keychain
377
+ end
378
+ UI.error("Your account has 2 step verification enabled")
379
+ UI.error("Please go to https://appleid.apple.com/account/manage")
380
+ UI.error("and generate an application specific password for")
381
+ UI.error("the iTunes Transporter, which is used to upload builds")
382
+ @password = a.password # to ask the user for the missing value
383
+
384
+ return true
385
+ end
386
+
336
387
  def handle_error(password)
337
388
  @transporter_executor.handle_error(password)
338
389
  end
@@ -1,3 +1,3 @@
1
1
  module FastlaneCore
2
- VERSION = "0.42.1".freeze
2
+ VERSION = "0.43.0".freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane_core
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.42.1
4
+ version: 0.43.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Felix Krause
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-04-27 00:00:00.000000000 Z
11
+ date: 2016-05-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json
@@ -170,7 +170,7 @@ dependencies:
170
170
  requirements:
171
171
  - - ">="
172
172
  - !ruby/object:Gem::Version
173
- version: 0.11.0
173
+ version: 0.16.0
174
174
  - - "<"
175
175
  - !ruby/object:Gem::Version
176
176
  version: 1.0.0
@@ -180,7 +180,7 @@ dependencies:
180
180
  requirements:
181
181
  - - ">="
182
182
  - !ruby/object:Gem::Version
183
- version: 0.11.0
183
+ version: 0.16.0
184
184
  - - "<"
185
185
  - !ruby/object:Gem::Version
186
186
  version: 1.0.0
@@ -399,7 +399,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
399
399
  version: '0'
400
400
  requirements: []
401
401
  rubyforge_project:
402
- rubygems_version: 2.4.5.1
402
+ rubygems_version: 2.4.0
403
403
  signing_key:
404
404
  specification_version: 4
405
405
  summary: Contains all shared code/dependencies of the fastlane.tools