fastlane_hotfix 2.165.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.yardopts +1 -0
- data/LICENSE +21 -0
- data/README.md +208 -0
- data/bin/bin-proxy +19 -0
- data/bin/fastlane +23 -0
- data/cert/README.md +17 -0
- data/cert/lib/cert.rb +4 -0
- data/cert/lib/cert/commands_generator.rb +60 -0
- data/cert/lib/cert/module.rb +16 -0
- data/cert/lib/cert/options.rb +132 -0
- data/cert/lib/cert/runner.rb +239 -0
- data/credentials_manager/README.md +64 -0
- data/credentials_manager/lib/credentials_manager.rb +7 -0
- data/credentials_manager/lib/credentials_manager/account_manager.rb +157 -0
- data/credentials_manager/lib/credentials_manager/appfile_config.rb +196 -0
- data/credentials_manager/lib/credentials_manager/cli.rb +69 -0
- data/deliver/README.md +17 -0
- data/deliver/lib/assets/DeliverfileDefault +3 -0
- data/deliver/lib/assets/DeliverfileDefault.swift +13 -0
- data/deliver/lib/assets/ScreenshotsHelp +7 -0
- data/deliver/lib/assets/summary.html.erb +299 -0
- data/deliver/lib/deliver.rb +15 -0
- data/deliver/lib/deliver/app_screenshot.rb +354 -0
- data/deliver/lib/deliver/app_screenshot_iterator.rb +95 -0
- data/deliver/lib/deliver/commands_generator.rb +190 -0
- data/deliver/lib/deliver/detect_values.rb +102 -0
- data/deliver/lib/deliver/download_screenshots.rb +76 -0
- data/deliver/lib/deliver/generate_summary.rb +13 -0
- data/deliver/lib/deliver/html_generator.rb +78 -0
- data/deliver/lib/deliver/languages.rb +7 -0
- data/deliver/lib/deliver/loader.rb +55 -0
- data/deliver/lib/deliver/module.rb +18 -0
- data/deliver/lib/deliver/options.rb +465 -0
- data/deliver/lib/deliver/queue_worker.rb +49 -0
- data/deliver/lib/deliver/runner.rb +233 -0
- data/deliver/lib/deliver/setup.rb +199 -0
- data/deliver/lib/deliver/submit_for_review.rb +214 -0
- data/deliver/lib/deliver/upload_metadata.rb +688 -0
- data/deliver/lib/deliver/upload_price_tier.rb +40 -0
- data/deliver/lib/deliver/upload_screenshots.rb +333 -0
- data/fastlane/README.md +11 -0
- data/fastlane/lib/assets/ActionDetails.md.erb +106 -0
- data/fastlane/lib/assets/Actions.md.erb +43 -0
- data/fastlane/lib/assets/AppfileTemplate +6 -0
- data/fastlane/lib/assets/AppfileTemplate.swift +7 -0
- data/fastlane/lib/assets/AppfileTemplateAndroid +2 -0
- data/fastlane/lib/assets/DefaultFastfileTemplate +20 -0
- data/fastlane/lib/assets/DefaultFastfileTemplate.swift +13 -0
- data/fastlane/lib/assets/completions/completion.bash +23 -0
- data/fastlane/lib/assets/completions/completion.fish +39 -0
- data/fastlane/lib/assets/completions/completion.sh +12 -0
- data/fastlane/lib/assets/completions/completion.zsh +23 -0
- data/fastlane/lib/assets/custom_action_template.rb +82 -0
- data/fastlane/lib/assets/mailgun_html_template.erb +142 -0
- data/fastlane/lib/assets/report_template.xml.erb +15 -0
- data/fastlane/lib/assets/s3_html_template.erb +105 -0
- data/fastlane/lib/assets/s3_plist_template.erb +31 -0
- data/fastlane/lib/assets/s3_version_template.erb +4 -0
- data/fastlane/lib/fastlane.rb +53 -0
- data/fastlane/lib/fastlane/action.rb +198 -0
- data/fastlane/lib/fastlane/action_collector.rb +35 -0
- data/fastlane/lib/fastlane/actions/README.md +5 -0
- data/fastlane/lib/fastlane/actions/actions_helper.rb +185 -0
- data/fastlane/lib/fastlane/actions/adb.rb +78 -0
- data/fastlane/lib/fastlane/actions/adb_devices.rb +71 -0
- data/fastlane/lib/fastlane/actions/add_extra_platforms.rb +45 -0
- data/fastlane/lib/fastlane/actions/add_git_tag.rb +122 -0
- data/fastlane/lib/fastlane/actions/app_store_build_number.rb +249 -0
- data/fastlane/lib/fastlane/actions/app_store_connect_api_key.rb +134 -0
- data/fastlane/lib/fastlane/actions/appaloosa.rb +266 -0
- data/fastlane/lib/fastlane/actions/appetize.rb +188 -0
- data/fastlane/lib/fastlane/actions/appetize_viewing_url_generator.rb +146 -0
- data/fastlane/lib/fastlane/actions/appium.rb +206 -0
- data/fastlane/lib/fastlane/actions/appledoc.rb +226 -0
- data/fastlane/lib/fastlane/actions/appstore.rb +14 -0
- data/fastlane/lib/fastlane/actions/apteligent.rb +105 -0
- data/fastlane/lib/fastlane/actions/artifactory.rb +157 -0
- data/fastlane/lib/fastlane/actions/automatic_code_signing.rb +226 -0
- data/fastlane/lib/fastlane/actions/backup_file.rb +41 -0
- data/fastlane/lib/fastlane/actions/backup_xcarchive.rb +135 -0
- data/fastlane/lib/fastlane/actions/badge.rb +155 -0
- data/fastlane/lib/fastlane/actions/build_and_upload_to_appetize.rb +107 -0
- data/fastlane/lib/fastlane/actions/build_android_app.rb +14 -0
- data/fastlane/lib/fastlane/actions/build_app.rb +165 -0
- data/fastlane/lib/fastlane/actions/build_ios_app.rb +47 -0
- data/fastlane/lib/fastlane/actions/build_mac_app.rb +46 -0
- data/fastlane/lib/fastlane/actions/bundle_install.rb +156 -0
- data/fastlane/lib/fastlane/actions/capture_android_screenshots.rb +63 -0
- data/fastlane/lib/fastlane/actions/capture_ios_screenshots.rb +61 -0
- data/fastlane/lib/fastlane/actions/capture_screenshots.rb +14 -0
- data/fastlane/lib/fastlane/actions/carthage.rb +230 -0
- data/fastlane/lib/fastlane/actions/cert.rb +14 -0
- data/fastlane/lib/fastlane/actions/changelog_from_git_commits.rb +197 -0
- data/fastlane/lib/fastlane/actions/chatwork.rb +94 -0
- data/fastlane/lib/fastlane/actions/check_app_store_metadata.rb +54 -0
- data/fastlane/lib/fastlane/actions/clean_build_artifacts.rb +72 -0
- data/fastlane/lib/fastlane/actions/clean_cocoapods_cache.rb +52 -0
- data/fastlane/lib/fastlane/actions/clear_derived_data.rb +70 -0
- data/fastlane/lib/fastlane/actions/clipboard.rb +52 -0
- data/fastlane/lib/fastlane/actions/cloc.rb +89 -0
- data/fastlane/lib/fastlane/actions/cocoapods.rb +170 -0
- data/fastlane/lib/fastlane/actions/commit_github_file.rb +186 -0
- data/fastlane/lib/fastlane/actions/commit_version_bump.rb +301 -0
- data/fastlane/lib/fastlane/actions/copy_artifacts.rb +114 -0
- data/fastlane/lib/fastlane/actions/crashlytics.rb +211 -0
- data/fastlane/lib/fastlane/actions/create_app_on_managed_play_store.rb +174 -0
- data/fastlane/lib/fastlane/actions/create_app_online.rb +75 -0
- data/fastlane/lib/fastlane/actions/create_keychain.rb +177 -0
- data/fastlane/lib/fastlane/actions/create_pull_request.rb +265 -0
- data/fastlane/lib/fastlane/actions/danger.rb +131 -0
- data/fastlane/lib/fastlane/actions/debug.rb +32 -0
- data/fastlane/lib/fastlane/actions/default_platform.rb +47 -0
- data/fastlane/lib/fastlane/actions/delete_keychain.rb +68 -0
- data/fastlane/lib/fastlane/actions/deliver.rb +14 -0
- data/fastlane/lib/fastlane/actions/deploygate.rb +210 -0
- data/fastlane/lib/fastlane/actions/device_grid/README.md +157 -0
- data/fastlane/lib/fastlane/actions/docs/build_app.md +245 -0
- data/fastlane/lib/fastlane/actions/docs/capture_android_screenshots.md +333 -0
- data/fastlane/lib/fastlane/actions/docs/capture_ios_screenshots.md +371 -0
- data/fastlane/lib/fastlane/actions/docs/check_app_store_metadata.md +103 -0
- data/fastlane/lib/fastlane/actions/docs/create_app_online.md +282 -0
- data/fastlane/lib/fastlane/actions/docs/frame_screenshots.md +349 -0
- data/fastlane/lib/fastlane/actions/docs/get_certificates.md +86 -0
- data/fastlane/lib/fastlane/actions/docs/get_provisioning_profile.md +223 -0
- data/fastlane/lib/fastlane/actions/docs/get_push_certificate.md +134 -0
- data/fastlane/lib/fastlane/actions/docs/run_tests.md +151 -0
- data/fastlane/lib/fastlane/actions/docs/sync_code_signing.md +573 -0
- data/fastlane/lib/fastlane/actions/docs/upload_to_app_store.md.erb +725 -0
- data/fastlane/lib/fastlane/actions/docs/upload_to_play_store.md +203 -0
- data/fastlane/lib/fastlane/actions/docs/upload_to_testflight.md +250 -0
- data/fastlane/lib/fastlane/actions/dotgpg_environment.rb +57 -0
- data/fastlane/lib/fastlane/actions/download.rb +76 -0
- data/fastlane/lib/fastlane/actions/download_dsyms.rb +369 -0
- data/fastlane/lib/fastlane/actions/download_from_play_store.rb +61 -0
- data/fastlane/lib/fastlane/actions/dsym_zip.rb +93 -0
- data/fastlane/lib/fastlane/actions/echo.rb +14 -0
- data/fastlane/lib/fastlane/actions/ensure_bundle_exec.rb +59 -0
- data/fastlane/lib/fastlane/actions/ensure_env_vars.rb +58 -0
- data/fastlane/lib/fastlane/actions/ensure_git_branch.rb +69 -0
- data/fastlane/lib/fastlane/actions/ensure_git_status_clean.rb +92 -0
- data/fastlane/lib/fastlane/actions/ensure_no_debug_code.rb +135 -0
- data/fastlane/lib/fastlane/actions/ensure_xcode_version.rb +125 -0
- data/fastlane/lib/fastlane/actions/environment_variable.rb +77 -0
- data/fastlane/lib/fastlane/actions/erb.rb +96 -0
- data/fastlane/lib/fastlane/actions/fastlane_version.rb +15 -0
- data/fastlane/lib/fastlane/actions/flock.rb +82 -0
- data/fastlane/lib/fastlane/actions/frame_screenshots.rb +64 -0
- data/fastlane/lib/fastlane/actions/frameit.rb +14 -0
- data/fastlane/lib/fastlane/actions/gcovr.rb +163 -0
- data/fastlane/lib/fastlane/actions/get_build_number.rb +106 -0
- data/fastlane/lib/fastlane/actions/get_build_number_repository.rb +120 -0
- data/fastlane/lib/fastlane/actions/get_certificates.rb +77 -0
- data/fastlane/lib/fastlane/actions/get_github_release.rb +166 -0
- data/fastlane/lib/fastlane/actions/get_info_plist_value.rb +78 -0
- data/fastlane/lib/fastlane/actions/get_ipa_info_plist_value.rb +82 -0
- data/fastlane/lib/fastlane/actions/get_managed_play_store_publishing_rights.rb +120 -0
- data/fastlane/lib/fastlane/actions/get_provisioning_profile.rb +101 -0
- data/fastlane/lib/fastlane/actions/get_push_certificate.rb +87 -0
- data/fastlane/lib/fastlane/actions/get_version_number.rb +200 -0
- data/fastlane/lib/fastlane/actions/git_add.rb +93 -0
- data/fastlane/lib/fastlane/actions/git_branch.rb +61 -0
- data/fastlane/lib/fastlane/actions/git_commit.rb +80 -0
- data/fastlane/lib/fastlane/actions/git_pull.rb +64 -0
- data/fastlane/lib/fastlane/actions/git_submodule_update.rb +52 -0
- data/fastlane/lib/fastlane/actions/git_tag_exists.rb +74 -0
- data/fastlane/lib/fastlane/actions/github_api.rb +262 -0
- data/fastlane/lib/fastlane/actions/google_play_track_release_names.rb +74 -0
- data/fastlane/lib/fastlane/actions/google_play_track_version_codes.rb +77 -0
- data/fastlane/lib/fastlane/actions/gradle.rb +329 -0
- data/fastlane/lib/fastlane/actions/gym.rb +10 -0
- data/fastlane/lib/fastlane/actions/hg_add_tag.rb +48 -0
- data/fastlane/lib/fastlane/actions/hg_commit_version_bump.rb +183 -0
- data/fastlane/lib/fastlane/actions/hg_ensure_clean_status.rb +53 -0
- data/fastlane/lib/fastlane/actions/hg_push.rb +64 -0
- data/fastlane/lib/fastlane/actions/hipchat.rb +200 -0
- data/fastlane/lib/fastlane/actions/hockey.rb +406 -0
- data/fastlane/lib/fastlane/actions/ifttt.rb +96 -0
- data/fastlane/lib/fastlane/actions/import.rb +49 -0
- data/fastlane/lib/fastlane/actions/import_certificate.rb +77 -0
- data/fastlane/lib/fastlane/actions/import_from_git.rb +83 -0
- data/fastlane/lib/fastlane/actions/increment_build_number.rb +117 -0
- data/fastlane/lib/fastlane/actions/increment_version_number.rb +180 -0
- data/fastlane/lib/fastlane/actions/install_on_device.rb +95 -0
- data/fastlane/lib/fastlane/actions/install_provisioning_profile.rb +58 -0
- data/fastlane/lib/fastlane/actions/install_xcode_plugin.rb +91 -0
- data/fastlane/lib/fastlane/actions/installr.rb +132 -0
- data/fastlane/lib/fastlane/actions/ipa.rb +246 -0
- data/fastlane/lib/fastlane/actions/is_ci.rb +51 -0
- data/fastlane/lib/fastlane/actions/jazzy.rb +56 -0
- data/fastlane/lib/fastlane/actions/jira.rb +115 -0
- data/fastlane/lib/fastlane/actions/lane_context.rb +60 -0
- data/fastlane/lib/fastlane/actions/last_git_commit.rb +58 -0
- data/fastlane/lib/fastlane/actions/last_git_tag.rb +60 -0
- data/fastlane/lib/fastlane/actions/latest_testflight_build_number.rb +155 -0
- data/fastlane/lib/fastlane/actions/lcov.rb +102 -0
- data/fastlane/lib/fastlane/actions/mailgun.rb +197 -0
- data/fastlane/lib/fastlane/actions/make_changelog_from_jenkins.rb +81 -0
- data/fastlane/lib/fastlane/actions/match.rb +14 -0
- data/fastlane/lib/fastlane/actions/min_fastlane_version.rb +57 -0
- data/fastlane/lib/fastlane/actions/modify_services.rb +173 -0
- data/fastlane/lib/fastlane/actions/nexus_upload.rb +230 -0
- data/fastlane/lib/fastlane/actions/notarize.rb +193 -0
- data/fastlane/lib/fastlane/actions/notification.rb +75 -0
- data/fastlane/lib/fastlane/actions/notify.rb +40 -0
- data/fastlane/lib/fastlane/actions/number_of_commits.rb +75 -0
- data/fastlane/lib/fastlane/actions/oclint.rb +269 -0
- data/fastlane/lib/fastlane/actions/onesignal.rb +186 -0
- data/fastlane/lib/fastlane/actions/opt_out_crash_reporting.rb +33 -0
- data/fastlane/lib/fastlane/actions/opt_out_usage.rb +40 -0
- data/fastlane/lib/fastlane/actions/pem.rb +14 -0
- data/fastlane/lib/fastlane/actions/pilot.rb +14 -0
- data/fastlane/lib/fastlane/actions/pod_lib_lint.rb +189 -0
- data/fastlane/lib/fastlane/actions/pod_push.rb +173 -0
- data/fastlane/lib/fastlane/actions/podio_item.rb +217 -0
- data/fastlane/lib/fastlane/actions/precheck.rb +14 -0
- data/fastlane/lib/fastlane/actions/println.rb +14 -0
- data/fastlane/lib/fastlane/actions/produce.rb +14 -0
- data/fastlane/lib/fastlane/actions/prompt.rb +119 -0
- data/fastlane/lib/fastlane/actions/push_git_tags.rb +76 -0
- data/fastlane/lib/fastlane/actions/push_to_git_remote.rb +127 -0
- data/fastlane/lib/fastlane/actions/puts.rb +68 -0
- data/fastlane/lib/fastlane/actions/read_podspec.rb +90 -0
- data/fastlane/lib/fastlane/actions/recreate_schemes.rb +46 -0
- data/fastlane/lib/fastlane/actions/register_device.rb +151 -0
- data/fastlane/lib/fastlane/actions/register_devices.rb +214 -0
- data/fastlane/lib/fastlane/actions/reset_git_repo.rb +121 -0
- data/fastlane/lib/fastlane/actions/reset_simulator_contents.rb +92 -0
- data/fastlane/lib/fastlane/actions/resign.rb +132 -0
- data/fastlane/lib/fastlane/actions/restore_file.rb +44 -0
- data/fastlane/lib/fastlane/actions/rocket.rb +83 -0
- data/fastlane/lib/fastlane/actions/rsync.rb +74 -0
- data/fastlane/lib/fastlane/actions/ruby_version.rb +56 -0
- data/fastlane/lib/fastlane/actions/run_tests.rb +114 -0
- data/fastlane/lib/fastlane/actions/s3.rb +174 -0
- data/fastlane/lib/fastlane/actions/say.rb +56 -0
- data/fastlane/lib/fastlane/actions/scan.rb +14 -0
- data/fastlane/lib/fastlane/actions/scp.rb +114 -0
- data/fastlane/lib/fastlane/actions/screengrab.rb +14 -0
- data/fastlane/lib/fastlane/actions/set_build_number_repository.rb +76 -0
- data/fastlane/lib/fastlane/actions/set_changelog.rb +204 -0
- data/fastlane/lib/fastlane/actions/set_github_release.rb +274 -0
- data/fastlane/lib/fastlane/actions/set_info_plist_value.rb +92 -0
- data/fastlane/lib/fastlane/actions/set_pod_key.rb +78 -0
- data/fastlane/lib/fastlane/actions/setup_ci.rb +132 -0
- data/fastlane/lib/fastlane/actions/setup_circle_ci.rb +58 -0
- data/fastlane/lib/fastlane/actions/setup_jenkins.rb +202 -0
- data/fastlane/lib/fastlane/actions/setup_travis.rb +57 -0
- data/fastlane/lib/fastlane/actions/sh.rb +71 -0
- data/fastlane/lib/fastlane/actions/sigh.rb +14 -0
- data/fastlane/lib/fastlane/actions/skip_docs.rb +52 -0
- data/fastlane/lib/fastlane/actions/slack.rb +288 -0
- data/fastlane/lib/fastlane/actions/slather.rb +329 -0
- data/fastlane/lib/fastlane/actions/snapshot.rb +14 -0
- data/fastlane/lib/fastlane/actions/sonar.rb +177 -0
- data/fastlane/lib/fastlane/actions/spaceship_logs.rb +135 -0
- data/fastlane/lib/fastlane/actions/spaceship_stats.rb +73 -0
- data/fastlane/lib/fastlane/actions/splunkmint.rb +156 -0
- data/fastlane/lib/fastlane/actions/spm.rb +138 -0
- data/fastlane/lib/fastlane/actions/ssh.rb +162 -0
- data/fastlane/lib/fastlane/actions/supply.rb +14 -0
- data/fastlane/lib/fastlane/actions/swiftlint.rb +240 -0
- data/fastlane/lib/fastlane/actions/sync_code_signing.rb +109 -0
- data/fastlane/lib/fastlane/actions/team_id.rb +42 -0
- data/fastlane/lib/fastlane/actions/team_name.rb +42 -0
- data/fastlane/lib/fastlane/actions/testfairy.rb +285 -0
- data/fastlane/lib/fastlane/actions/testflight.rb +14 -0
- data/fastlane/lib/fastlane/actions/tryouts.rb +149 -0
- data/fastlane/lib/fastlane/actions/twitter.rb +89 -0
- data/fastlane/lib/fastlane/actions/typetalk.rb +93 -0
- data/fastlane/lib/fastlane/actions/unlock_keychain.rb +132 -0
- data/fastlane/lib/fastlane/actions/update_app_group_identifiers.rb +91 -0
- data/fastlane/lib/fastlane/actions/update_app_identifier.rb +124 -0
- data/fastlane/lib/fastlane/actions/update_code_signing_settings.rb +203 -0
- data/fastlane/lib/fastlane/actions/update_fastlane.rb +137 -0
- data/fastlane/lib/fastlane/actions/update_icloud_container_identifiers.rb +99 -0
- data/fastlane/lib/fastlane/actions/update_info_plist.rb +143 -0
- data/fastlane/lib/fastlane/actions/update_keychain_access_groups.rb +94 -0
- data/fastlane/lib/fastlane/actions/update_plist.rb +115 -0
- data/fastlane/lib/fastlane/actions/update_project_code_signing.rb +76 -0
- data/fastlane/lib/fastlane/actions/update_project_provisioning.rb +173 -0
- data/fastlane/lib/fastlane/actions/update_project_team.rb +95 -0
- data/fastlane/lib/fastlane/actions/update_urban_airship_configuration.rb +91 -0
- data/fastlane/lib/fastlane/actions/update_url_schemes.rb +123 -0
- data/fastlane/lib/fastlane/actions/upload_symbols_to_crashlytics.rb +231 -0
- data/fastlane/lib/fastlane/actions/upload_symbols_to_sentry.rb +165 -0
- data/fastlane/lib/fastlane/actions/upload_to_app_store.rb +67 -0
- data/fastlane/lib/fastlane/actions/upload_to_play_store.rb +80 -0
- data/fastlane/lib/fastlane/actions/upload_to_play_store_internal_app_sharing.rb +78 -0
- data/fastlane/lib/fastlane/actions/upload_to_testflight.rb +119 -0
- data/fastlane/lib/fastlane/actions/validate_play_store_json_key.rb +104 -0
- data/fastlane/lib/fastlane/actions/verify_build.rb +199 -0
- data/fastlane/lib/fastlane/actions/verify_pod_keys.rb +67 -0
- data/fastlane/lib/fastlane/actions/verify_xcode.rb +159 -0
- data/fastlane/lib/fastlane/actions/version_bump_podspec.rb +105 -0
- data/fastlane/lib/fastlane/actions/version_get_podspec.rb +71 -0
- data/fastlane/lib/fastlane/actions/xcode_install.rb +105 -0
- data/fastlane/lib/fastlane/actions/xcode_select.rb +68 -0
- data/fastlane/lib/fastlane/actions/xcode_server_get_assets.rb +312 -0
- data/fastlane/lib/fastlane/actions/xcodebuild.rb +641 -0
- data/fastlane/lib/fastlane/actions/xcov.rb +66 -0
- data/fastlane/lib/fastlane/actions/xctool.rb +55 -0
- data/fastlane/lib/fastlane/actions/xcversion.rb +55 -0
- data/fastlane/lib/fastlane/actions/zip.rb +120 -0
- data/fastlane/lib/fastlane/auto_complete.rb +82 -0
- data/fastlane/lib/fastlane/boolean.rb +5 -0
- data/fastlane/lib/fastlane/cli_tools_distributor.rb +207 -0
- data/fastlane/lib/fastlane/command_line_handler.rb +49 -0
- data/fastlane/lib/fastlane/commands_generator.rb +369 -0
- data/fastlane/lib/fastlane/configuration_helper.rb +26 -0
- data/fastlane/lib/fastlane/core_ext/bundler_monkey_patch.rb +14 -0
- data/fastlane/lib/fastlane/documentation/actions_list.rb +214 -0
- data/fastlane/lib/fastlane/documentation/docs_generator.rb +89 -0
- data/fastlane/lib/fastlane/documentation/markdown_docs_generator.rb +228 -0
- data/fastlane/lib/fastlane/environment_printer.rb +303 -0
- data/fastlane/lib/fastlane/erb_template_helper.rb +30 -0
- data/fastlane/lib/fastlane/fast_file.rb +439 -0
- data/fastlane/lib/fastlane/fastlane_require.rb +75 -0
- data/fastlane/lib/fastlane/features.rb +4 -0
- data/fastlane/lib/fastlane/helper/README.md +29 -0
- data/fastlane/lib/fastlane/helper/adb_helper.rb +66 -0
- data/fastlane/lib/fastlane/helper/crashlytics_helper.rb +157 -0
- data/fastlane/lib/fastlane/helper/dotenv_helper.rb +50 -0
- data/fastlane/lib/fastlane/helper/gem_helper.rb +26 -0
- data/fastlane/lib/fastlane/helper/git_helper.rb +137 -0
- data/fastlane/lib/fastlane/helper/gradle_helper.rb +62 -0
- data/fastlane/lib/fastlane/helper/lane_helper.rb +13 -0
- data/fastlane/lib/fastlane/helper/podspec_helper.rb +75 -0
- data/fastlane/lib/fastlane/helper/s3_client_helper.rb +78 -0
- data/fastlane/lib/fastlane/helper/sh_helper.rb +134 -0
- data/fastlane/lib/fastlane/helper/xcodeproj_helper.rb +12 -0
- data/fastlane/lib/fastlane/helper/xcversion_helper.rb +25 -0
- data/fastlane/lib/fastlane/junit_generator.rb +27 -0
- data/fastlane/lib/fastlane/lane.rb +97 -0
- data/fastlane/lib/fastlane/lane_list.rb +137 -0
- data/fastlane/lib/fastlane/lane_manager.rb +130 -0
- data/fastlane/lib/fastlane/lane_manager_base.rb +92 -0
- data/fastlane/lib/fastlane/markdown_table_formatter.rb +62 -0
- data/fastlane/lib/fastlane/new_action.rb +47 -0
- data/fastlane/lib/fastlane/one_off.rb +45 -0
- data/fastlane/lib/fastlane/other_action.rb +29 -0
- data/fastlane/lib/fastlane/plugins/plugin_fetcher.rb +55 -0
- data/fastlane/lib/fastlane/plugins/plugin_generator.rb +86 -0
- data/fastlane/lib/fastlane/plugins/plugin_generator_ui.rb +19 -0
- data/fastlane/lib/fastlane/plugins/plugin_info.rb +49 -0
- data/fastlane/lib/fastlane/plugins/plugin_info_collector.rb +159 -0
- data/fastlane/lib/fastlane/plugins/plugin_manager.rb +399 -0
- data/fastlane/lib/fastlane/plugins/plugin_search.rb +46 -0
- data/fastlane/lib/fastlane/plugins/plugin_update_manager.rb +70 -0
- data/fastlane/lib/fastlane/plugins/plugins.rb +12 -0
- data/fastlane/lib/fastlane/plugins/template/%gem_name%.gemspec.erb +35 -0
- data/fastlane/lib/fastlane/plugins/template/.circleci/config.yml +43 -0
- data/fastlane/lib/fastlane/plugins/template/.github/workflows/test.yml +29 -0
- data/fastlane/lib/fastlane/plugins/template/.gitignore +12 -0
- data/fastlane/lib/fastlane/plugins/template/.rspec +5 -0
- data/fastlane/lib/fastlane/plugins/template/.rubocop.yml +188 -0
- data/fastlane/lib/fastlane/plugins/template/.travis.yml +4 -0
- data/fastlane/lib/fastlane/plugins/template/Gemfile +6 -0
- data/fastlane/lib/fastlane/plugins/template/LICENSE.erb +21 -0
- data/fastlane/lib/fastlane/plugins/template/README.md.erb +52 -0
- data/fastlane/lib/fastlane/plugins/template/Rakefile +9 -0
- data/fastlane/lib/fastlane/plugins/template/fastlane/Fastfile.erb +3 -0
- data/fastlane/lib/fastlane/plugins/template/fastlane/Pluginfile.erb +1 -0
- data/fastlane/lib/fastlane/plugins/template/lib/fastlane/plugin/%plugin_name%.rb.erb +16 -0
- data/fastlane/lib/fastlane/plugins/template/lib/fastlane/plugin/%plugin_name%/actions/%plugin_name%_action.rb.erb +47 -0
- data/fastlane/lib/fastlane/plugins/template/lib/fastlane/plugin/%plugin_name%/helper/%plugin_name%_helper.rb.erb +16 -0
- data/fastlane/lib/fastlane/plugins/template/lib/fastlane/plugin/%plugin_name%/version.rb.erb +5 -0
- data/fastlane/lib/fastlane/plugins/template/spec/%plugin_name%_action_spec.rb.erb +9 -0
- data/fastlane/lib/fastlane/plugins/template/spec/spec_helper.rb.erb +15 -0
- data/fastlane/lib/fastlane/runner.rb +378 -0
- data/fastlane/lib/fastlane/server/action_command.rb +61 -0
- data/fastlane/lib/fastlane/server/action_command_return.rb +14 -0
- data/fastlane/lib/fastlane/server/command_executor.rb +7 -0
- data/fastlane/lib/fastlane/server/command_parser.rb +44 -0
- data/fastlane/lib/fastlane/server/control_command.rb +23 -0
- data/fastlane/lib/fastlane/server/json_return_value_processor.rb +72 -0
- data/fastlane/lib/fastlane/server/socket_server.rb +238 -0
- data/fastlane/lib/fastlane/server/socket_server_action_command_executor.rb +101 -0
- data/fastlane/lib/fastlane/setup/setup.rb +355 -0
- data/fastlane/lib/fastlane/setup/setup_android.rb +97 -0
- data/fastlane/lib/fastlane/setup/setup_ios.rb +504 -0
- data/fastlane/lib/fastlane/shells.rb +6 -0
- data/fastlane/lib/fastlane/supported_platforms.rb +28 -0
- data/fastlane/lib/fastlane/swift_fastlane_api_generator.rb +477 -0
- data/fastlane/lib/fastlane/swift_fastlane_function.rb +419 -0
- data/fastlane/lib/fastlane/swift_lane_manager.rb +296 -0
- data/fastlane/lib/fastlane/swift_runner_upgrader.rb +210 -0
- data/fastlane/lib/fastlane/tools.rb +33 -0
- data/fastlane/lib/fastlane/version.rb +6 -0
- data/fastlane/swift/Actions.swift +16 -0
- data/fastlane/swift/Appfile.swift +15 -0
- data/fastlane/swift/ArgumentProcessor.swift +89 -0
- data/fastlane/swift/ControlCommand.swift +74 -0
- data/fastlane/swift/Deliverfile.swift +20 -0
- data/fastlane/swift/DeliverfileProtocol.swift +259 -0
- data/fastlane/swift/Fastfile.swift +16 -0
- data/fastlane/swift/Fastlane.swift +9402 -0
- data/fastlane/swift/FastlaneSwiftRunner/FastlaneSwiftRunner.xcodeproj/project.pbxproj +434 -0
- data/fastlane/swift/FastlaneSwiftRunner/FastlaneSwiftRunner.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
- data/fastlane/swift/FastlaneSwiftRunner/FastlaneSwiftRunner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
- data/fastlane/swift/FastlaneSwiftRunner/FastlaneSwiftRunner.xcodeproj/xcshareddata/xcschemes/FastlaneRunner.xcscheme +97 -0
- data/fastlane/swift/FastlaneSwiftRunner/README.txt +10 -0
- data/fastlane/swift/Gymfile.swift +20 -0
- data/fastlane/swift/GymfileProtocol.swift +187 -0
- data/fastlane/swift/LaneFileProtocol.swift +149 -0
- data/fastlane/swift/MainProcess.swift +77 -0
- data/fastlane/swift/Matchfile.swift +20 -0
- data/fastlane/swift/MatchfileProtocol.swift +187 -0
- data/fastlane/swift/Plugins.swift +16 -0
- data/fastlane/swift/Precheckfile.swift +20 -0
- data/fastlane/swift/PrecheckfileProtocol.swift +51 -0
- data/fastlane/swift/RubyCommand.swift +157 -0
- data/fastlane/swift/RubyCommandable.swift +43 -0
- data/fastlane/swift/Runner.swift +275 -0
- data/fastlane/swift/RunnerArgument.swift +20 -0
- data/fastlane/swift/Scanfile.swift +20 -0
- data/fastlane/swift/ScanfileProtocol.swift +263 -0
- data/fastlane/swift/Screengrabfile.swift +20 -0
- data/fastlane/swift/ScreengrabfileProtocol.swift +99 -0
- data/fastlane/swift/Snapshotfile.swift +20 -0
- data/fastlane/swift/SnapshotfileProtocol.swift +187 -0
- data/fastlane/swift/SocketClient.swift +327 -0
- data/fastlane/swift/SocketClientDelegateProtocol.swift +21 -0
- data/fastlane/swift/SocketResponse.swift +82 -0
- data/fastlane/swift/formatting/Brewfile +1 -0
- data/fastlane/swift/formatting/Brewfile.lock.json +47 -0
- data/fastlane/swift/formatting/Rakefile +18 -0
- data/fastlane/swift/main.swift +47 -0
- data/fastlane/swift/upgrade_manifest.json +1 -0
- data/fastlane_core/README.md +79 -0
- data/fastlane_core/lib/assets/XMLTemplate.xml.erb +12 -0
- data/fastlane_core/lib/fastlane_core.rb +46 -0
- data/fastlane_core/lib/fastlane_core/analytics/action_completion_context.rb +34 -0
- data/fastlane_core/lib/fastlane_core/analytics/action_launch_context.rb +38 -0
- data/fastlane_core/lib/fastlane_core/analytics/analytics_event_builder.rb +23 -0
- data/fastlane_core/lib/fastlane_core/analytics/analytics_ingester_client.rb +54 -0
- data/fastlane_core/lib/fastlane_core/analytics/analytics_session.rb +70 -0
- data/fastlane_core/lib/fastlane_core/analytics/app_identifier_guesser.rb +64 -0
- data/fastlane_core/lib/fastlane_core/android_package_name_guesser.rb +79 -0
- data/fastlane_core/lib/fastlane_core/build_watcher.rb +96 -0
- data/fastlane_core/lib/fastlane_core/cert_checker.rb +144 -0
- data/fastlane_core/lib/fastlane_core/command_executor.rb +100 -0
- data/fastlane_core/lib/fastlane_core/configuration/commander_generator.rb +103 -0
- data/fastlane_core/lib/fastlane_core/configuration/config_item.rb +321 -0
- data/fastlane_core/lib/fastlane_core/configuration/configuration.rb +332 -0
- data/fastlane_core/lib/fastlane_core/configuration/configuration_file.rb +182 -0
- data/fastlane_core/lib/fastlane_core/core_ext/cfpropertylist.rb +23 -0
- data/fastlane_core/lib/fastlane_core/core_ext/shellwords.rb +63 -0
- data/fastlane_core/lib/fastlane_core/core_ext/string.rb +17 -0
- data/fastlane_core/lib/fastlane_core/device_manager.rb +374 -0
- data/fastlane_core/lib/fastlane_core/env.rb +9 -0
- data/fastlane_core/lib/fastlane_core/fastlane_folder.rb +72 -0
- data/fastlane_core/lib/fastlane_core/fastlane_pty.rb +57 -0
- data/fastlane_core/lib/fastlane_core/feature/feature.rb +51 -0
- data/fastlane_core/lib/fastlane_core/features.rb +4 -0
- data/fastlane_core/lib/fastlane_core/globals.rb +27 -0
- data/fastlane_core/lib/fastlane_core/helper.rb +437 -0
- data/fastlane_core/lib/fastlane_core/ios_app_identifier_guesser.rb +112 -0
- data/fastlane_core/lib/fastlane_core/ipa_file_analyser.rb +63 -0
- data/fastlane_core/lib/fastlane_core/ipa_upload_package_builder.rb +52 -0
- data/fastlane_core/lib/fastlane_core/itunes_transporter.rb +595 -0
- data/fastlane_core/lib/fastlane_core/keychain_importer.rb +120 -0
- data/fastlane_core/lib/fastlane_core/languages.rb +16 -0
- data/fastlane_core/lib/fastlane_core/module.rb +31 -0
- data/fastlane_core/lib/fastlane_core/pkg_file_analyser.rb +51 -0
- data/fastlane_core/lib/fastlane_core/pkg_upload_package_builder.rb +48 -0
- data/fastlane_core/lib/fastlane_core/print_table.rb +131 -0
- data/fastlane_core/lib/fastlane_core/project.rb +509 -0
- data/fastlane_core/lib/fastlane_core/provisioning_profile.rb +124 -0
- data/fastlane_core/lib/fastlane_core/string_filters.rb +51 -0
- data/fastlane_core/lib/fastlane_core/swag.rb +85 -0
- data/fastlane_core/lib/fastlane_core/tag_version.rb +31 -0
- data/fastlane_core/lib/fastlane_core/test_parser.rb +107 -0
- data/fastlane_core/lib/fastlane_core/ui/disable_colors.rb +17 -0
- data/fastlane_core/lib/fastlane_core/ui/errors.rb +1 -0
- data/fastlane_core/lib/fastlane_core/ui/errors/fastlane_common_error.rb +19 -0
- data/fastlane_core/lib/fastlane_core/ui/errors/fastlane_crash.rb +11 -0
- data/fastlane_core/lib/fastlane_core/ui/errors/fastlane_error.rb +25 -0
- data/fastlane_core/lib/fastlane_core/ui/errors/fastlane_exception.rb +19 -0
- data/fastlane_core/lib/fastlane_core/ui/errors/fastlane_shell_error.rb +11 -0
- data/fastlane_core/lib/fastlane_core/ui/fastlane_runner.rb +294 -0
- data/fastlane_core/lib/fastlane_core/ui/github_issue_inspector_reporter.rb +62 -0
- data/fastlane_core/lib/fastlane_core/ui/implementations/shell.rb +159 -0
- data/fastlane_core/lib/fastlane_core/ui/interface.rb +205 -0
- data/fastlane_core/lib/fastlane_core/ui/ui.rb +26 -0
- data/fastlane_core/lib/fastlane_core/update_checker/changelog.rb +37 -0
- data/fastlane_core/lib/fastlane_core/update_checker/update_checker.rb +109 -0
- data/frameit/README.md +17 -0
- data/frameit/lib/assets/empty.png +0 -0
- data/frameit/lib/frameit.rb +13 -0
- data/frameit/lib/frameit/commands_generator.rb +140 -0
- data/frameit/lib/frameit/config_parser.rb +136 -0
- data/frameit/lib/frameit/dependency_checker.rb +22 -0
- data/frameit/lib/frameit/device.rb +90 -0
- data/frameit/lib/frameit/device_types.rb +144 -0
- data/frameit/lib/frameit/editor.rb +560 -0
- data/frameit/lib/frameit/frame_downloader.rb +85 -0
- data/frameit/lib/frameit/mac_editor.rb +35 -0
- data/frameit/lib/frameit/module.rb +42 -0
- data/frameit/lib/frameit/offsets.rb +28 -0
- data/frameit/lib/frameit/options.rb +112 -0
- data/frameit/lib/frameit/runner.rb +97 -0
- data/frameit/lib/frameit/screenshot.rb +134 -0
- data/frameit/lib/frameit/strings_parser.rb +46 -0
- data/frameit/lib/frameit/template_finder.rb +45 -0
- data/frameit/lib/frameit/trim_box.rb +35 -0
- data/gym/README.md +17 -0
- data/gym/lib/assets/GymfileTemplate +13 -0
- data/gym/lib/assets/GymfileTemplate.swift +13 -0
- data/gym/lib/assets/wrap_xcodebuild/xcbuild-safe.sh +61 -0
- data/gym/lib/gym.rb +9 -0
- data/gym/lib/gym/code_signing_mapping.rb +210 -0
- data/gym/lib/gym/commands_generator.rb +78 -0
- data/gym/lib/gym/detect_values.rb +206 -0
- data/gym/lib/gym/error_handler.rb +306 -0
- data/gym/lib/gym/generators/README.md +1 -0
- data/gym/lib/gym/generators/build_command_generator.rb +147 -0
- data/gym/lib/gym/generators/package_command_generator.rb +68 -0
- data/gym/lib/gym/generators/package_command_generator_xcode7.rb +232 -0
- data/gym/lib/gym/manager.rb +22 -0
- data/gym/lib/gym/module.rb +74 -0
- data/gym/lib/gym/options.rb +286 -0
- data/gym/lib/gym/runner.rb +365 -0
- data/gym/lib/gym/xcode.rb +27 -0
- data/gym/lib/gym/xcodebuild_fixes/README.md +9 -0
- data/gym/lib/gym/xcodebuild_fixes/generic_archive_fix.rb +35 -0
- data/match/README.md +17 -0
- data/match/lib/assets/MatchfileTemplate +11 -0
- data/match/lib/assets/MatchfileTemplate.swift +9 -0
- data/match/lib/assets/READMETemplate.md +59 -0
- data/match/lib/match.rb +14 -0
- data/match/lib/match/change_password.rb +53 -0
- data/match/lib/match/commands_generator.rb +190 -0
- data/match/lib/match/encryption.rb +49 -0
- data/match/lib/match/encryption/interface.rb +17 -0
- data/match/lib/match/encryption/openssl.rb +161 -0
- data/match/lib/match/generator.rb +122 -0
- data/match/lib/match/importer.rb +157 -0
- data/match/lib/match/migrate.rb +109 -0
- data/match/lib/match/module.rb +32 -0
- data/match/lib/match/nuke.rb +350 -0
- data/match/lib/match/options.rb +315 -0
- data/match/lib/match/runner.rb +369 -0
- data/match/lib/match/setup.rb +40 -0
- data/match/lib/match/spaceship_ensure.rb +97 -0
- data/match/lib/match/storage.rb +46 -0
- data/match/lib/match/storage/git_storage.rb +250 -0
- data/match/lib/match/storage/google_cloud_storage.rb +382 -0
- data/match/lib/match/storage/interface.rb +119 -0
- data/match/lib/match/storage/s3_storage.rb +205 -0
- data/match/lib/match/table_printer.rb +51 -0
- data/match/lib/match/utils.rb +75 -0
- data/pem/README.md +17 -0
- data/pem/lib/pem.rb +4 -0
- data/pem/lib/pem/commands_generator.rb +47 -0
- data/pem/lib/pem/manager.rb +112 -0
- data/pem/lib/pem/module.rb +19 -0
- data/pem/lib/pem/options.rb +103 -0
- data/pilot/README.md +17 -0
- data/pilot/lib/pilot.rb +9 -0
- data/pilot/lib/pilot/build_manager.rb +546 -0
- data/pilot/lib/pilot/commands_generator.rb +174 -0
- data/pilot/lib/pilot/features.rb +0 -0
- data/pilot/lib/pilot/manager.rb +90 -0
- data/pilot/lib/pilot/module.rb +11 -0
- data/pilot/lib/pilot/options.rb +303 -0
- data/pilot/lib/pilot/tester_exporter.rb +58 -0
- data/pilot/lib/pilot/tester_importer.rb +53 -0
- data/pilot/lib/pilot/tester_manager.rb +168 -0
- data/pilot/lib/pilot/tester_util.rb +0 -0
- data/precheck/README.md +17 -0
- data/precheck/lib/assets/PrecheckfileTemplate +27 -0
- data/precheck/lib/assets/PrecheckfileTemplate.swift +19 -0
- data/precheck/lib/precheck.rb +3 -0
- data/precheck/lib/precheck/commands_generator.rb +74 -0
- data/precheck/lib/precheck/item_to_check.rb +58 -0
- data/precheck/lib/precheck/module.rb +21 -0
- data/precheck/lib/precheck/options.rb +104 -0
- data/precheck/lib/precheck/rule.rb +171 -0
- data/precheck/lib/precheck/rule_check_result.rb +19 -0
- data/precheck/lib/precheck/rule_processor.rb +265 -0
- data/precheck/lib/precheck/rules/abstract_text_match_rule.rb +80 -0
- data/precheck/lib/precheck/rules/all.rb +1 -0
- data/precheck/lib/precheck/rules/copyright_date_rule.rb +37 -0
- data/precheck/lib/precheck/rules/curse_words_rule.rb +62 -0
- data/precheck/lib/precheck/rules/custom_text_rule.rb +35 -0
- data/precheck/lib/precheck/rules/free_stuff_iap_rule.rb +31 -0
- data/precheck/lib/precheck/rules/future_functionality_rule.rb +33 -0
- data/precheck/lib/precheck/rules/negative_apple_sentiment_rule.rb +37 -0
- data/precheck/lib/precheck/rules/other_platforms_rule.rb +43 -0
- data/precheck/lib/precheck/rules/placeholder_words_rule.rb +31 -0
- data/precheck/lib/precheck/rules/rules_data/curse_word_hashes/en_us.txt +349 -0
- data/precheck/lib/precheck/rules/test_words_rule.rb +30 -0
- data/precheck/lib/precheck/rules/unreachable_urls_rule.rb +47 -0
- data/precheck/lib/precheck/runner.rb +197 -0
- data/produce/README.md +17 -0
- data/produce/lib/produce.rb +6 -0
- data/produce/lib/produce/available_default_languages.rb +51 -0
- data/produce/lib/produce/cloud_container.rb +82 -0
- data/produce/lib/produce/commands_generator.rb +236 -0
- data/produce/lib/produce/developer_center.rb +143 -0
- data/produce/lib/produce/group.rb +90 -0
- data/produce/lib/produce/itunes_connect.rb +139 -0
- data/produce/lib/produce/manager.rb +15 -0
- data/produce/lib/produce/merchant.rb +121 -0
- data/produce/lib/produce/module.rb +14 -0
- data/produce/lib/produce/options.rb +184 -0
- data/produce/lib/produce/service.rb +319 -0
- data/scan/README.md +17 -0
- data/scan/lib/assets/ScanfileTemplate +16 -0
- data/scan/lib/assets/ScanfileTemplate.swift +13 -0
- data/scan/lib/scan.rb +10 -0
- data/scan/lib/scan/commands_generator.rb +78 -0
- data/scan/lib/scan/detect_values.rb +224 -0
- data/scan/lib/scan/error_handler.rb +57 -0
- data/scan/lib/scan/manager.rb +38 -0
- data/scan/lib/scan/module.rb +32 -0
- data/scan/lib/scan/options.rb +445 -0
- data/scan/lib/scan/runner.rb +197 -0
- data/scan/lib/scan/slack_poster.rb +60 -0
- data/scan/lib/scan/test_command_generator.rb +174 -0
- data/scan/lib/scan/test_result_parser.rb +33 -0
- data/scan/lib/scan/xcpretty_reporter_options_generator.rb +85 -0
- data/screengrab/README.md +17 -0
- data/screengrab/lib/assets/ScreengrabfileTemplate +15 -0
- data/screengrab/lib/assets/ScreengrabfileTemplate.swift +15 -0
- data/screengrab/lib/screengrab.rb +7 -0
- data/screengrab/lib/screengrab/android_environment.rb +91 -0
- data/screengrab/lib/screengrab/commands_generator.rb +70 -0
- data/screengrab/lib/screengrab/dependency_checker.rb +58 -0
- data/screengrab/lib/screengrab/detect_values.rb +16 -0
- data/screengrab/lib/screengrab/module.rb +26 -0
- data/screengrab/lib/screengrab/options.rb +148 -0
- data/screengrab/lib/screengrab/page.html.erb +190 -0
- data/screengrab/lib/screengrab/reports_generator.rb +36 -0
- data/screengrab/lib/screengrab/runner.rb +449 -0
- data/screengrab/lib/screengrab/setup.rb +24 -0
- data/sigh/README.md +17 -0
- data/sigh/lib/assets/resign.sh +909 -0
- data/sigh/lib/sigh.rb +4 -0
- data/sigh/lib/sigh/commands_generator.rb +154 -0
- data/sigh/lib/sigh/download_all.rb +112 -0
- data/sigh/lib/sigh/local_manage.rb +145 -0
- data/sigh/lib/sigh/manager.rb +47 -0
- data/sigh/lib/sigh/module.rb +42 -0
- data/sigh/lib/sigh/options.rb +187 -0
- data/sigh/lib/sigh/repair.rb +34 -0
- data/sigh/lib/sigh/resign.rb +220 -0
- data/sigh/lib/sigh/runner.rb +402 -0
- data/snapshot/README.md +17 -0
- data/snapshot/lib/assets/SnapfileTemplate +37 -0
- data/snapshot/lib/assets/SnapfileTemplate.swift +41 -0
- data/snapshot/lib/assets/SnapshotHelper.swift +301 -0
- data/snapshot/lib/assets/SnapshotHelperXcode8.swift +172 -0
- data/snapshot/lib/snapshot.rb +19 -0
- data/snapshot/lib/snapshot/collector.rb +140 -0
- data/snapshot/lib/snapshot/commands_generator.rb +115 -0
- data/snapshot/lib/snapshot/dependency_checker.rb +69 -0
- data/snapshot/lib/snapshot/detect_values.rb +86 -0
- data/snapshot/lib/snapshot/error_handler.rb +24 -0
- data/snapshot/lib/snapshot/fixes/README.md +5 -0
- data/snapshot/lib/snapshot/fixes/hardware_keyboard_fix.rb +27 -0
- data/snapshot/lib/snapshot/fixes/simulator_shared_pasteboard.rb +16 -0
- data/snapshot/lib/snapshot/fixes/simulator_zoom_fix.rb +27 -0
- data/snapshot/lib/snapshot/latest_os_version.rb +34 -0
- data/snapshot/lib/snapshot/module.rb +44 -0
- data/snapshot/lib/snapshot/options.rb +290 -0
- data/snapshot/lib/snapshot/page.html.erb +285 -0
- data/snapshot/lib/snapshot/reports_generator.rb +139 -0
- data/snapshot/lib/snapshot/reset_simulators.rb +122 -0
- data/snapshot/lib/snapshot/runner.rb +146 -0
- data/snapshot/lib/snapshot/screenshot_flatten.rb +20 -0
- data/snapshot/lib/snapshot/screenshot_rotate.rb +36 -0
- data/snapshot/lib/snapshot/setup.rb +58 -0
- data/snapshot/lib/snapshot/simulator_launchers/launcher_configuration.rb +62 -0
- data/snapshot/lib/snapshot/simulator_launchers/simulator_launcher.rb +219 -0
- data/snapshot/lib/snapshot/simulator_launchers/simulator_launcher_base.rb +200 -0
- data/snapshot/lib/snapshot/simulator_launchers/simulator_launcher_xcode_8.rb +113 -0
- data/snapshot/lib/snapshot/test_command_generator.rb +108 -0
- data/snapshot/lib/snapshot/test_command_generator_base.rb +128 -0
- data/snapshot/lib/snapshot/test_command_generator_xcode_8.rb +70 -0
- data/snapshot/lib/snapshot/update.rb +38 -0
- data/spaceship/README.md +183 -0
- data/spaceship/lib/assets/displayFamilies.json +181 -0
- data/spaceship/lib/assets/languageMapping.json +306 -0
- data/spaceship/lib/assets/languageMappingReadable.json +30 -0
- data/spaceship/lib/spaceship.rb +30 -0
- data/spaceship/lib/spaceship/base.rb +310 -0
- data/spaceship/lib/spaceship/client.rb +913 -0
- data/spaceship/lib/spaceship/commands_generator.rb +53 -0
- data/spaceship/lib/spaceship/connect_api.rb +116 -0
- data/spaceship/lib/spaceship/connect_api/api_client.rb +279 -0
- data/spaceship/lib/spaceship/connect_api/client.rb +216 -0
- data/spaceship/lib/spaceship/connect_api/file_uploader.rb +99 -0
- data/spaceship/lib/spaceship/connect_api/model.rb +172 -0
- data/spaceship/lib/spaceship/connect_api/models/age_rating_declaration.rb +114 -0
- data/spaceship/lib/spaceship/connect_api/models/app.rb +388 -0
- data/spaceship/lib/spaceship/connect_api/models/app_category.rb +94 -0
- data/spaceship/lib/spaceship/connect_api/models/app_info.rb +95 -0
- data/spaceship/lib/spaceship/connect_api/models/app_info_localization.rb +39 -0
- data/spaceship/lib/spaceship/connect_api/models/app_preview.rb +131 -0
- data/spaceship/lib/spaceship/connect_api/models/app_preview_set.rb +100 -0
- data/spaceship/lib/spaceship/connect_api/models/app_price.rb +22 -0
- data/spaceship/lib/spaceship/connect_api/models/app_price_point.rb +26 -0
- data/spaceship/lib/spaceship/connect_api/models/app_price_tier.rb +12 -0
- data/spaceship/lib/spaceship/connect_api/models/app_screenshot.rb +187 -0
- data/spaceship/lib/spaceship/connect_api/models/app_screenshot_set.rb +153 -0
- data/spaceship/lib/spaceship/connect_api/models/app_store_review_attachment.rb +71 -0
- data/spaceship/lib/spaceship/connect_api/models/app_store_review_detail.rb +51 -0
- data/spaceship/lib/spaceship/connect_api/models/app_store_version.rb +217 -0
- data/spaceship/lib/spaceship/connect_api/models/app_store_version_localization.rb +85 -0
- data/spaceship/lib/spaceship/connect_api/models/app_store_version_phased_release.rb +57 -0
- data/spaceship/lib/spaceship/connect_api/models/app_store_version_release_request.rb +12 -0
- data/spaceship/lib/spaceship/connect_api/models/app_store_version_submission.rb +26 -0
- data/spaceship/lib/spaceship/connect_api/models/beta_app_localization.rb +28 -0
- data/spaceship/lib/spaceship/connect_api/models/beta_app_review_detail.rb +32 -0
- data/spaceship/lib/spaceship/connect_api/models/beta_app_review_submission.rb +26 -0
- data/spaceship/lib/spaceship/connect_api/models/beta_build_localization.rb +20 -0
- data/spaceship/lib/spaceship/connect_api/models/beta_build_metric.rb +24 -0
- data/spaceship/lib/spaceship/connect_api/models/beta_feedback.rb +75 -0
- data/spaceship/lib/spaceship/connect_api/models/beta_group.rb +41 -0
- data/spaceship/lib/spaceship/connect_api/models/beta_screenshot.rb +18 -0
- data/spaceship/lib/spaceship/connect_api/models/beta_tester.rb +57 -0
- data/spaceship/lib/spaceship/connect_api/models/beta_tester_metric.rb +44 -0
- data/spaceship/lib/spaceship/connect_api/models/build.rb +172 -0
- data/spaceship/lib/spaceship/connect_api/models/build_beta_detail.rb +61 -0
- data/spaceship/lib/spaceship/connect_api/models/build_delivery.rb +36 -0
- data/spaceship/lib/spaceship/connect_api/models/bundle_id.rb +58 -0
- data/spaceship/lib/spaceship/connect_api/models/bundle_id_capability.rb +71 -0
- data/spaceship/lib/spaceship/connect_api/models/certificate.rb +102 -0
- data/spaceship/lib/spaceship/connect_api/models/custom_app_organization.rb +43 -0
- data/spaceship/lib/spaceship/connect_api/models/custom_app_user.rb +41 -0
- data/spaceship/lib/spaceship/connect_api/models/device.rb +58 -0
- data/spaceship/lib/spaceship/connect_api/models/idfa_declaration.rb +41 -0
- data/spaceship/lib/spaceship/connect_api/models/pre_release_version.rb +20 -0
- data/spaceship/lib/spaceship/connect_api/models/profile.rb +97 -0
- data/spaceship/lib/spaceship/connect_api/models/reset_ratings_request.rb +26 -0
- data/spaceship/lib/spaceship/connect_api/models/sandbox_tester.rb +64 -0
- data/spaceship/lib/spaceship/connect_api/models/territory.rb +27 -0
- data/spaceship/lib/spaceship/connect_api/models/user.rb +51 -0
- data/spaceship/lib/spaceship/connect_api/models/user_invitation.rb +59 -0
- data/spaceship/lib/spaceship/connect_api/provisioning/client.rb +92 -0
- data/spaceship/lib/spaceship/connect_api/provisioning/provisioning.rb +143 -0
- data/spaceship/lib/spaceship/connect_api/response.rb +67 -0
- data/spaceship/lib/spaceship/connect_api/spaceship.rb +102 -0
- data/spaceship/lib/spaceship/connect_api/testflight/client.rb +24 -0
- data/spaceship/lib/spaceship/connect_api/testflight/testflight.rb +391 -0
- data/spaceship/lib/spaceship/connect_api/token.rb +102 -0
- data/spaceship/lib/spaceship/connect_api/token_refresh_middleware.rb +24 -0
- data/spaceship/lib/spaceship/connect_api/tunes/client.rb +24 -0
- data/spaceship/lib/spaceship/connect_api/tunes/tunes.rb +1045 -0
- data/spaceship/lib/spaceship/connect_api/users/client.rb +24 -0
- data/spaceship/lib/spaceship/connect_api/users/users.rb +80 -0
- data/spaceship/lib/spaceship/du/du_client.rb +138 -0
- data/spaceship/lib/spaceship/du/upload_file.rb +58 -0
- data/spaceship/lib/spaceship/du/utilities.rb +99 -0
- data/spaceship/lib/spaceship/errors.rb +82 -0
- data/spaceship/lib/spaceship/globals.rb +12 -0
- data/spaceship/lib/spaceship/helper/net_http_generic_request.rb +20 -0
- data/spaceship/lib/spaceship/helper/plist_middleware.rb +16 -0
- data/spaceship/lib/spaceship/helper/rels_middleware.rb +28 -0
- data/spaceship/lib/spaceship/launcher.rb +99 -0
- data/spaceship/lib/spaceship/module.rb +8 -0
- data/spaceship/lib/spaceship/playground.rb +75 -0
- data/spaceship/lib/spaceship/portal/app.rb +201 -0
- data/spaceship/lib/spaceship/portal/app_group.rb +73 -0
- data/spaceship/lib/spaceship/portal/app_service.rb +87 -0
- data/spaceship/lib/spaceship/portal/certificate.rb +365 -0
- data/spaceship/lib/spaceship/portal/cloud_container.rb +74 -0
- data/spaceship/lib/spaceship/portal/device.rb +191 -0
- data/spaceship/lib/spaceship/portal/invite.rb +53 -0
- data/spaceship/lib/spaceship/portal/key.rb +101 -0
- data/spaceship/lib/spaceship/portal/legacy_wrapper.rb +21 -0
- data/spaceship/lib/spaceship/portal/merchant.rb +86 -0
- data/spaceship/lib/spaceship/portal/passbook.rb +78 -0
- data/spaceship/lib/spaceship/portal/person.rb +62 -0
- data/spaceship/lib/spaceship/portal/persons.rb +67 -0
- data/spaceship/lib/spaceship/portal/portal.rb +17 -0
- data/spaceship/lib/spaceship/portal/portal_base.rb +16 -0
- data/spaceship/lib/spaceship/portal/portal_client.rb +862 -0
- data/spaceship/lib/spaceship/portal/provisioning_profile.rb +559 -0
- data/spaceship/lib/spaceship/portal/provisioning_profile_template.rb +52 -0
- data/spaceship/lib/spaceship/portal/spaceship.rb +154 -0
- data/spaceship/lib/spaceship/portal/ui/select_team.rb +116 -0
- data/spaceship/lib/spaceship/portal/website_push.rb +88 -0
- data/spaceship/lib/spaceship/provider.rb +13 -0
- data/spaceship/lib/spaceship/spaceauth_runner.rb +74 -0
- data/spaceship/lib/spaceship/stats_middleware.rb +65 -0
- data/spaceship/lib/spaceship/test_flight.rb +10 -0
- data/spaceship/lib/spaceship/test_flight/app_test_info.rb +40 -0
- data/spaceship/lib/spaceship/test_flight/base.rb +39 -0
- data/spaceship/lib/spaceship/test_flight/beta_review_info.rb +19 -0
- data/spaceship/lib/spaceship/test_flight/build.rb +242 -0
- data/spaceship/lib/spaceship/test_flight/build_trains.rb +50 -0
- data/spaceship/lib/spaceship/test_flight/client.rb +361 -0
- data/spaceship/lib/spaceship/test_flight/export_compliance.rb +12 -0
- data/spaceship/lib/spaceship/test_flight/group.rb +131 -0
- data/spaceship/lib/spaceship/test_flight/test_info.rb +56 -0
- data/spaceship/lib/spaceship/test_flight/tester.rb +136 -0
- data/spaceship/lib/spaceship/tunes/app_analytics.rb +168 -0
- data/spaceship/lib/spaceship/tunes/app_details.rb +147 -0
- data/spaceship/lib/spaceship/tunes/app_image.rb +51 -0
- data/spaceship/lib/spaceship/tunes/app_ratings.rb +58 -0
- data/spaceship/lib/spaceship/tunes/app_review.rb +55 -0
- data/spaceship/lib/spaceship/tunes/app_review_attachment.rb +49 -0
- data/spaceship/lib/spaceship/tunes/app_screenshot.rb +12 -0
- data/spaceship/lib/spaceship/tunes/app_status.rb +63 -0
- data/spaceship/lib/spaceship/tunes/app_submission.rb +161 -0
- data/spaceship/lib/spaceship/tunes/app_trailer.rb +64 -0
- data/spaceship/lib/spaceship/tunes/app_version.rb +970 -0
- data/spaceship/lib/spaceship/tunes/app_version_common.rb +35 -0
- data/spaceship/lib/spaceship/tunes/app_version_generated_promocodes.rb +28 -0
- data/spaceship/lib/spaceship/tunes/app_version_history.rb +52 -0
- data/spaceship/lib/spaceship/tunes/app_version_promocodes.rb +27 -0
- data/spaceship/lib/spaceship/tunes/app_version_ref.rb +15 -0
- data/spaceship/lib/spaceship/tunes/app_version_states_history.rb +27 -0
- data/spaceship/lib/spaceship/tunes/application.rb +453 -0
- data/spaceship/lib/spaceship/tunes/availability.rb +164 -0
- data/spaceship/lib/spaceship/tunes/b2b_organization.rb +50 -0
- data/spaceship/lib/spaceship/tunes/b2b_user.rb +30 -0
- data/spaceship/lib/spaceship/tunes/build.rb +263 -0
- data/spaceship/lib/spaceship/tunes/build_details.rb +184 -0
- data/spaceship/lib/spaceship/tunes/build_train.rb +181 -0
- data/spaceship/lib/spaceship/tunes/developer_response.rb +23 -0
- data/spaceship/lib/spaceship/tunes/device_type.rb +17 -0
- data/spaceship/lib/spaceship/tunes/display_family.rb +84 -0
- data/spaceship/lib/spaceship/tunes/errors.rb +17 -0
- data/spaceship/lib/spaceship/tunes/iap.rb +168 -0
- data/spaceship/lib/spaceship/tunes/iap_detail.rb +264 -0
- data/spaceship/lib/spaceship/tunes/iap_families.rb +68 -0
- data/spaceship/lib/spaceship/tunes/iap_family_details.rb +90 -0
- data/spaceship/lib/spaceship/tunes/iap_family_list.rb +28 -0
- data/spaceship/lib/spaceship/tunes/iap_list.rb +76 -0
- data/spaceship/lib/spaceship/tunes/iap_status.rb +56 -0
- data/spaceship/lib/spaceship/tunes/iap_subscription_pricing_info.rb +46 -0
- data/spaceship/lib/spaceship/tunes/iap_subscription_pricing_tier.rb +25 -0
- data/spaceship/lib/spaceship/tunes/iap_type.rb +45 -0
- data/spaceship/lib/spaceship/tunes/language_converter.rb +65 -0
- data/spaceship/lib/spaceship/tunes/language_item.rb +61 -0
- data/spaceship/lib/spaceship/tunes/legacy_wrapper.rb +13 -0
- data/spaceship/lib/spaceship/tunes/member.rb +84 -0
- data/spaceship/lib/spaceship/tunes/members.rb +35 -0
- data/spaceship/lib/spaceship/tunes/pricing_info.rb +42 -0
- data/spaceship/lib/spaceship/tunes/pricing_tier.rb +25 -0
- data/spaceship/lib/spaceship/tunes/sandbox_tester.rb +74 -0
- data/spaceship/lib/spaceship/tunes/spaceship.rb +39 -0
- data/spaceship/lib/spaceship/tunes/territory.rb +39 -0
- data/spaceship/lib/spaceship/tunes/transit_app_file.rb +23 -0
- data/spaceship/lib/spaceship/tunes/tunes.rb +35 -0
- data/spaceship/lib/spaceship/tunes/tunes_base.rb +17 -0
- data/spaceship/lib/spaceship/tunes/tunes_client.rb +1644 -0
- data/spaceship/lib/spaceship/tunes/user_detail.rb +15 -0
- data/spaceship/lib/spaceship/tunes/version_set.rb +26 -0
- data/spaceship/lib/spaceship/two_step_or_factor_client.rb +346 -0
- data/spaceship/lib/spaceship/ui.rb +27 -0
- data/supply/README.md +17 -0
- data/supply/lib/supply.rb +53 -0
- data/supply/lib/supply/apk_listing.rb +14 -0
- data/supply/lib/supply/client.rb +551 -0
- data/supply/lib/supply/commands_generator.rb +67 -0
- data/supply/lib/supply/languages.rb +88 -0
- data/supply/lib/supply/listing.rb +32 -0
- data/supply/lib/supply/options.rb +324 -0
- data/supply/lib/supply/reader.rb +41 -0
- data/supply/lib/supply/release_listing.rb +18 -0
- data/supply/lib/supply/setup.rb +122 -0
- data/supply/lib/supply/uploader.rb +480 -0
- metadata +1832 -0
@@ -0,0 +1,913 @@
|
|
1
|
+
require 'babosa'
|
2
|
+
require 'faraday' # HTTP Client
|
3
|
+
require 'faraday-cookie_jar'
|
4
|
+
require 'faraday_middleware'
|
5
|
+
require 'logger'
|
6
|
+
require 'tmpdir'
|
7
|
+
require 'cgi'
|
8
|
+
require 'tempfile'
|
9
|
+
require 'openssl'
|
10
|
+
|
11
|
+
require 'fastlane/version'
|
12
|
+
require_relative 'helper/net_http_generic_request'
|
13
|
+
require_relative 'helper/plist_middleware'
|
14
|
+
require_relative 'helper/rels_middleware'
|
15
|
+
require_relative 'ui'
|
16
|
+
require_relative 'errors'
|
17
|
+
require_relative 'tunes/errors'
|
18
|
+
require_relative 'globals'
|
19
|
+
require_relative 'provider'
|
20
|
+
require_relative 'stats_middleware'
|
21
|
+
|
22
|
+
Faraday::Utils.default_params_encoder = Faraday::FlatParamsEncoder
|
23
|
+
|
24
|
+
module Spaceship
|
25
|
+
# rubocop:disable Metrics/ClassLength
|
26
|
+
class Client
|
27
|
+
PROTOCOL_VERSION = "QH65B2"
|
28
|
+
USER_AGENT = "Spaceship #{Fastlane::VERSION}"
|
29
|
+
AUTH_TYPES = ["sa", "hsa", "non-sa", "hsa2"]
|
30
|
+
|
31
|
+
attr_reader :client
|
32
|
+
|
33
|
+
# The user that is currently logged in
|
34
|
+
attr_accessor :user
|
35
|
+
|
36
|
+
# The email of the user that is currently logged in
|
37
|
+
attr_accessor :user_email
|
38
|
+
|
39
|
+
# The logger in which all requests are logged
|
40
|
+
# /tmp/spaceship[time]_[pid].log by default
|
41
|
+
attr_accessor :logger
|
42
|
+
|
43
|
+
attr_accessor :csrf_tokens
|
44
|
+
|
45
|
+
attr_accessor :provider
|
46
|
+
|
47
|
+
# legacy support
|
48
|
+
BasicPreferredInfoError = Spaceship::BasicPreferredInfoError
|
49
|
+
InvalidUserCredentialsError = Spaceship::InvalidUserCredentialsError
|
50
|
+
NoUserCredentialsError = Spaceship::NoUserCredentialsError
|
51
|
+
ProgramLicenseAgreementUpdated = Spaceship::ProgramLicenseAgreementUpdated
|
52
|
+
InsufficientPermissions = Spaceship::InsufficientPermissions
|
53
|
+
UnexpectedResponse = Spaceship::UnexpectedResponse
|
54
|
+
AppleTimeoutError = Spaceship::AppleTimeoutError
|
55
|
+
UnauthorizedAccessError = Spaceship::UnauthorizedAccessError
|
56
|
+
GatewayTimeoutError = Spaceship::GatewayTimeoutError
|
57
|
+
InternalServerError = Spaceship::InternalServerError
|
58
|
+
BadGatewayError = Spaceship::BadGatewayError
|
59
|
+
AccessForbiddenError = Spaceship::AccessForbiddenError
|
60
|
+
|
61
|
+
def self.hostname
|
62
|
+
raise "You must implement self.hostname"
|
63
|
+
end
|
64
|
+
|
65
|
+
#####################################################
|
66
|
+
# @!group Teams + User
|
67
|
+
#####################################################
|
68
|
+
|
69
|
+
# @return (Array) A list of all available teams
|
70
|
+
def teams
|
71
|
+
user_details_data['associatedAccounts'].sort_by do |team|
|
72
|
+
[
|
73
|
+
team['contentProvider']['name'],
|
74
|
+
team['contentProvider']['contentProviderId']
|
75
|
+
]
|
76
|
+
end
|
77
|
+
end
|
78
|
+
|
79
|
+
# Fetch the general information of the user, is used by various methods across spaceship
|
80
|
+
# Sample return value
|
81
|
+
# => {"associatedAccounts"=>
|
82
|
+
# [{"contentProvider"=>{"contentProviderId"=>11142800, "name"=>"Felix Krause", "contentProviderTypes"=>["Purple Software"]}, "roles"=>["Developer"], "lastLogin"=>1468784113000}],
|
83
|
+
# "sessionToken"=>{"dsId"=>"8501011116", "contentProviderId"=>18111111, "expirationDate"=>nil, "ipAddress"=>nil},
|
84
|
+
# "permittedActivities"=>
|
85
|
+
# {"EDIT"=>
|
86
|
+
# ["UserManagementSelf",
|
87
|
+
# "GameCenterTestData",
|
88
|
+
# "AppAddonCreation"],
|
89
|
+
# "REPORT"=>
|
90
|
+
# ["UserManagementSelf",
|
91
|
+
# "AppAddonCreation"],
|
92
|
+
# "VIEW"=>
|
93
|
+
# ["TestFlightAppExternalTesterManagement",
|
94
|
+
# ...
|
95
|
+
# "HelpGeneral",
|
96
|
+
# "HelpApplicationLoader"]},
|
97
|
+
# "preferredCurrencyCode"=>"EUR",
|
98
|
+
# "preferredCountryCode"=>nil,
|
99
|
+
# "countryOfOrigin"=>"AT",
|
100
|
+
# "isLocaleNameReversed"=>false,
|
101
|
+
# "feldsparToken"=>nil,
|
102
|
+
# "feldsparChannelName"=>nil,
|
103
|
+
# "hasPendingFeldsparBindingRequest"=>false,
|
104
|
+
# "isLegalUser"=>false,
|
105
|
+
# "userId"=>"1771111155",
|
106
|
+
# "firstname"=>"Detlef",
|
107
|
+
# "lastname"=>"Mueller",
|
108
|
+
# "isEmailInvalid"=>false,
|
109
|
+
# "hasContractInfo"=>false,
|
110
|
+
# "canEditITCUsersAndRoles"=>false,
|
111
|
+
# "canViewITCUsersAndRoles"=>true,
|
112
|
+
# "canEditIAPUsersAndRoles"=>false,
|
113
|
+
# "transporterEnabled"=>false,
|
114
|
+
# "contentProviderFeatures"=>["APP_SILOING", "PROMO_CODE_REDESIGN", ...],
|
115
|
+
# "contentProviderType"=>"Purple Software",
|
116
|
+
# "displayName"=>"Detlef",
|
117
|
+
# "contentProviderId"=>"18742800",
|
118
|
+
# "userFeatures"=>[],
|
119
|
+
# "visibility"=>true,
|
120
|
+
# "DYCVisibility"=>false,
|
121
|
+
# "contentProvider"=>"Felix Krause",
|
122
|
+
# "userName"=>"detlef@krausefx.com"}
|
123
|
+
def user_details_data
|
124
|
+
return @_cached_user_details if @_cached_user_details
|
125
|
+
r = request(:get, '/WebObjects/iTunesConnect.woa/ra/user/detail')
|
126
|
+
@_cached_user_details = parse_response(r, 'data')
|
127
|
+
end
|
128
|
+
|
129
|
+
# @return (String) The currently selected Team ID
|
130
|
+
def team_id
|
131
|
+
return @current_team_id if @current_team_id
|
132
|
+
|
133
|
+
if teams.count > 1
|
134
|
+
puts("The current user is in #{teams.count} teams. Pass a team ID or call `select_team` to choose a team. Using the first one for now.")
|
135
|
+
end
|
136
|
+
@current_team_id ||= teams[0]['contentProvider']['contentProviderId']
|
137
|
+
end
|
138
|
+
|
139
|
+
# Set a new team ID which will be used from now on
|
140
|
+
def team_id=(team_id)
|
141
|
+
# First, we verify the team actually exists, because otherwise iTC would return the
|
142
|
+
# following confusing error message
|
143
|
+
#
|
144
|
+
# invalid content provider id
|
145
|
+
#
|
146
|
+
available_teams = teams.collect do |team|
|
147
|
+
{
|
148
|
+
team_id: (team["contentProvider"] || {})["contentProviderId"],
|
149
|
+
team_name: (team["contentProvider"] || {})["name"]
|
150
|
+
}
|
151
|
+
end
|
152
|
+
|
153
|
+
result = available_teams.find do |available_team|
|
154
|
+
team_id.to_s == available_team[:team_id].to_s
|
155
|
+
end
|
156
|
+
|
157
|
+
unless result
|
158
|
+
error_string = "Could not set team ID to '#{team_id}', only found the following available teams:\n\n#{available_teams.map { |team| "- #{team[:team_id]} (#{team[:team_name]})" }.join("\n")}\n"
|
159
|
+
raise Tunes::Error.new, error_string
|
160
|
+
end
|
161
|
+
|
162
|
+
response = request(:post) do |req|
|
163
|
+
req.url("ra/v2/session/webSession")
|
164
|
+
req.body = {
|
165
|
+
contentProviderId: team_id,
|
166
|
+
dsId: user_detail_data.ds_id # https://github.com/fastlane/fastlane/issues/6711
|
167
|
+
}.to_json
|
168
|
+
req.headers['Content-Type'] = 'application/json'
|
169
|
+
end
|
170
|
+
|
171
|
+
handle_itc_response(response.body)
|
172
|
+
|
173
|
+
@current_team_id = team_id
|
174
|
+
end
|
175
|
+
|
176
|
+
# @return (Hash) Fetches all information of the currently used team
|
177
|
+
def team_information
|
178
|
+
teams.find do |t|
|
179
|
+
t['teamId'] == team_id
|
180
|
+
end
|
181
|
+
end
|
182
|
+
|
183
|
+
# @return (String) Fetches name from currently used team
|
184
|
+
def team_name
|
185
|
+
(team_information || {})['name']
|
186
|
+
end
|
187
|
+
|
188
|
+
#####################################################
|
189
|
+
# @!group Client Init
|
190
|
+
#####################################################
|
191
|
+
|
192
|
+
# Instantiates a client but with a cookie derived from another client.
|
193
|
+
#
|
194
|
+
# HACK: since the `@cookie` is not exposed, we use this hacky way of sharing the instance.
|
195
|
+
def self.client_with_authorization_from(another_client)
|
196
|
+
self.new(cookie: another_client.instance_variable_get(:@cookie), current_team_id: another_client.team_id)
|
197
|
+
end
|
198
|
+
|
199
|
+
def initialize(cookie: nil, current_team_id: nil, csrf_tokens: nil, timeout: nil)
|
200
|
+
options = {
|
201
|
+
request: {
|
202
|
+
timeout: (ENV["SPACESHIP_TIMEOUT"] || timeout || 300).to_i,
|
203
|
+
open_timeout: (ENV["SPACESHIP_TIMEOUT"] || timeout || 300).to_i
|
204
|
+
}
|
205
|
+
}
|
206
|
+
@current_team_id = current_team_id
|
207
|
+
@csrf_tokens = csrf_tokens
|
208
|
+
@cookie = cookie || HTTP::CookieJar.new
|
209
|
+
|
210
|
+
@client = Faraday.new(self.class.hostname, options) do |c|
|
211
|
+
c.response(:json, content_type: /\bjson$/)
|
212
|
+
c.response(:plist, content_type: /\bplist$/)
|
213
|
+
c.use(:cookie_jar, jar: @cookie)
|
214
|
+
c.use(FaradayMiddleware::RelsMiddleware)
|
215
|
+
c.use(Spaceship::StatsMiddleware)
|
216
|
+
c.adapter(Faraday.default_adapter)
|
217
|
+
|
218
|
+
if ENV['SPACESHIP_DEBUG']
|
219
|
+
# for debugging only
|
220
|
+
# This enables tracking of networking requests using Charles Web Proxy
|
221
|
+
c.proxy = "https://127.0.0.1:8888"
|
222
|
+
c.ssl[:verify_mode] = OpenSSL::SSL::VERIFY_NONE
|
223
|
+
elsif ENV["SPACESHIP_PROXY"]
|
224
|
+
c.proxy = ENV["SPACESHIP_PROXY"]
|
225
|
+
c.ssl[:verify_mode] = OpenSSL::SSL::VERIFY_NONE if ENV["SPACESHIP_PROXY_SSL_VERIFY_NONE"]
|
226
|
+
end
|
227
|
+
|
228
|
+
if ENV["DEBUG"]
|
229
|
+
puts("To run spaceship through a local proxy, use SPACESHIP_DEBUG")
|
230
|
+
end
|
231
|
+
end
|
232
|
+
end
|
233
|
+
|
234
|
+
#####################################################
|
235
|
+
# @!group Request Logger
|
236
|
+
#####################################################
|
237
|
+
|
238
|
+
# The logger in which all requests are logged
|
239
|
+
# /tmp/spaceship[time]_[pid]_["threadid"].log by default
|
240
|
+
def logger
|
241
|
+
unless @logger
|
242
|
+
if ENV["VERBOSE"]
|
243
|
+
@logger = Logger.new(STDOUT)
|
244
|
+
else
|
245
|
+
# Log to file by default
|
246
|
+
path = "/tmp/spaceship#{Time.now.to_i}_#{Process.pid}_#{Thread.current.object_id}.log"
|
247
|
+
@logger = Logger.new(path)
|
248
|
+
end
|
249
|
+
|
250
|
+
@logger.formatter = proc do |severity, datetime, progname, msg|
|
251
|
+
severity = format('%-5.5s', severity)
|
252
|
+
"#{severity} [#{datetime.strftime('%H:%M:%S')}]: #{msg}\n"
|
253
|
+
end
|
254
|
+
end
|
255
|
+
|
256
|
+
@logger
|
257
|
+
end
|
258
|
+
|
259
|
+
#####################################################
|
260
|
+
# @!group Session Cookie
|
261
|
+
#####################################################
|
262
|
+
|
263
|
+
##
|
264
|
+
# Return the session cookie.
|
265
|
+
#
|
266
|
+
# @return (String) the cookie-string in the RFC6265 format: https://tools.ietf.org/html/rfc6265#section-4.2.1
|
267
|
+
def cookie
|
268
|
+
@cookie.map(&:to_s).join(';')
|
269
|
+
end
|
270
|
+
|
271
|
+
def store_cookie(path: nil)
|
272
|
+
path ||= persistent_cookie_path
|
273
|
+
FileUtils.mkdir_p(File.expand_path("..", path))
|
274
|
+
|
275
|
+
# really important to specify the session to true
|
276
|
+
# otherwise myacinfo and more won't be stored
|
277
|
+
@cookie.save(path, :yaml, session: true)
|
278
|
+
return File.read(path)
|
279
|
+
end
|
280
|
+
|
281
|
+
# This is a duplicate method of fastlane_core/fastlane_core.rb#fastlane_user_dir
|
282
|
+
def fastlane_user_dir
|
283
|
+
path = File.expand_path(File.join(Dir.home, ".fastlane"))
|
284
|
+
FileUtils.mkdir_p(path) unless File.directory?(path)
|
285
|
+
return path
|
286
|
+
end
|
287
|
+
|
288
|
+
# Returns preferred path for storing cookie
|
289
|
+
# for two step verification.
|
290
|
+
def persistent_cookie_path
|
291
|
+
if ENV["SPACESHIP_COOKIE_PATH"]
|
292
|
+
path = File.expand_path(File.join(ENV["SPACESHIP_COOKIE_PATH"], "spaceship", self.user, "cookie"))
|
293
|
+
else
|
294
|
+
[File.join(self.fastlane_user_dir, "spaceship"), "~/.spaceship", "/var/tmp/spaceship", "#{Dir.tmpdir}/spaceship"].each do |dir|
|
295
|
+
dir_parts = File.split(dir)
|
296
|
+
if directory_accessible?(File.expand_path(dir_parts.first))
|
297
|
+
path = File.expand_path(File.join(dir, self.user, "cookie"))
|
298
|
+
break
|
299
|
+
end
|
300
|
+
end
|
301
|
+
end
|
302
|
+
|
303
|
+
return path
|
304
|
+
end
|
305
|
+
|
306
|
+
#####################################################
|
307
|
+
# @!group Automatic Paging
|
308
|
+
#####################################################
|
309
|
+
|
310
|
+
# The page size we want to request, defaults to 500
|
311
|
+
def page_size
|
312
|
+
@page_size ||= 500
|
313
|
+
end
|
314
|
+
|
315
|
+
# Handles the paging for you... for free
|
316
|
+
# Just pass a block and use the parameter as page number
|
317
|
+
def paging
|
318
|
+
page = 0
|
319
|
+
results = []
|
320
|
+
loop do
|
321
|
+
page += 1
|
322
|
+
current = yield(page)
|
323
|
+
|
324
|
+
results += current
|
325
|
+
|
326
|
+
break if (current || []).count < page_size # no more results
|
327
|
+
end
|
328
|
+
|
329
|
+
return results
|
330
|
+
end
|
331
|
+
|
332
|
+
#####################################################
|
333
|
+
# @!group Login and Team Selection
|
334
|
+
#####################################################
|
335
|
+
|
336
|
+
# Authenticates with Apple's web services. This method has to be called once
|
337
|
+
# to generate a valid session. The session will automatically be used from then
|
338
|
+
# on.
|
339
|
+
#
|
340
|
+
# This method will automatically use the username from the Appfile (if available)
|
341
|
+
# and fetch the password from the Keychain (if available)
|
342
|
+
#
|
343
|
+
# @param user (String) (optional): The username (usually the email address)
|
344
|
+
# @param password (String) (optional): The password
|
345
|
+
#
|
346
|
+
# @raise InvalidUserCredentialsError: raised if authentication failed
|
347
|
+
#
|
348
|
+
# @return (Spaceship::Client) The client the login method was called for
|
349
|
+
def self.login(user = nil, password = nil)
|
350
|
+
instance = self.new
|
351
|
+
if instance.login(user, password)
|
352
|
+
instance
|
353
|
+
else
|
354
|
+
raise InvalidUserCredentialsError.new, "Invalid User Credentials"
|
355
|
+
end
|
356
|
+
end
|
357
|
+
|
358
|
+
# Authenticates with Apple's web services. This method has to be called once
|
359
|
+
# to generate a valid session. The session will automatically be used from then
|
360
|
+
# on.
|
361
|
+
#
|
362
|
+
# This method will automatically use the username from the Appfile (if available)
|
363
|
+
# and fetch the password from the Keychain (if available)
|
364
|
+
#
|
365
|
+
# @param user (String) (optional): The username (usually the email address)
|
366
|
+
# @param password (String) (optional): The password
|
367
|
+
#
|
368
|
+
# @raise InvalidUserCredentialsError: raised if authentication failed
|
369
|
+
#
|
370
|
+
# @return (Spaceship::Client) The client the login method was called for
|
371
|
+
def login(user = nil, password = nil)
|
372
|
+
if user.to_s.empty? || password.to_s.empty?
|
373
|
+
require 'credentials_manager/account_manager'
|
374
|
+
|
375
|
+
puts("Reading keychain entry, because either user or password were empty") if Spaceship::Globals.verbose?
|
376
|
+
|
377
|
+
keychain_entry = CredentialsManager::AccountManager.new(user: user, password: password)
|
378
|
+
user ||= keychain_entry.user
|
379
|
+
password = keychain_entry.password
|
380
|
+
end
|
381
|
+
|
382
|
+
if user.to_s.strip.empty? || password.to_s.strip.empty?
|
383
|
+
raise NoUserCredentialsError.new, "No login data provided"
|
384
|
+
end
|
385
|
+
|
386
|
+
self.user = user
|
387
|
+
@password = password
|
388
|
+
begin
|
389
|
+
do_login(user, password) # calls `send_login_request` in sub class (which then will redirect back here to `send_shared_login_request`, below)
|
390
|
+
rescue InvalidUserCredentialsError => ex
|
391
|
+
raise ex unless keychain_entry
|
392
|
+
|
393
|
+
if keychain_entry.invalid_credentials
|
394
|
+
login(user)
|
395
|
+
else
|
396
|
+
raise ex
|
397
|
+
end
|
398
|
+
end
|
399
|
+
end
|
400
|
+
|
401
|
+
# This method is used for both the Apple Dev Portal and App Store Connect
|
402
|
+
# This will also handle 2 step verification and 2 factor authentication
|
403
|
+
#
|
404
|
+
# It is called in `send_login_request` of sub classes (which the method `login`, above, transferred over to via `do_login`)
|
405
|
+
def send_shared_login_request(user, password)
|
406
|
+
# Check if we have a cached/valid session
|
407
|
+
#
|
408
|
+
# Background:
|
409
|
+
# December 4th 2017 Apple introduced a rate limit - which is of course fine by itself -
|
410
|
+
# but unfortunately also rate limits successful logins. If you call multiple tools in a
|
411
|
+
# lane (e.g. call match 5 times), this would lock you out of the account for a while.
|
412
|
+
# By loading existing sessions and checking if they're valid, we're sending less login requests.
|
413
|
+
# More context on why this change was necessary https://github.com/fastlane/fastlane/pull/11108
|
414
|
+
#
|
415
|
+
# If there was a successful manual login before, we have a session on disk
|
416
|
+
if load_session_from_file
|
417
|
+
# Check if the session is still valid here
|
418
|
+
begin
|
419
|
+
# We use the olympus session to determine if the old session is still valid
|
420
|
+
# As this will raise an exception if the old session has expired
|
421
|
+
# If the old session is still valid, we don't have to do anything else in this method
|
422
|
+
# that's why we return true
|
423
|
+
return true if fetch_olympus_session
|
424
|
+
rescue
|
425
|
+
# If the `fetch_olympus_session` method raises an exception
|
426
|
+
# we'll land here, and therefore continue doing a full login process
|
427
|
+
# This happens if the session we loaded from the cache isn't valid any more
|
428
|
+
# which is common, as the session automatically invalidates after x hours (we don't know x)
|
429
|
+
# In this case we don't actually care about the exact exception, and why it was failing
|
430
|
+
# because either way, we'll have to do a fresh login, where we do the actual error handling
|
431
|
+
puts("Available session is not valid any more. Continuing with normal login.")
|
432
|
+
end
|
433
|
+
end
|
434
|
+
#
|
435
|
+
# The user can pass the session via environment variable (Mainly used in CI environments)
|
436
|
+
if load_session_from_env
|
437
|
+
# see above
|
438
|
+
begin
|
439
|
+
# see above
|
440
|
+
return true if fetch_olympus_session
|
441
|
+
rescue
|
442
|
+
puts("Session loaded from environment variable is not valid. Continuing with normal login.")
|
443
|
+
# see above
|
444
|
+
end
|
445
|
+
end
|
446
|
+
#
|
447
|
+
# After this point, we sure have no valid session any more and have to create a new one
|
448
|
+
#
|
449
|
+
|
450
|
+
data = {
|
451
|
+
accountName: user,
|
452
|
+
password: password,
|
453
|
+
rememberMe: true
|
454
|
+
}
|
455
|
+
|
456
|
+
begin
|
457
|
+
# The below workaround is only needed for 2 step verified machines
|
458
|
+
# Due to escaping of cookie values we have a little workaround here
|
459
|
+
# By default the cookie jar would generate the following header
|
460
|
+
# DES5c148...=HSARM.......xaA/O69Ws/CHfQ==SRVT
|
461
|
+
# However we need the following
|
462
|
+
# DES5c148...="HSARM.......xaA/O69Ws/CHfQ==SRVT"
|
463
|
+
# There is no way to get the cookie jar value with " around the value
|
464
|
+
# so we manually modify the cookie (only this one) to be properly escaped
|
465
|
+
# Afterwards we pass this value manually as a header
|
466
|
+
# It's not enough to just modify @cookie, it needs to be done after self.cookie
|
467
|
+
# as a string operation
|
468
|
+
important_cookie = @cookie.store.entries.find { |a| a.name.include?("DES") }
|
469
|
+
if important_cookie
|
470
|
+
modified_cookie = self.cookie # returns a string of all cookies
|
471
|
+
unescaped_important_cookie = "#{important_cookie.name}=#{important_cookie.value}"
|
472
|
+
escaped_important_cookie = "#{important_cookie.name}=\"#{important_cookie.value}\""
|
473
|
+
modified_cookie.gsub!(unescaped_important_cookie, escaped_important_cookie)
|
474
|
+
end
|
475
|
+
|
476
|
+
response = request(:post) do |req|
|
477
|
+
req.url("https://idmsa.apple.com/appleauth/auth/signin")
|
478
|
+
req.body = data.to_json
|
479
|
+
req.headers['Content-Type'] = 'application/json'
|
480
|
+
req.headers['X-Requested-With'] = 'XMLHttpRequest'
|
481
|
+
req.headers['X-Apple-Widget-Key'] = self.itc_service_key
|
482
|
+
req.headers['Accept'] = 'application/json, text/javascript'
|
483
|
+
req.headers["Cookie"] = modified_cookie if modified_cookie
|
484
|
+
end
|
485
|
+
rescue UnauthorizedAccessError
|
486
|
+
raise InvalidUserCredentialsError.new, "Invalid username and password combination. Used '#{user}' as the username."
|
487
|
+
end
|
488
|
+
|
489
|
+
# Now we know if the login is successful or if we need to do 2 factor
|
490
|
+
|
491
|
+
case response.status
|
492
|
+
when 403
|
493
|
+
raise InvalidUserCredentialsError.new, "Invalid username and password combination. Used '#{user}' as the username."
|
494
|
+
when 200
|
495
|
+
fetch_olympus_session
|
496
|
+
return response
|
497
|
+
when 409
|
498
|
+
# 2 step/factor is enabled for this account, first handle that
|
499
|
+
handle_two_step_or_factor(response)
|
500
|
+
# and then get the olympus session
|
501
|
+
fetch_olympus_session
|
502
|
+
return true
|
503
|
+
else
|
504
|
+
if (response.body || "").include?('invalid="true"')
|
505
|
+
# User Credentials are wrong
|
506
|
+
raise InvalidUserCredentialsError.new, "Invalid username and password combination. Used '#{user}' as the username."
|
507
|
+
elsif response.status == 412 && AUTH_TYPES.include?(response.body["authType"])
|
508
|
+
# Need to acknowledge Apple ID and Privacy statement - https://github.com/fastlane/fastlane/issues/12577
|
509
|
+
# Looking for status of 412 might be enough but might be safer to keep looking only at what is being reported
|
510
|
+
raise AppleIDAndPrivacyAcknowledgementNeeded.new, "Need to acknowledge to Apple's Apple ID and Privacy statement. Please manually log into https://appleid.apple.com (or https://appstoreconnect.apple.com) to acknowledge the statement."
|
511
|
+
elsif (response['Set-Cookie'] || "").include?("itctx")
|
512
|
+
raise "Looks like your Apple ID is not enabled for App Store Connect, make sure to be able to login online"
|
513
|
+
else
|
514
|
+
info = [response.body, response['Set-Cookie']]
|
515
|
+
raise Tunes::Error.new, info.join("\n")
|
516
|
+
end
|
517
|
+
end
|
518
|
+
end
|
519
|
+
|
520
|
+
# Get the `itctx` from the new (22nd May 2017) API endpoint "olympus"
|
521
|
+
# Update (29th March 2019) olympus migrates to new appstoreconnect API
|
522
|
+
def fetch_olympus_session
|
523
|
+
response = request(:get, "https://appstoreconnect.apple.com/olympus/v1/session")
|
524
|
+
body = response.body
|
525
|
+
if body
|
526
|
+
body = JSON.parse(body) if body.kind_of?(String)
|
527
|
+
user_map = body["user"]
|
528
|
+
if user_map
|
529
|
+
self.user_email = user_map["emailAddress"]
|
530
|
+
end
|
531
|
+
|
532
|
+
provider = body["provider"]
|
533
|
+
if provider
|
534
|
+
self.provider = Spaceship::Provider.new(provider_hash: provider)
|
535
|
+
return true
|
536
|
+
end
|
537
|
+
end
|
538
|
+
|
539
|
+
return false
|
540
|
+
end
|
541
|
+
|
542
|
+
def itc_service_key
|
543
|
+
return @service_key if @service_key
|
544
|
+
|
545
|
+
# Check if we have a local cache of the key
|
546
|
+
itc_service_key_path = "/tmp/spaceship_itc_service_key.txt"
|
547
|
+
return File.read(itc_service_key_path) if File.exist?(itc_service_key_path)
|
548
|
+
|
549
|
+
# Fixes issue https://github.com/fastlane/fastlane/issues/13281
|
550
|
+
# Even though we are using https://appstoreconnect.apple.com, the service key needs to still use a
|
551
|
+
# hostname through itunesconnect.apple.com
|
552
|
+
response = request(:get, "https://appstoreconnect.apple.com/olympus/v1/app/config?hostname=itunesconnect.apple.com")
|
553
|
+
@service_key = response.body["authServiceKey"].to_s
|
554
|
+
|
555
|
+
raise "Service key is empty" if @service_key.length == 0
|
556
|
+
|
557
|
+
# Cache the key locally
|
558
|
+
File.write(itc_service_key_path, @service_key)
|
559
|
+
|
560
|
+
return @service_key
|
561
|
+
rescue => ex
|
562
|
+
puts(ex.to_s)
|
563
|
+
raise AppleTimeoutError.new, "Could not receive latest API key from App Store Connect, this might be a server issue."
|
564
|
+
end
|
565
|
+
|
566
|
+
#####################################################
|
567
|
+
# @!group Session
|
568
|
+
#####################################################
|
569
|
+
|
570
|
+
def load_session_from_file
|
571
|
+
begin
|
572
|
+
if File.exist?(persistent_cookie_path)
|
573
|
+
puts("Loading session from '#{persistent_cookie_path}'") if Spaceship::Globals.verbose?
|
574
|
+
@cookie.load(persistent_cookie_path)
|
575
|
+
return true
|
576
|
+
end
|
577
|
+
rescue => ex
|
578
|
+
puts(ex.to_s)
|
579
|
+
puts("Continuing with normal login.")
|
580
|
+
end
|
581
|
+
return false
|
582
|
+
end
|
583
|
+
|
584
|
+
def load_session_from_env
|
585
|
+
return if self.class.spaceship_session_env.to_s.length == 0
|
586
|
+
puts("Loading session from environment variable") if Spaceship::Globals.verbose?
|
587
|
+
|
588
|
+
file = Tempfile.new('cookie.yml')
|
589
|
+
file.write(self.class.spaceship_session_env.gsub("\\n", "\n"))
|
590
|
+
file.close
|
591
|
+
|
592
|
+
begin
|
593
|
+
@cookie.load(file.path)
|
594
|
+
rescue => ex
|
595
|
+
puts("Error loading session from environment")
|
596
|
+
puts("Make sure to pass the session in a valid format")
|
597
|
+
raise ex
|
598
|
+
ensure
|
599
|
+
file.unlink
|
600
|
+
end
|
601
|
+
end
|
602
|
+
|
603
|
+
# Fetch the session cookie from the environment
|
604
|
+
# (if exists)
|
605
|
+
def self.spaceship_session_env
|
606
|
+
ENV["FASTLANE_SESSION"] || ENV["SPACESHIP_SESSION"]
|
607
|
+
end
|
608
|
+
|
609
|
+
# Get contract messages from App Store Connect's "olympus" endpoint
|
610
|
+
def fetch_program_license_agreement_messages
|
611
|
+
all_messages = []
|
612
|
+
|
613
|
+
messages_request = request(:get, "https://appstoreconnect.apple.com/olympus/v1/contractMessages")
|
614
|
+
body = messages_request.body
|
615
|
+
if body
|
616
|
+
body = JSON.parse(body) if body.kind_of?(String)
|
617
|
+
body.map do |messages|
|
618
|
+
all_messages.push(messages["message"])
|
619
|
+
end
|
620
|
+
end
|
621
|
+
|
622
|
+
return all_messages
|
623
|
+
end
|
624
|
+
|
625
|
+
#####################################################
|
626
|
+
# @!group Helpers
|
627
|
+
#####################################################
|
628
|
+
|
629
|
+
def with_retry(tries = 5, &_block)
|
630
|
+
return yield
|
631
|
+
rescue \
|
632
|
+
Faraday::ConnectionFailed,
|
633
|
+
Faraday::TimeoutError,
|
634
|
+
BadGatewayError,
|
635
|
+
AppleTimeoutError,
|
636
|
+
GatewayTimeoutError,
|
637
|
+
AccessForbiddenError => ex
|
638
|
+
tries -= 1
|
639
|
+
unless tries.zero?
|
640
|
+
msg = "Timeout received: '#{ex.class}', '#{ex.message}'. Retrying after 3 seconds (remaining: #{tries})..."
|
641
|
+
puts(msg) if Spaceship::Globals.verbose?
|
642
|
+
logger.warn(msg)
|
643
|
+
|
644
|
+
sleep(3) unless Object.const_defined?("SpecHelper")
|
645
|
+
retry
|
646
|
+
end
|
647
|
+
raise ex # re-raise the exception
|
648
|
+
rescue \
|
649
|
+
Faraday::ParsingError, # <h2>Internal Server Error</h2> with content type json
|
650
|
+
InternalServerError => ex
|
651
|
+
tries -= 1
|
652
|
+
unless tries.zero?
|
653
|
+
msg = "Internal Server Error received: '#{ex.class}', '#{ex.message}'. Retrying after 3 seconds (remaining: #{tries})..."
|
654
|
+
puts(msg) if Spaceship::Globals.verbose?
|
655
|
+
logger.warn(msg)
|
656
|
+
|
657
|
+
sleep(3) unless Object.const_defined?("SpecHelper")
|
658
|
+
retry
|
659
|
+
end
|
660
|
+
raise ex # re-raise the exception
|
661
|
+
rescue UnauthorizedAccessError => ex
|
662
|
+
if @loggedin && !(tries -= 1).zero?
|
663
|
+
msg = "Auth error received: '#{ex.class}', '#{ex.message}'. Login in again then retrying after 3 seconds (remaining: #{tries})..."
|
664
|
+
puts(msg) if Spaceship::Globals.verbose?
|
665
|
+
logger.warn(msg)
|
666
|
+
|
667
|
+
if self.class.spaceship_session_env.to_s.length > 0
|
668
|
+
raise UnauthorizedAccessError.new, "Authentication error, you passed an invalid session using the environment variable FASTLANE_SESSION or SPACESHIP_SESSION"
|
669
|
+
end
|
670
|
+
|
671
|
+
do_login(self.user, @password)
|
672
|
+
sleep(3) unless Object.const_defined?("SpecHelper")
|
673
|
+
retry
|
674
|
+
end
|
675
|
+
raise ex # re-raise the exception
|
676
|
+
end
|
677
|
+
|
678
|
+
# memorize the last csrf tokens from responses
|
679
|
+
def csrf_tokens
|
680
|
+
@csrf_tokens || {}
|
681
|
+
end
|
682
|
+
|
683
|
+
def request(method, url_or_path = nil, params = nil, headers = {}, auto_paginate = false, &block)
|
684
|
+
headers.merge!(csrf_tokens)
|
685
|
+
headers['User-Agent'] = USER_AGENT
|
686
|
+
|
687
|
+
# Before encoding the parameters, log them
|
688
|
+
log_request(method, url_or_path, params, headers, &block)
|
689
|
+
|
690
|
+
# form-encode the params only if there are params, and the block is not supplied.
|
691
|
+
# this is so that certain requests can be made using the block for more control
|
692
|
+
if method == :post && params && !block_given?
|
693
|
+
params, headers = encode_params(params, headers)
|
694
|
+
end
|
695
|
+
|
696
|
+
response = if auto_paginate
|
697
|
+
send_request_auto_paginate(method, url_or_path, params, headers, &block)
|
698
|
+
else
|
699
|
+
send_request(method, url_or_path, params, headers, &block)
|
700
|
+
end
|
701
|
+
|
702
|
+
return response
|
703
|
+
end
|
704
|
+
|
705
|
+
def parse_response(response, expected_key = nil)
|
706
|
+
if response.body
|
707
|
+
# If we have an `expected_key`, select that from response.body Hash
|
708
|
+
# Else, don't.
|
709
|
+
|
710
|
+
# the returned error message and info, is html encoded -> "issued" -> make this readable -> "issued"
|
711
|
+
response.body["userString"] = CGI.unescapeHTML(response.body["userString"]) if response.body["userString"]
|
712
|
+
response.body["resultString"] = CGI.unescapeHTML(response.body["resultString"]) if response.body["resultString"]
|
713
|
+
|
714
|
+
content = expected_key ? response.body[expected_key] : response.body
|
715
|
+
end
|
716
|
+
|
717
|
+
# if content (filled with whole body or just expected_key) is missing
|
718
|
+
if content.nil?
|
719
|
+
detect_most_common_errors_and_raise_exceptions(response.body) if response.body
|
720
|
+
raise UnexpectedResponse, response.body
|
721
|
+
# else if it is a hash and `resultString` includes `NotAllowed`
|
722
|
+
elsif content.kind_of?(Hash) && (content["resultString"] || "").include?("NotAllowed")
|
723
|
+
# example content when doing a Developer Portal action with not enough permission
|
724
|
+
# => {"responseId"=>"e5013d83-c5cb-4ba0-bb62-734a8d56007f",
|
725
|
+
# "resultCode"=>1200,
|
726
|
+
# "resultString"=>"webservice.certificate.downloadNotAllowed",
|
727
|
+
# "userString"=>"You are not permitted to download this certificate.",
|
728
|
+
# "creationTimestamp"=>"2017-01-26T22:44:13Z",
|
729
|
+
# "protocolVersion"=>"QH65B2",
|
730
|
+
# "userLocale"=>"en_US",
|
731
|
+
# "requestUrl"=>"https://developer.apple.com/services-account/QH65B2/account/ios/certificate/downloadCertificateContent.action",
|
732
|
+
# "httpCode"=>200}
|
733
|
+
raise_insufficient_permission_error!(additional_error_string: content["userString"])
|
734
|
+
else
|
735
|
+
store_csrf_tokens(response)
|
736
|
+
content
|
737
|
+
end
|
738
|
+
end
|
739
|
+
|
740
|
+
def detect_most_common_errors_and_raise_exceptions(body)
|
741
|
+
# Check if the failure is due to missing permissions (App Store Connect)
|
742
|
+
if body["messages"] && body["messages"]["error"].include?("Forbidden")
|
743
|
+
raise_insufficient_permission_error!
|
744
|
+
elsif body["messages"] && body["messages"]["error"].include?("insufficient privileges")
|
745
|
+
# Passing a specific `caller_location` here to make sure we return the correct method
|
746
|
+
# With the default location the error would say that `parse_response` is the caller
|
747
|
+
raise_insufficient_permission_error!(caller_location: 3)
|
748
|
+
elsif body.to_s.include?("Internal Server Error - Read")
|
749
|
+
raise InternalServerError, "Received an internal server error from App Store Connect / Developer Portal, please try again later"
|
750
|
+
elsif body.to_s.include?("Gateway Timeout - In read")
|
751
|
+
raise GatewayTimeoutError, "Received a gateway timeout error from App Store Connect / Developer Portal, please try again later"
|
752
|
+
elsif (body["userString"] || "").include?("Program License Agreement")
|
753
|
+
raise ProgramLicenseAgreementUpdated, "#{body['userString']} Please manually log into your Apple Developer account to review and accept the updated agreement."
|
754
|
+
end
|
755
|
+
end
|
756
|
+
|
757
|
+
# This also gets called from subclasses
|
758
|
+
def raise_insufficient_permission_error!(additional_error_string: nil, caller_location: 2)
|
759
|
+
# get the method name of the request that failed
|
760
|
+
# `block in` is used very often for requests when surrounded for paging or retrying blocks
|
761
|
+
# The ! is part of some methods when they modify or delete a resource, so we don't want to show it
|
762
|
+
# Using `sub` instead of `delete` as we don't want to allow multiple matches
|
763
|
+
calling_method_name = caller_locations(caller_location, 2).first.label.sub("block in", "").delete("!").strip
|
764
|
+
|
765
|
+
# calling the computed property self.team_id can get us into an exception handling loop
|
766
|
+
team_id = @current_team_id ? "(Team ID #{@current_team_id}) " : ""
|
767
|
+
|
768
|
+
error_message = "User #{self.user} #{team_id}doesn't have enough permission for the following action: #{calling_method_name}"
|
769
|
+
error_message += " (#{additional_error_string})" if additional_error_string.to_s.length > 0
|
770
|
+
raise InsufficientPermissions, error_message
|
771
|
+
end
|
772
|
+
|
773
|
+
private
|
774
|
+
|
775
|
+
def directory_accessible?(path)
|
776
|
+
Dir.exist?(File.expand_path(path))
|
777
|
+
end
|
778
|
+
|
779
|
+
def do_login(user, password)
|
780
|
+
@loggedin = false
|
781
|
+
ret = send_login_request(user, password) # different in subclasses
|
782
|
+
@loggedin = true
|
783
|
+
ret
|
784
|
+
end
|
785
|
+
|
786
|
+
# Is called from `parse_response` to store the latest csrf_token (if available)
|
787
|
+
def store_csrf_tokens(response)
|
788
|
+
if response && response.headers
|
789
|
+
tokens = response.headers.select { |k, v| %w(csrf csrf_ts).include?(k) }
|
790
|
+
if tokens && !tokens.empty?
|
791
|
+
@csrf_tokens = tokens
|
792
|
+
end
|
793
|
+
end
|
794
|
+
end
|
795
|
+
|
796
|
+
def log_request(method, url, params, headers = nil, &block)
|
797
|
+
url ||= extract_key_from_block('url', &block)
|
798
|
+
body = extract_key_from_block('body', &block)
|
799
|
+
body_to_log = '[undefined body]'
|
800
|
+
if body
|
801
|
+
begin
|
802
|
+
body = JSON.parse(body)
|
803
|
+
# replace password in body if present
|
804
|
+
body['password'] = '***' if body.kind_of?(Hash) && body.key?("password")
|
805
|
+
body_to_log = body.to_json
|
806
|
+
rescue JSON::ParserError
|
807
|
+
# no json, no password to replace
|
808
|
+
body_to_log = "[non JSON body]"
|
809
|
+
end
|
810
|
+
end
|
811
|
+
params_to_log = Hash(params).dup # to also work with nil
|
812
|
+
params_to_log.delete(:accountPassword) # Dev Portal
|
813
|
+
params_to_log.delete(:theAccountPW) # iTC
|
814
|
+
params_to_log = params_to_log.collect do |key, value|
|
815
|
+
"{#{key}: #{value}}"
|
816
|
+
end
|
817
|
+
logger.info(">> #{method.upcase} #{url}: #{body_to_log} #{params_to_log.join(', ')}")
|
818
|
+
end
|
819
|
+
|
820
|
+
def log_response(method, url, response, headers = nil, &block)
|
821
|
+
url ||= extract_key_from_block('url', &block)
|
822
|
+
body = response.body.kind_of?(String) ? response.body.force_encoding(Encoding::UTF_8) : response.body
|
823
|
+
logger.debug("<< #{method.upcase} #{url}: #{response.status} #{body}")
|
824
|
+
end
|
825
|
+
|
826
|
+
def extract_key_from_block(key, &block)
|
827
|
+
if block_given?
|
828
|
+
obj = Object.new
|
829
|
+
class << obj
|
830
|
+
attr_accessor :body, :headers, :params, :url, :options
|
831
|
+
# rubocop: disable Style/TrivialAccessors
|
832
|
+
# the block calls `url` (not `url=`) so need to define `url` method
|
833
|
+
def url(url)
|
834
|
+
@url = url
|
835
|
+
end
|
836
|
+
|
837
|
+
def options
|
838
|
+
options_obj = Object.new
|
839
|
+
class << options_obj
|
840
|
+
attr_accessor :params_encoder
|
841
|
+
end
|
842
|
+
options_obj
|
843
|
+
end
|
844
|
+
# rubocop: enable Style/TrivialAccessors
|
845
|
+
end
|
846
|
+
obj.headers = {}
|
847
|
+
yield(obj)
|
848
|
+
obj.instance_variable_get("@#{key}")
|
849
|
+
end
|
850
|
+
end
|
851
|
+
|
852
|
+
# Actually sends the request to the remote server
|
853
|
+
# Automatically retries the request up to 3 times if something goes wrong
|
854
|
+
def send_request(method, url_or_path, params, headers, &block)
|
855
|
+
with_retry do
|
856
|
+
response = @client.send(method, url_or_path, params, headers, &block)
|
857
|
+
log_response(method, url_or_path, response, headers, &block)
|
858
|
+
|
859
|
+
resp_hash = response.to_hash
|
860
|
+
if resp_hash[:status] == 401
|
861
|
+
handle_401(response)
|
862
|
+
end
|
863
|
+
|
864
|
+
if response.body.to_s.include?("<title>302 Found</title>")
|
865
|
+
raise AppleTimeoutError.new, "Apple 302 detected - this might be temporary server error, check https://developer.apple.com/system-status/ to see if there is a known downtime"
|
866
|
+
end
|
867
|
+
|
868
|
+
if response.body.to_s.include?("<h3>Bad Gateway</h3>")
|
869
|
+
raise BadGatewayError.new, "Apple 502 detected - this might be temporary server error, try again later"
|
870
|
+
end
|
871
|
+
|
872
|
+
if resp_hash[:status] == 403
|
873
|
+
msg = "Access forbidden"
|
874
|
+
logger.warn(msg)
|
875
|
+
raise AccessForbiddenError.new, msg
|
876
|
+
end
|
877
|
+
|
878
|
+
return response
|
879
|
+
end
|
880
|
+
end
|
881
|
+
|
882
|
+
def handle_401(response)
|
883
|
+
msg = "Auth lost"
|
884
|
+
logger.warn(msg)
|
885
|
+
raise UnauthorizedAccessError.new, "Unauthorized Access"
|
886
|
+
end
|
887
|
+
|
888
|
+
def send_request_auto_paginate(method, url_or_path, params, headers, &block)
|
889
|
+
response = send_request(method, url_or_path, params, headers, &block)
|
890
|
+
return response unless should_process_next_rel?(response)
|
891
|
+
last_response = response
|
892
|
+
while last_response.env.rels[:next]
|
893
|
+
last_response = send_request(method, last_response.env.rels[:next], params, headers, &block)
|
894
|
+
break unless should_process_next_rel?(last_response)
|
895
|
+
response.body['data'].concat(last_response.body['data'])
|
896
|
+
end
|
897
|
+
response
|
898
|
+
end
|
899
|
+
|
900
|
+
def should_process_next_rel?(response)
|
901
|
+
response.body.kind_of?(Hash) && response.body['data'].kind_of?(Array)
|
902
|
+
end
|
903
|
+
|
904
|
+
def encode_params(params, headers)
|
905
|
+
params = Faraday::Utils::ParamsHash[params].to_query
|
906
|
+
headers = { 'Content-Type' => 'application/x-www-form-urlencoded' }.merge(headers)
|
907
|
+
return params, headers
|
908
|
+
end
|
909
|
+
end
|
910
|
+
# rubocop:enable Metrics/ClassLength
|
911
|
+
end
|
912
|
+
|
913
|
+
require 'spaceship/two_step_or_factor_client'
|