fastlane 1.111.0 → 2.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (558) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +76 -111
  3. data/bin/bin-proxy +19 -0
  4. data/cert/README.md +163 -0
  5. data/cert/lib/cert.rb +18 -0
  6. data/cert/lib/cert/commands_generator.rb +51 -0
  7. data/cert/lib/cert/options.rb +67 -0
  8. data/cert/lib/cert/runner.rb +181 -0
  9. data/credentials_manager/README.md +62 -0
  10. data/credentials_manager/lib/credentials_manager.rb +12 -0
  11. data/credentials_manager/lib/credentials_manager/account_manager.rb +104 -0
  12. data/credentials_manager/lib/credentials_manager/appfile_config.rb +186 -0
  13. data/credentials_manager/lib/credentials_manager/cli.rb +65 -0
  14. data/deliver/README.md +271 -0
  15. data/deliver/lib/assets/DeliverfileDefault +10 -0
  16. data/deliver/lib/assets/ScreenshotsHelp +7 -0
  17. data/deliver/lib/assets/summary.html.erb +210 -0
  18. data/deliver/lib/deliver.rb +31 -0
  19. data/deliver/lib/deliver/app_screenshot.rb +226 -0
  20. data/deliver/lib/deliver/commands_generator.rb +150 -0
  21. data/deliver/lib/deliver/detect_values.rb +69 -0
  22. data/deliver/lib/deliver/download_screenshots.rb +46 -0
  23. data/deliver/lib/deliver/generate_summary.rb +9 -0
  24. data/deliver/lib/deliver/html_generator.rb +58 -0
  25. data/deliver/lib/deliver/loader.rb +18 -0
  26. data/deliver/lib/deliver/options.rb +269 -0
  27. data/deliver/lib/deliver/runner.rb +99 -0
  28. data/deliver/lib/deliver/setup.rb +78 -0
  29. data/deliver/lib/deliver/submit_for_review.rb +87 -0
  30. data/deliver/lib/deliver/upload_assets.rb +22 -0
  31. data/deliver/lib/deliver/upload_metadata.rb +191 -0
  32. data/deliver/lib/deliver/upload_price_tier.rb +21 -0
  33. data/deliver/lib/deliver/upload_screenshots.rb +110 -0
  34. data/fastlane/README.md +193 -0
  35. data/{lib → fastlane/lib}/assets/Actions.md.erb +0 -0
  36. data/{lib → fastlane/lib}/assets/AppfileTemplate +0 -0
  37. data/{lib → fastlane/lib}/assets/AppfileTemplateAndroid +0 -0
  38. data/{lib → fastlane/lib}/assets/AvailablePlugins.md.erb +0 -0
  39. data/{lib → fastlane/lib}/assets/DefaultFastfileTemplate +2 -2
  40. data/{lib → fastlane/lib}/assets/FastfileTemplateAndroid +2 -2
  41. data/{lib → fastlane/lib}/assets/completions/completion.bash +0 -0
  42. data/{lib → fastlane/lib}/assets/completions/completion.sh +0 -0
  43. data/{lib → fastlane/lib}/assets/completions/completion.zsh +0 -0
  44. data/{lib → fastlane/lib}/assets/custom_action_template.rb +0 -0
  45. data/{lib → fastlane/lib}/assets/mailgun_html_template.erb +0 -0
  46. data/{lib → fastlane/lib}/assets/report_template.xml.erb +0 -0
  47. data/{lib → fastlane/lib}/assets/s3_html_template.erb +0 -0
  48. data/{lib → fastlane/lib}/assets/s3_plist_template.erb +0 -0
  49. data/{lib → fastlane/lib}/assets/s3_version_template.erb +0 -0
  50. data/{lib → fastlane/lib}/fastlane.rb +3 -3
  51. data/{lib → fastlane/lib}/fastlane/action.rb +0 -0
  52. data/{lib → fastlane/lib}/fastlane/action_collector.rb +0 -0
  53. data/{lib → fastlane/lib}/fastlane/actions/README.md +0 -0
  54. data/{lib → fastlane/lib}/fastlane/actions/actions_helper.rb +16 -0
  55. data/{lib → fastlane/lib}/fastlane/actions/adb.rb +0 -0
  56. data/{lib → fastlane/lib}/fastlane/actions/adb_devices.rb +0 -0
  57. data/{lib → fastlane/lib}/fastlane/actions/add_git_tag.rb +0 -0
  58. data/{lib → fastlane/lib}/fastlane/actions/app_store_build_number.rb +0 -0
  59. data/{lib → fastlane/lib}/fastlane/actions/appaloosa.rb +1 -0
  60. data/{lib → fastlane/lib}/fastlane/actions/appetize.rb +1 -0
  61. data/{lib → fastlane/lib}/fastlane/actions/appetize_viewing_url_generator.rb +1 -0
  62. data/{lib → fastlane/lib}/fastlane/actions/appium.rb +0 -0
  63. data/{lib → fastlane/lib}/fastlane/actions/appledoc.rb +0 -0
  64. data/{lib → fastlane/lib}/fastlane/actions/appstore.rb +0 -0
  65. data/{lib → fastlane/lib}/fastlane/actions/apteligent.rb +1 -0
  66. data/{lib → fastlane/lib}/fastlane/actions/artifactory.rb +2 -0
  67. data/{lib → fastlane/lib}/fastlane/actions/backup_file.rb +0 -0
  68. data/{lib → fastlane/lib}/fastlane/actions/backup_xcarchive.rb +0 -0
  69. data/{lib → fastlane/lib}/fastlane/actions/badge.rb +0 -0
  70. data/{lib → fastlane/lib}/fastlane/actions/build_and_upload_to_appetize.rb +1 -0
  71. data/{lib → fastlane/lib}/fastlane/actions/bundle_install.rb +0 -0
  72. data/{lib → fastlane/lib}/fastlane/actions/carthage.rb +1 -1
  73. data/{lib → fastlane/lib}/fastlane/actions/cert.rb +0 -4
  74. data/{lib → fastlane/lib}/fastlane/actions/changelog_from_git_commits.rb +0 -0
  75. data/{lib → fastlane/lib}/fastlane/actions/chatwork.rb +1 -0
  76. data/{lib → fastlane/lib}/fastlane/actions/clean_build_artifacts.rb +0 -0
  77. data/{lib → fastlane/lib}/fastlane/actions/clean_cocoapods_cache.rb +0 -0
  78. data/{lib → fastlane/lib}/fastlane/actions/clear_derived_data.rb +0 -0
  79. data/{lib → fastlane/lib}/fastlane/actions/clipboard.rb +0 -0
  80. data/{lib → fastlane/lib}/fastlane/actions/cloc.rb +0 -0
  81. data/{lib → fastlane/lib}/fastlane/actions/cocoapods.rb +0 -0
  82. data/{lib → fastlane/lib}/fastlane/actions/commit_version_bump.rb +0 -0
  83. data/{lib → fastlane/lib}/fastlane/actions/copy_artifacts.rb +0 -0
  84. data/{lib → fastlane/lib}/fastlane/actions/crashlytics.rb +2 -0
  85. data/{lib → fastlane/lib}/fastlane/actions/create_keychain.rb +1 -0
  86. data/{lib → fastlane/lib}/fastlane/actions/create_pull_request.rb +1 -0
  87. data/{lib → fastlane/lib}/fastlane/actions/danger.rb +1 -0
  88. data/{lib → fastlane/lib}/fastlane/actions/debug.rb +0 -0
  89. data/{lib → fastlane/lib}/fastlane/actions/default_platform.rb +0 -0
  90. data/{lib → fastlane/lib}/fastlane/actions/delete_keychain.rb +0 -0
  91. data/{lib → fastlane/lib}/fastlane/actions/deliver.rb +0 -4
  92. data/{lib → fastlane/lib}/fastlane/actions/deploygate.rb +34 -19
  93. data/{lib → fastlane/lib}/fastlane/actions/device_grid/README.md +0 -0
  94. data/{lib → fastlane/lib}/fastlane/actions/dotgpg_environment.rb +0 -0
  95. data/{lib → fastlane/lib}/fastlane/actions/download.rb +0 -0
  96. data/{lib → fastlane/lib}/fastlane/actions/download_dsyms.rb +0 -0
  97. data/{lib → fastlane/lib}/fastlane/actions/dsym_zip.rb +0 -0
  98. data/{lib → fastlane/lib}/fastlane/actions/ensure_git_branch.rb +0 -0
  99. data/{lib → fastlane/lib}/fastlane/actions/ensure_git_status_clean.rb +0 -0
  100. data/{lib → fastlane/lib}/fastlane/actions/ensure_no_debug_code.rb +10 -2
  101. data/{lib → fastlane/lib}/fastlane/actions/ensure_xcode_version.rb +0 -0
  102. data/{lib → fastlane/lib}/fastlane/actions/erb.rb +0 -0
  103. data/{lib → fastlane/lib}/fastlane/actions/fastlane_version.rb +0 -0
  104. data/{lib → fastlane/lib}/fastlane/actions/flock.rb +1 -0
  105. data/{lib → fastlane/lib}/fastlane/actions/frameit.rb +6 -10
  106. data/{lib → fastlane/lib}/fastlane/actions/gcovr.rb +0 -0
  107. data/{lib → fastlane/lib}/fastlane/actions/get_build_number.rb +0 -0
  108. data/{lib → fastlane/lib}/fastlane/actions/get_build_number_repository.rb +0 -0
  109. data/{lib → fastlane/lib}/fastlane/actions/get_github_release.rb +1 -0
  110. data/{lib → fastlane/lib}/fastlane/actions/get_info_plist_value.rb +0 -0
  111. data/{lib → fastlane/lib}/fastlane/actions/get_ipa_info_plist_value.rb +0 -0
  112. data/{lib → fastlane/lib}/fastlane/actions/get_version_number.rb +0 -0
  113. data/{lib → fastlane/lib}/fastlane/actions/git_add.rb +0 -0
  114. data/{lib → fastlane/lib}/fastlane/actions/git_branch.rb +0 -0
  115. data/{lib → fastlane/lib}/fastlane/actions/git_commit.rb +0 -0
  116. data/{lib → fastlane/lib}/fastlane/actions/git_pull.rb +0 -0
  117. data/{lib → fastlane/lib}/fastlane/actions/git_tag_exists.rb +0 -0
  118. data/{lib → fastlane/lib}/fastlane/actions/gradle.rb +0 -0
  119. data/fastlane/lib/fastlane/actions/gym.rb +84 -0
  120. data/{lib → fastlane/lib}/fastlane/actions/hg_add_tag.rb +0 -0
  121. data/{lib → fastlane/lib}/fastlane/actions/hg_commit_version_bump.rb +0 -0
  122. data/{lib → fastlane/lib}/fastlane/actions/hg_ensure_clean_status.rb +0 -0
  123. data/{lib → fastlane/lib}/fastlane/actions/hg_push.rb +0 -0
  124. data/{lib → fastlane/lib}/fastlane/actions/hipchat.rb +1 -0
  125. data/{lib → fastlane/lib}/fastlane/actions/hockey.rb +37 -11
  126. data/{lib → fastlane/lib}/fastlane/actions/ifttt.rb +1 -0
  127. data/{lib → fastlane/lib}/fastlane/actions/import.rb +0 -0
  128. data/{lib → fastlane/lib}/fastlane/actions/import_certificate.rb +2 -0
  129. data/{lib → fastlane/lib}/fastlane/actions/import_from_git.rb +0 -0
  130. data/{lib → fastlane/lib}/fastlane/actions/increment_build_number.rb +0 -0
  131. data/{lib → fastlane/lib}/fastlane/actions/increment_version_number.rb +0 -0
  132. data/{lib → fastlane/lib}/fastlane/actions/install_on_device.rb +0 -0
  133. data/{lib → fastlane/lib}/fastlane/actions/install_xcode_plugin.rb +0 -0
  134. data/{lib → fastlane/lib}/fastlane/actions/installr.rb +1 -0
  135. data/{lib → fastlane/lib}/fastlane/actions/ipa.rb +12 -4
  136. data/{lib → fastlane/lib}/fastlane/actions/is_ci.rb +0 -0
  137. data/{lib → fastlane/lib}/fastlane/actions/jazzy.rb +0 -0
  138. data/{lib → fastlane/lib}/fastlane/actions/jira.rb +1 -0
  139. data/{lib → fastlane/lib}/fastlane/actions/lane_context.rb +0 -0
  140. data/{lib → fastlane/lib}/fastlane/actions/last_git_commit.rb +0 -0
  141. data/{lib → fastlane/lib}/fastlane/actions/last_git_tag.rb +0 -0
  142. data/{lib → fastlane/lib}/fastlane/actions/latest_testflight_build_number.rb +0 -0
  143. data/{lib → fastlane/lib}/fastlane/actions/lcov.rb +0 -0
  144. data/{lib → fastlane/lib}/fastlane/actions/mailgun.rb +2 -0
  145. data/{lib → fastlane/lib}/fastlane/actions/make_changelog_from_jenkins.rb +0 -0
  146. data/{lib → fastlane/lib}/fastlane/actions/match.rb +3 -9
  147. data/{lib → fastlane/lib}/fastlane/actions/nexus_upload.rb +1 -0
  148. data/{lib → fastlane/lib}/fastlane/actions/notification.rb +0 -0
  149. data/{lib → fastlane/lib}/fastlane/actions/notify.rb +0 -0
  150. data/{lib → fastlane/lib}/fastlane/actions/number_of_commits.rb +0 -0
  151. data/{lib → fastlane/lib}/fastlane/actions/oclint.rb +0 -0
  152. data/{lib → fastlane/lib}/fastlane/actions/onesignal.rb +3 -0
  153. data/{lib → fastlane/lib}/fastlane/actions/opt_out_usage.rb +0 -0
  154. data/{lib → fastlane/lib}/fastlane/actions/pem.rb +9 -15
  155. data/{lib → fastlane/lib}/fastlane/actions/pilot.rb +6 -12
  156. data/{lib → fastlane/lib}/fastlane/actions/pod_lib_lint.rb +0 -0
  157. data/{lib → fastlane/lib}/fastlane/actions/pod_push.rb +0 -0
  158. data/{lib → fastlane/lib}/fastlane/actions/podio_item.rb +2 -0
  159. data/{lib → fastlane/lib}/fastlane/actions/produce.rb +7 -11
  160. data/{lib → fastlane/lib}/fastlane/actions/prompt.rb +5 -2
  161. data/{lib → fastlane/lib}/fastlane/actions/push_git_tags.rb +0 -0
  162. data/{lib → fastlane/lib}/fastlane/actions/push_to_git_remote.rb +0 -0
  163. data/{lib → fastlane/lib}/fastlane/actions/puts.rb +8 -0
  164. data/{lib → fastlane/lib}/fastlane/actions/read_podspec.rb +0 -0
  165. data/{lib → fastlane/lib}/fastlane/actions/recreate_schemes.rb +0 -0
  166. data/{lib → fastlane/lib}/fastlane/actions/register_devices.rb +0 -0
  167. data/{lib → fastlane/lib}/fastlane/actions/reset_git_repo.rb +0 -0
  168. data/fastlane/lib/fastlane/actions/reset_simulator_contents.rb +62 -0
  169. data/{lib → fastlane/lib}/fastlane/actions/resign.rb +0 -0
  170. data/{lib → fastlane/lib}/fastlane/actions/restore_file.rb +0 -0
  171. data/{lib → fastlane/lib}/fastlane/actions/rocket.rb +0 -0
  172. data/{lib → fastlane/lib}/fastlane/actions/rsync.rb +0 -0
  173. data/{lib → fastlane/lib}/fastlane/actions/s3.rb +2 -1
  174. data/{lib → fastlane/lib}/fastlane/actions/say.rb +0 -0
  175. data/{lib → fastlane/lib}/fastlane/actions/scan.rb +0 -4
  176. data/{lib → fastlane/lib}/fastlane/actions/scp.rb +1 -0
  177. data/{lib → fastlane/lib}/fastlane/actions/screengrab.rb +7 -13
  178. data/{lib → fastlane/lib}/fastlane/actions/set_build_number_repository.rb +0 -0
  179. data/{lib → fastlane/lib}/fastlane/actions/set_changelog.rb +0 -0
  180. data/{lib → fastlane/lib}/fastlane/actions/set_github_release.rb +1 -0
  181. data/{lib → fastlane/lib}/fastlane/actions/set_info_plist_value.rb +0 -0
  182. data/{lib → fastlane/lib}/fastlane/actions/set_pod_key.rb +0 -0
  183. data/{lib → fastlane/lib}/fastlane/actions/setup_jenkins.rb +0 -0
  184. data/{lib → fastlane/lib}/fastlane/actions/sigh.rb +9 -15
  185. data/{lib → fastlane/lib}/fastlane/actions/skip_docs.rb +0 -0
  186. data/{lib → fastlane/lib}/fastlane/actions/slack.rb +1 -0
  187. data/{lib → fastlane/lib}/fastlane/actions/slather.rb +0 -0
  188. data/{lib → fastlane/lib}/fastlane/actions/snapshot.rb +5 -11
  189. data/{lib → fastlane/lib}/fastlane/actions/sonar.rb +0 -0
  190. data/{lib → fastlane/lib}/fastlane/actions/splunkmint.rb +3 -0
  191. data/{lib → fastlane/lib}/fastlane/actions/ssh.rb +1 -0
  192. data/{lib → fastlane/lib}/fastlane/actions/supply.rb +9 -13
  193. data/{lib → fastlane/lib}/fastlane/actions/swiftlint.rb +0 -0
  194. data/{lib → fastlane/lib}/fastlane/actions/team_id.rb +0 -0
  195. data/{lib → fastlane/lib}/fastlane/actions/team_name.rb +0 -0
  196. data/{lib → fastlane/lib}/fastlane/actions/testfairy.rb +28 -9
  197. data/{lib → fastlane/lib}/fastlane/actions/testflight.rb +0 -0
  198. data/{lib → fastlane/lib}/fastlane/actions/tryouts.rb +1 -0
  199. data/{lib → fastlane/lib}/fastlane/actions/twitter.rb +4 -0
  200. data/{lib → fastlane/lib}/fastlane/actions/typetalk.rb +0 -0
  201. data/{lib → fastlane/lib}/fastlane/actions/unlock_keychain.rb +1 -0
  202. data/{lib → fastlane/lib}/fastlane/actions/update_app_group_identifiers.rb +0 -0
  203. data/{lib → fastlane/lib}/fastlane/actions/update_app_identifier.rb +0 -0
  204. data/{lib → fastlane/lib}/fastlane/actions/update_fastlane.rb +1 -20
  205. data/{lib → fastlane/lib}/fastlane/actions/update_icloud_container_identifiers.rb +0 -0
  206. data/{lib → fastlane/lib}/fastlane/actions/update_info_plist.rb +0 -0
  207. data/{lib → fastlane/lib}/fastlane/actions/update_project_code_signing.rb +0 -0
  208. data/{lib → fastlane/lib}/fastlane/actions/update_project_provisioning.rb +0 -0
  209. data/{lib → fastlane/lib}/fastlane/actions/update_project_team.rb +0 -0
  210. data/{lib → fastlane/lib}/fastlane/actions/update_urban_airship_configuration.rb +4 -0
  211. data/{lib → fastlane/lib}/fastlane/actions/update_url_schemes.rb +0 -0
  212. data/{lib → fastlane/lib}/fastlane/actions/upload_symbols_to_crashlytics.rb +1 -0
  213. data/{lib → fastlane/lib}/fastlane/actions/upload_symbols_to_sentry.rb +2 -0
  214. data/{lib → fastlane/lib}/fastlane/actions/verify_build.rb +0 -0
  215. data/{lib → fastlane/lib}/fastlane/actions/verify_pod_keys.rb +0 -0
  216. data/{lib → fastlane/lib}/fastlane/actions/verify_xcode.rb +0 -0
  217. data/{lib → fastlane/lib}/fastlane/actions/version_bump_podspec.rb +0 -0
  218. data/{lib → fastlane/lib}/fastlane/actions/version_get_podspec.rb +0 -0
  219. data/{lib → fastlane/lib}/fastlane/actions/xcode_install.rb +0 -0
  220. data/{lib → fastlane/lib}/fastlane/actions/xcode_select.rb +0 -0
  221. data/{lib → fastlane/lib}/fastlane/actions/xcode_server_get_assets.rb +1 -0
  222. data/{lib → fastlane/lib}/fastlane/actions/xcodebuild.rb +0 -0
  223. data/{lib → fastlane/lib}/fastlane/actions/xcov.rb +0 -0
  224. data/{lib → fastlane/lib}/fastlane/actions/xctool.rb +1 -1
  225. data/{lib → fastlane/lib}/fastlane/actions/xcversion.rb +0 -0
  226. data/{lib → fastlane/lib}/fastlane/actions/zip.rb +0 -0
  227. data/{lib → fastlane/lib}/fastlane/auto_complete.rb +0 -0
  228. data/fastlane/lib/fastlane/cli_tools_distributor.rb +125 -0
  229. data/{lib → fastlane/lib}/fastlane/command_line_handler.rb +0 -0
  230. data/{lib → fastlane/lib}/fastlane/commands_generator.rb +5 -4
  231. data/{lib → fastlane/lib}/fastlane/configuration_helper.rb +0 -1
  232. data/{lib → fastlane/lib}/fastlane/core_ext/bundler_monkey_patch.rb +0 -0
  233. data/{lib → fastlane/lib}/fastlane/documentation/actions_list.rb +1 -1
  234. data/{lib → fastlane/lib}/fastlane/documentation/docs_generator.rb +1 -1
  235. data/{lib → fastlane/lib}/fastlane/documentation/markdown_docs_generator.rb +0 -0
  236. data/{lib → fastlane/lib}/fastlane/environment_printer.rb +1 -1
  237. data/{lib → fastlane/lib}/fastlane/erb_template_helper.rb +0 -0
  238. data/{lib → fastlane/lib}/fastlane/fast_file.rb +1 -1
  239. data/{lib → fastlane/lib}/fastlane/fastlane_require.rb +27 -3
  240. data/{lib → fastlane/lib}/fastlane/features.rb +0 -0
  241. data/{lib → fastlane/lib}/fastlane/helper/README.md +0 -0
  242. data/{lib → fastlane/lib}/fastlane/helper/adb_helper.rb +0 -0
  243. data/{lib → fastlane/lib}/fastlane/helper/cocoapod_helper.rb +0 -0
  244. data/{lib → fastlane/lib}/fastlane/helper/crashlytics_helper.rb +0 -0
  245. data/{lib → fastlane/lib}/fastlane/helper/gem_helper.rb +0 -0
  246. data/{lib → fastlane/lib}/fastlane/helper/git_helper.rb +0 -0
  247. data/{lib → fastlane/lib}/fastlane/helper/gradle_helper.rb +0 -0
  248. data/{lib → fastlane/lib}/fastlane/helper/podspec_helper.rb +0 -0
  249. data/{lib → fastlane/lib}/fastlane/helper/sh_helper.rb +0 -0
  250. data/{lib → fastlane/lib}/fastlane/helper/xcversion_helper.rb +0 -0
  251. data/{lib → fastlane/lib}/fastlane/junit_generator.rb +1 -1
  252. data/{lib → fastlane/lib}/fastlane/lane.rb +0 -0
  253. data/{lib → fastlane/lib}/fastlane/lane_list.rb +0 -0
  254. data/{lib → fastlane/lib}/fastlane/lane_manager.rb +25 -6
  255. data/{lib → fastlane/lib}/fastlane/markdown_table_formatter.rb +0 -0
  256. data/{lib → fastlane/lib}/fastlane/new_action.rb +1 -1
  257. data/{lib → fastlane/lib}/fastlane/one_off.rb +0 -0
  258. data/{lib → fastlane/lib}/fastlane/other_action.rb +0 -0
  259. data/{lib → fastlane/lib}/fastlane/plugins/plugin_fetcher.rb +0 -0
  260. data/{lib → fastlane/lib}/fastlane/plugins/plugin_generator.rb +0 -0
  261. data/{lib → fastlane/lib}/fastlane/plugins/plugin_generator_ui.rb +0 -0
  262. data/{lib → fastlane/lib}/fastlane/plugins/plugin_info.rb +0 -0
  263. data/{lib → fastlane/lib}/fastlane/plugins/plugin_info_collector.rb +0 -0
  264. data/{lib → fastlane/lib}/fastlane/plugins/plugin_manager.rb +4 -4
  265. data/{lib → fastlane/lib}/fastlane/plugins/plugin_search.rb +0 -0
  266. data/{lib → fastlane/lib}/fastlane/plugins/plugin_update_manager.rb +0 -0
  267. data/{lib → fastlane/lib}/fastlane/plugins/plugins.rb +0 -0
  268. data/{lib → fastlane/lib}/fastlane/plugins/template/%gem_name%.gemspec.erb +3 -0
  269. data/{lib → fastlane/lib}/fastlane/plugins/template/.gitignore +0 -0
  270. data/{lib → fastlane/lib}/fastlane/plugins/template/.rspec +0 -0
  271. data/{lib → fastlane/lib}/fastlane/plugins/template/.rubocop.yml +0 -0
  272. data/{lib → fastlane/lib}/fastlane/plugins/template/.travis.yml +0 -0
  273. data/{lib → fastlane/lib}/fastlane/plugins/template/Gemfile +0 -0
  274. data/{lib → fastlane/lib}/fastlane/plugins/template/LICENSE.erb +0 -0
  275. data/{lib → fastlane/lib}/fastlane/plugins/template/README.md.erb +2 -2
  276. data/{lib → fastlane/lib}/fastlane/plugins/template/Rakefile +0 -0
  277. data/{lib → fastlane/lib}/fastlane/plugins/template/circle.yml +0 -0
  278. data/{lib → fastlane/lib}/fastlane/plugins/template/fastlane/Fastfile.erb +0 -0
  279. data/{lib → fastlane/lib}/fastlane/plugins/template/fastlane/Pluginfile.erb +0 -0
  280. data/{lib → fastlane/lib}/fastlane/plugins/template/lib/fastlane/plugin/%plugin_name%.rb.erb +0 -0
  281. data/{lib → fastlane/lib}/fastlane/plugins/template/lib/fastlane/plugin/%plugin_name%/actions/%plugin_name%_action.rb.erb +0 -0
  282. data/{lib → fastlane/lib}/fastlane/plugins/template/lib/fastlane/plugin/%plugin_name%/helper/%plugin_name%_helper.rb.erb +0 -0
  283. data/{lib → fastlane/lib}/fastlane/plugins/template/lib/fastlane/plugin/%plugin_name%/version.rb.erb +0 -0
  284. data/{lib → fastlane/lib}/fastlane/plugins/template/spec/%plugin_name%_action_spec.rb.erb +0 -0
  285. data/{lib → fastlane/lib}/fastlane/plugins/template/spec/spec_helper.rb.erb +0 -0
  286. data/{lib → fastlane/lib}/fastlane/runner.rb +25 -2
  287. data/{lib → fastlane/lib}/fastlane/setup/crashlytics_beta.rb +1 -1
  288. data/{lib → fastlane/lib}/fastlane/setup/crashlytics_beta_command_line_handler.rb +0 -0
  289. data/{lib → fastlane/lib}/fastlane/setup/crashlytics_beta_info.rb +0 -0
  290. data/{lib → fastlane/lib}/fastlane/setup/crashlytics_beta_info_collector.rb +0 -0
  291. data/{lib → fastlane/lib}/fastlane/setup/crashlytics_beta_ui.rb +0 -0
  292. data/{lib → fastlane/lib}/fastlane/setup/crashlytics_beta_user_email_fetcher.rb +0 -0
  293. data/{lib → fastlane/lib}/fastlane/setup/crashlytics_project_parser.rb +0 -0
  294. data/{lib → fastlane/lib}/fastlane/setup/setup.rb +2 -2
  295. data/{lib → fastlane/lib}/fastlane/setup/setup_android.rb +2 -2
  296. data/{lib → fastlane/lib}/fastlane/setup/setup_ios.rb +3 -3
  297. data/{lib → fastlane/lib}/fastlane/supported_platforms.rb +0 -0
  298. data/{lib → fastlane/lib}/fastlane/tools.rb +0 -0
  299. data/{lib → fastlane/lib}/fastlane/version.rb +2 -2
  300. data/fastlane_core/README.md +54 -0
  301. data/fastlane_core/lib/assets/XMLTemplate.xml.erb +12 -0
  302. data/fastlane_core/lib/fastlane_core.rb +48 -0
  303. data/fastlane_core/lib/fastlane_core/cert_checker.rb +94 -0
  304. data/fastlane_core/lib/fastlane_core/command_executor.rb +98 -0
  305. data/fastlane_core/lib/fastlane_core/configuration/commander_generator.rb +82 -0
  306. data/fastlane_core/lib/fastlane_core/configuration/config_item.rb +133 -0
  307. data/fastlane_core/lib/fastlane_core/configuration/configuration.rb +266 -0
  308. data/fastlane_core/lib/fastlane_core/configuration/configuration_file.rb +82 -0
  309. data/fastlane_core/lib/fastlane_core/core_ext/string.rb +17 -0
  310. data/fastlane_core/lib/fastlane_core/device_manager.rb +231 -0
  311. data/fastlane_core/lib/fastlane_core/env.rb +9 -0
  312. data/{lib/fastlane → fastlane_core/lib/fastlane_core}/fastlane_folder.rb +1 -11
  313. data/fastlane_core/lib/fastlane_core/feature/feature.rb +49 -0
  314. data/fastlane_core/lib/fastlane_core/features.rb +2 -0
  315. data/fastlane_core/lib/fastlane_core/helper.rb +240 -0
  316. data/fastlane_core/lib/fastlane_core/ipa_file_analyser.rb +55 -0
  317. data/fastlane_core/lib/fastlane_core/ipa_upload_package_builder.rb +44 -0
  318. data/fastlane_core/lib/fastlane_core/itunes_search_api.rb +48 -0
  319. data/fastlane_core/lib/fastlane_core/itunes_transporter.rb +409 -0
  320. data/fastlane_core/lib/fastlane_core/keychain_importer.rb +27 -0
  321. data/fastlane_core/lib/fastlane_core/languages.rb +11 -0
  322. data/fastlane_core/lib/fastlane_core/pkg_file_analyser.rb +42 -0
  323. data/fastlane_core/lib/fastlane_core/pkg_upload_package_builder.rb +44 -0
  324. data/fastlane_core/lib/fastlane_core/print_table.rb +63 -0
  325. data/fastlane_core/lib/fastlane_core/project.rb +450 -0
  326. data/fastlane_core/lib/fastlane_core/provisioning_profile.rb +69 -0
  327. data/fastlane_core/lib/fastlane_core/string_filters.rb +34 -0
  328. data/fastlane_core/lib/fastlane_core/tool_collector.rb +179 -0
  329. data/fastlane_core/lib/fastlane_core/ui/disable_colors.rb +17 -0
  330. data/fastlane_core/lib/fastlane_core/ui/fastlane_runner.rb +190 -0
  331. data/fastlane_core/lib/fastlane_core/ui/github_issue_inspector_reporter.rb +50 -0
  332. data/fastlane_core/lib/fastlane_core/ui/implementations/shell.rb +122 -0
  333. data/fastlane_core/lib/fastlane_core/ui/interface.rb +159 -0
  334. data/fastlane_core/lib/fastlane_core/ui/ui.rb +26 -0
  335. data/fastlane_core/lib/fastlane_core/update_checker/changelog.rb +37 -0
  336. data/fastlane_core/lib/fastlane_core/update_checker/update_checker.rb +198 -0
  337. data/fastlane_core/lib/fastlane_core/xcodebuild_list_output_parser.rb +28 -0
  338. data/frameit/README.md +284 -0
  339. data/frameit/lib/assets/empty.png +0 -0
  340. data/frameit/lib/frameit.rb +52 -0
  341. data/frameit/lib/frameit/commands_generator.rb +99 -0
  342. data/frameit/lib/frameit/config_parser.rb +98 -0
  343. data/frameit/lib/frameit/dependency_checker.rb +20 -0
  344. data/frameit/lib/frameit/device_types.rb +13 -0
  345. data/frameit/lib/frameit/editor.rb +351 -0
  346. data/frameit/lib/frameit/frame_downloader.rb +71 -0
  347. data/frameit/lib/frameit/mac_editor.rb +32 -0
  348. data/frameit/lib/frameit/offsets.rb +19 -0
  349. data/frameit/lib/frameit/options.rb +46 -0
  350. data/frameit/lib/frameit/runner.rb +45 -0
  351. data/frameit/lib/frameit/screenshot.rb +89 -0
  352. data/frameit/lib/frameit/strings_parser.rb +35 -0
  353. data/frameit/lib/frameit/template_finder.rb +36 -0
  354. data/gym/README.md +288 -0
  355. data/gym/lib/assets/GymfileTemplate +13 -0
  356. data/gym/lib/assets/package_application_patches/0001_codesign_args_patch.diff +38 -0
  357. data/gym/lib/assets/package_application_patches/0002_no_strict_parameter_patch.diff +42 -0
  358. data/gym/lib/assets/package_application_patches/PackageApplication_MD5 +2 -0
  359. data/gym/lib/assets/wrap_xcodebuild/xcbuild-safe.sh +58 -0
  360. data/gym/lib/gym.rb +49 -0
  361. data/gym/lib/gym/commands_generator.rb +62 -0
  362. data/gym/lib/gym/detect_values.rb +105 -0
  363. data/gym/lib/gym/error_handler.rb +186 -0
  364. data/gym/lib/gym/generators/README.md +1 -0
  365. data/gym/lib/gym/generators/build_command_generator.rb +136 -0
  366. data/gym/lib/gym/generators/package_command_generator.rb +58 -0
  367. data/gym/lib/gym/generators/package_command_generator_legacy.rb +102 -0
  368. data/gym/lib/gym/generators/package_command_generator_xcode7.rb +191 -0
  369. data/gym/lib/gym/manager.rb +17 -0
  370. data/gym/lib/gym/options.rb +254 -0
  371. data/gym/lib/gym/runner.rb +256 -0
  372. data/gym/lib/gym/xcode.rb +21 -0
  373. data/gym/lib/gym/xcodebuild_fixes/README.md +9 -0
  374. data/gym/lib/gym/xcodebuild_fixes/generic_archive_fix.rb +32 -0
  375. data/gym/lib/gym/xcodebuild_fixes/package_application_fix.rb +53 -0
  376. data/gym/lib/gym/xcodebuild_fixes/swift_fix.rb +99 -0
  377. data/gym/lib/gym/xcodebuild_fixes/watchkit2_fix.rb +35 -0
  378. data/gym/lib/gym/xcodebuild_fixes/watchkit_fix.rb +40 -0
  379. data/match/README.md +414 -0
  380. data/match/lib/assets/MatchfileTemplate +9 -0
  381. data/match/lib/assets/READMETemplate.md +49 -0
  382. data/match/lib/match.rb +57 -0
  383. data/match/lib/match/change_password.rb +30 -0
  384. data/match/lib/match/commands_generator.rb +120 -0
  385. data/match/lib/match/encrypt.rb +93 -0
  386. data/match/lib/match/generator.rb +74 -0
  387. data/match/lib/match/git_helper.rb +139 -0
  388. data/match/lib/match/nuke.rb +190 -0
  389. data/match/lib/match/options.rb +124 -0
  390. data/match/lib/match/runner.rb +172 -0
  391. data/match/lib/match/setup.rb +20 -0
  392. data/match/lib/match/spaceship_ensure.rb +78 -0
  393. data/match/lib/match/table_printer.rb +43 -0
  394. data/match/lib/match/utils.rb +59 -0
  395. data/pem/README.md +175 -0
  396. data/pem/lib/pem.rb +21 -0
  397. data/pem/lib/pem/commands_generator.rb +41 -0
  398. data/pem/lib/pem/manager.rb +93 -0
  399. data/pem/lib/pem/options.rb +79 -0
  400. data/pilot/README.md +285 -0
  401. data/pilot/lib/pilot.rb +22 -0
  402. data/pilot/lib/pilot/build_manager.rb +209 -0
  403. data/pilot/lib/pilot/commands_generator.rb +136 -0
  404. data/pilot/lib/pilot/features.rb +0 -0
  405. data/pilot/lib/pilot/manager.rb +71 -0
  406. data/pilot/lib/pilot/options.rb +161 -0
  407. data/pilot/lib/pilot/tester_exporter.rb +37 -0
  408. data/pilot/lib/pilot/tester_importer.rb +51 -0
  409. data/pilot/lib/pilot/tester_manager.rb +212 -0
  410. data/pilot/lib/pilot/tester_util.rb +23 -0
  411. data/produce/README.md +232 -0
  412. data/produce/lib/produce.rb +21 -0
  413. data/produce/lib/produce/available_default_languages.rb +36 -0
  414. data/produce/lib/produce/commands_generator.rb +134 -0
  415. data/produce/lib/produce/developer_center.rb +58 -0
  416. data/produce/lib/produce/group.rb +89 -0
  417. data/produce/lib/produce/itunes_connect.rb +87 -0
  418. data/produce/lib/produce/manager.rb +11 -0
  419. data/produce/lib/produce/options.rb +114 -0
  420. data/produce/lib/produce/service.rb +227 -0
  421. data/scan/README.md +219 -0
  422. data/scan/lib/assets/ScanfileTemplate +13 -0
  423. data/scan/lib/scan.rb +40 -0
  424. data/scan/lib/scan/commands_generator.rb +61 -0
  425. data/scan/lib/scan/detect_values.rb +184 -0
  426. data/scan/lib/scan/error_handler.rb +43 -0
  427. data/scan/lib/scan/manager.rb +17 -0
  428. data/scan/lib/scan/options.rb +189 -0
  429. data/scan/lib/scan/report_collector.rb +70 -0
  430. data/scan/lib/scan/runner.rb +103 -0
  431. data/scan/lib/scan/slack_poster.rb +59 -0
  432. data/scan/lib/scan/test_command_generator.rb +130 -0
  433. data/scan/lib/scan/test_result_parser.rb +21 -0
  434. data/screengrab/README.md +190 -0
  435. data/screengrab/lib/assets/ScreengrabfileTemplate +15 -0
  436. data/screengrab/lib/screengrab.rb +32 -0
  437. data/screengrab/lib/screengrab/android_environment.rb +88 -0
  438. data/screengrab/lib/screengrab/commands_generator.rb +60 -0
  439. data/screengrab/lib/screengrab/dependency_checker.rb +56 -0
  440. data/screengrab/lib/screengrab/detect_values.rb +16 -0
  441. data/screengrab/lib/screengrab/options.rb +109 -0
  442. data/screengrab/lib/screengrab/page.html.erb +206 -0
  443. data/screengrab/lib/screengrab/runner.rb +336 -0
  444. data/screengrab/lib/screengrab/setup.rb +16 -0
  445. data/sigh/README.md +256 -0
  446. data/sigh/lib/assets/resign.sh +774 -0
  447. data/sigh/lib/sigh.rb +19 -0
  448. data/sigh/lib/sigh/commands_generator.rb +133 -0
  449. data/sigh/lib/sigh/download_all.rb +36 -0
  450. data/sigh/lib/sigh/local_manage.rb +140 -0
  451. data/sigh/lib/sigh/manager.rb +44 -0
  452. data/sigh/lib/sigh/options.rb +117 -0
  453. data/sigh/lib/sigh/repair.rb +30 -0
  454. data/sigh/lib/sigh/resign.rb +201 -0
  455. data/sigh/lib/sigh/runner.rb +235 -0
  456. data/snapshot/README.md +400 -0
  457. data/snapshot/lib/assets/SnapfileTemplate +36 -0
  458. data/snapshot/lib/assets/SnapshotHelper.swift +138 -0
  459. data/snapshot/lib/assets/SnapshotHelper2-3.swift +140 -0
  460. data/snapshot/lib/snapshot.rb +59 -0
  461. data/snapshot/lib/snapshot/collector.rb +92 -0
  462. data/snapshot/lib/snapshot/commands_generator.rb +108 -0
  463. data/snapshot/lib/snapshot/dependency_checker.rb +50 -0
  464. data/snapshot/lib/snapshot/detect_values.rb +53 -0
  465. data/snapshot/lib/snapshot/error_handler.rb +22 -0
  466. data/snapshot/lib/snapshot/fixes/README.md +5 -0
  467. data/snapshot/lib/snapshot/fixes/hardware_keyboard_fix.rb +14 -0
  468. data/snapshot/lib/snapshot/fixes/simulator_zoom_fix.rb +25 -0
  469. data/snapshot/lib/snapshot/latest_os_version.rb +31 -0
  470. data/snapshot/lib/snapshot/options.rb +161 -0
  471. data/snapshot/lib/snapshot/page.html.erb +206 -0
  472. data/snapshot/lib/snapshot/reports_generator.rb +64 -0
  473. data/snapshot/lib/snapshot/reset_simulators.rb +88 -0
  474. data/snapshot/lib/snapshot/runner.rb +294 -0
  475. data/snapshot/lib/snapshot/screenshot_flatten.rb +18 -0
  476. data/snapshot/lib/snapshot/screenshot_rotate.rb +38 -0
  477. data/snapshot/lib/snapshot/setup.rb +35 -0
  478. data/snapshot/lib/snapshot/test_command_generator.rb +118 -0
  479. data/snapshot/lib/snapshot/update.rb +29 -0
  480. data/spaceship/README.md +191 -0
  481. data/spaceship/lib/assets/languageMapping.json +240 -0
  482. data/spaceship/lib/assets/languageMappingReadable.json +30 -0
  483. data/spaceship/lib/spaceship.rb +31 -0
  484. data/spaceship/lib/spaceship/babosa_fix.rb +30 -0
  485. data/spaceship/lib/spaceship/base.rb +236 -0
  486. data/spaceship/lib/spaceship/client.rb +487 -0
  487. data/spaceship/lib/spaceship/commands_generator.rb +48 -0
  488. data/spaceship/lib/spaceship/du/du_client.rb +122 -0
  489. data/spaceship/lib/spaceship/du/upload_file.rb +56 -0
  490. data/spaceship/lib/spaceship/du/utilities.rb +81 -0
  491. data/spaceship/lib/spaceship/helper/net_http_generic_request.rb +14 -0
  492. data/spaceship/lib/spaceship/helper/plist_middleware.rb +15 -0
  493. data/spaceship/lib/spaceship/launcher.rb +94 -0
  494. data/spaceship/lib/spaceship/playground.rb +72 -0
  495. data/spaceship/lib/spaceship/portal/app.rb +148 -0
  496. data/spaceship/lib/spaceship/portal/app_group.rb +77 -0
  497. data/spaceship/lib/spaceship/portal/app_service.rb +278 -0
  498. data/spaceship/lib/spaceship/portal/certificate.rb +333 -0
  499. data/spaceship/lib/spaceship/portal/device.rb +192 -0
  500. data/spaceship/lib/spaceship/portal/portal.rb +8 -0
  501. data/spaceship/lib/spaceship/portal/portal_base.rb +13 -0
  502. data/spaceship/lib/spaceship/portal/portal_client.rb +491 -0
  503. data/spaceship/lib/spaceship/portal/provisioning_profile.rb +467 -0
  504. data/spaceship/lib/spaceship/portal/spaceship.rb +112 -0
  505. data/spaceship/lib/spaceship/portal/ui/select_team.rb +83 -0
  506. data/spaceship/lib/spaceship/spaceauth_runner.rb +50 -0
  507. data/spaceship/lib/spaceship/tunes/app_details.rb +139 -0
  508. data/spaceship/lib/spaceship/tunes/app_image.rb +55 -0
  509. data/spaceship/lib/spaceship/tunes/app_ratings.rb +107 -0
  510. data/spaceship/lib/spaceship/tunes/app_screenshot.rb +17 -0
  511. data/spaceship/lib/spaceship/tunes/app_status.rb +60 -0
  512. data/spaceship/lib/spaceship/tunes/app_submission.rb +136 -0
  513. data/spaceship/lib/spaceship/tunes/app_trailer.rb +68 -0
  514. data/spaceship/lib/spaceship/tunes/app_version.rb +766 -0
  515. data/spaceship/lib/spaceship/tunes/app_version_common.rb +33 -0
  516. data/spaceship/lib/spaceship/tunes/app_version_generated_promocodes.rb +35 -0
  517. data/spaceship/lib/spaceship/tunes/app_version_history.rb +59 -0
  518. data/spaceship/lib/spaceship/tunes/app_version_promocodes.rb +34 -0
  519. data/spaceship/lib/spaceship/tunes/app_version_ref.rb +19 -0
  520. data/spaceship/lib/spaceship/tunes/app_version_states_history.rb +34 -0
  521. data/spaceship/lib/spaceship/tunes/application.rb +437 -0
  522. data/spaceship/lib/spaceship/tunes/build.rb +269 -0
  523. data/spaceship/lib/spaceship/tunes/build_details.rb +48 -0
  524. data/spaceship/lib/spaceship/tunes/build_train.rb +182 -0
  525. data/spaceship/lib/spaceship/tunes/device_type.rb +14 -0
  526. data/spaceship/lib/spaceship/tunes/language_converter.rb +63 -0
  527. data/spaceship/lib/spaceship/tunes/language_item.rb +56 -0
  528. data/spaceship/lib/spaceship/tunes/pricing_tier.rb +81 -0
  529. data/spaceship/lib/spaceship/tunes/recovery_device.rb +69 -0
  530. data/spaceship/lib/spaceship/tunes/spaceship.rb +34 -0
  531. data/spaceship/lib/spaceship/tunes/tester.rb +283 -0
  532. data/spaceship/lib/spaceship/tunes/transit_app_file.rb +27 -0
  533. data/spaceship/lib/spaceship/tunes/tunes.rb +35 -0
  534. data/spaceship/lib/spaceship/tunes/tunes_base.rb +15 -0
  535. data/spaceship/lib/spaceship/tunes/tunes_client.rb +1068 -0
  536. data/spaceship/lib/spaceship/tunes/user_detail.rb +19 -0
  537. data/spaceship/lib/spaceship/tunes/version_set.rb +35 -0
  538. data/spaceship/lib/spaceship/two_step_client.rb +195 -0
  539. data/spaceship/lib/spaceship/ui.rb +27 -0
  540. data/supply/README.md +214 -0
  541. data/supply/lib/supply.rb +29 -0
  542. data/supply/lib/supply/apk_listing.rb +14 -0
  543. data/supply/lib/supply/client.rb +345 -0
  544. data/supply/lib/supply/commands_generator.rb +62 -0
  545. data/supply/lib/supply/listing.rb +32 -0
  546. data/supply/lib/supply/options.rb +135 -0
  547. data/supply/lib/supply/setup.rb +102 -0
  548. data/supply/lib/supply/uploader.rb +221 -0
  549. metadata +699 -428
  550. data/bin//360/237/232/200 +0 -5
  551. data/lib/.DS_Store +0 -0
  552. data/lib/assets/.DS_Store +0 -0
  553. data/lib/assets/completions/.DS_Store +0 -0
  554. data/lib/fastlane/.DS_Store +0 -0
  555. data/lib/fastlane/actions/gym.rb +0 -90
  556. data/lib/fastlane/actions/reset_simulators.rb +0 -44
  557. data/lib/fastlane/cli_tools_distributor.rb +0 -100
  558. data/lib/fastlane/setup/.DS_Store +0 -0
@@ -0,0 +1,774 @@
1
+ #!/bin/bash
2
+
3
+ # Copyright (c) 2011 Float Mobile Learning
4
+ # http://www.floatlearning.com/
5
+ # Extension Copyright (c) 2013 Weptun Gmbh
6
+ # http://www.weptun.de
7
+ #
8
+ # Extended by Ronan O Ciosoig January 2012
9
+ #
10
+ # Extended by Patrick Blitz, April 2013
11
+ #
12
+ # Extended by John Turnipseed and Matthew Nespor, November 2014
13
+ # http://nanonation.net/
14
+ #
15
+ # Extended by Nicolas Bachschmidt, October 2015
16
+ #
17
+ # Permission is hereby granted, free of charge, to any person obtaining
18
+ # a copy of this software and associated documentation files (the "Software"),
19
+ # to deal in the Software without restriction, including without limitation
20
+ # the rights to use, copy, modify, merge, publish, distribute, sublicense,
21
+ # and/or sell copies of the Software, and to permit persons to whom the
22
+ # Software is furnished to do so, subject to the following conditions:
23
+ #
24
+ # The above copyright notice and this permission notice shall be included
25
+ # in all copies or substantial portions of the Software.
26
+ #
27
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
28
+ # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
29
+ # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
30
+ # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
31
+ # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
32
+ # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
33
+ # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
34
+ #
35
+ # Please let us know about any improvements you make to this script!
36
+ # ./floatsign source "iPhone Distribution: Name" -p "path/to/profile" [-d "display name"] [-e entitlements] [-k keychain] [-b "BundleIdentifier"] outputIpa
37
+ #
38
+ #
39
+ # Modifed 26th January 2012
40
+ #
41
+ # new features January 2012:
42
+ # 1. change the app display name
43
+ #
44
+ # new features April 2013
45
+ # 1. specify the target bundleId on the command line
46
+ # 2. correctly handles entitlements for keychain-enabled resigning
47
+ #
48
+ # new features November 2014
49
+ # 1. now re-signs embedded iOS frameworks, if present, prior to re-signing the application itself
50
+ # 2. extracts the team-identifier from provisioning profile and uses it to update previous entitlements
51
+ # 3. fixed bug in packaging if -e flag is used
52
+ # 4. renamed 'temp' directory and made it a variable so it can be easily modified
53
+ # 5. various code formatting and logging adjustments
54
+ #
55
+ # new features October 2015
56
+ # 1. now re-signs nested applications and app extensions, if present, prior to re-signing the application itself
57
+ # 2. enables the -p option to be used more than once
58
+ # 3. ensures the provisioning profile's bundle-identifier matches the app's bundle identifier
59
+ # 4. extracts the entitlements from the provisioning profile
60
+ # 5. copy the entitlements as archived-expanded-entitlements.xcent inside the app bundle (because Xcode does too)
61
+ #
62
+
63
+ # Logging functions
64
+
65
+ log() {
66
+ # Make sure it returns 0 code even when verose mode is off (test 1)
67
+ # To use like [[ condition ]] && log "x" && something
68
+ [[ -n "$VERBOSE" ]] && echo -e "$@" || test 1
69
+ }
70
+
71
+ error() {
72
+ echo "$@" >&2
73
+ exit 1
74
+ }
75
+
76
+ warning() {
77
+ echo "$@" >&2
78
+ }
79
+
80
+ function checkStatus {
81
+
82
+ if [ $? -ne 0 ];
83
+ then
84
+ error "Encountered an error, aborting!"
85
+ fi
86
+ }
87
+
88
+ usage() {
89
+ echo -e "Usage: $(basename $0) source identity -p|--provisioning provisioning" >&2
90
+ echo -e "\t\t[-e|--entitlements entitlements]" >&2
91
+ echo -e "\t\t[-k|--keychain keychain]" >&2
92
+ echo -e "\t\t[-d|--display-name displayName]" >&2
93
+ echo -e "\t\t[-n|--version-number version]" >&2
94
+ echo -e "\t\t[--short-version shortVersion]" >&2
95
+ echo -e "\t\t[--bundle-version bundleVersion]" >&2
96
+ echo -e "\t\t[-b|--bundle-id bundleId]" >&2
97
+ echo -e "\t\t[--use-app-entitlements]" >&2
98
+ echo -e "\t\toutputIpa" >&2
99
+ echo "Usage: $(basename $0) -h|--help" >&2
100
+ echo "Options:" >&2
101
+ echo -e "\t-p, --provisioning provisioning\t\tProvisioning profile option, may be provided multiple times." >&2
102
+ echo -e "\t\t\t\t\t\tYou can specify provisioning profile file name." >&2
103
+ echo -e "\t\t\t\t\t\t\t-p xxx.mobileprovision" >&2
104
+ echo "" >&2
105
+ echo -e "\t\t\t\t\t\tAlternatively you may provide multiple provisioning profiles if the application contains" >&2
106
+ echo -e "\t\t\t\t\t\tnested applications or app extensions, which need their own provisioning" >&2
107
+ echo -e "\t\t\t\t\t\tprofile. You can do so by providing -p option multiple times specifying" >&2
108
+ echo -e "\t\t\t\t\t\told bundle identifier and new provisioning profile for that bundle id joined with '='." >&2
109
+ echo -e "\t\t\t\t\t\t\t-p com.main-app=main-app.mobileprovision" >&2
110
+ echo -e "\t\t\t\t\t\t\t-p com.nested-app=nested-app.mobileprovision" >&2
111
+ echo -e "\t\t\t\t\t\t\t-p com.nested-extension=nested-extension.mobileprovision" >&2
112
+ echo "" >&2
113
+ echo -e "\t-e, --entitlements entitlements\t\tSpecify entitlements file path for code signing." >&2
114
+ echo -e "\t-k, --keychain keychain\t\t\tSpecify keychain for code signing." >&2
115
+ echo -e "\t-d, --display-name displayName\t\tSpecify new display name." >&2
116
+ echo -e "\t\t\t\t\t\t\tWarning: will apply for all nested apps and extensions." >&2
117
+ echo -e "\t-n, --version-number version\t\tSpecify new version number." >&2
118
+ echo -e "\t\t\t\t\t\t\tWill set CFBundleShortVersionString and CFBundleVersion values in Info.plist." >&2
119
+ echo -e "\t\t\t\t\t\t\tWill apply for all nested apps and extensions." >&2
120
+ echo -e "\t --short-version shortVersion\tSpecify new short version string (CFBundleShortVersionString)." >&2
121
+ echo -e "\t\t\t\t\t\t\tWill apply for all nested apps and extensions." >&2
122
+ echo -e "\t\t\t\t\t\t\tCan't use together with '-n, --version-number' option." >&2
123
+ echo -e "\t --bundle-version bundleVersion\tSpecify new bundle version (CFBundleVersion) number." >&2
124
+ echo -e "\t\t\t\t\t\t\tWill apply for all nested apps and extensions." >&2
125
+ echo -e "\t\t\t\t\t\t\tCan't use together with '-n, --version-number' option." >&2
126
+ echo -e "\t-b, --bundle-id bundleId\t\tSpecify new bundle identifier (CFBundleIdentifier)." >&2
127
+ echo -e "\t\t\t\t\t\t\tWarning: will NOT apply for nested apps and extensions." >&2
128
+ echo -e "\t --use-app-entitlements\t\tExtract app bundle codesigning entitlements and combine with entitlements from new provisionin profile." >&2
129
+ echo -e "\t\t\t\t\t\t\tCan't use together with '-e, --entitlements' option." >&2
130
+ echo -e "\t--keychain-path path\t\t\tSpecify the path to a keychain that /usr/bin/codesign should use." >&2
131
+ echo -e "\t-v, --verbose\t\t\t\tVerbose output." >&2
132
+ echo -e "\t-h, --help\t\t\t\tDisplay help message." >&2
133
+ exit 2
134
+ }
135
+
136
+ if [ $# -lt 3 ]; then
137
+ usage
138
+ fi
139
+
140
+ ORIGINAL_FILE="$1"
141
+ CERTIFICATE="$2"
142
+ ENTITLEMENTS=
143
+ BUNDLE_IDENTIFIER=""
144
+ DISPLAY_NAME=""
145
+ KEYCHAIN=""
146
+ VERSION_NUMBER=""
147
+ SHORT_VERSION=
148
+ BUNDLE_VERSION=
149
+ KEYCHAIN_PATH=
150
+ RAW_PROVISIONS=()
151
+ PROVISIONS_BY_ID=()
152
+ DEFAULT_PROVISION=""
153
+ TEMP_DIR="_floatsignTemp"
154
+ USE_APP_ENTITLEMENTS=""
155
+
156
+ # List of plist keys used for reference to and from nested apps and extensions
157
+ NESTED_APP_REFERENCE_KEYS=(":WKCompanionAppBundleIdentifier" ":NSExtension:NSExtensionAttributes:WKAppBundleIdentifier")
158
+
159
+ # options start index
160
+ shift 2
161
+
162
+ # Parse args
163
+ while [ "$1" != "" ]; do
164
+ case $1 in
165
+ -p | --provisioning )
166
+ shift
167
+ RAW_PROVISIONS+=("$1")
168
+ ;;
169
+ -e | --entitlements )
170
+ shift
171
+ ENTITLEMENTS="$1"
172
+ ;;
173
+ -d | --display-name )
174
+ shift
175
+ DISPLAY_NAME="$1"
176
+ ;;
177
+ -b | --bundle-id )
178
+ shift
179
+ BUNDLE_IDENTIFIER="$1"
180
+ ;;
181
+ -k | --keychain )
182
+ shift
183
+ KEYCHAIN="$1"
184
+ ;;
185
+ -n | --version-number )
186
+ shift
187
+ VERSION_NUMBER="$1"
188
+ ;;
189
+ --short-version )
190
+ shift
191
+ SHORT_VERSION="$1"
192
+ ;;
193
+ --bundle-version )
194
+ shift
195
+ BUNDLE_VERSION="$1"
196
+ ;;
197
+ --use-app-entitlements )
198
+ USE_APP_ENTITLEMENTS="YES"
199
+ ;;
200
+ --keychain-path )
201
+ shift
202
+ KEYCHAIN_PATH="$1"
203
+ ;;
204
+ -v | --verbose )
205
+ VERBOSE="--verbose"
206
+ ;;
207
+ -h | --help )
208
+ usage
209
+ ;;
210
+ * )
211
+ [[ -n "$NEW_FILE" ]] && error "Multiple output file names specified!"
212
+ [[ -z "$NEW_FILE" ]] && NEW_FILE="$1"
213
+ ;;
214
+ esac
215
+
216
+ # Next arg
217
+ shift
218
+ done
219
+
220
+ KEYCHAIN_FLAG=
221
+ if [ -n "$KEYCHAIN_PATH" ]
222
+ then
223
+ KEYCHAIN_FLAG="--keychain $KEYCHAIN_PATH"
224
+ fi
225
+
226
+ # Log the options
227
+ for provision in ${RAW_PROVISIONS[@]}; do
228
+ if [[ "$provision" =~ .+=.+ ]]; then
229
+ log "Specified provisioning profile: '${provision#*=}' for bundle identifier: '${provision%%=*}'"
230
+ else
231
+ log "Specified provisioning profile: '$provision'"
232
+ fi
233
+ done
234
+
235
+ log "Original file: '$ORIGINAL_FILE'"
236
+ log "Certificate: '$CERTIFICATE'"
237
+ [[ -n "${DISPLAY_NAME}" ]] && log "Specified display name: '$DISPLAY_NAME'"
238
+ [[ -n "${ENTITLEMENTS}" ]] && log "Specified signing entitlements: '$ENTITLEMENTS'"
239
+ [[ -n "${BUNDLE_IDENTIFIER}" ]] && log "Specified bundle identifier: '$BUNDLE_IDENTIFIER'"
240
+ [[ -n "${KEYCHAIN}" ]] && log "Specified keychain to use: '$KEYCHAIN'"
241
+ [[ -n "${VERSION_NUMBER}" ]] && log "Specified version number to use: '$VERSION_NUMBER'"
242
+ [[ -n "${SHORT_VERSION}" ]] && log "Specified short version to use: '$SHORT_VERSION'"
243
+ [[ -n "${BUNDLE_VERSION}" ]] && log "Specified bundle version to use: '$BUNDLE_VERSION'"
244
+ [[ -n "${KEYCHAIN_FLAG}" ]] && log "Specified keychain to use: '$KEYCHAIN_PATH'"
245
+ [[ -n "${NEW_FILE}" ]] && log "Output file name: '$NEW_FILE'"
246
+ [[ -n "${USE_APP_ENTITLEMENTS}" ]] && log "Extract app entitlements: YES"
247
+
248
+ # Check that version number option is not clashing with short or bundle version options
249
+ [[ -n "$VERSION_NUMBER" && (-n "$SHORT_VERSION" || -n "$BUNDLE_VERSION") ]] && error "versionNumber option cannot be used in combination with shortVersion or bundleVersion options"
250
+
251
+ # Check that --use-app-entitlements and -e, --entitlements are not used at the same time
252
+ [[ -n "${USE_APP_ENTITLEMENTS}" && -n ${ENTITLEMENTS} ]] && error "--use-app-entitlements option cannot be used in combination with -e, --entitlements option."
253
+
254
+ # Check output file name
255
+ if [ -z "$NEW_FILE" ];
256
+ then
257
+ error "Output file name required"
258
+ fi
259
+
260
+ if [[ "${#RAW_PROVISIONS[*]}" == "0" ]]; then
261
+ error "-p 'xxxx.mobileprovision' argument is required"
262
+ fi
263
+
264
+ # Check for and remove the temporary directory if it already exists
265
+ if [ -d "$TEMP_DIR" ];
266
+ then
267
+ log "Removing previous temporary directory: '$TEMP_DIR'"
268
+ rm -Rf "$TEMP_DIR"
269
+ fi
270
+
271
+ filename=$(basename "$ORIGINAL_FILE")
272
+ extension="${filename##*.}"
273
+ filename="${filename%.*}"
274
+
275
+ # Check if the supplied file is an ipa or an app file
276
+ if [ "${extension}" = "ipa" ]
277
+ then
278
+ # Unzip the old ipa quietly
279
+ unzip -q "$ORIGINAL_FILE" -d $TEMP_DIR
280
+ checkStatus
281
+ elif [ "${extension}" = "app" ]
282
+ then
283
+ # Copy the app file into an ipa-like structure
284
+ mkdir -p "$TEMP_DIR/Payload"
285
+ cp -Rf "${ORIGINAL_FILE}" "$TEMP_DIR/Payload/${filename}.app"
286
+ checkStatus
287
+ else
288
+ error "Error: Only can resign .app files and .ipa files."
289
+ fi
290
+
291
+ # check the keychain
292
+ if [ "${KEYCHAIN}" != "" ];
293
+ then
294
+ security list-keychains -s $KEYCHAIN
295
+ security unlock $KEYCHAIN
296
+ security default-keychain -s $KEYCHAIN
297
+ fi
298
+
299
+ # Set the app name
300
+ # In Payload directory may be another file except .app file, such as StoreKit folder.
301
+ # Search the first .app file within the Payload directory
302
+ APP_NAME=$(ls "$TEMP_DIR/Payload/"|grep ".app$"| head -1)
303
+
304
+ # Make sure that PATH includes the location of the PlistBuddy helper tool as its location is not standard
305
+ export PATH=$PATH:/usr/libexec
306
+
307
+ # Test whether two bundle identifiers match
308
+ # The first one may contain the wildcard character '*', in which case pattern matching will be used unless the third parameter is "STRICT"
309
+ function does_bundle_id_match {
310
+
311
+ if [[ "$1" == "$2" ]]; then
312
+ return 0
313
+ elif [[ "$3" != STRICT && "$1" =~ \* ]]; then
314
+ local PATTERN0="${1//\./\\.}" # com.example.* -> com\.example\.*
315
+ local PATTERN1="${PATTERN0//\*/.*}" # com\.example\.* -> com\.example\..*
316
+ if [[ "$2" =~ ^$PATTERN1$ ]]; then
317
+ return 0
318
+ fi
319
+ fi
320
+
321
+ return 1
322
+ }
323
+
324
+ # Find the provisioning profile for a given bundle identifier
325
+ function provision_for_bundle_id {
326
+
327
+ for ARG in "${PROVISIONS_BY_ID[@]}"; do
328
+ if does_bundle_id_match "${ARG%%=*}" "$1" "$2"; then
329
+ echo "${ARG#*=}"
330
+ break
331
+ fi
332
+ done
333
+ }
334
+
335
+ # Find the bundle identifier contained inside a provisioning profile
336
+ function bundle_id_for_provison {
337
+
338
+ local FULL_BUNDLE_ID=`PlistBuddy -c 'Print :Entitlements:application-identifier' /dev/stdin <<< $(security cms -D -i "$1")`
339
+ checkStatus
340
+ echo "${FULL_BUNDLE_ID#*.}"
341
+ }
342
+
343
+ # Add given provisioning profile and bundle identifier to the search list
344
+ function add_provision_for_bundle_id {
345
+
346
+ local PROVISION="$1"
347
+ local BUNDLE_ID="$2"
348
+
349
+ local CURRENT_PROVISION=`provision_for_bundle_id "$BUNDLE_ID" STRICT`
350
+
351
+ if [[ "$CURRENT_PROVISION" != "" && "$CURRENT_PROVISION" != "$PROVISION" ]]; then
352
+ error "Conflicting provisioning profiles '$PROVISION' and '$CURRENT_PROVISION' for bundle identifier '$BUNDLE_ID'."
353
+ fi
354
+
355
+ PROVISIONS_BY_ID+=("$BUNDLE_ID=$PROVISION")
356
+ }
357
+
358
+ # Add given provisioning profile to the search list
359
+ function add_provision {
360
+
361
+ local PROVISION="$1"
362
+
363
+ if [[ "$1" =~ .+=.+ ]]; then
364
+ PROVISION="${1#*=}"
365
+ add_provision_for_bundle_id "$PROVISION" "${1%%=*}"
366
+ elif [[ "$DEFAULT_PROVISION" == "" ]]; then
367
+ DEFAULT_PROVISION="$PROVISION"
368
+ fi
369
+
370
+ if [[ ! -e "$PROVISION" ]]; then
371
+ error "Provisioning profile '$PROVISION' file does not exist"
372
+ fi
373
+
374
+ local BUNDLE_ID=`bundle_id_for_provison "$PROVISION"`
375
+ add_provision_for_bundle_id "$PROVISION" "$BUNDLE_ID"
376
+ }
377
+
378
+ # Load bundle identifiers from provisioning profiles
379
+ for ARG in "${RAW_PROVISIONS[@]}"; do
380
+ add_provision "$ARG"
381
+ done
382
+
383
+ # Resign the given application
384
+ function resign {
385
+
386
+ local APP_PATH="$1"
387
+ local NESTED="$2"
388
+ local BUNDLE_IDENTIFIER="$BUNDLE_IDENTIFIER"
389
+ local NEW_PROVISION="$NEW_PROVISION"
390
+ local APP_IDENTIFIER_PREFIX=""
391
+ local TEAM_IDENTIFIER=""
392
+
393
+ if [[ "$NESTED" == NESTED ]]; then
394
+ # Ignore bundle identifier for nested applications
395
+ BUNDLE_IDENTIFIER=""
396
+ fi
397
+
398
+ # Make sure that the Info.plist file is where we expect it
399
+ if [ ! -e "$APP_PATH/Info.plist" ];
400
+ then
401
+ error "Expected file does not exist: '$APP_PATH/Info.plist'"
402
+ fi
403
+
404
+ # Make a copy of old Info.plist, it will come handy later to extract some old values
405
+ cp -f "$APP_PATH/Info.plist" "$TEMP_DIR/oldInfo.plist"
406
+
407
+ # Read in current values from the app
408
+ local CURRENT_NAME=`PlistBuddy -c "Print :CFBundleDisplayName" "$APP_PATH/Info.plist"`
409
+ local CURRENT_BUNDLE_IDENTIFIER=`PlistBuddy -c "Print :CFBundleIdentifier" "$APP_PATH/Info.plist"`
410
+ local NEW_PROVISION=`provision_for_bundle_id "${BUNDLE_IDENTIFIER:-$CURRENT_BUNDLE_IDENTIFIER}"`
411
+
412
+ if [[ "$NEW_PROVISION" == "" && "$NESTED" != NESTED ]]; then
413
+ NEW_PROVISION="$DEFAULT_PROVISION"
414
+ fi
415
+
416
+ if [[ "$NEW_PROVISION" == "" ]]; then
417
+ if [[ "$NESTED" == NESTED ]]; then
418
+ warning "No provisioning profile for nested application: '$APP_PATH' with bundle identifier '${BUNDLE_IDENTIFIER:-$CURRENT_BUNDLE_IDENTIFIER}'"
419
+ else
420
+ warning "No provisioning profile for application: '$APP_PATH' with bundle identifier '${BUNDLE_IDENTIFIER:-$CURRENT_BUNDLE_IDENTIFIER}'"
421
+ fi
422
+ error "Use the -p option (example: -p com.example.app=xxxx.mobileprovision)"
423
+ fi
424
+
425
+ local PROVISION_BUNDLE_IDENTIFIER=`bundle_id_for_provison "$NEW_PROVISION"`
426
+
427
+ # Use provisioning profile's bundle identifier
428
+ if [ "$BUNDLE_IDENTIFIER" == "" ]; then
429
+ if [[ "$PROVISION_BUNDLE_IDENTIFIER" =~ \* ]]; then
430
+ log "Bundle Identifier contains a *, using the current bundle identifier"
431
+ BUNDLE_IDENTIFIER="$CURRENT_BUNDLE_IDENTIFIER"
432
+ else
433
+ BUNDLE_IDENTIFIER="$PROVISION_BUNDLE_IDENTIFIER"
434
+ fi
435
+ fi
436
+
437
+ if ! does_bundle_id_match "$PROVISION_BUNDLE_IDENTIFIER" "$BUNDLE_IDENTIFIER"; then
438
+ error "Bundle Identifier '$PROVISION_BUNDLE_IDENTIFIER' in provisioning profile '$NEW_PROVISION' does not match the Bundle Identifier '$BUNDLE_IDENTIFIER' for application '$APP_PATH'."
439
+ fi
440
+
441
+ log "Current bundle identifier is: '$CURRENT_BUNDLE_IDENTIFIER'"
442
+ log "New bundle identifier will be: '$BUNDLE_IDENTIFIER'"
443
+
444
+ # Update the CFBundleDisplayName property in the Info.plist if a new name has been provided
445
+ if [ "${DISPLAY_NAME}" != "" ];
446
+ then
447
+ if [ "${DISPLAY_NAME}" != "${CURRENT_NAME}" ];
448
+ then
449
+ log "Changing display name from '$CURRENT_NAME' to '$DISPLAY_NAME'"
450
+ `PlistBuddy -c "Set :CFBundleDisplayName $DISPLAY_NAME" "$APP_PATH/Info.plist"`
451
+ fi
452
+ fi
453
+
454
+ # Replace the embedded mobile provisioning profile
455
+ log "Validating the new provisioning profile: $NEW_PROVISION"
456
+ security cms -D -i "$NEW_PROVISION" > "$TEMP_DIR/profile.plist"
457
+ checkStatus
458
+
459
+ APP_IDENTIFIER_PREFIX=`PlistBuddy -c "Print :Entitlements:application-identifier" "$TEMP_DIR/profile.plist" | grep -E '^[A-Z0-9]*' -o | tr -d '\n'`
460
+ if [ "$APP_IDENTIFIER_PREFIX" == "" ];
461
+ then
462
+ APP_IDENTIFIER_PREFIX=`PlistBuddy -c "Print :ApplicationIdentifierPrefix:0" "$TEMP_DIR/profile.plist"`
463
+ if [ "$APP_IDENTIFIER_PREFIX" == "" ];
464
+ then
465
+ error "Failed to extract any app identifier prefix from '$NEW_PROVISION'"
466
+ else
467
+ warning "WARNING: extracted an app identifier prefix '$APP_IDENTIFIER_PREFIX' from '$NEW_PROVISION', but it was not found in the profile's entitlements"
468
+ fi
469
+ else
470
+ log "Profile app identifier prefix is '$APP_IDENTIFIER_PREFIX'"
471
+ fi
472
+
473
+ # Set new app identifer prefix if such entry exists in plist file
474
+ PlistBuddy -c "Set :AppIdentifierPrefix $APP_IDENTIFIER_PREFIX." "$APP_PATH/Info.plist" 2>/dev/null
475
+
476
+ TEAM_IDENTIFIER=`PlistBuddy -c "Print :Entitlements:com.apple.developer.team-identifier" "$TEMP_DIR/profile.plist" | tr -d '\n'`
477
+ if [ "$TEAM_IDENTIFIER" == "" ];
478
+ then
479
+ TEAM_IDENTIFIER=`PlistBuddy -c "Print :TeamIdentifier:0" "$TEMP_DIR/profile.plist"`
480
+ if [ "$TEAM_IDENTIFIER" == "" ];
481
+ then
482
+ warning "Failed to extract team identifier from '$NEW_PROVISION', resigned ipa may fail on iOS 8 and higher"
483
+ else
484
+ warning "WARNING: extracted a team identifier '$TEAM_IDENTIFIER' from '$NEW_PROVISION', but it was not found in the profile's entitlements, resigned ipa may fail on iOS 8 and higher"
485
+ fi
486
+ else
487
+ log "Profile team identifier is '$TEAM_IDENTIFIER'"
488
+ fi
489
+
490
+ # Make a copy of old embedded provisioning profile for futher use
491
+ cp -f "$APP_PATH/embedded.mobileprovision" "$TEMP_DIR/old-embedded.mobileprovision"
492
+
493
+ # Replace embedded provisioning profile with new file
494
+ cp -f "$NEW_PROVISION" "$APP_PATH/embedded.mobileprovision"
495
+
496
+ #if the current bundle identifier is different from the new one in the provisioning profile, then change it.
497
+ if [ "$CURRENT_BUNDLE_IDENTIFIER" != "$BUNDLE_IDENTIFIER" ];
498
+ then
499
+ log "Updating the bundle identifier from '$CURRENT_BUNDLE_IDENTIFIER' to '$BUNDLE_IDENTIFIER'"
500
+ `PlistBuddy -c "Set :CFBundleIdentifier $BUNDLE_IDENTIFIER" "$APP_PATH/Info.plist"`
501
+ checkStatus
502
+ fi
503
+
504
+ # Update the version number properties in the Info.plist if a version number has been provided
505
+ if [ "$VERSION_NUMBER" != "" ];
506
+ then
507
+ CURRENT_VERSION_NUMBER=`PlistBuddy -c "Print :CFBundleVersion" "$APP_PATH/Info.plist"`
508
+ if [ "$VERSION_NUMBER" != "$CURRENT_VERSION_NUMBER" ];
509
+ then
510
+ log "Updating the version from '$CURRENT_VERSION_NUMBER' to '$VERSION_NUMBER'"
511
+ `PlistBuddy -c "Set :CFBundleVersion $VERSION_NUMBER" "$APP_PATH/Info.plist"`
512
+ `PlistBuddy -c "Set :CFBundleShortVersionString $VERSION_NUMBER" "$APP_PATH/Info.plist"`
513
+ fi
514
+ fi
515
+
516
+ # Update short version string in the Info.plist if provided
517
+ if [[ -n "$SHORT_VERSION" ]];
518
+ then
519
+ CURRENT_VALUE="$(PlistBuddy -c "Print :CFBundleShortVersionString" "$APP_PATH/Info.plist")"
520
+ # Even if the old value is same - just update, less code, less debugging
521
+ log "Updating the short version string (CFBundleShortVersionString) from '$CURRENT_VALUE' to '$SHORT_VERSION'"
522
+ PlistBuddy -c "Set :CFBundleShortVersionString $SHORT_VERSION" "$APP_PATH/Info.plist"
523
+ fi
524
+
525
+ # Update bundle version in the Info.plist if provided
526
+ if [[ -n "$BUNDLE_VERSION" ]];
527
+ then
528
+ CURRENT_VALUE="$(PlistBuddy -c "Print :CFBundleVersion" "$APP_PATH/Info.plist")"
529
+ # Even if the old value is same - just update, less code, less debugging
530
+ log "Updating the bundle version (CFBundleVersion) from '$CURRENT_VALUE' to '$BUNDLE_VERSION'"
531
+ PlistBuddy -c "Set :CFBundleVersion $BUNDLE_VERSION" "$APP_PATH/Info.plist"
532
+ fi
533
+
534
+ # Check for and resign any embedded frameworks (new feature for iOS 8 and above apps)
535
+ FRAMEWORKS_DIR="$APP_PATH/Frameworks"
536
+ if [ -d "$FRAMEWORKS_DIR" ];
537
+ then
538
+ if [ "$TEAM_IDENTIFIER" == "" ];
539
+ then
540
+ error "ERROR: embedded frameworks detected, re-signing iOS 8 (or higher) applications wihout a team identifier in the certificate/profile does not work"
541
+ fi
542
+
543
+ log "Resigning embedded frameworks using certificate: '$CERTIFICATE'"
544
+ for framework in "$FRAMEWORKS_DIR"/*
545
+ do
546
+ if [[ "$framework" == *.framework || "$framework" == *.dylib ]]
547
+ then
548
+ /usr/bin/codesign ${VERBOSE} ${KEYCHAIN_FLAG} -f -s "$CERTIFICATE" "$framework"
549
+ checkStatus
550
+ else
551
+ log "Ignoring non-framework: $framework"
552
+ fi
553
+ done
554
+ fi
555
+
556
+ # Check for and update bundle identifiers for extensions and associated nested apps
557
+ log "Fixing nested app and extension references"
558
+ for key in ${NESTED_APP_REFERENCE_KEYS[@]}; do
559
+ # Check if Info.plist has a reference to another app or extension
560
+ REF_BUNDLE_ID=`PlistBuddy -c "Print ${key}" "$APP_PATH/Info.plist" 2>/dev/null`
561
+ if [ -n "$REF_BUNDLE_ID" ];
562
+ then
563
+ # Found a reference bundle id, now get the corresponding provisioning profile for this bundle id
564
+ REF_PROVISION=`provision_for_bundle_id $REF_BUNDLE_ID`
565
+ # Map to the new bundle id
566
+ NEW_REF_BUNDLE_ID=`bundle_id_for_provison "$REF_PROVISION"`
567
+ # Change if not the same and if doesn't contain wildcard
568
+ if [[ "$REF_BUNDLE_ID" != "$NEW_REF_BUNDLE_ID" ]] && ! [[ "$NEW_REF_BUNDLE_ID" =~ \* ]];
569
+ then
570
+ log "Updating nested app or extension reference for ${key} key from ${REF_BUNDLE_ID} to ${NEW_REF_BUNDLE_ID}"
571
+ `PlistBuddy -c "Set ${key} $NEW_REF_BUNDLE_ID" "$APP_PATH/Info.plist"`
572
+ fi
573
+ fi
574
+ done
575
+
576
+ if [ "$ENTITLEMENTS" != "" ];
577
+ then
578
+ if [ -n "$APP_IDENTIFIER_PREFIX" ];
579
+ then
580
+ # sanity check the 'application-identifier' is present in the provided entitlements and matches the provisioning profile value
581
+ ENTITLEMENTS_APP_ID_PREFIX=`PlistBuddy -c "Print :application-identifier" "$ENTITLEMENTS" | grep -E '^[A-Z0-9]*' -o | tr -d '\n'`
582
+ if [ "$ENTITLEMENTS_APP_ID_PREFIX" == "" ];
583
+ then
584
+ error "Provided entitlements file is missing a value for the required 'application-identifier' key"
585
+ elif [ "$ENTITLEMENTS_APP_ID_PREFIX" != "$APP_IDENTIFIER_PREFIX" ];
586
+ then
587
+ error "Provided entitlements file's app identifier prefix value '$ENTITLEMENTS_APP_ID_PREFIX' does not match the provided provisioning profile's value '$APP_IDENTIFIER_PREFIX'"
588
+ fi
589
+ fi
590
+
591
+ if [ -n "$TEAM_IDENTIFIER" ];
592
+ then
593
+ # sanity check the 'com.apple.developer.team-identifier' is present in the provided entitlements and matches the provisioning profile value
594
+ ENTITLEMENTS_TEAM_IDENTIFIER=`PlistBuddy -c "Print :com.apple.developer.team-identifier" "$ENTITLEMENTS" | tr -d '\n'`
595
+ if [ "$ENTITLEMENTS_TEAM_IDENTIFIER" == "" ];
596
+ then
597
+ error "Provided entitlements file is missing a value for the required 'com.apple.developer.team-identifier' key"
598
+ elif [ "$ENTITLEMENTS_TEAM_IDENTIFIER" != "$TEAM_IDENTIFIER" ];
599
+ then
600
+ error "Provided entitlements file's 'com.apple.developer.team-identifier' '$ENTITLEMENTS_TEAM_IDENTIFIER' does not match the provided provisioning profile's value '$TEAM_IDENTIFIER'"
601
+ fi
602
+ fi
603
+
604
+ log "Resigning application using certificate: '$CERTIFICATE'"
605
+ log "and entitlements: $ENTITLEMENTS"
606
+ cp -f "$ENTITLEMENTS" "$APP_PATH/archived-expanded-entitlements.xcent"
607
+ /usr/bin/codesign ${VERBOSE} -f -s "$CERTIFICATE" --entitlements "$ENTITLEMENTS" "$APP_PATH"
608
+ checkStatus
609
+ elif [[ -n "${USE_APP_ENTITLEMENTS}" ]];
610
+ then
611
+ # Extract entitlements from provisioning profile and from the app binary
612
+ # then combine them together
613
+
614
+ log "Extracting entitlements from provisioning profile"
615
+ PROFILE_ENTITLEMENTS="$TEMP_DIR/profileEntitlements"
616
+ PlistBuddy -x -c "Print Entitlements" "$TEMP_DIR/profile.plist" > "$PROFILE_ENTITLEMENTS"
617
+ checkStatus
618
+
619
+ log "Extracting entitlements from the app"
620
+ APP_ENTITLEMENTS="$TEMP_DIR/appEntitlements"
621
+ /usr/bin/codesign -d --entitlements :"$APP_ENTITLEMENTS" "$APP_PATH"
622
+ checkStatus
623
+
624
+ log "\nApp entitlements for ${APP_PATH}:"
625
+ log "$(cat "$APP_ENTITLEMENTS")"
626
+
627
+ log "Patching profile entitlements with values from app entitlements"
628
+ PATCHED_ENTITLEMENTS="$TEMP_DIR/patchedEntitlements"
629
+ # Start with using what comes in provisioning profile entitlements before patching
630
+ cp -f "$PROFILE_ENTITLEMENTS" "$PATCHED_ENTITLEMENTS"
631
+
632
+ # Get the old and new app identifier (prefix)
633
+ APP_ID_KEY="application-identifier"
634
+ # Extract just the identifier from the value
635
+ # Use the fact that we are after some identifer, which is always at the start of the string
636
+ OLD_APP_ID=$(PlistBuddy -c "Print $APP_ID_KEY" "$APP_ENTITLEMENTS" | grep -E '^[A-Z0-9]*' -o | tr -d '\n')
637
+ NEW_APP_ID=$(PlistBuddy -c "Print $APP_ID_KEY" "$PROFILE_ENTITLEMENTS" | grep -E '^[A-Z0-9]*' -o | tr -d '\n')
638
+
639
+ # Get the old and the new team ID
640
+ # Old team ID is not part of app entitlements, have to get it from old embedded provisioning profile
641
+ security cms -D -i "$TEMP_DIR/old-embedded.mobileprovision" > "$TEMP_DIR/old-embedded-profile.plist"
642
+ OLD_TEAM_ID=$(PlistBuddy -c "Print :TeamIdentifier:0" "$TEMP_DIR/old-embedded-profile.plist")
643
+ # New team ID is part of profile entitlements
644
+ NEW_TEAM_ID=$(PlistBuddy -c "Print com.apple.developer.team-identifier" "$PROFILE_ENTITLEMENTS" | grep -E '^[A-Z0-9]*' -o | tr -d '\n')
645
+
646
+ # List of rules for transferring entitlements from app to profile plist
647
+ # The format for each enty is "KEY[|ID_TYPE]"
648
+ # Where KEY is the plist key, e.g. "keychain-access-groups"
649
+ # and ID_TYPE is optional part separated by '|' that specifies what value to patch:
650
+ # TEAM_ID - patch the TeamIdentifierPrefix
651
+ # APP_ID - patch the AppIdentifierPrefix
652
+ # Patching means replacing old value from app entitlements with new value from provisioning profile
653
+ # For example, for KEY=keychain-access-groups the ID_TYPE=APP_ID
654
+ # Which means that old app ID prefix in keychain-access-groups will be replaced with new app ID prefix
655
+ # There can be only one ID_TYPE specified
656
+ # If entitlements use more than one ID type for single entitlement, then this way of resigning will not work
657
+ # instead an entitlements file must be provided explicitly
658
+ ENTITLEMENTS_TRANSFER_RULES=("com.apple.developer.associated-domains" \
659
+ "com.apple.developer.healthkit" \
660
+ "com.apple.developer.homekit" \
661
+ "com.apple.developer.icloud-container-identifiers" \
662
+ "com.apple.developer.icloud-services" \
663
+ "com.apple.developer.in-app-payments" \
664
+ "com.apple.developer.networking.vpn.api" \
665
+ "com.apple.developer.ubiquity-container-identifiers" \
666
+ "com.apple.developer.ubiquity-kvstore-identifier|TEAM_ID" \
667
+ "com.apple.external-accessory.wireless-configuration" \
668
+ "com.apple.security.application-groups" \
669
+ "inter-app-audio" \
670
+ "keychain-access-groups|APP_ID")
671
+
672
+ # Loop over all the entitlement keys that need to be transferred from app entitlements
673
+ for RULE in ${ENTITLEMENTS_TRANSFER_RULES[@]}; do
674
+ KEY=$(echo $RULE | cut -d'|' -f1)
675
+ ID_TYPE=$(echo $RULE | cut -d'|' -f2)
676
+
677
+ # Get the entry from app's entitlements
678
+ # Read it with PlistBuddy as XML, then strip the header and <plist></plist> part
679
+ ENTITLEMENTS_VALUE="$(PlistBuddy -x -c "Print $KEY" "$APP_ENTITLEMENTS" 2>/dev/null | sed -e 's,.*<plist[^>]*>\(.*\)</plist>,\1,g')"
680
+ if [[ -z "$ENTITLEMENTS_VALUE" ]]; then
681
+ log "No value for '$KEY'"
682
+ continue
683
+ fi
684
+
685
+ log "App entitlements value for key '$KEY':"
686
+ log "$ENTITLEMENTS_VALUE"
687
+
688
+ # Remove the entry for current key from profisioning profile entitlements (if exists)
689
+ PlistBuddy -c "Delete $KEY" "$PATCHED_ENTITLEMENTS" 2>/dev/null
690
+
691
+ # Add new entry to patched entitlements
692
+ # plutil needs dots in the key path to be escaped (e.g. com\.apple\.security\.application-groups)
693
+ # otherwise it interprets they key path as nested keys
694
+ PLUTIL_KEY=`echo "$KEY" | sed 's/\./\\\\./g'`
695
+ plutil -insert "$PLUTIL_KEY" -xml "$ENTITLEMENTS_VALUE" "$PATCHED_ENTITLEMENTS"
696
+
697
+ # Patch the ID value if specified
698
+ if [[ "$ID_TYPE" == "APP_ID" ]]; then
699
+ # Replace old value with new value in patched entitlements
700
+ log "Replacing old app identifier prefix '$OLD_APP_ID' with new value '$NEW_APP_ID'"
701
+ sed -i .bak "s/$OLD_APP_ID/$NEW_APP_ID/g" "$PATCHED_ENTITLEMENTS"
702
+ elif [[ "$ID_TYPE" == "TEAM_ID" ]]; then
703
+ # Replace new team identifier with new value
704
+ log "Replacing old team ID '$OLD_TEAM_ID' with new team ID: '$NEW_TEAM_ID'"
705
+ sed -i .bak "s/$OLD_TEAM_ID/$NEW_TEAM_ID/g" "$PATCHED_ENTITLEMENTS"
706
+ else
707
+ continue
708
+ fi
709
+ done
710
+
711
+ # Replace old bundle ID with new bundle ID in patched entitlements
712
+ # Read old bundle ID from the old Info.plist which was saved for this purpose
713
+ OLD_BUNDLE_ID="$(PlistBuddy -c "Print :CFBundleIdentifier" "$TEMP_DIR/oldInfo.plist")"
714
+ NEW_BUNDLE_ID="$(bundle_id_for_provison "$NEW_PROVISION")"
715
+ log "Replacing old bundle ID '$OLD_BUNDLE_ID' with new bundle ID '$NEW_BUNDLE_ID' in patched entitlements"
716
+ sed -i .bak "s/$OLD_BUNDLE_ID/$NEW_BUNDLE_ID/g" "$PATCHED_ENTITLEMENTS"
717
+
718
+ log "Resigning application using certificate: '$CERTIFICATE'"
719
+ log "and patched entitlements:"
720
+ log "$(cat "$PATCHED_ENTITLEMENTS")"
721
+ cp -f "$PATCHED_ENTITLEMENTS" "$APP_PATH/archived-expanded-entitlements.xcent"
722
+ /usr/bin/codesign ${VERBOSE} -f -s "$CERTIFICATE" --entitlements "$PATCHED_ENTITLEMENTS" "$APP_PATH"
723
+ checkStatus
724
+ else
725
+ log "Extracting entitlements from provisioning profile"
726
+ PlistBuddy -x -c "Print Entitlements" "$TEMP_DIR/profile.plist" > "$TEMP_DIR/newEntitlements"
727
+ checkStatus
728
+ log "Resigning application using certificate: '$CERTIFICATE'"
729
+ log "and entitlements from provisioning profile: $NEW_PROVISION"
730
+ cp -- "$TEMP_DIR/newEntitlements" "$APP_PATH/archived-expanded-entitlements.xcent"
731
+ /usr/bin/codesign ${VERBOSE} ${KEYCHAIN_FLAG} -f -s "$CERTIFICATE" --entitlements "$TEMP_DIR/newEntitlements" "$APP_PATH"
732
+ checkStatus
733
+ fi
734
+
735
+ # Remove the temporary files if they were created before generating ipa
736
+ rm -f "$TEMP_DIR/newEntitlements"
737
+ rm -f "$PROFILE_ENTITLEMENTS"
738
+ rm -f "$APP_ENTITLEMENTS"
739
+ rm -f "$PATCHED_ENTITLEMENTS"
740
+ rm -f "$PATCHED_ENTITLEMENTS.bak"
741
+ rm -r "$TEMP_DIR/old-embedded-profile.plist"
742
+ rm -f "$TEMP_DIR/profile.plist"
743
+ rm -f "$TEMP_DIR/old-embedded.mobileprovision"
744
+ rm -f "$TEMP_DIR/oldInfo.plist"
745
+ }
746
+
747
+ # Sign nested applications and app extensions
748
+ while IFS= read -d '' -r app;
749
+ do
750
+ log "Resigning nested application: '$app'"
751
+ resign "$app" NESTED
752
+ done < <(find "$TEMP_DIR/Payload/$APP_NAME" -d -mindepth 1 \( -name "*.app" -or -name "*.appex" \) -print0)
753
+
754
+ # Resign the application
755
+ resign "$TEMP_DIR/Payload/$APP_NAME"
756
+
757
+ # Repackage quietly
758
+ log "Repackaging as $NEW_FILE"
759
+
760
+ # Zip up the contents of the "$TEMP_DIR" folder
761
+ # Navigate to the temporary directory (sending the output to null)
762
+ # Zip all the contents, saving the zip file in the above directory
763
+ # Navigate back to the orignating directory (sending the output to null)
764
+ pushd "$TEMP_DIR" > /dev/null
765
+ zip -qry "../$TEMP_DIR.ipa" *
766
+ popd > /dev/null
767
+
768
+ # Move the resulting ipa to the target destination
769
+ mv "$TEMP_DIR.ipa" "$NEW_FILE"
770
+
771
+ # Remove the temp directory
772
+ rm -rf "$TEMP_DIR"
773
+
774
+ log "Process complete"