fastlane 2.105.2 → 2.106.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (57) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +73 -72
  3. data/bin/fastlane +24 -1
  4. data/deliver/lib/deliver/app_screenshot.rb +7 -0
  5. data/deliver/lib/deliver/submit_for_review.rb +14 -1
  6. data/fastlane/lib/fastlane/actions/docs/sync_code_signing.md +1 -1
  7. data/fastlane/lib/fastlane/actions/download_from_play_store.rb +61 -0
  8. data/fastlane/lib/fastlane/actions/modify_services.rb +7 -5
  9. data/fastlane/lib/fastlane/actions/push_to_git_remote.rb +2 -2
  10. data/fastlane/lib/fastlane/actions/register_device.rb +6 -4
  11. data/fastlane/lib/fastlane/actions/register_devices.rb +9 -8
  12. data/fastlane/lib/fastlane/actions/upload_to_play_store.rb +12 -0
  13. data/fastlane/lib/fastlane/helper/crashlytics_helper.rb +1 -1
  14. data/fastlane/lib/fastlane/version.rb +1 -1
  15. data/fastlane/swift/Deliverfile.swift +1 -1
  16. data/fastlane/swift/Fastlane.swift +24 -6
  17. data/fastlane/swift/Gymfile.swift +1 -1
  18. data/fastlane/swift/Matchfile.swift +1 -1
  19. data/fastlane/swift/MatchfileProtocol.swift +3 -4
  20. data/fastlane/swift/Precheckfile.swift +1 -1
  21. data/fastlane/swift/Scanfile.swift +1 -1
  22. data/fastlane/swift/Screengrabfile.swift +1 -1
  23. data/fastlane/swift/Snapshotfile.swift +1 -1
  24. data/fastlane_core/lib/fastlane_core.rb +0 -1
  25. data/fastlane_core/lib/fastlane_core/device_manager.rb +1 -1
  26. data/fastlane_core/lib/fastlane_core/helper.rb +1 -1
  27. data/fastlane_core/lib/fastlane_core/itunes_transporter.rb +13 -10
  28. data/frameit/lib/frameit/editor.rb +3 -2
  29. data/frameit/lib/frameit/frame_downloader.rb +1 -1
  30. data/match/lib/match.rb +2 -2
  31. data/match/lib/match/change_password.rb +31 -18
  32. data/match/lib/match/commands_generator.rb +20 -7
  33. data/match/lib/match/encryption.rb +18 -0
  34. data/match/lib/match/encryption/interface.rb +17 -0
  35. data/match/lib/match/encryption/openssl.rb +155 -0
  36. data/match/lib/match/generator.rb +5 -5
  37. data/match/lib/match/module.rb +5 -1
  38. data/match/lib/match/nuke.rb +33 -15
  39. data/match/lib/match/options.rb +11 -12
  40. data/match/lib/match/runner.rb +59 -38
  41. data/match/lib/match/storage.rb +16 -0
  42. data/match/lib/match/storage/git_storage.rb +228 -0
  43. data/match/lib/match/storage/interface.rb +50 -0
  44. data/snapshot/lib/snapshot/screenshot_rotate.rb +3 -8
  45. data/spaceship/README.md +10 -1
  46. data/spaceship/lib/spaceship/api/.DS_Store +0 -0
  47. data/spaceship/lib/spaceship/api/.base.rb.swp +0 -0
  48. data/spaceship/lib/spaceship/du/du_client.rb +2 -0
  49. data/spaceship/lib/spaceship/portal/device.rb +0 -1
  50. data/spaceship/lib/spaceship/portal/portal_client.rb +7 -1
  51. data/spaceship/lib/spaceship/spaceauth_runner.rb +1 -1
  52. data/spaceship/lib/spaceship/tunes/app_details.rb +1 -1
  53. data/spaceship/lib/spaceship/tunes/device_type.rb +1 -1
  54. metadata +46 -20
  55. data/fastlane_core/lib/fastlane_core/itunes_search_api.rb +0 -50
  56. data/match/lib/match/encrypt.rb +0 -133
  57. data/match/lib/match/git_helper.rb +0 -209
@@ -3,9 +3,6 @@ require 'credentials_manager'
3
3
  module Fastlane
4
4
  module Actions
5
5
  class RegisterDevicesAction < Action
6
- UDID_REGEXP_IOS = /^(\h{40}|\h{8}-\h{16})$/
7
- UDID_REGEXP_MAC = /^[\h\-]{36}$/
8
-
9
6
  def self.is_supported?(platform)
10
7
  [:ios, :mac].include?(platform)
11
8
  end
@@ -17,7 +14,6 @@ module Fastlane
17
14
  devices_file = params[:devices_file]
18
15
 
19
16
  mac = params[:platform] == "mac"
20
- udid_regexp = mac ? UDID_REGEXP_MAC : UDID_REGEXP_IOS
21
17
 
22
18
  credentials = CredentialsManager::AccountManager.new(user: params[:username])
23
19
  Spaceship.login(credentials.user, credentials.password)
@@ -28,9 +24,8 @@ module Fastlane
28
24
 
29
25
  if devices
30
26
  device_objs = devices.map do |k, v|
31
- UI.user_error!("Passed invalid UDID: #{v} for device: #{k}") unless udid_regexp =~ v
32
27
  next if existing_devices.map(&:udid).include?(v)
33
- Spaceship::Device.create!(name: k, udid: v, mac: mac)
28
+ try_create_device(name: k, udid: v, mac: mac)
34
29
  end
35
30
  elsif devices_file
36
31
  require 'csv'
@@ -42,9 +37,8 @@ module Fastlane
42
37
  next if existing_devices.map(&:udid).include?(device[0])
43
38
 
44
39
  UI.user_error!("Invalid device line, please provide a file according to the Apple Sample UDID file (http://devimages.apple.com/downloads/devices/Multiple-Upload-Samples.zip)") unless device.count == 2
45
- UI.user_error!("Passed invalid UDID: #{device[0]} for device: #{device[1]}") unless udid_regexp =~ device[0]
46
40
 
47
- Spaceship::Device.create!(name: device[1], udid: device[0], mac: mac)
41
+ try_create_device(name: device[1], udid: device[0], mac: mac)
48
42
  end
49
43
  else
50
44
  UI.user_error!("You must pass either a valid `devices` or `devices_file`. Please check the readme.")
@@ -54,6 +48,13 @@ module Fastlane
54
48
  return device_objs
55
49
  end
56
50
 
51
+ def self.try_create_device(name: nil, udid: nil, mac: false)
52
+ Spaceship::Device.create!(name: name, udid: udid, mac: mac)
53
+ rescue => ex
54
+ UI.error(ex.to_s)
55
+ UI.crash!("Failed to register new device (name: #{name}, UDID: #{udid})")
56
+ end
57
+
57
58
  def self.description
58
59
  "Registers new devices to the Apple Dev Portal"
59
60
  end
@@ -16,6 +16,18 @@ module Fastlane
16
16
  end
17
17
  end
18
18
 
19
+ # If no AAB param was provided, try to fill in the value from lane context.
20
+ # First GRADLE_ALL_AAB_OUTPUT_PATHS if only one
21
+ # Else from GRADLE_AAB_OUTPUT_PATH
22
+ if params[:aab].nil?
23
+ all_aab_paths = Actions.lane_context[SharedValues::GRADLE_ALL_AAB_OUTPUT_PATHS] || []
24
+ if all_aab_paths.count == 1
25
+ params[:aab] = all_aab_paths.first
26
+ else
27
+ params[:aab] = Actions.lane_context[SharedValues::GRADLE_AAB_OUTPUT_PATH]
28
+ end
29
+ end
30
+
19
31
  Supply.config = params # we already have the finished config
20
32
 
21
33
  Supply::Uploader.new.perform_upload
@@ -69,7 +69,7 @@ module Fastlane
69
69
  if ENV['JAVA_HOME'].nil?
70
70
  command = ["java"]
71
71
  else
72
- command = [Shellwords.escape(File.join(ENV['JAVA_HOME'], "/bin/java"))]
72
+ command = [File.join(ENV['JAVA_HOME'], "/bin/java").shellescape]
73
73
  end
74
74
  command << "-jar #{File.expand_path(params[:crashlytics_path])}"
75
75
  command << "-androidRes ."
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
- VERSION = '2.105.2'.freeze
2
+ VERSION = '2.106.0'.freeze
3
3
  DESCRIPTION = "The easiest way to automate beta deployments and releases for your iOS and Android apps".freeze
4
4
  MINIMUM_XCODE_RELEASE = "7.0".freeze
5
5
  RUBOCOP_REQUIREMENT = '0.49.1'.freeze
@@ -18,4 +18,4 @@ class Deliverfile: DeliverfileProtocol {
18
18
 
19
19
 
20
20
 
21
- // Generated with fastlane 2.105.2
21
+ // Generated with fastlane 2.106.0
@@ -1349,6 +1349,24 @@ func downloadDsyms(username: String,
1349
1349
  RubyCommand.Argument(name: "output_directory", value: outputDirectory)])
1350
1350
  _ = runner.executeCommand(command)
1351
1351
  }
1352
+ func downloadFromPlayStore(packageName: String,
1353
+ metadataPath: String? = nil,
1354
+ key: String? = nil,
1355
+ issuer: String? = nil,
1356
+ jsonKey: String? = nil,
1357
+ jsonKeyData: String? = nil,
1358
+ rootUrl: String? = nil,
1359
+ timeout: Int = 300) {
1360
+ let command = RubyCommand(commandID: "", methodName: "download_from_play_store", className: nil, args: [RubyCommand.Argument(name: "package_name", value: packageName),
1361
+ RubyCommand.Argument(name: "metadata_path", value: metadataPath),
1362
+ RubyCommand.Argument(name: "key", value: key),
1363
+ RubyCommand.Argument(name: "issuer", value: issuer),
1364
+ RubyCommand.Argument(name: "json_key", value: jsonKey),
1365
+ RubyCommand.Argument(name: "json_key_data", value: jsonKeyData),
1366
+ RubyCommand.Argument(name: "root_url", value: rootUrl),
1367
+ RubyCommand.Argument(name: "timeout", value: timeout)])
1368
+ _ = runner.executeCommand(command)
1369
+ }
1352
1370
  func dsymZip(archivePath: String? = nil,
1353
1371
  dsymPath: String? = nil,
1354
1372
  all: Bool = false) {
@@ -2076,6 +2094,7 @@ func makeChangelogFromJenkins(fallbackChangelog: String = "",
2076
2094
  func match(gitUrl: String = matchfile.gitUrl,
2077
2095
  gitBranch: String = matchfile.gitBranch,
2078
2096
  type: String = matchfile.type,
2097
+ storageMode: String = matchfile.storageMode,
2079
2098
  appIdentifier: [String] = matchfile.appIdentifier,
2080
2099
  username: String = matchfile.username,
2081
2100
  keychainName: String = matchfile.keychainName,
@@ -2090,7 +2109,6 @@ func match(gitUrl: String = matchfile.gitUrl,
2090
2109
  skipConfirmation: Bool = matchfile.skipConfirmation,
2091
2110
  shallowClone: Bool = matchfile.shallowClone,
2092
2111
  cloneBranchDirectly: Bool = matchfile.cloneBranchDirectly,
2093
- workspace: String? = matchfile.workspace,
2094
2112
  forceForNewDevices: Bool = matchfile.forceForNewDevices,
2095
2113
  skipDocs: Bool = matchfile.skipDocs,
2096
2114
  platform: String = matchfile.platform,
@@ -2098,6 +2116,7 @@ func match(gitUrl: String = matchfile.gitUrl,
2098
2116
  let command = RubyCommand(commandID: "", methodName: "match", className: nil, args: [RubyCommand.Argument(name: "git_url", value: gitUrl),
2099
2117
  RubyCommand.Argument(name: "git_branch", value: gitBranch),
2100
2118
  RubyCommand.Argument(name: "type", value: type),
2119
+ RubyCommand.Argument(name: "storage_mode", value: storageMode),
2101
2120
  RubyCommand.Argument(name: "app_identifier", value: appIdentifier),
2102
2121
  RubyCommand.Argument(name: "username", value: username),
2103
2122
  RubyCommand.Argument(name: "keychain_name", value: keychainName),
@@ -2112,7 +2131,6 @@ func match(gitUrl: String = matchfile.gitUrl,
2112
2131
  RubyCommand.Argument(name: "skip_confirmation", value: skipConfirmation),
2113
2132
  RubyCommand.Argument(name: "shallow_clone", value: shallowClone),
2114
2133
  RubyCommand.Argument(name: "clone_branch_directly", value: cloneBranchDirectly),
2115
- RubyCommand.Argument(name: "workspace", value: workspace),
2116
2134
  RubyCommand.Argument(name: "force_for_new_devices", value: forceForNewDevices),
2117
2135
  RubyCommand.Argument(name: "skip_docs", value: skipDocs),
2118
2136
  RubyCommand.Argument(name: "platform", value: platform),
@@ -3342,6 +3360,7 @@ func swiftlint(mode: String = "lint",
3342
3360
  func syncCodeSigning(gitUrl: String,
3343
3361
  gitBranch: String = "master",
3344
3362
  type: String = "development",
3363
+ storageMode: String = "git",
3345
3364
  appIdentifier: [String],
3346
3365
  username: String,
3347
3366
  keychainName: String = "login.keychain",
@@ -3356,7 +3375,6 @@ func syncCodeSigning(gitUrl: String,
3356
3375
  skipConfirmation: Bool = false,
3357
3376
  shallowClone: Bool = false,
3358
3377
  cloneBranchDirectly: Bool = false,
3359
- workspace: String? = nil,
3360
3378
  forceForNewDevices: Bool = false,
3361
3379
  skipDocs: Bool = false,
3362
3380
  platform: String = "ios",
@@ -3364,6 +3382,7 @@ func syncCodeSigning(gitUrl: String,
3364
3382
  let command = RubyCommand(commandID: "", methodName: "sync_code_signing", className: nil, args: [RubyCommand.Argument(name: "git_url", value: gitUrl),
3365
3383
  RubyCommand.Argument(name: "git_branch", value: gitBranch),
3366
3384
  RubyCommand.Argument(name: "type", value: type),
3385
+ RubyCommand.Argument(name: "storage_mode", value: storageMode),
3367
3386
  RubyCommand.Argument(name: "app_identifier", value: appIdentifier),
3368
3387
  RubyCommand.Argument(name: "username", value: username),
3369
3388
  RubyCommand.Argument(name: "keychain_name", value: keychainName),
@@ -3378,7 +3397,6 @@ func syncCodeSigning(gitUrl: String,
3378
3397
  RubyCommand.Argument(name: "skip_confirmation", value: skipConfirmation),
3379
3398
  RubyCommand.Argument(name: "shallow_clone", value: shallowClone),
3380
3399
  RubyCommand.Argument(name: "clone_branch_directly", value: cloneBranchDirectly),
3381
- RubyCommand.Argument(name: "workspace", value: workspace),
3382
3400
  RubyCommand.Argument(name: "force_for_new_devices", value: forceForNewDevices),
3383
3401
  RubyCommand.Argument(name: "skip_docs", value: skipDocs),
3384
3402
  RubyCommand.Argument(name: "platform", value: platform),
@@ -3983,7 +4001,7 @@ func xcov(workspace: String? = nil,
3983
4001
  coverallsServiceJobId: String? = nil,
3984
4002
  coverallsRepoToken: String? = nil,
3985
4003
  xcconfig: String? = nil,
3986
- ideFoundationPath: String = "/Applications/Xcode-10.app/Contents/Developer/../Frameworks/IDEFoundation.framework/Versions/A/IDEFoundation",
4004
+ ideFoundationPath: String = "/Applications/Xcode.app/Contents/Developer/../Frameworks/IDEFoundation.framework/Versions/A/IDEFoundation",
3987
4005
  legacySupport: Bool = false) {
3988
4006
  let command = RubyCommand(commandID: "", methodName: "xcov", className: nil, args: [RubyCommand.Argument(name: "workspace", value: workspace),
3989
4007
  RubyCommand.Argument(name: "project", value: project),
@@ -4091,4 +4109,4 @@ let screengrabfile: Screengrabfile = Screengrabfile()
4091
4109
  let snapshotfile: Snapshotfile = Snapshotfile()
4092
4110
  // Please don't remove the lines below
4093
4111
  // They are used to detect outdated files
4094
- // FastlaneRunnerAPIVersion [0.9.29]
4112
+ // FastlaneRunnerAPIVersion [0.9.30]
@@ -18,4 +18,4 @@ class Gymfile: GymfileProtocol {
18
18
 
19
19
 
20
20
 
21
- // Generated with fastlane 2.105.2
21
+ // Generated with fastlane 2.106.0
@@ -18,4 +18,4 @@ class Matchfile: MatchfileProtocol {
18
18
 
19
19
 
20
20
 
21
- // Generated with fastlane 2.105.2
21
+ // Generated with fastlane 2.106.0
@@ -2,6 +2,7 @@ protocol MatchfileProtocol: class {
2
2
  var gitUrl: String { get }
3
3
  var gitBranch: String { get }
4
4
  var type: String { get }
5
+ var storageMode: String { get }
5
6
  var appIdentifier: [String] { get }
6
7
  var username: String { get }
7
8
  var keychainName: String { get }
@@ -16,7 +17,6 @@ protocol MatchfileProtocol: class {
16
17
  var skipConfirmation: Bool { get }
17
18
  var shallowClone: Bool { get }
18
19
  var cloneBranchDirectly: Bool { get }
19
- var workspace: String? { get }
20
20
  var forceForNewDevices: Bool { get }
21
21
  var skipDocs: Bool { get }
22
22
  var platform: String { get }
@@ -27,6 +27,7 @@ extension MatchfileProtocol {
27
27
  var gitUrl: String { return "" }
28
28
  var gitBranch: String { return "master" }
29
29
  var type: String { return "development" }
30
+ var storageMode: String { return "git" }
30
31
  var appIdentifier: [String] { return [] }
31
32
  var username: String { return "" }
32
33
  var keychainName: String { return "login.keychain" }
@@ -41,14 +42,12 @@ extension MatchfileProtocol {
41
42
  var skipConfirmation: Bool { return false }
42
43
  var shallowClone: Bool { return false }
43
44
  var cloneBranchDirectly: Bool { return false }
44
- var workspace: String? { return nil }
45
45
  var forceForNewDevices: Bool { return false }
46
46
  var skipDocs: Bool { return false }
47
47
  var platform: String { return "ios" }
48
48
  var templateName: String? { return nil }
49
49
  }
50
50
 
51
-
52
51
  // Please don't remove the lines below
53
52
  // They are used to detect outdated files
54
- // FastlaneRunnerAPIVersion [0.9.1]
53
+ // FastlaneRunnerAPIVersion [0.9.2]
@@ -18,4 +18,4 @@ class Precheckfile: PrecheckfileProtocol {
18
18
 
19
19
 
20
20
 
21
- // Generated with fastlane 2.105.2
21
+ // Generated with fastlane 2.106.0
@@ -18,4 +18,4 @@ class Scanfile: ScanfileProtocol {
18
18
 
19
19
 
20
20
 
21
- // Generated with fastlane 2.105.2
21
+ // Generated with fastlane 2.106.0
@@ -18,4 +18,4 @@ class Screengrabfile: ScreengrabfileProtocol {
18
18
 
19
19
 
20
20
 
21
- // Generated with fastlane 2.105.2
21
+ // Generated with fastlane 2.106.0
@@ -18,4 +18,4 @@ class Snapshotfile: SnapshotfileProtocol {
18
18
 
19
19
 
20
20
 
21
- // Generated with fastlane 2.105.2
21
+ // Generated with fastlane 2.106.0
@@ -10,7 +10,6 @@ require_relative 'fastlane_core/helper'
10
10
  require_relative 'fastlane_core/configuration/configuration'
11
11
  require_relative 'fastlane_core/update_checker/update_checker'
12
12
  require_relative 'fastlane_core/languages'
13
- require_relative 'fastlane_core/itunes_search_api'
14
13
  require_relative 'fastlane_core/cert_checker'
15
14
  require_relative 'fastlane_core/ipa_file_analyser'
16
15
  require_relative 'fastlane_core/itunes_transporter'
@@ -292,7 +292,7 @@ module FastlaneCore
292
292
  def copy_logarchive(device, log_identity, logs_destination_dir)
293
293
  require 'shellwords'
294
294
 
295
- logarchive_dst = Shellwords.escape(File.join(logs_destination_dir, "system_logs-#{log_identity}.logarchive"))
295
+ logarchive_dst = File.join(logs_destination_dir, "system_logs-#{log_identity}.logarchive").shellescape
296
296
  FileUtils.rm_rf(logarchive_dst)
297
297
  FileUtils.mkdir_p(File.expand_path("..", logarchive_dst))
298
298
  command = "xcrun simctl spawn #{device.udid} log collect --output #{logarchive_dst} 2>/dev/null"
@@ -72,7 +72,7 @@ module FastlaneCore
72
72
  # @return [boolean] true if building in a known CI environment
73
73
  def self.ci?
74
74
  # Check for Jenkins, Travis CI, ... environment variables
75
- ['JENKINS_HOME', 'JENKINS_URL', 'TRAVIS', 'CIRCLECI', 'CI', 'APPCENTER_BUILD_ID', 'TEAMCITY_VERSION', 'GO_PIPELINE_NAME', 'bamboo_buildKey', 'GITLAB_CI', 'XCS'].each do |current|
75
+ ['JENKINS_HOME', 'JENKINS_URL', 'TRAVIS', 'CIRCLECI', 'CI', 'APPCENTER_BUILD_ID', 'TEAMCITY_VERSION', 'GO_PIPELINE_NAME', 'bamboo_buildKey', 'GITLAB_CI', 'XCS', 'TF_BUILD'].each do |current|
76
76
  return true if ENV.key?(current)
77
77
  end
78
78
  return false
@@ -33,14 +33,6 @@ module FastlaneCore
33
33
  def execute(command, hide_output)
34
34
  return command if Helper.test?
35
35
 
36
- # Workaround because the traditional transporter broke on 1st March 2018
37
- # More information https://github.com/fastlane/fastlane/issues/11958
38
- # As there was no communication from Apple, we don't know if this is a temporary
39
- # server outage, or something they changed without giving a heads-up
40
- if ENV["DELIVER_ITMSTRANSPORTER_ADDITIONAL_UPLOAD_PARAMETERS"].to_s.length == 0
41
- ENV["DELIVER_ITMSTRANSPORTER_ADDITIONAL_UPLOAD_PARAMETERS"] = "-t DAV"
42
- end
43
-
44
36
  @errors = []
45
37
  @warnings = []
46
38
  @all_lines = []
@@ -151,6 +143,17 @@ module FastlaneCore
151
143
  end
152
144
  end
153
145
  end
146
+
147
+ def additional_upload_parameters
148
+ # Workaround because the traditional transporter broke on 1st March 2018
149
+ # More information https://github.com/fastlane/fastlane/issues/11958
150
+ # As there was no communication from Apple, we don't know if this is a temporary
151
+ # server outage, or something they changed without giving a heads-up
152
+ if ENV["DELIVER_ITMSTRANSPORTER_ADDITIONAL_UPLOAD_PARAMETERS"].to_s.length == 0
153
+ ENV["DELIVER_ITMSTRANSPORTER_ADDITIONAL_UPLOAD_PARAMETERS"] = "-t DAV"
154
+ end
155
+ return ENV["DELIVER_ITMSTRANSPORTER_ADDITIONAL_UPLOAD_PARAMETERS"]
156
+ end
154
157
  end
155
158
 
156
159
  # Generates commands and executes the iTMSTransporter through the shell script it provides by the same name
@@ -162,7 +165,7 @@ module FastlaneCore
162
165
  "-u \"#{username}\"",
163
166
  "-p #{shell_escaped_password(password)}",
164
167
  "-f \"#{source}\"",
165
- ENV["DELIVER_ITMSTRANSPORTER_ADDITIONAL_UPLOAD_PARAMETERS"], # that's here, because the user might overwrite the -t option
168
+ additional_upload_parameters, # that's here, because the user might overwrite the -t option
166
169
  "-t Signiant",
167
170
  "-k 100000",
168
171
  ("-WONoPause true" if Helper.windows?), # Windows only: process instantly returns instead of waiting for key press
@@ -236,7 +239,7 @@ module FastlaneCore
236
239
  "-u #{username.shellescape}",
237
240
  "-p #{password.shellescape}",
238
241
  "-f #{source.shellescape}",
239
- ENV["DELIVER_ITMSTRANSPORTER_ADDITIONAL_UPLOAD_PARAMETERS"], # that's here, because the user might overwrite the -t option
242
+ additional_upload_parameters, # that's here, because the user might overwrite the -t option
240
243
  '-t Signiant',
241
244
  '-k 100000',
242
245
  ("-itc_provider #{provider_short_name}" unless provider_short_name.to_s.empty?),
@@ -19,8 +19,9 @@ module Frameit
19
19
  self.screenshot = screenshot
20
20
  prepare_image
21
21
 
22
- if load_frame # Mac doesn't need a frame
23
- self.frame = MiniMagick::Image.open(load_frame)
22
+ frame = load_frame
23
+ if frame # Mac doesn't need a frame
24
+ self.frame = MiniMagick::Image.open(frame)
24
25
  # Rotate the frame according to the device orientation
25
26
  self.frame.rotate(self.rotation_for_device_orientation)
26
27
  elsif self.class == Editor
@@ -21,7 +21,7 @@ module Frameit
21
21
  files = JSON.parse(download_file("files.json"))
22
22
  files.each_with_index do |current, index|
23
23
  content = download_file(current, txt: "#{index + 1} of #{files.count} files")
24
- File.write(File.join(templates_path, current), content)
24
+ File.binwrite(File.join(templates_path, current), content)
25
25
  end
26
26
  File.write(File.join(templates_path, "offsets.json"), download_file("offsets.json"))
27
27
 
@@ -3,10 +3,10 @@ require_relative 'match/runner'
3
3
  require_relative 'match/nuke'
4
4
  require_relative 'match/utils'
5
5
  require_relative 'match/table_printer'
6
- require_relative 'match/git_helper'
7
6
  require_relative 'match/generator'
8
7
  require_relative 'match/setup'
9
- require_relative 'match/encrypt'
10
8
  require_relative 'match/spaceship_ensure'
11
9
  require_relative 'match/change_password'
10
+ require_relative 'match/storage'
11
+ require_relative 'match/encryption'
12
12
  require_relative 'match/module'
@@ -1,31 +1,44 @@
1
1
  require_relative 'module'
2
- require_relative 'encrypt'
3
- require_relative 'git_helper'
2
+
3
+ require_relative 'storage'
4
+ require_relative 'encryption'
4
5
 
5
6
  module Match
6
7
  # These functions should only be used while in (UI.) interactive mode
7
8
  class ChangePassword
8
- def self.update(params: nil, from: nil, to: nil)
9
+ def self.update(params: nil)
9
10
  ensure_ui_interactive
10
- to ||= ChangePassword.ask_password(message: "New passphrase for Git Repo: ", confirm: false)
11
- from ||= ChangePassword.ask_password(message: "Old passphrase for Git Repo: ", confirm: true)
12
- GitHelper.clear_changes
13
- workspace = GitHelper.clone(params[:git_url],
14
- params[:shallow_clone],
15
- manual_password: from,
16
- skip_docs: params[:skip_docs],
17
- branch: params[:git_branch],
18
- git_full_name: params[:git_full_name],
19
- git_user_email: params[:git_user_email],
20
- clone_branch_directly: params[:clone_branch_directly])
21
- Encrypt.new.clear_password(params[:git_url])
22
- Encrypt.new.store_password(params[:git_url], to)
11
+
12
+ to = ChangePassword.ask_password(message: "New passphrase for Git Repo: ", confirm: true)
13
+
14
+ # Choose the right storage and encryption implementations
15
+ storage = Storage.for_mode(params[:storage_mode], {
16
+ git_url: params[:git_url],
17
+ shallow_clone: params[:shallow_clone],
18
+ skip_docs: params[:skip_docs],
19
+ git_branch: params[:git_branch],
20
+ git_full_name: params[:git_full_name],
21
+ git_user_email: params[:git_user_email],
22
+ clone_branch_directly: params[:clone_branch_directly]
23
+ })
24
+ storage.download
25
+
26
+ encryption = Encryption.for_storage_mode(params[:storage_mode], {
27
+ git_url: params[:git_url],
28
+ working_directory: storage.working_directory
29
+ })
30
+ encryption.decrypt_files
31
+
32
+ encryption.clear_password
33
+ encryption.store_password(to)
23
34
 
24
35
  message = "[fastlane] Changed passphrase"
25
- GitHelper.commit_changes(workspace, message, params[:git_url], params[:git_branch])
36
+ encryption.encrypt_files
37
+ storage.save_changes!(custom_message: message)
26
38
  end
27
39
 
28
- def self.ask_password(message: "Passphrase for Git Repo: ", confirm: true)
40
+ # This method is called from both here, and from `openssl.rb`
41
+ def self.ask_password(message: "Passphrase for Git Repo: ", confirm: nil)
29
42
  ensure_ui_interactive
30
43
  loop do
31
44
  password = UI.password(message)