Sha256: a33f01d8f765ccacfe114be4394a4231e1a9f7c51625ebc1b62cddd194a6def9

Contents?: true

Size: 1.54 KB

Versions: 17

Compression:

Stored size: 1.54 KB

Contents

#!/usr/bin/env ruby
$LOAD_PATH.push File.expand_path("../../lib", __FILE__)
require "colored"

# First we have to check if the user has `pry` installed
# We don't want to add pry as a spaceship dependency, as
# it shouldn't really be added to production systems

require "spaceship"
require "credentials_manager"

username = ARGV[1] if ARGV[0] == '-u'
username ||= CredentialsManager::AppfileConfig.try_fetch_value(:apple_id)
username ||= ask("Username: ")

begin
  puts "Logging into to iTunes Connect (#{username})..."
  Spaceship::Tunes.login(username)
  puts "Successfully logged in to iTunes Connect".green
  puts ""
rescue
  puts "Could not login to iTunes Connect...".red
end

itc_cookie_content = Spaceship::Tunes.client.store_cookie

# The only value we actually need is the "DES5c148586daa451e55afb017aa62418f91" cookie
# We're not sure if the key changes
#
# Example:
# name: DES5c148586daa451e55afb017aa62418f91
# value: HSARMTKNSRVTWFlaF/ek8asaa9lymMA0dN8JQ6pY7B3F5kdqTxJvMT19EVEFX8EQudB/uNwBHOHzaa30KYTU/eCP/UF7vGTgxs6PAnlVWKscWssOVHfP2IKWUPaa4Dn+I6ilA7eAFQsiaaVT

require 'yaml'
cookies = YAML.load(itc_cookie_content)

# We remove all the un-needed cookies
cookies.delete_if do |current|
  ['aa', 'X-SESS', 'site', 'acn01', 'myacinfo', 'itctx', 'wosid', 'woinst', 'NSC_17ofu-jud-jud-mc'].include?(current.name)
end

yaml = cookies.to_yaml.gsub("\n", "\\n")

puts "---"
puts ""
puts "Pass the following via the FASTLANE_SESSION environment variable:"
puts yaml.cyan.underline
puts ""
puts ""
puts "Example:"
puts "export FASTLANE_SESSION='#{yaml}'".cyan.underline

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
spaceship-0.39.0 bin/spaceauth
spaceship-0.38.5 bin/spaceauth
spaceship-0.38.4 bin/spaceauth
spaceship-0.38.3 bin/spaceauth
spaceship-0.38.2 bin/spaceauth
spaceship-0.38.1 bin/spaceauth
spaceship-0.38.0 bin/spaceauth
spaceship-0.37.0 bin/spaceauth
spaceship-0.36.2 bin/spaceauth
spaceship-0.36.1 bin/spaceauth
spaceship-0.36.0 bin/spaceauth
spaceship-0.35.0 bin/spaceauth
spaceship-0.34.3 bin/spaceauth
spaceship-0.34.2 bin/spaceauth
spaceship-0.34.1 bin/spaceauth
spaceship-0.34.0 bin/spaceauth
spaceship-0.33.0 bin/spaceauth