fastlane 2.173.0 → 2.194.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (391) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE +1 -1
  3. data/README.md +105 -85
  4. data/cert/lib/cert/commands_generator.rb +2 -1
  5. data/cert/lib/cert/options.rb +4 -3
  6. data/cert/lib/cert/runner.rb +7 -7
  7. data/deliver/lib/assets/summary.html.erb +10 -10
  8. data/deliver/lib/deliver/app_screenshot.rb +8 -3
  9. data/deliver/lib/deliver/app_screenshot_iterator.rb +2 -2
  10. data/deliver/lib/deliver/commands_generator.rb +3 -2
  11. data/deliver/lib/deliver/detect_values.rb +5 -3
  12. data/deliver/lib/deliver/download_screenshots.rb +2 -3
  13. data/deliver/lib/deliver/html_generator.rb +2 -2
  14. data/deliver/lib/deliver/languages.rb +1 -1
  15. data/deliver/lib/deliver/loader.rb +1 -1
  16. data/deliver/lib/deliver/module.rb +6 -0
  17. data/deliver/lib/deliver/options.rb +48 -56
  18. data/deliver/lib/deliver/runner.rb +28 -15
  19. data/deliver/lib/deliver/screenshot_comparable.rb +62 -0
  20. data/deliver/lib/deliver/setup.rb +1 -2
  21. data/deliver/lib/deliver/submit_for_review.rb +4 -4
  22. data/deliver/lib/deliver/sync_screenshots.rb +200 -0
  23. data/deliver/lib/deliver/upload_metadata.rb +26 -11
  24. data/deliver/lib/deliver/upload_price_tier.rb +1 -1
  25. data/deliver/lib/deliver/upload_screenshots.rb +13 -12
  26. data/fastlane/lib/assets/completions/completion.bash +4 -1
  27. data/fastlane/lib/assets/completions/completion.zsh +6 -5
  28. data/{spaceship/lib/spaceship/connect_api/models/.app_store_version_submission.rb.swp → fastlane/lib/fastlane/actions/.notarize.rb.swp} +0 -0
  29. data/fastlane/lib/fastlane/actions/actions_helper.rb +2 -2
  30. data/fastlane/lib/fastlane/actions/adb.rb +2 -5
  31. data/fastlane/lib/fastlane/actions/adb_devices.rb +0 -1
  32. data/fastlane/lib/fastlane/actions/add_git_tag.rb +4 -4
  33. data/fastlane/lib/fastlane/actions/app_store_build_number.rb +18 -18
  34. data/fastlane/lib/fastlane/actions/app_store_connect_api_key.rb +21 -7
  35. data/fastlane/lib/fastlane/actions/appaloosa.rb +7 -2
  36. data/fastlane/lib/fastlane/actions/appetize.rb +13 -8
  37. data/fastlane/lib/fastlane/actions/appetize_viewing_url_generator.rb +0 -11
  38. data/fastlane/lib/fastlane/actions/appium.rb +40 -65
  39. data/fastlane/lib/fastlane/actions/appledoc.rb +45 -45
  40. data/fastlane/lib/fastlane/actions/apteligent.rb +3 -2
  41. data/fastlane/lib/fastlane/actions/artifactory.rb +5 -6
  42. data/fastlane/lib/fastlane/actions/automatic_code_signing.rb +7 -13
  43. data/fastlane/lib/fastlane/actions/backup_file.rb +1 -1
  44. data/fastlane/lib/fastlane/actions/backup_xcarchive.rb +3 -3
  45. data/fastlane/lib/fastlane/actions/badge.rb +9 -13
  46. data/fastlane/lib/fastlane/actions/build_and_upload_to_appetize.rb +11 -5
  47. data/fastlane/lib/fastlane/actions/build_app.rb +4 -0
  48. data/fastlane/lib/fastlane/actions/bundle_install.rb +21 -11
  49. data/fastlane/lib/fastlane/actions/carthage.rb +22 -14
  50. data/fastlane/lib/fastlane/actions/changelog_from_git_commits.rb +8 -17
  51. data/fastlane/lib/fastlane/actions/chatwork.rb +3 -2
  52. data/fastlane/lib/fastlane/actions/check_app_store_metadata.rb +9 -1
  53. data/fastlane/lib/fastlane/actions/clean_build_artifacts.rb +0 -1
  54. data/fastlane/lib/fastlane/actions/clean_cocoapods_cache.rb +25 -2
  55. data/fastlane/lib/fastlane/actions/clipboard.rb +3 -6
  56. data/fastlane/lib/fastlane/actions/cloc.rb +9 -13
  57. data/fastlane/lib/fastlane/actions/cocoapods.rb +23 -15
  58. data/fastlane/lib/fastlane/actions/commit_github_file.rb +12 -4
  59. data/fastlane/lib/fastlane/actions/commit_version_bump.rb +6 -7
  60. data/fastlane/lib/fastlane/actions/copy_artifacts.rb +3 -4
  61. data/fastlane/lib/fastlane/actions/crashlytics.rb +7 -11
  62. data/fastlane/lib/fastlane/actions/create_app_on_managed_play_store.rb +70 -76
  63. data/fastlane/lib/fastlane/actions/create_keychain.rb +13 -11
  64. data/fastlane/lib/fastlane/actions/create_pull_request.rb +0 -9
  65. data/fastlane/lib/fastlane/actions/create_xcframework.rb +102 -17
  66. data/fastlane/lib/fastlane/actions/danger.rb +13 -12
  67. data/fastlane/lib/fastlane/actions/deploygate.rb +1 -2
  68. data/fastlane/lib/fastlane/actions/docs/build_app.md +1 -1
  69. data/fastlane/lib/fastlane/actions/docs/capture_android_screenshots.md +29 -30
  70. data/fastlane/lib/fastlane/actions/docs/capture_ios_screenshots.md +3 -3
  71. data/fastlane/lib/fastlane/actions/docs/create_app_online.md +171 -67
  72. data/fastlane/lib/fastlane/actions/docs/frame_screenshots.md +19 -2
  73. data/fastlane/lib/fastlane/actions/docs/sync_code_signing.md +8 -2
  74. data/fastlane/lib/fastlane/actions/docs/upload_to_app_store.md.erb +37 -18
  75. data/fastlane/lib/fastlane/actions/docs/upload_to_play_store.md +2 -1
  76. data/fastlane/lib/fastlane/actions/docs/upload_to_testflight.md +10 -4
  77. data/fastlane/lib/fastlane/actions/download_app_privacy_details_from_app_store.rb +1 -1
  78. data/fastlane/lib/fastlane/actions/download_dsyms.rb +8 -19
  79. data/fastlane/lib/fastlane/actions/dsym_zip.rb +1 -1
  80. data/fastlane/lib/fastlane/actions/ensure_env_vars.rb +2 -6
  81. data/fastlane/lib/fastlane/actions/ensure_git_branch.rb +0 -1
  82. data/fastlane/lib/fastlane/actions/ensure_git_status_clean.rb +3 -4
  83. data/fastlane/lib/fastlane/actions/ensure_no_debug_code.rb +3 -5
  84. data/fastlane/lib/fastlane/actions/ensure_xcode_version.rb +1 -2
  85. data/fastlane/lib/fastlane/actions/environment_variable.rb +13 -21
  86. data/fastlane/lib/fastlane/actions/erb.rb +2 -5
  87. data/fastlane/lib/fastlane/actions/get_build_number_repository.rb +1 -1
  88. data/fastlane/lib/fastlane/actions/get_certificates.rb +5 -1
  89. data/fastlane/lib/fastlane/actions/get_github_release.rb +11 -1
  90. data/fastlane/lib/fastlane/actions/get_ipa_info_plist_value.rb +0 -1
  91. data/fastlane/lib/fastlane/actions/get_managed_play_store_publishing_rights.rb +32 -35
  92. data/fastlane/lib/fastlane/actions/get_provisioning_profile.rb +10 -2
  93. data/fastlane/lib/fastlane/actions/get_push_certificate.rb +1 -1
  94. data/fastlane/lib/fastlane/actions/get_version_number.rb +17 -10
  95. data/fastlane/lib/fastlane/actions/git_add.rb +5 -10
  96. data/fastlane/lib/fastlane/actions/git_branch.rb +4 -10
  97. data/fastlane/lib/fastlane/actions/git_commit.rb +6 -8
  98. data/fastlane/lib/fastlane/actions/git_pull.rb +4 -10
  99. data/fastlane/lib/fastlane/actions/git_remote_branch.rb +57 -0
  100. data/fastlane/lib/fastlane/actions/git_submodule_update.rb +16 -8
  101. data/fastlane/lib/fastlane/actions/git_tag_exists.rb +4 -0
  102. data/fastlane/lib/fastlane/actions/github_api.rb +4 -6
  103. data/fastlane/lib/fastlane/actions/gradle.rb +13 -21
  104. data/fastlane/lib/fastlane/actions/hg_commit_version_bump.rb +1 -1
  105. data/fastlane/lib/fastlane/actions/hg_push.rb +1 -1
  106. data/fastlane/lib/fastlane/actions/hipchat.rb +6 -6
  107. data/fastlane/lib/fastlane/actions/hockey.rb +5 -12
  108. data/fastlane/lib/fastlane/actions/ifttt.rb +3 -6
  109. data/fastlane/lib/fastlane/actions/import_from_git.rb +7 -9
  110. data/fastlane/lib/fastlane/actions/increment_build_number.rb +8 -2
  111. data/fastlane/lib/fastlane/actions/install_on_device.rb +3 -6
  112. data/fastlane/lib/fastlane/actions/install_provisioning_profile.rb +4 -0
  113. data/fastlane/lib/fastlane/actions/installr.rb +22 -25
  114. data/fastlane/lib/fastlane/actions/ipa.rb +2 -2
  115. data/fastlane/lib/fastlane/actions/jazzy.rb +11 -8
  116. data/fastlane/lib/fastlane/actions/jira.rb +61 -14
  117. data/fastlane/lib/fastlane/actions/latest_testflight_build_number.rb +7 -7
  118. data/fastlane/lib/fastlane/actions/lcov.rb +0 -4
  119. data/fastlane/lib/fastlane/actions/mailgun.rb +21 -27
  120. data/fastlane/lib/fastlane/actions/make_changelog_from_jenkins.rb +1 -1
  121. data/fastlane/lib/fastlane/actions/match_nuke.rb +59 -0
  122. data/fastlane/lib/fastlane/actions/modify_services.rb +59 -24
  123. data/fastlane/lib/fastlane/actions/nexus_upload.rb +2 -2
  124. data/fastlane/lib/fastlane/actions/notarize.rb +181 -52
  125. data/fastlane/lib/fastlane/actions/notification.rb +1 -1
  126. data/fastlane/lib/fastlane/actions/number_of_commits.rb +1 -1
  127. data/fastlane/lib/fastlane/actions/oclint.rb +15 -14
  128. data/fastlane/lib/fastlane/actions/pod_push.rb +0 -2
  129. data/fastlane/lib/fastlane/actions/podio_item.rb +0 -7
  130. data/fastlane/lib/fastlane/actions/prompt.rb +3 -4
  131. data/fastlane/lib/fastlane/actions/push_git_tags.rb +2 -2
  132. data/fastlane/lib/fastlane/actions/push_to_git_remote.rb +6 -3
  133. data/fastlane/lib/fastlane/actions/puts.rb +1 -2
  134. data/fastlane/lib/fastlane/actions/register_device.rb +10 -13
  135. data/fastlane/lib/fastlane/actions/register_devices.rb +10 -14
  136. data/fastlane/lib/fastlane/actions/reset_git_repo.rb +5 -8
  137. data/fastlane/lib/fastlane/actions/reset_simulator_contents.rb +0 -2
  138. data/fastlane/lib/fastlane/actions/resign.rb +2 -9
  139. data/fastlane/lib/fastlane/actions/restore_file.rb +1 -1
  140. data/fastlane/lib/fastlane/actions/rsync.rb +3 -6
  141. data/fastlane/lib/fastlane/actions/run_tests.rb +1 -1
  142. data/fastlane/lib/fastlane/actions/s3.rb +1 -1
  143. data/fastlane/lib/fastlane/actions/say.rb +2 -3
  144. data/fastlane/lib/fastlane/actions/scp.rb +4 -10
  145. data/fastlane/lib/fastlane/actions/set_build_number_repository.rb +1 -1
  146. data/fastlane/lib/fastlane/actions/set_changelog.rb +11 -14
  147. data/fastlane/lib/fastlane/actions/set_github_release.rb +2 -8
  148. data/fastlane/lib/fastlane/actions/set_info_plist_value.rb +1 -1
  149. data/fastlane/lib/fastlane/actions/set_pod_key.rb +3 -4
  150. data/fastlane/lib/fastlane/actions/setup_ci.rb +1 -2
  151. data/fastlane/lib/fastlane/actions/setup_circle_ci.rb +1 -1
  152. data/fastlane/lib/fastlane/actions/setup_jenkins.rb +7 -12
  153. data/fastlane/lib/fastlane/actions/setup_travis.rb +1 -1
  154. data/fastlane/lib/fastlane/actions/sh.rb +2 -4
  155. data/fastlane/lib/fastlane/actions/slack.rb +161 -141
  156. data/fastlane/lib/fastlane/actions/slather.rb +9 -19
  157. data/fastlane/lib/fastlane/actions/sonar.rb +12 -19
  158. data/fastlane/lib/fastlane/actions/sourcedocs.rb +128 -0
  159. data/fastlane/lib/fastlane/actions/spaceship_logs.rb +1 -1
  160. data/fastlane/lib/fastlane/actions/splunkmint.rb +2 -2
  161. data/fastlane/lib/fastlane/actions/spm.rb +3 -3
  162. data/fastlane/lib/fastlane/actions/ssh.rb +5 -10
  163. data/fastlane/lib/fastlane/actions/swiftlint.rb +18 -16
  164. data/fastlane/lib/fastlane/actions/sync_code_signing.rb +7 -2
  165. data/fastlane/lib/fastlane/actions/testfairy.rb +0 -1
  166. data/fastlane/lib/fastlane/actions/tryouts.rb +2 -3
  167. data/fastlane/lib/fastlane/actions/twitter.rb +0 -5
  168. data/fastlane/lib/fastlane/actions/unlock_keychain.rb +3 -3
  169. data/fastlane/lib/fastlane/actions/update_app_group_identifiers.rb +1 -4
  170. data/fastlane/lib/fastlane/actions/update_code_signing_settings.rb +8 -15
  171. data/fastlane/lib/fastlane/actions/update_fastlane.rb +2 -2
  172. data/fastlane/lib/fastlane/actions/update_icloud_container_identifiers.rb +1 -4
  173. data/fastlane/lib/fastlane/actions/update_info_plist.rb +1 -1
  174. data/fastlane/lib/fastlane/actions/update_keychain_access_groups.rb +1 -4
  175. data/fastlane/lib/fastlane/actions/update_plist.rb +1 -1
  176. data/fastlane/lib/fastlane/actions/update_project_provisioning.rb +3 -4
  177. data/fastlane/lib/fastlane/actions/update_urban_airship_configuration.rb +0 -1
  178. data/fastlane/lib/fastlane/actions/update_url_schemes.rb +15 -26
  179. data/fastlane/lib/fastlane/actions/upload_app_privacy_details_to_app_store.rb +1 -2
  180. data/fastlane/lib/fastlane/actions/upload_symbols_to_crashlytics.rb +8 -7
  181. data/fastlane/lib/fastlane/actions/upload_symbols_to_sentry.rb +3 -10
  182. data/fastlane/lib/fastlane/actions/upload_to_app_store.rb +5 -1
  183. data/fastlane/lib/fastlane/actions/upload_to_testflight.rb +10 -3
  184. data/fastlane/lib/fastlane/actions/validate_play_store_json_key.rb +40 -44
  185. data/fastlane/lib/fastlane/actions/version_get_podspec.rb +1 -2
  186. data/fastlane/lib/fastlane/actions/xcode_server_get_assets.rb +3 -3
  187. data/fastlane/lib/fastlane/actions/xcodebuild.rb +5 -5
  188. data/fastlane/lib/fastlane/actions/zip.rb +86 -21
  189. data/fastlane/lib/fastlane/cli_tools_distributor.rb +1 -1
  190. data/fastlane/lib/fastlane/commands_generator.rb +2 -1
  191. data/fastlane/lib/fastlane/documentation/actions_list.rb +2 -2
  192. data/fastlane/lib/fastlane/documentation/docs_generator.rb +1 -1
  193. data/fastlane/lib/fastlane/documentation/markdown_docs_generator.rb +12 -6
  194. data/fastlane/lib/fastlane/environment_printer.rb +1 -0
  195. data/fastlane/lib/fastlane/erb_template_helper.rb +7 -1
  196. data/fastlane/lib/fastlane/fast_file.rb +19 -7
  197. data/fastlane/lib/fastlane/fastlane_require.rb +7 -1
  198. data/fastlane/lib/fastlane/features.rb +3 -0
  199. data/fastlane/lib/fastlane/helper/adb_helper.rb +1 -1
  200. data/fastlane/lib/fastlane/helper/crashlytics_helper.rb +4 -4
  201. data/fastlane/lib/fastlane/helper/gem_helper.rb +2 -2
  202. data/fastlane/lib/fastlane/helper/git_helper.rb +34 -5
  203. data/fastlane/lib/fastlane/lane_manager.rb +3 -2
  204. data/fastlane/lib/fastlane/notification/slack.rb +56 -0
  205. data/fastlane/lib/fastlane/plugins/plugin_fetcher.rb +1 -2
  206. data/fastlane/lib/fastlane/plugins/plugin_info.rb +2 -2
  207. data/fastlane/lib/fastlane/plugins/plugin_info_collector.rb +1 -2
  208. data/fastlane/lib/fastlane/plugins/plugin_manager.rb +2 -3
  209. data/fastlane/lib/fastlane/plugins/template/%gem_name%.gemspec.erb +7 -6
  210. data/fastlane/lib/fastlane/plugins/template/.circleci/config.yml +1 -1
  211. data/fastlane/lib/fastlane/plugins/template/.github/workflows/test.yml +1 -1
  212. data/fastlane/lib/fastlane/plugins/template/.rubocop.yml +30 -35
  213. data/fastlane/lib/fastlane/plugins/template/spec/spec_helper.rb.erb +1 -1
  214. data/fastlane/lib/fastlane/setup/setup.rb +23 -10
  215. data/fastlane/lib/fastlane/setup/setup_ios.rb +3 -3
  216. data/fastlane/lib/fastlane/swift_fastlane_function.rb +43 -15
  217. data/fastlane/lib/fastlane/swift_runner_upgrader.rb +2 -0
  218. data/fastlane/lib/fastlane/version.rb +2 -2
  219. data/fastlane/swift/Actions.swift +1 -1
  220. data/fastlane/swift/Appfile.swift +1 -1
  221. data/fastlane/swift/ArgumentProcessor.swift +1 -1
  222. data/fastlane/swift/ControlCommand.swift +1 -1
  223. data/fastlane/swift/Deliverfile.swift +1 -1
  224. data/fastlane/swift/DeliverfileProtocol.swift +27 -23
  225. data/fastlane/swift/Fastlane.swift +7993 -4352
  226. data/fastlane/swift/FastlaneSwiftRunner/FastlaneSwiftRunner.xcodeproj/project.pbxproj +4 -0
  227. data/fastlane/swift/Gymfile.swift +1 -1
  228. data/fastlane/swift/GymfileProtocol.swift +1 -1
  229. data/fastlane/swift/LaneFileProtocol.swift +10 -4
  230. data/fastlane/swift/MainProcess.swift +1 -1
  231. data/fastlane/swift/Matchfile.swift +1 -1
  232. data/fastlane/swift/MatchfileProtocol.swift +3 -3
  233. data/fastlane/swift/OptionalConfigValue.swift +101 -0
  234. data/fastlane/swift/Plugins.swift +1 -1
  235. data/fastlane/swift/Precheckfile.swift +1 -1
  236. data/fastlane/swift/PrecheckfileProtocol.swift +4 -4
  237. data/fastlane/swift/RubyCommand.swift +2 -2
  238. data/fastlane/swift/RubyCommandable.swift +1 -1
  239. data/fastlane/swift/Runner.swift +2 -2
  240. data/fastlane/swift/RunnerArgument.swift +1 -1
  241. data/fastlane/swift/Scanfile.swift +1 -1
  242. data/fastlane/swift/ScanfileProtocol.swift +17 -1
  243. data/fastlane/swift/Screengrabfile.swift +1 -1
  244. data/fastlane/swift/ScreengrabfileProtocol.swift +4 -4
  245. data/fastlane/swift/Snapshotfile.swift +1 -1
  246. data/fastlane/swift/SnapshotfileProtocol.swift +5 -1
  247. data/fastlane/swift/SocketClient.swift +3 -2
  248. data/fastlane/swift/SocketClientDelegateProtocol.swift +1 -1
  249. data/fastlane/swift/SocketResponse.swift +5 -3
  250. data/fastlane/swift/formatting/Brewfile.lock.json +37 -21
  251. data/fastlane/swift/main.swift +1 -1
  252. data/fastlane/swift/upgrade_manifest.json +1 -1
  253. data/fastlane_core/lib/fastlane_core/build_watcher.rb +113 -17
  254. data/fastlane_core/lib/fastlane_core/clipboard.rb +20 -0
  255. data/fastlane_core/lib/fastlane_core/command_executor.rb +3 -9
  256. data/fastlane_core/lib/fastlane_core/configuration/commander_generator.rb +6 -1
  257. data/fastlane_core/lib/fastlane_core/configuration/config_item.rb +41 -3
  258. data/fastlane_core/lib/fastlane_core/configuration/configuration.rb +14 -8
  259. data/fastlane_core/lib/fastlane_core/device_manager.rb +1 -1
  260. data/fastlane_core/lib/fastlane_core/helper.rb +66 -10
  261. data/fastlane_core/lib/fastlane_core/ipa_upload_package_builder.rb +3 -2
  262. data/fastlane_core/lib/fastlane_core/itunes_transporter.rb +14 -8
  263. data/fastlane_core/lib/fastlane_core/keychain_importer.rb +12 -5
  264. data/fastlane_core/lib/fastlane_core/languages.rb +2 -2
  265. data/fastlane_core/lib/fastlane_core/pkg_file_analyser.rb +5 -0
  266. data/fastlane_core/lib/fastlane_core/pkg_upload_package_builder.rb +3 -2
  267. data/fastlane_core/lib/fastlane_core/print_table.rb +5 -3
  268. data/fastlane_core/lib/fastlane_core/project.rb +30 -23
  269. data/{deliver/lib/deliver → fastlane_core/lib/fastlane_core}/queue_worker.rb +4 -4
  270. data/fastlane_core/lib/fastlane_core/swag.rb +1 -1
  271. data/fastlane_core/lib/fastlane_core/ui/disable_colors.rb +1 -0
  272. data/fastlane_core/lib/fastlane_core/ui/fastlane_runner.rb +41 -0
  273. data/fastlane_core/lib/fastlane_core/ui/help.erb +35 -0
  274. data/fastlane_core/lib/fastlane_core/ui/help_formatter.rb +16 -0
  275. data/fastlane_core/lib/fastlane_core/ui/implementations/shell.rb +16 -2
  276. data/fastlane_core/lib/fastlane_core/ui/interface.rb +1 -1
  277. data/fastlane_core/lib/fastlane_core/update_checker/update_checker.rb +2 -2
  278. data/fastlane_core/lib/fastlane_core.rb +22 -20
  279. data/frameit/lib/frameit/commands_generator.rb +2 -1
  280. data/frameit/lib/frameit/config_parser.rb +2 -2
  281. data/frameit/lib/frameit/frame_downloader.rb +2 -1
  282. data/gym/lib/gym/code_signing_mapping.rb +2 -2
  283. data/gym/lib/gym/commands_generator.rb +2 -1
  284. data/gym/lib/gym/generators/package_command_generator.rb +4 -0
  285. data/gym/lib/gym/generators/package_command_generator_xcode7.rb +19 -13
  286. data/gym/lib/gym/runner.rb +15 -4
  287. data/match/lib/match/change_password.rb +3 -3
  288. data/match/lib/match/commands_generator.rb +2 -1
  289. data/match/lib/match/encryption/interface.rb +1 -1
  290. data/match/lib/match/encryption/openssl.rb +2 -2
  291. data/match/lib/match/importer.rb +9 -10
  292. data/match/lib/match/migrate.rb +2 -3
  293. data/match/lib/match/module.rb +1 -0
  294. data/match/lib/match/nuke.rb +10 -10
  295. data/match/lib/match/options.rb +5 -4
  296. data/match/lib/match/runner.rb +12 -12
  297. data/match/lib/match/spaceship_ensure.rb +3 -0
  298. data/match/lib/match/storage/google_cloud_storage.rb +2 -2
  299. data/match/lib/match/storage/s3_storage.rb +2 -2
  300. data/pem/lib/pem/commands_generator.rb +2 -1
  301. data/pilot/lib/pilot/build_manager.rb +45 -15
  302. data/pilot/lib/pilot/commands_generator.rb +2 -1
  303. data/pilot/lib/pilot/manager.rb +14 -9
  304. data/pilot/lib/pilot/options.rb +39 -11
  305. data/pilot/lib/pilot/tester_exporter.rb +0 -1
  306. data/pilot/lib/pilot/tester_manager.rb +0 -1
  307. data/pilot/lib/pilot.rb +0 -1
  308. data/precheck/lib/precheck/commands_generator.rb +2 -1
  309. data/precheck/lib/precheck/module.rb +2 -0
  310. data/precheck/lib/precheck/options.rb +7 -6
  311. data/precheck/lib/precheck/runner.rb +13 -8
  312. data/produce/lib/produce/commands_generator.rb +129 -28
  313. data/produce/lib/produce/developer_center.rb +42 -4
  314. data/produce/lib/produce/options.rb +1 -1
  315. data/produce/lib/produce/service.rb +285 -179
  316. data/scan/lib/scan/commands_generator.rb +2 -1
  317. data/scan/lib/scan/detect_values.rb +26 -14
  318. data/scan/lib/scan/module.rb +1 -0
  319. data/scan/lib/scan/options.rb +32 -6
  320. data/scan/lib/scan/runner.rb +81 -1
  321. data/scan/lib/scan/test_command_generator.rb +37 -12
  322. data/scan/lib/scan/xcpretty_reporter_options_generator.rb +1 -1
  323. data/screengrab/lib/screengrab/android_environment.rb +5 -53
  324. data/screengrab/lib/screengrab/commands_generator.rb +2 -1
  325. data/screengrab/lib/screengrab/dependency_checker.rb +0 -20
  326. data/screengrab/lib/screengrab/options.rb +5 -2
  327. data/screengrab/lib/screengrab/runner.rb +110 -109
  328. data/sigh/lib/assets/resign.sh +81 -61
  329. data/sigh/lib/sigh/commands_generator.rb +2 -1
  330. data/sigh/lib/sigh/download_all.rb +4 -8
  331. data/sigh/lib/sigh/options.rb +6 -4
  332. data/sigh/lib/sigh/runner.rb +8 -8
  333. data/snapshot/lib/assets/SnapfileTemplate +3 -2
  334. data/snapshot/lib/assets/SnapfileTemplate.swift +2 -1
  335. data/snapshot/lib/assets/SnapshotHelper.swift +14 -10
  336. data/snapshot/lib/snapshot/commands_generator.rb +3 -1
  337. data/snapshot/lib/snapshot/options.rb +5 -0
  338. data/snapshot/lib/snapshot/reports_generator.rb +7 -1
  339. data/snapshot/lib/snapshot/simulator_launchers/launcher_configuration.rb +2 -0
  340. data/snapshot/lib/snapshot/simulator_launchers/simulator_launcher.rb +1 -1
  341. data/snapshot/lib/snapshot/simulator_launchers/simulator_launcher_base.rb +12 -6
  342. data/snapshot/lib/snapshot/test_command_generator.rb +17 -3
  343. data/spaceship/README.md +4 -14
  344. data/spaceship/lib/spaceship/base.rb +2 -2
  345. data/spaceship/lib/spaceship/client.rb +37 -20
  346. data/spaceship/lib/spaceship/commands_generator.rb +4 -2
  347. data/spaceship/lib/spaceship/connect_api/api_client.rb +80 -8
  348. data/spaceship/lib/spaceship/connect_api/model.rb +1 -1
  349. data/spaceship/lib/spaceship/connect_api/models/age_rating_declaration.rb +36 -4
  350. data/spaceship/lib/spaceship/connect_api/models/app.rb +10 -2
  351. data/spaceship/lib/spaceship/connect_api/models/app_info.rb +10 -0
  352. data/spaceship/lib/spaceship/connect_api/models/app_preview_set.rb +5 -0
  353. data/spaceship/lib/spaceship/connect_api/models/app_screenshot.rb +1 -1
  354. data/spaceship/lib/spaceship/connect_api/models/app_screenshot_set.rb +5 -0
  355. data/spaceship/lib/spaceship/connect_api/models/app_store_version.rb +2 -3
  356. data/spaceship/lib/spaceship/connect_api/models/app_store_version_localization.rb +6 -0
  357. data/spaceship/lib/spaceship/connect_api/models/beta_group.rb +8 -1
  358. data/spaceship/lib/spaceship/connect_api/models/beta_tester.rb +3 -1
  359. data/spaceship/lib/spaceship/connect_api/models/build.rb +14 -1
  360. data/spaceship/lib/spaceship/connect_api/models/build_beta_detail.rb +8 -0
  361. data/spaceship/lib/spaceship/connect_api/models/bundle_id.rb +32 -0
  362. data/spaceship/lib/spaceship/connect_api/models/bundle_id_capability.rb +84 -21
  363. data/spaceship/lib/spaceship/connect_api/models/capabilities.rb +27 -0
  364. data/spaceship/lib/spaceship/connect_api/models/profile.rb +6 -0
  365. data/spaceship/lib/spaceship/connect_api/models/user.rb +17 -3
  366. data/spaceship/lib/spaceship/connect_api/models/user_invitation.rb +37 -3
  367. data/spaceship/lib/spaceship/connect_api/provisioning/provisioning.rb +104 -2
  368. data/spaceship/lib/spaceship/connect_api/testflight/client.rb +3 -0
  369. data/spaceship/lib/spaceship/connect_api/testflight/testflight.rb +72 -5
  370. data/spaceship/lib/spaceship/connect_api/token.rb +19 -4
  371. data/spaceship/lib/spaceship/connect_api/tunes/client.rb +3 -0
  372. data/spaceship/lib/spaceship/connect_api/tunes/tunes.rb +19 -2
  373. data/spaceship/lib/spaceship/connect_api/users/client.rb +3 -0
  374. data/spaceship/lib/spaceship/connect_api/users/users.rb +58 -3
  375. data/spaceship/lib/spaceship/connect_api.rb +1 -0
  376. data/spaceship/lib/spaceship/playground.rb +2 -2
  377. data/spaceship/lib/spaceship/spaceauth_runner.rb +38 -15
  378. data/spaceship/lib/spaceship/tunes/members.rb +1 -1
  379. data/spaceship/lib/spaceship/tunes/tunes_client.rb +5 -2
  380. data/spaceship/lib/spaceship/two_step_or_factor_client.rb +42 -29
  381. data/spaceship/lib/spaceship/ui.rb +2 -2
  382. data/supply/lib/supply/client.rb +45 -4
  383. data/supply/lib/supply/commands_generator.rb +2 -1
  384. data/supply/lib/supply/options.rb +14 -2
  385. data/supply/lib/supply/uploader.rb +13 -9
  386. metadata +119 -98
  387. data/fastlane/lib/fastlane/.erb_template_helper.rb.swp +0 -0
  388. data/fastlane/lib/fastlane/actions/.git_commit.rb.swp +0 -0
  389. data/pilot/lib/pilot/features.rb +0 -0
  390. data/pilot/lib/pilot/tester_util.rb +0 -0
  391. data/spaceship/lib/spaceship/.DS_Store +0 -0
@@ -75,6 +75,11 @@
75
75
  # new features August 2020
76
76
  # 1. fixes usage for users with GNU-sed in their $PATH
77
77
  #
78
+ # new features May 2021
79
+ # 1. fix entitlements merging when changing team
80
+ #
81
+ # new features June 2021
82
+ # 1. fix the way app entitlements are extracted
78
83
 
79
84
  # Logging functions
80
85
 
@@ -346,7 +351,7 @@ function provision_for_bundle_id {
346
351
  }
347
352
 
348
353
  # Find the bundle identifier contained inside a provisioning profile
349
- function bundle_id_for_provison {
354
+ function bundle_id_for_provision {
350
355
 
351
356
  local FULL_BUNDLE_ID=$(PlistBuddy -c 'Print :Entitlements:application-identifier' /dev/stdin <<< "$(security cms -D -i "$1")")
352
357
  checkStatus
@@ -384,7 +389,7 @@ function add_provision {
384
389
  error "Provisioning profile '$PROVISION' file does not exist"
385
390
  fi
386
391
 
387
- local BUNDLE_ID=$(bundle_id_for_provison "$PROVISION")
392
+ local BUNDLE_ID=$(bundle_id_for_provision "$PROVISION")
388
393
  add_provision_for_bundle_id "$PROVISION" "$BUNDLE_ID"
389
394
  }
390
395
 
@@ -434,7 +439,7 @@ function resign {
434
439
  error "Use the -p option (example: -p com.example.app=xxxx.mobileprovision)"
435
440
  fi
436
441
 
437
- local PROVISION_BUNDLE_IDENTIFIER=$(bundle_id_for_provison "$NEW_PROVISION")
442
+ local PROVISION_BUNDLE_IDENTIFIER=$(bundle_id_for_provision "$NEW_PROVISION")
438
443
 
439
444
  # Use provisioning profile's bundle identifier
440
445
  if [ "$BUNDLE_IDENTIFIER" == "" ]; then
@@ -580,7 +585,7 @@ function resign {
580
585
  # Found a reference bundle id, now get the corresponding provisioning profile for this bundle id
581
586
  REF_PROVISION=$(provision_for_bundle_id "$REF_BUNDLE_ID")
582
587
  # Map to the new bundle id
583
- NEW_REF_BUNDLE_ID=$(bundle_id_for_provison "$REF_PROVISION")
588
+ NEW_REF_BUNDLE_ID=$(bundle_id_for_provision "$REF_PROVISION")
584
589
  # Change if not the same and if doesn't contain wildcard
585
590
  # shellcheck disable=SC2049
586
591
  if [[ "$REF_BUNDLE_ID" != "$NEW_REF_BUNDLE_ID" ]] && ! [[ "$NEW_REF_BUNDLE_ID" =~ \* ]]; then
@@ -636,6 +641,20 @@ function resign {
636
641
  log "\nApp entitlements for ${APP_PATH}:"
637
642
  log "$(cat "$APP_ENTITLEMENTS")"
638
643
 
644
+ # Get the old and new app identifier (prefix)
645
+ APP_ID_KEY="application-identifier"
646
+ # Extract just the identifier from the value
647
+ # Use the fact that we are after some identifier, which is always at the start of the string
648
+ OLD_APP_ID=$(PlistBuddy -c "Print $APP_ID_KEY" "$APP_ENTITLEMENTS" | grep -E '^[A-Z0-9]*' -o | tr -d '\n')
649
+ NEW_APP_ID=$(PlistBuddy -c "Print $APP_ID_KEY" "$PROFILE_ENTITLEMENTS" | grep -E '^[A-Z0-9]*' -o | tr -d '\n')
650
+
651
+ # Get the old and the new team ID
652
+ # Old team ID is not part of app entitlements, have to get it from old embedded provisioning profile
653
+ security cms -D -i "$TEMP_DIR/old-embedded.mobileprovision" > "$TEMP_DIR/old-embedded-profile.plist"
654
+ OLD_TEAM_ID=$(PlistBuddy -c "Print :TeamIdentifier:0" "$TEMP_DIR/old-embedded-profile.plist")
655
+ # New team ID is part of profile entitlements
656
+ NEW_TEAM_ID=$(PlistBuddy -c "Print com.apple.developer.team-identifier" "$PROFILE_ENTITLEMENTS" | grep -E '^[A-Z0-9]*' -o | tr -d '\n')
657
+
639
658
  log "Patching profile entitlements with values from app entitlements"
640
659
  PATCHED_ENTITLEMENTS="$TEMP_DIR/patchedEntitlements"
641
660
  # Start with using what comes in provisioning profile entitlements before patching
@@ -654,20 +673,14 @@ function resign {
654
673
  "com.apple.developer.icloud-container-development-container-identifiers" \
655
674
  # This key has an invalid generic value in PP (actual value is set by Xcode during export), see dedicated processing a few blocks below
656
675
  "com.apple.developer.icloud-container-environment" \
657
- # PP list identifiers inconsistent with app-defined ones, must use App entitlements value
658
- "com.apple.developer.icloud-container-identifiers" \
659
676
  # PP enable all available services and not app-defined ones, must use App entitlements value
660
677
  "com.apple.developer.icloud-services" \
661
678
  # Was already denylisted in previous version, but has someone ever seen this key in a PP?
662
679
  "com.apple.developer.restricted-resource-mode" \
663
680
  # If actually used by the App, this value will be set in its entitlements
664
681
  "com.apple.developer.nfc.readersession.formats" \
665
- # PP list a single TeamID.* identifier and not app-defined ones, must use App entitlements value
666
- "com.apple.developer.pass-type-identifiers" \
667
682
  # If actually used by the App, this value will be set in its entitlements
668
683
  "com.apple.developer.siri" \
669
- # PP list identifiers inconsistent with app-defined ones, must use App entitlements value
670
- "com.apple.developer.ubiquity-container-identifiers" \
671
684
  # PP define a generic TeamID.* identifier and not the app-defined one, must use App entitlements value
672
685
  "com.apple.developer.ubiquity-kvstore-identifier" \
673
686
  # If actually used by the App, this value will be set in its entitlements
@@ -680,8 +693,6 @@ function resign {
680
693
  "com.apple.developer.healthkit" \
681
694
  # If actually used by the App, this value will be set in its entitlements
682
695
  "com.apple.developer.healthkit.access" \
683
- # PP list identifiers inconsistent with app-defined ones, must use App entitlements value
684
- "com.apple.developer.in-app-payments" \
685
696
  # If actually used by the App, this value will be set in its entitlements
686
697
  "com.apple.developer.networking.vpn.api" \
687
698
  # If actually used by the App, this value will be set in its entitlements
@@ -694,40 +705,45 @@ function resign {
694
705
  "com.apple.developer.associated-domains" \
695
706
  # If actually used by the App, this value will be set in its entitlements
696
707
  "com.apple.developer.default-data-protection" \
697
- # PP seem to list the same groups as the App, but use App entitlements value to be sure
698
- "com.apple.security.application-groups" \
699
708
  # Was already denylisted in previous version, seems to be an artifact from an old Xcode release
700
709
  "com.apple.developer.maps" \
701
710
  # If actually used by the App, this value will be set in its entitlements
702
711
  "com.apple.external-accessory.wireless-configuration"
703
712
  )
704
713
 
714
+ # If we change team while resigning, we have no other choice than to use the following entitlements from the PP instead of the App
715
+ # because they are based on unique identifiers (defined in the developer portal) that can't be shared between teams
716
+ if [[ "$OLD_TEAM_ID" != "$NEW_TEAM_ID" ]]; then
717
+ warning "WARNING: Changing team while resigning"
718
+ warning "WARNING: Using these entitlements from the provisioning profile instead of the existing app:"
719
+ warning "WARNING: App Groups, Merchant IDs (Apple Pay In-App Payments), iCloud Containers, Pass Type IDs (Wallet)"
720
+ warning "WARNING: If these capabilities are enabled, make sure AppID and provisioning profile are properly configured"
721
+ # For Pass Types, PP only list a single TeamID.* identifier and not the potential restricted list defined in the existing App
722
+ # but we can't guess the new identifiers to be used, so this generic value is better than nothing and should be fine for most apps
723
+ warning "WARNING: Resigned app will allow all pass types from the new team, even if old app only allowed a restricted list"
724
+ else
725
+ DENYLISTED_KEYS+=(\
726
+ "com.apple.security.application-groups" \
727
+ "com.apple.developer.in-app-payments" \
728
+ "com.apple.developer.ubiquity-container-identifiers" \
729
+ "com.apple.developer.icloud-container-identifiers" \
730
+ "com.apple.developer.pass-type-identifiers" \
731
+ )
732
+ fi
733
+
705
734
  # Denylisted keys must not be included into new profile, so remove them from patched profile
706
735
  for KEY in "${DENYLISTED_KEYS[@]}"; do
707
736
  log "Removing denylisted key: $KEY"
708
737
  PlistBuddy -c "Delete $KEY" "$PATCHED_ENTITLEMENTS" 2>/dev/null
709
738
  done
710
739
 
711
- # Get the old and new app identifier (prefix)
712
- APP_ID_KEY="application-identifier"
713
- # Extract just the identifier from the value
714
- # Use the fact that we are after some identifier, which is always at the start of the string
715
- OLD_APP_ID=$(PlistBuddy -c "Print $APP_ID_KEY" "$APP_ENTITLEMENTS" | grep -E '^[A-Z0-9]*' -o | tr -d '\n')
716
- NEW_APP_ID=$(PlistBuddy -c "Print $APP_ID_KEY" "$PROFILE_ENTITLEMENTS" | grep -E '^[A-Z0-9]*' -o | tr -d '\n')
717
-
718
- # Get the old and the new team ID
719
- # Old team ID is not part of app entitlements, have to get it from old embedded provisioning profile
720
- security cms -D -i "$TEMP_DIR/old-embedded.mobileprovision" > "$TEMP_DIR/old-embedded-profile.plist"
721
- OLD_TEAM_ID=$(PlistBuddy -c "Print :TeamIdentifier:0" "$TEMP_DIR/old-embedded-profile.plist")
722
- # New team ID is part of profile entitlements
723
- NEW_TEAM_ID=$(PlistBuddy -c "Print com.apple.developer.team-identifier" "$PROFILE_ENTITLEMENTS" | grep -E '^[A-Z0-9]*' -o | tr -d '\n')
724
-
725
740
  # List of rules for transferring entitlements from app to profile plist
726
741
  # The format for each enty is "KEY[|ID_TYPE]"
727
742
  # Where KEY is the plist key, e.g. "keychain-access-groups"
728
743
  # and ID_TYPE is optional part separated by '|' that specifies what value to patch:
729
744
  # TEAM_ID - patch the TeamIdentifierPrefix
730
745
  # APP_ID - patch the AppIdentifierPrefix
746
+ # ICLOUD_ENV - patch the target iCloud Environment
731
747
  # Patching means replacing old value from app entitlements with new value from provisioning profile
732
748
  # For example, for KEY=keychain-access-groups the ID_TYPE=APP_ID
733
749
  # Which means that old app ID prefix in keychain-access-groups will be replaced with new app ID prefix
@@ -740,23 +756,32 @@ function resign {
740
756
  "com.apple.developer.healthkit" \
741
757
  "com.apple.developer.healthkit.access" \
742
758
  "com.apple.developer.homekit" \
743
- "com.apple.developer.icloud-container-environment" \
744
- "com.apple.developer.icloud-container-identifiers" \
759
+ "com.apple.developer.icloud-container-environment|ICLOUD_ENV" \
745
760
  "com.apple.developer.icloud-services" \
746
- "com.apple.developer.in-app-payments" \
747
761
  "com.apple.developer.networking.HotspotConfiguration" \
748
762
  "com.apple.developer.networking.multipath" \
749
763
  "com.apple.developer.networking.networkextension" \
750
764
  "com.apple.developer.networking.vpn.api" \
751
765
  "com.apple.developer.nfc.readersession.formats" \
752
- "com.apple.developer.pass-type-identifiers|TEAM_ID" \
753
766
  "com.apple.developer.siri" \
754
- "com.apple.developer.ubiquity-container-identifiers" \
755
767
  "com.apple.developer.ubiquity-kvstore-identifier|TEAM_ID" \
756
768
  "com.apple.external-accessory.wireless-configuration" \
757
- "com.apple.security.application-groups" \
758
769
  "inter-app-audio" \
759
- "keychain-access-groups|APP_ID")
770
+ "keychain-access-groups|APP_ID" \
771
+ )
772
+
773
+ # If we change team while resigning, we have no other choice than to use the following entitlements from the PP instead of the App
774
+ # because they are based on unique identifiers (defined in the developer portal) that can't be shared between teams
775
+ # If we don't change team while resigning, we should use the following entitlements from the existing App and not from the PP
776
+ if [[ "$OLD_TEAM_ID" == "$NEW_TEAM_ID" ]]; then
777
+ ENTITLEMENTS_TRANSFER_RULES+=(\
778
+ "com.apple.security.application-groups" \
779
+ "com.apple.developer.in-app-payments" \
780
+ "com.apple.developer.ubiquity-container-identifiers" \
781
+ "com.apple.developer.icloud-container-identifiers" \
782
+ "com.apple.developer.pass-type-identifiers|TEAM_ID" \
783
+ )
784
+ fi
760
785
 
761
786
  # Loop over all the entitlement keys that need to be transferred from app entitlements
762
787
  for RULE in "${ENTITLEMENTS_TRANSFER_RULES[@]}"; do
@@ -765,13 +790,25 @@ function resign {
765
790
 
766
791
  # Get the entry from app's entitlements
767
792
  # Read it with PlistBuddy as XML, then strip the header and <plist></plist> part
768
- ENTITLEMENTS_VALUE="$(PlistBuddy -x -c "Print $KEY" "$APP_ENTITLEMENTS" 2>/dev/null | /usr/bin/sed -e 's,.*<plist[^>]*>\(.*\)</plist>,\1,g')"
793
+ ENTITLEMENTS_VALUE="$(PlistBuddy -x -c "Print $KEY" "$APP_ENTITLEMENTS" 2>/dev/null | tr -d '\n' | /usr/bin/sed -e 's,.*<plist[^>]*>\(.*\)</plist>,\1,g')"
769
794
  if [[ -z "$ENTITLEMENTS_VALUE" ]]; then
770
795
  log "No value for '$KEY'"
771
796
  continue
772
797
  fi
773
798
 
774
- if [[ "$KEY" == "com.apple.developer.icloud-container-environment" ]]; then
799
+ log "App entitlements value for key '$KEY':"
800
+ log "$ENTITLEMENTS_VALUE"
801
+
802
+ # Patch the ID value if specified
803
+ if [[ "$ID_TYPE" == "APP_ID" ]]; then
804
+ # Replace old value with new value in patched entitlements
805
+ log "Replacing old app ID '$OLD_APP_ID' with new app ID '$NEW_APP_ID'"
806
+ ENTITLEMENTS_VALUE=$(echo "$ENTITLEMENTS_VALUE" | /usr/bin/sed -e "s/$OLD_APP_ID/$NEW_APP_ID/g")
807
+ elif [[ "$ID_TYPE" == "TEAM_ID" ]]; then
808
+ # Replace old team identifier with new value
809
+ log "Replacing old team ID '$OLD_TEAM_ID' with new team ID '$NEW_TEAM_ID'"
810
+ ENTITLEMENTS_VALUE=$(echo "$ENTITLEMENTS_VALUE" | /usr/bin/sed -e "s/$OLD_TEAM_ID/$NEW_TEAM_ID/g")
811
+ elif [[ "$ID_TYPE" == "ICLOUD_ENV" ]]; then
775
812
  # Add specific iCloud Environment key to patched entitlements
776
813
  # This value is set by Xcode during export (manually selected for Development and AdHoc, automatically set to Production for Store)
777
814
  # Would need an additional dedicated option to specify the iCloud environment to be used (Development or Production)
@@ -788,20 +825,16 @@ function resign {
788
825
  fi
789
826
  fi
790
827
 
828
+ OLD_ICLOUD_ENV=$(echo "$ENTITLEMENTS_VALUE" | /usr/bin/sed -e 's,<string>\(.*\)</string>,\1,g')
791
829
  if [[ "$certificate_name" =~ "Distribution:" ]]; then
792
- ICLOUD_ENV="Production"
830
+ NEW_ICLOUD_ENV="Production"
793
831
  else
794
- ICLOUD_ENV="Development"
832
+ NEW_ICLOUD_ENV="Development"
795
833
  fi
796
- log "Overriding value for $KEY"
797
- log "Old value: $ENTITLEMENTS_VALUE"
798
- log "New value: $ICLOUD_ENV"
799
- ENTITLEMENTS_VALUE="$ICLOUD_ENV"
834
+ log "Replacing iCloud environment '$OLD_ICLOUD_ENV' with '$NEW_ICLOUD_ENV'"
835
+ ENTITLEMENTS_VALUE=$(echo "$ENTITLEMENTS_VALUE" | /usr/bin/sed -e "s/$OLD_ICLOUD_ENV/$NEW_ICLOUD_ENV/g")
800
836
  fi
801
837
 
802
- log "App entitlements value for key '$KEY':"
803
- log "$ENTITLEMENTS_VALUE"
804
-
805
838
  # Remove the entry for current key from profisioning profile entitlements (if exists)
806
839
  PlistBuddy -c "Delete $KEY" "$PATCHED_ENTITLEMENTS" 2>/dev/null
807
840
 
@@ -810,27 +843,14 @@ function resign {
810
843
  # otherwise it interprets they key path as nested keys
811
844
  # TODO: Should be able to replace with echo ${KEY//\./\\\\.} and remove shellcheck disable directive
812
845
  # shellcheck disable=SC2001
813
- PLUTIL_KEY=$(echo "$KEY" | /usr/bin/sed 's/\./\\\./g')
846
+ PLUTIL_KEY=$(echo "$KEY" | /usr/bin/sed -e 's/\./\\\./g')
814
847
  plutil -insert "$PLUTIL_KEY" -xml "$ENTITLEMENTS_VALUE" "$PATCHED_ENTITLEMENTS"
815
-
816
- # Patch the ID value if specified
817
- if [[ "$ID_TYPE" == "APP_ID" ]]; then
818
- # Replace old value with new value in patched entitlements
819
- log "Replacing old app identifier prefix '$OLD_APP_ID' with new value '$NEW_APP_ID'"
820
- /usr/bin/sed -i .bak "s/$OLD_APP_ID/$NEW_APP_ID/g" "$PATCHED_ENTITLEMENTS"
821
- elif [[ "$ID_TYPE" == "TEAM_ID" ]]; then
822
- # Replace old team identifier with new value
823
- log "Replacing old team ID '$OLD_TEAM_ID' with new team ID: '$NEW_TEAM_ID'"
824
- /usr/bin/sed -i .bak "s/$OLD_TEAM_ID/$NEW_TEAM_ID/g" "$PATCHED_ENTITLEMENTS"
825
- else
826
- continue
827
- fi
828
848
  done
829
849
 
830
850
  # Replace old bundle ID with new bundle ID in patched entitlements
831
851
  # Read old bundle ID from the old Info.plist which was saved for this purpose
832
852
  OLD_BUNDLE_ID="$(PlistBuddy -c "Print :CFBundleIdentifier" "$TEMP_DIR/oldInfo.plist")"
833
- NEW_BUNDLE_ID="$(bundle_id_for_provison "$NEW_PROVISION")"
853
+ NEW_BUNDLE_ID="$(bundle_id_for_provision "$NEW_PROVISION")"
834
854
  log "Replacing old bundle ID '$OLD_BUNDLE_ID' with new bundle ID '$NEW_BUNDLE_ID' in patched entitlements"
835
855
  # Note: ideally we'd match against the opening <string> tag too, but this isn't possible
836
856
  # because $OLD_BUNDLE_ID and $NEW_BUNDLE_ID do not include the team ID prefix which is
@@ -1,5 +1,6 @@
1
1
  require 'commander'
2
2
  require 'fastlane/version'
3
+ require 'fastlane_core/ui/help_formatter'
3
4
 
4
5
  require_relative 'options'
5
6
  require_relative 'resign'
@@ -23,7 +24,7 @@ module Sigh
23
24
  program :help, 'Author', 'Felix Krause <sigh@krausefx.com>'
24
25
  program :help, 'Website', 'https://fastlane.tools'
25
26
  program :help, 'Documentation', 'https://docs.fastlane.tools/actions/sigh/'
26
- program :help_formatter, :compact
27
+ program :help_formatter, FastlaneCore::HelpFormatter
27
28
 
28
29
  global_option('--verbose') { FastlaneCore::Globals.verbose = true }
29
30
  global_option('--env STRING[,STRING2]', String, 'Add environment(s) to use with `dotenv`')
@@ -9,9 +9,11 @@ module Sigh
9
9
  class DownloadAll
10
10
  # Download all valid provisioning profiles
11
11
  def download_all(download_xcode_profiles: false)
12
- if (token = api_token)
12
+ if (api_token = Spaceship::ConnectAPI::Token.from(hash: Sigh.config[:api_key], filepath: Sigh.config[:api_key_path]))
13
13
  UI.message("Creating authorization token for App Store Connect API")
14
- Spaceship::ConnectAPI.token = token
14
+ Spaceship::ConnectAPI.token = api_token
15
+ elsif !Spaceship::ConnectAPI.token.nil?
16
+ UI.message("Using existing authorization token for App Store Connect API")
15
17
  else
16
18
  # Team selection passed though FASTLANE_ITC_TEAM_ID and FASTLANE_ITC_TEAM_NAME environment variables
17
19
  # Prompts select team if multiple teams and none specified
@@ -59,12 +61,6 @@ module Sigh
59
61
  download_profiles(profiles)
60
62
  end
61
63
 
62
- def api_token
63
- api_token ||= Spaceship::ConnectAPI::Token.create(Sigh.config[:api_key]) if Sigh.config[:api_key]
64
- api_token ||= Spaceship::ConnectAPI::Token.from_json_file(Sigh.config[:api_key_path]) if Sigh.config[:api_key_path]
65
- return api_token
66
- end
67
-
68
64
  # @param profiles [Array] Array of all the provisioning profiles we want to download
69
65
  def download_profiles(profiles)
70
66
  UI.important("No profiles available for download") if profiles.empty?
@@ -57,7 +57,7 @@ module Sigh
57
57
 
58
58
  # App Store Connect API
59
59
  FastlaneCore::ConfigItem.new(key: :api_key_path,
60
- env_name: "SIGH_API_KEY_PATH",
60
+ env_names: ["SIGH_API_KEY_PATH", "APP_STORE_CONNECT_API_KEY_PATH"],
61
61
  description: "Path to your App Store Connect API Key JSON file (https://docs.fastlane.tools/app-store-connect-api/#using-fastlane-api-key-json-file)",
62
62
  optional: true,
63
63
  conflicting_options: [:api_key],
@@ -65,8 +65,8 @@ module Sigh
65
65
  UI.user_error!("Couldn't find API key JSON file at path '#{value}'") unless File.exist?(value)
66
66
  end),
67
67
  FastlaneCore::ConfigItem.new(key: :api_key,
68
- env_name: "SIGH_API_KEY",
69
- description: "Your App Store Connect API Key information (https://docs.fastlane.tools/app-store-connect-api/#use-return-value-and-pass-in-as-an-option)",
68
+ env_names: ["SIGH_API_KEY", "APP_STORE_CONNECT_API_KEY"],
69
+ description: "Your App Store Connect API Key information (https://docs.fastlane.tools/app-store-connect-api/#using-fastlane-api-key-hash-option)",
70
70
  type: Hash,
71
71
  optional: true,
72
72
  sensitive: true,
@@ -77,6 +77,7 @@ module Sigh
77
77
  short_option: "-u",
78
78
  env_name: "SIGH_USERNAME",
79
79
  description: "Your Apple ID Username",
80
+ optional: true,
80
81
  default_value: user,
81
82
  default_value_dynamic: true),
82
83
  FastlaneCore::ConfigItem.new(key: :team_id,
@@ -148,7 +149,8 @@ module Sigh
148
149
  env_name: "SIGH_SKIP_CERTIFICATE_VERIFICATION",
149
150
  description: "Skips the verification of the certificates for every existing profiles. This will make sure the provisioning profile can be used on the local machine",
150
151
  is_string: false,
151
- default_value: false),
152
+ default_value: !FastlaneCore::Helper.mac?,
153
+ default_value_dynamic: true),
152
154
  FastlaneCore::ConfigItem.new(key: :platform,
153
155
  short_option: '-p',
154
156
  env_name: "SIGH_PLATFORM",
@@ -17,10 +17,16 @@ module Sigh
17
17
  hide_keys: [:output_path],
18
18
  title: "Summary for sigh #{Fastlane::VERSION}")
19
19
 
20
- if api_token
20
+ if (api_token = Spaceship::ConnectAPI::Token.from(hash: Sigh.config[:api_key], filepath: Sigh.config[:api_key_path]))
21
21
  UI.message("Creating authorization token for App Store Connect API")
22
22
  Spaceship::ConnectAPI.token = api_token
23
+ elsif !Spaceship::ConnectAPI.token.nil?
24
+ UI.message("Using existing authorization token for App Store Connect API")
23
25
  else
26
+ # Username is now optional since addition of App Store Connect API Key
27
+ # Force asking for username to prompt user if not already set
28
+ Sigh.config.fetch(:username, force_ask: true)
29
+
24
30
  # Team selection passed though FASTLANE_ITC_TEAM_ID and FASTLANE_ITC_TEAM_NAME environment variables
25
31
  # Prompts select team if multiple teams and none specified
26
32
  UI.message("Starting login with user '#{Sigh.config[:username]}'")
@@ -59,12 +65,6 @@ module Sigh
59
65
  return download_profile(profile)
60
66
  end
61
67
 
62
- def api_token
63
- @api_token ||= Spaceship::ConnectAPI::Token.create(Sigh.config[:api_key]) if Sigh.config[:api_key]
64
- @api_token ||= Spaceship::ConnectAPI::Token.from_json_file(Sigh.config[:api_key_path]) if Sigh.config[:api_key_path]
65
- return @api_token
66
- end
67
-
68
68
  # The kind of provisioning profile we're interested in
69
69
  def profile_type
70
70
  return @profile_type if @profile_type
@@ -282,7 +282,7 @@ module Sigh
282
282
  [Spaceship::ConnectAPI::Device::DeviceClass::MAC]
283
283
  end
284
284
 
285
- if api_token
285
+ if Spaceship::ConnectAPI.token
286
286
  return Spaceship::ConnectAPI::Device.all.select do |device|
287
287
  device_classes.include?(device.device_class)
288
288
  end
@@ -8,7 +8,8 @@
8
8
  # "iPhone X",
9
9
  # "iPad Pro (12.9-inch)",
10
10
  # "iPad Pro (9.7-inch)",
11
- # "Apple TV 1080p"
11
+ # "Apple TV 1080p",
12
+ # "Apple Watch Series 6 - 44mm"
12
13
  # ])
13
14
 
14
15
  # languages([
@@ -27,7 +28,7 @@
27
28
  # remove the '#' to clear all previously generated screenshots before creating new ones
28
29
  # clear_previous_screenshots(true)
29
30
 
30
- # Remove the '#' to set the status bar to 9:41 AM, and show full battery and reception.
31
+ # Remove the '#' to set the status bar to 9:41 AM, and show full battery and reception. See also override_status_bar_arguments for custom options.
31
32
  # override_status_bar(true)
32
33
 
33
34
  # Arguments to pass to the app on launch. See https://docs.fastlane.tools/actions/snapshot/#launch-arguments
@@ -8,7 +8,8 @@ class Snapshotfile: SnapshotfileProtocol {
8
8
  // "iPhone 5",
9
9
  // "iPad Pro (12.9-inch)",
10
10
  // "iPad Pro (9.7-inch)",
11
- // "Apple TV 1080p"
11
+ // "Apple TV 1080p",
12
+ // "Apple Watch Series 6 - 44mm"
12
13
  // ]
13
14
  //}
14
15
 
@@ -193,16 +193,20 @@ open class Snapshot: NSObject {
193
193
  }
194
194
 
195
195
  class func fixLandscapeOrientation(image: UIImage) -> UIImage {
196
- if #available(iOS 10.0, *) {
197
- let format = UIGraphicsImageRendererFormat()
198
- format.scale = image.scale
199
- let renderer = UIGraphicsImageRenderer(size: image.size, format: format)
200
- return renderer.image { context in
201
- image.draw(in: CGRect(x: 0, y: 0, width: image.size.width, height: image.size.height))
202
- }
203
- } else {
196
+ #if os(watchOS)
204
197
  return image
205
- }
198
+ #else
199
+ if #available(iOS 10.0, *) {
200
+ let format = UIGraphicsImageRendererFormat()
201
+ format.scale = image.scale
202
+ let renderer = UIGraphicsImageRenderer(size: image.size, format: format)
203
+ return renderer.image { context in
204
+ image.draw(in: CGRect(x: 0, y: 0, width: image.size.width, height: image.size.height))
205
+ }
206
+ } else {
207
+ return image
208
+ }
209
+ #endif
206
210
  }
207
211
 
208
212
  class func waitForLoadingIndicatorToDisappear(within timeout: TimeInterval) {
@@ -302,4 +306,4 @@ private extension CGFloat {
302
306
 
303
307
  // Please don't remove the lines below
304
308
  // They are used to detect outdated configuration files
305
- // SnapshotHelperVersion [1.24]
309
+ // SnapshotHelperVersion [1.27]
@@ -1,5 +1,7 @@
1
1
  require 'commander'
2
2
 
3
+ require 'fastlane_core/ui/help_formatter'
4
+
3
5
  require_relative 'module'
4
6
  require_relative 'runner'
5
7
  require_relative 'options'
@@ -21,7 +23,7 @@ module Snapshot
21
23
  program :help, 'Author', 'Felix Krause <snapshot@krausefx.com>'
22
24
  program :help, 'Website', 'https://fastlane.tools'
23
25
  program :help, 'Documentation', 'https://docs.fastlane.tools/actions/snapshot/'
24
- program :help_formatter, :compact
26
+ program :help_formatter, FastlaneCore::HelpFormatter
25
27
 
26
28
  global_option('--verbose', 'Shows a more verbose output') { FastlaneCore::Globals.verbose = true }
27
29
 
@@ -126,6 +126,11 @@ module Snapshot
126
126
  description: "Enabling this option will automatically override the status bar to show 9:41 AM, full battery, and full reception",
127
127
  default_value: false,
128
128
  is_string: false),
129
+ FastlaneCore::ConfigItem.new(key: :override_status_bar_arguments,
130
+ env_name: 'SNAPSHOT_OVERRIDE_STATUS_BAR_ARGUMENTS',
131
+ description: "Fully customize the status bar by setting each option here. See `xcrun simctl status_bar --help`",
132
+ optional: true,
133
+ type: String),
129
134
  FastlaneCore::ConfigItem.new(key: :localize_simulator,
130
135
  env_name: 'SNAPSHOT_LOCALIZE_SIMULATOR',
131
136
  description: "Enabling this option will configure the Simulator's system language",
@@ -84,6 +84,10 @@ module Snapshot
84
84
  {
85
85
  # snapshot in Xcode 9 saves screenshots with the SIMULATOR_DEVICE_NAME
86
86
  # which includes spaces
87
+ 'iPhone 12 Pro Max' => "iPhone 12 Pro Max",
88
+ 'iPhone 12 Pro' => "iPhone 12 Pro",
89
+ 'iPhone 12 mini' => "iPhone 12 mini",
90
+ 'iPhone 12' => "iPhone 12",
87
91
  'iPhone 11 Pro Max' => "iPhone 11 Pro Max",
88
92
  'iPhone 11 Pro' => "iPhone 11 Pro",
89
93
  'iPhone 11' => "iPhone 11",
@@ -124,7 +128,9 @@ module Snapshot
124
128
  'Apple TV 4K (at 1080p)' => 'Apple TV 4K (at 1080p)',
125
129
  'Apple TV 4K' => 'Apple TV 4K',
126
130
  'Apple TV' => 'Apple TV',
127
- 'Mac' => 'Mac'
131
+ 'Mac' => 'Mac',
132
+ 'Apple Watch Series 5 - 44mm' => 'Apple Watch Series 5 - 44mm',
133
+ 'Apple Watch Series 6 - 44mm' => 'Apple Watch Series 6 - 44mm'
128
134
  }
129
135
  end
130
136
 
@@ -14,6 +14,7 @@ module Snapshot
14
14
  attr_accessor :app_identifier
15
15
  attr_accessor :disable_slide_to_type
16
16
  attr_accessor :override_status_bar
17
+ attr_accessor :override_status_bar_arguments
17
18
 
18
19
  # xcode 8
19
20
  attr_accessor :number_of_retries
@@ -47,6 +48,7 @@ module Snapshot
47
48
  @concurrent_simulators = snapshot_config[:concurrent_simulators]
48
49
  @disable_slide_to_type = snapshot_config[:disable_slide_to_type]
49
50
  @override_status_bar = snapshot_config[:override_status_bar]
51
+ @override_status_bar_arguments = snapshot_config[:override_status_bar_arguments]
50
52
 
51
53
  launch_arguments = Array(snapshot_config[:launch_arguments])
52
54
  # if more than 1 set of arguments, use a tuple with an index
@@ -89,7 +89,7 @@ module Snapshot
89
89
  log_path: xcodebuild_log_path(language: language, locale: locale)
90
90
  )
91
91
 
92
- devices.each { |device_type| override_status_bar(device_type) } if launcher_config.override_status_bar
92
+ devices.each { |device_type| override_status_bar(device_type, launcher_config.override_status_bar_arguments) } if launcher_config.override_status_bar
93
93
 
94
94
  UI.important("Running snapshot on: #{devices.join(', ')}")
95
95
 
@@ -69,7 +69,8 @@ module Snapshot
69
69
  unless launcher_config.dark_mode.nil?
70
70
  interface_style(type, launcher_config.dark_mode)
71
71
  end
72
- elsif launcher_config.reinstall_app
72
+ end
73
+ if launcher_config.reinstall_app && !launcher_config.erase_simulator
73
74
  # no need to reinstall if device has been erased
74
75
  uninstall_app(type)
75
76
  end
@@ -111,17 +112,22 @@ module Snapshot
111
112
  end
112
113
  end
113
114
 
114
- def override_status_bar(device_type)
115
+ def override_status_bar(device_type, arguments = nil)
115
116
  device_udid = TestCommandGenerator.device_udid(device_type)
116
117
 
117
118
  UI.message("Launch Simulator #{device_type}")
118
- Helper.backticks("xcrun instruments -w #{device_udid} &> /dev/null")
119
+ # Boot the simulator and wait for it to finish booting
120
+ Helper.backticks("xcrun simctl bootstatus #{device_udid} -b &> /dev/null")
119
121
 
120
122
  UI.message("Overriding Status Bar")
121
123
 
122
- # The time needs to be passed as ISO8601 so the simulator formats it correctly
123
- time = Time.new(2007, 1, 9, 9, 41, 0)
124
- Helper.backticks("xcrun simctl status_bar #{device_udid} override --time #{time.iso8601} --dataNetwork wifi --wifiMode active --wifiBars 3 --cellularMode active --cellularBars 4 --batteryState charged --batteryLevel 100 &> /dev/null")
124
+ if arguments.nil? || arguments.empty?
125
+ # The time needs to be passed as ISO8601 so the simulator formats it correctly
126
+ time = Time.new(2007, 1, 9, 9, 41, 0)
127
+ arguments = "--time #{time.iso8601} --dataNetwork wifi --wifiMode active --wifiBars 3 --cellularMode active --cellularBars 4 --batteryState charged --batteryLevel 100"
128
+ end
129
+
130
+ Helper.backticks("xcrun simctl status_bar #{device_udid} override #{arguments} &> /dev/null")
125
131
  end
126
132
 
127
133
  def clear_status_bar(device_type)
@@ -45,7 +45,14 @@ module Snapshot
45
45
  # on Mac we will always run on host machine, so should specify only platform
46
46
  return ["-destination 'platform=macOS'"] if devices.first.to_s =~ /^Mac/
47
47
 
48
- os = devices.first.to_s =~ /^Apple TV/ ? "tvOS" : "iOS"
48
+ case devices.first.to_s
49
+ when /^Apple TV/
50
+ os = 'tvOS'
51
+ when /^Apple Watch/
52
+ os = 'watchOS'
53
+ else
54
+ os = 'iOS'
55
+ end
49
56
 
50
57
  os_version = Snapshot.config[:ios_version] || Snapshot::LatestOsVersion.version(os)
51
58
 
@@ -69,7 +76,7 @@ module Snapshot
69
76
  # Check each device to see if it is an iOS device
70
77
  all_ios = devices.map do |device|
71
78
  device = device.downcase
72
- device.include?('iphone') || device.include?('ipad')
79
+ device.include?('iphone') || device.include?('ipad') || device.include?('ipod')
73
80
  end
74
81
  # Return true if all devices are iOS devices
75
82
  return true unless all_ios.include?(false)
@@ -78,9 +85,16 @@ module Snapshot
78
85
  device = device.downcase
79
86
  device.include?('apple tv')
80
87
  end
81
- # Return true if all devices are iOS devices
88
+ # Return true if all devices are tvOS devices
82
89
  return true unless all_tvos.include?(false)
83
90
 
91
+ all_watchos = devices.map do |device|
92
+ device = device.downcase
93
+ device.include?('apple watch')
94
+ end
95
+ # Return true if all devices are watchOS devices
96
+ return true unless all_watchos.include?(false)
97
+
84
98
  # There should only be more than 1 device type if
85
99
  # it is iOS or tvOS, therefore, if there is more than 1
86
100
  # device in the array, and they are not all iOS or tvOS