app-tools 1.1.0 → 1.1.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3fe657959e9ea56d1406b80163d00dfd78f7b116
4
- data.tar.gz: ff2f7a2e3878d85b6b815c59bd98883c81406526
3
+ metadata.gz: 19cf0d4936accba0a7a544a1055d7b8a96cc6b50
4
+ data.tar.gz: afff72b3bf1582c14ae26e0af24b2b997f028eb6
5
5
  SHA512:
6
- metadata.gz: 7cfb0498810b3be5d6173d0c956d982c210cca09d152dab244fd611ceb5e0e49d5b647b0ddf5a036b0b414b130c267b6f2ca6d57aa31a74d5baff3298392cfe4
7
- data.tar.gz: 5e30aca44fb2938e51deaebd1503716d5a65b85adc61542782c883d3d6df725b9e354048eb200a96230df051553b5a4d0510d9a011a01c0cebe21a7d9d88575d
6
+ metadata.gz: c10c537c7f4f06015ee8019e81cf133891a8dc6f762e94369a24117d5647880f590ccaf2b46c584bf3ca7469f8274049dab3375ca6efecf16126ba4921c7fd57
7
+ data.tar.gz: c0bae93ce72d9df694dc80d8e36779377c58a88b5b74a14ee538001d2686ba9a699f21caf9f98d0fb18f028c091f830da89e9bbd4cf28b799bc49b8187346329
data/bin/kcpass CHANGED
@@ -16,42 +16,43 @@ module AppTools
16
16
  itunes_password = options[:p]
17
17
  itunes_user = options[:u]
18
18
  cli = HighLine.new
19
- name = "app-tools-itunesconnect"
19
+ keychain_name = "app-tools/iTunesConnect - #{itunes_user}"
20
+
21
+ if itunes_user.nil?
22
+ exit_now! "Must supply an iTunesConnect user email"
23
+ end
20
24
 
21
25
  case action
22
26
  when 'add'
23
- if itunes_user.nil?
24
- exit_now! "Must supply an iTunesConnect user email"
25
- end
26
-
27
27
  if itunes_password.nil?
28
28
  itunes_password = cli.ask("Password:") { |q| q.echo = 'x' }
29
29
  end
30
30
 
31
- pid = Process.spawn('security', 'add-generic-password', '-a', itunes_user, '-w', itunes_password, '-s', name, '-A')
31
+ # TODO: When these tools are actually executables remove the -A flag
32
+ pid = Process.spawn('security', 'add-generic-password', '-a', itunes_user, '-w', itunes_password, '-s', keychain_name, '-A')
32
33
  Process.wait(pid)
33
34
 
34
35
  if $?.exitstatus == 0
35
- info "Successfully added generic password for '#{name}'"
36
+ info "Successfully added generic password for '#{keychain_name}'"
36
37
  else
37
- error "Unable to add password for '#{name}'"
38
+ error "Unable to add password for '#{keychain_name}'"
38
39
  end
39
40
  when 'delete'
40
- pid = Process.spawn('security', 'delete-generic-password', '-s', name)
41
+ pid = Process.spawn('security', 'delete-generic-password', '-s', keychain_name)
41
42
  Process.wait pid
42
43
 
43
44
  if $?.exitstatus == 0
44
- info "Deleted generic password '#{name}'"
45
+ info "Deleted generic password '#{keychain_name}'"
45
46
  else
46
- error "Could not find generic password '#{name}'"
47
+ error "Could not find generic password '#{keychain_name}'"
47
48
  end
48
49
  when 'find'
49
50
  r, w = IO.pipe
50
- pid = Process.spawn('security', 'find-generic-password', '-s', name, '-w', :out => w)
51
+ pid = Process.spawn('security', 'find-generic-password', '-s', keychain_name, '-w', :out => w)
51
52
  w.close
52
53
  Process.wait(pid)
53
54
  if $?.exitstatus != 0
54
- exit_now! "Could not find generic password '#{name}'"
55
+ exit_now! "Could not find generic password '#{keychain_name}'"
55
56
  end
56
57
  itunes_password = r.read
57
58
  r.close
@@ -1,3 +1,7 @@
1
+ #!/usr/bin/osascript
2
+
3
+ # See https://github.com/paypal/Illuminator/blob/master/gem/resources/scripts/set_hardware_keyboard.applescript
4
+
1
5
  on run argv
2
6
 
3
7
  tell application "Simulator" to launch
data/bin/syncpp CHANGED
@@ -17,10 +17,18 @@ module AppTools
17
17
  include Methadone::CLILogging
18
18
  include Methadone::ExitNow
19
19
 
20
+ def self.keep_trying
21
+ tries ||= 5
22
+ yield
23
+ rescue UnexpectedResponse
24
+ sleep 3
25
+ retry unless (tries -= 1).zero?
26
+ end
27
+
20
28
  main do |profile_name|
21
29
  itunes_user = options[:u]
22
30
  itunes_password = options[:p]
23
- name = "app-tools-itunesconnect"
31
+ keychain_name = "app-tools/iTunesConnect - #{itunes_user}"
24
32
 
25
33
  if itunes_user.nil?
26
34
  exit_now! "Must supply a user name"
@@ -28,11 +36,11 @@ module AppTools
28
36
 
29
37
  if itunes_password.nil?
30
38
  r, w = IO.pipe
31
- pid = Process.spawn('security', 'find-generic-password', '-s', name, '-w', :out => w)
39
+ pid = Process.spawn('security', 'find-generic-password', '-s', keychain_name, '-w', :out => w)
32
40
  w.close
33
41
  Process.wait(pid)
34
42
  if $?.exitstatus != 0
35
- exit_now! "Could not find generic password '#{name}'"
43
+ exit_now! "Could not find generic password '#{keychain_name}'"
36
44
  end
37
45
  itunes_password = r.read.chomp
38
46
  r.close
@@ -44,9 +52,14 @@ module AppTools
44
52
 
45
53
  Spaceship.login(itunes_user, itunes_password)
46
54
 
47
- profiles = Spaceship.provisioning_profile.app_store.all
48
- profile = profiles.find do |profile|
49
- profile.name == profile_name
55
+ profile = nil
56
+
57
+ # Sometimes the call to the Apple API can fail
58
+ keep_trying do
59
+ profiles = Spaceship.provisioning_profile.app_store.all
60
+ profile = profiles.find do |profile|
61
+ profile.name == profile_name
62
+ end
50
63
  end
51
64
 
52
65
  if profile.nil?
@@ -65,9 +78,13 @@ module AppTools
65
78
  cert.name == profile.type
66
79
  end
67
80
 
68
- prod_certs = Spaceship.certificate.production.all
69
- prod_cert = prod_certs.find do |cert|
70
- cert.id == profile.certificates.first.id
81
+ prod_cert = nil
82
+
83
+ keep_trying do
84
+ prod_certs = Spaceship.certificate.production.all
85
+ prod_cert = prod_certs.find do |cert|
86
+ cert.id == profile.certificates.first.id
87
+ end
71
88
  end
72
89
 
73
90
  profile_path = "#{profile_name}.mobileprovision"
data/bin/upload2itunes CHANGED
@@ -26,6 +26,16 @@ module AppTools
26
26
  # Create working variables
27
27
  ipa_basename = File.basename(ipa_path)
28
28
  itmsp_path = File.dirname(ipa_path) + '/' + ipa_basename[0...-4] + '.itmsp'
29
+ itunes_user = options[:u]
30
+ keychain_name = "app-tools/iTunesConnect - #{itunes_user}"
31
+ itunes_password = options[:p]
32
+
33
+ if itunes_password.nil?
34
+ IO.popen(['security', 'find-generic-password', '-s', keychain_name, '-w']) do |io|
35
+ itunes_password = io.read.chop
36
+ end
37
+ end
38
+
29
39
 
30
40
  FileUtils.rm_rf itmsp_path
31
41
  FileUtils.mkdir itmsp_path
@@ -68,16 +78,6 @@ module AppTools
68
78
  File.open(itmsp_path + '/metadata.xml', 'w') { |file| file.write(metadata_xml) }
69
79
 
70
80
  itmstransporter = "/Applications/Xcode.app/Contents/Applications/Application Loader.app/Contents/itms/bin/iTMSTransporter"
71
-
72
- itunes_user = options[:u]
73
- itunes_password = options[:p]
74
-
75
- if itunes_password.nil?
76
- IO.popen(['security', 'find-generic-password', '-s', "app-tools-itunesconnect", '-w']) do |io|
77
- itunes_password = io.read.chop
78
- end
79
- end
80
-
81
81
  safe_password = itunes_password.gsub!('&', '\\\&')
82
82
  IO.popen([itmstransporter, '-m', 'upload', '-u', itunes_user, '-p', safe_password, '-f', itmsp_path]) do |io|
83
83
  while not io.eof?
@@ -94,7 +94,7 @@ module AppTools
94
94
 
95
95
  on("-u", "--itunes-user USER", "The iTunesConnect user name")
96
96
  on("-i", "--itunes-app-id APP_ID", "The iTunesConnect app ID")
97
- on("-p", "--itunes-password PASSWORD", "The iTunes user password. If not supplied keychain entry with the name 'app-tools-itunesconnect' is used.")
97
+ on("-p", "--itunes-password PASSWORD", "The iTunes user password, otherwise the password is retrieved from the keychain.")
98
98
 
99
99
  arg :ipa_path, "An IPA path", :require
100
100
 
@@ -1,3 +1,3 @@
1
1
  module AppTools
2
- VERSION = "1.1.0"
2
+ VERSION = "1.1.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: app-tools
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Lyon-Smith
@@ -128,11 +128,10 @@ description: |
128
128
  email:
129
129
  - john@jamoki.com
130
130
  executables:
131
- - add-password-to-keychain.sh
132
131
  - app-tools
133
132
  - kcpass
134
133
  - resignipa
135
- - set-hardware-keyboard.applescript
134
+ - setsimkbd
136
135
  - syncpp
137
136
  - upload2itunes
138
137
  - xcarchive2ipa
@@ -140,11 +139,10 @@ extensions: []
140
139
  extra_rdoc_files: []
141
140
  files:
142
141
  - lib/app_tools/version.rb
143
- - bin/add-password-to-keychain.sh
144
142
  - bin/app-tools
145
143
  - bin/kcpass
146
144
  - bin/resignipa
147
- - bin/set-hardware-keyboard.applescript
145
+ - bin/setsimkbd
148
146
  - bin/syncpp
149
147
  - bin/upload2itunes
150
148
  - bin/xcarchive2ipa
@@ -1,21 +0,0 @@
1
- #!/usr/bin/env bash
2
-
3
- # Passed in from build script
4
- if [[ -z "$USER_NAME" || -z "$USER_PASSWORD" ]]; then
5
- echo Must set USER_NAME and USER_PASSWORD variables. Use single quotes around the USER_PASSWORD value to escape special bash characters.
6
- exit 1
7
- fi
8
-
9
- ITMSTRANSPORTER=/Applications/Xcode.app/Contents/Applications/Application\ Loader.app/Contents/itms/bin/iTMSTransporter
10
-
11
- # See http://qntm.org/bash for explanation of why we escape everything in the password string
12
-
13
- security add-generic-password -a $USER_NAME -s "app-tools/iTunesConnect" -w $(echo $USER_PASSWORD | sed -E 's/([^a-zA-Z0-9])/\1/g') -T "$ITMSTRANSPORTER" -T $(which security)
14
-
15
- # This password can be deleted with:
16
- #
17
- # security delete-generic-password -a ${USER_NAME} -s "iTunesConnect - ${USER_NAME}"
18
- #
19
- # It can be retrieved with:
20
- #
21
- # security find-generic-password -a ${USER_NAME} -s "iTunesConnect - ${USER_NAME}" -w