Sha256: 9ee39f1dc75f6deae893212df7c8ddec6d49d7a73f21ac3fe3ff1302ba6287d0

Contents?: true

Size: 1.45 KB

Versions: 12

Compression:

Stored size: 1.45 KB

Contents

require_relative 'helper'
require 'open3'

module FastlaneCore
  class KeychainImporter
    def self.import_file(path, keychain_path, keychain_password: "", certificate_password: "", output: FastlaneCore::Globals.verbose?)
      UI.user_error!("Could not find file '#{path}'") unless File.exist?(path)

      command = "security import #{path.shellescape} -k '#{keychain_path.shellescape}'"
      command << " -P #{certificate_password.shellescape}"
      command << " -T /usr/bin/codesign" # to not be asked for permission when running a tool like `gym`
      command << " -T /usr/bin/security"
      command << " &> /dev/null" unless output

      Helper.backticks(command, print: output)

      # When security supports partition lists, also add the partition IDs
      # See https://openradar.appspot.com/28524119
      if Helper.backticks('security -h | grep set-key-partition-list', print: false).length > 0
        command = "security set-key-partition-list"
        command << " -S apple-tool:,apple:"
        command << " -k #{keychain_password.to_s.shellescape}"
        command << " #{keychain_path.shellescape}"

        Open3.popen3(command) do |stdin, stdout, stderr, thrd|
          if output
            UI.command(command)
            UI.command_output(stdout.read)
          end

          unless thrd.value.success?
            UI.user_error!("Could not configure key to bypass permission popup:\n#{stderr.read}")
          end
        end
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
fastlane-2.113.0.beta.20190101200013 fastlane_core/lib/fastlane_core/keychain_importer.rb
fastlane-2.113.0.beta.20181231200027 fastlane_core/lib/fastlane_core/keychain_importer.rb
fastlane-2.113.0.beta.20181230200014 fastlane_core/lib/fastlane_core/keychain_importer.rb
fastlane-2.113.0.beta.20181229200101 fastlane_core/lib/fastlane_core/keychain_importer.rb
fastlane-2.113.0.beta.20181228200027 fastlane_core/lib/fastlane_core/keychain_importer.rb
fastlane-2.113.0.beta.20181227200058 fastlane_core/lib/fastlane_core/keychain_importer.rb
fastlane-2.113.0.beta.20181226200116 fastlane_core/lib/fastlane_core/keychain_importer.rb
fastlane-2.113.0.beta.20181225200026 fastlane_core/lib/fastlane_core/keychain_importer.rb
fastlane-2.113.0.beta.20181224200038 fastlane_core/lib/fastlane_core/keychain_importer.rb
fastlane-2.113.0.beta.20181223200038 fastlane_core/lib/fastlane_core/keychain_importer.rb
fastlane-2.113.0.beta.20181222200027 fastlane_core/lib/fastlane_core/keychain_importer.rb
fastlane-2.113.0.beta.20181221200014 fastlane_core/lib/fastlane_core/keychain_importer.rb