appsendr 0.0.5 → 0.0.6
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.
- data/Manifest +2 -1
- data/Rakefile +1 -1
- data/appsendr.gemspec +10 -4
- data/lib/appsendr/client.rb +4 -3
- data/lib/appsendr/command.rb +1 -1
- data/lib/appsendr/commands/app.rb +3 -2
- data/lib/appsendr/commands/auth.rb +1 -1
- data/lib/appsendr/commands/build.rb +11 -10
- data/lib/appsendr/commands/common.rb +36 -0
- data/lib/appsendr/commands/deploy.rb +4 -2
- data/lib/appsendr/commands/help.rb +2 -0
- data/lib/appsendr/commands/testers.rb +14 -1
- data/lib/appsendr/constants.rb +1 -1
- data/portal.rb +197 -0
- metadata +35 -4
data/Manifest
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
Manifest
|
|
2
2
|
README.rdoc
|
|
3
3
|
Rakefile
|
|
4
|
-
appsendr.gemspec
|
|
5
4
|
bin/appsendr
|
|
6
5
|
lib/appsendr.rb
|
|
7
6
|
lib/appsendr/binary_plist.rb
|
|
@@ -12,6 +11,7 @@ lib/appsendr/commands/auth.rb
|
|
|
12
11
|
lib/appsendr/commands/base.rb
|
|
13
12
|
lib/appsendr/commands/build.rb
|
|
14
13
|
lib/appsendr/commands/collaborators.rb
|
|
14
|
+
lib/appsendr/commands/common.rb
|
|
15
15
|
lib/appsendr/commands/deploy.rb
|
|
16
16
|
lib/appsendr/commands/groups.rb
|
|
17
17
|
lib/appsendr/commands/help.rb
|
|
@@ -21,4 +21,5 @@ lib/appsendr/commands/version.rb
|
|
|
21
21
|
lib/appsendr/constants.rb
|
|
22
22
|
lib/appsendr/helpers.rb
|
|
23
23
|
lib/appsendr/progressbar.rb
|
|
24
|
+
portal.rb
|
|
24
25
|
terms
|
data/Rakefile
CHANGED
|
@@ -10,7 +10,7 @@ Echoe.new('appsendr', AppSendr::VERSION) do |p|
|
|
|
10
10
|
p.email = "nolan@appsendr.com"
|
|
11
11
|
p.ignore_pattern = ["tmp/*", "script/*"]
|
|
12
12
|
p.development_dependencies = []
|
|
13
|
-
p.runtime_dependencies = ["rest-client >=1.4.0", "rubyzip", "json_pure >=1.2.0"]
|
|
13
|
+
p.runtime_dependencies = ["rest-client >=1.4.0", "rubyzip", "json_pure >=1.2.0", "highline","mechanize"]
|
|
14
14
|
p.has_rdoc = true
|
|
15
15
|
|
|
16
16
|
end
|
data/appsendr.gemspec
CHANGED
|
@@ -2,17 +2,17 @@
|
|
|
2
2
|
|
|
3
3
|
Gem::Specification.new do |s|
|
|
4
4
|
s.name = %q{appsendr}
|
|
5
|
-
s.version = "0.0.
|
|
5
|
+
s.version = "0.0.6"
|
|
6
6
|
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
|
|
8
8
|
s.authors = ["AppSendr"]
|
|
9
|
-
s.date = %q{2011-
|
|
9
|
+
s.date = %q{2011-02-22}
|
|
10
10
|
s.default_executable = %q{appsendr}
|
|
11
11
|
s.description = %q{A gem that will build and distribute an iphone/ipad app to the web for remote install}
|
|
12
12
|
s.email = %q{nolan@appsendr.com}
|
|
13
13
|
s.executables = ["appsendr"]
|
|
14
|
-
s.extra_rdoc_files = ["README.rdoc", "bin/appsendr", "lib/appsendr.rb", "lib/appsendr/binary_plist.rb", "lib/appsendr/client.rb", "lib/appsendr/command.rb", "lib/appsendr/commands/app.rb", "lib/appsendr/commands/auth.rb", "lib/appsendr/commands/base.rb", "lib/appsendr/commands/build.rb", "lib/appsendr/commands/collaborators.rb", "lib/appsendr/commands/deploy.rb", "lib/appsendr/commands/groups.rb", "lib/appsendr/commands/help.rb", "lib/appsendr/commands/portal.rb", "lib/appsendr/commands/testers.rb", "lib/appsendr/commands/version.rb", "lib/appsendr/constants.rb", "lib/appsendr/helpers.rb", "lib/appsendr/progressbar.rb"]
|
|
15
|
-
s.files = ["Manifest", "README.rdoc", "Rakefile", "bin/appsendr", "lib/appsendr.rb", "lib/appsendr/binary_plist.rb", "lib/appsendr/client.rb", "lib/appsendr/command.rb", "lib/appsendr/commands/app.rb", "lib/appsendr/commands/auth.rb", "lib/appsendr/commands/base.rb", "lib/appsendr/commands/build.rb", "lib/appsendr/commands/collaborators.rb", "lib/appsendr/commands/deploy.rb", "lib/appsendr/commands/groups.rb", "lib/appsendr/commands/help.rb", "lib/appsendr/commands/portal.rb", "lib/appsendr/commands/testers.rb", "lib/appsendr/commands/version.rb", "lib/appsendr/constants.rb", "lib/appsendr/helpers.rb", "lib/appsendr/progressbar.rb", "terms", "appsendr.gemspec"]
|
|
14
|
+
s.extra_rdoc_files = ["README.rdoc", "bin/appsendr", "lib/appsendr.rb", "lib/appsendr/binary_plist.rb", "lib/appsendr/client.rb", "lib/appsendr/command.rb", "lib/appsendr/commands/app.rb", "lib/appsendr/commands/auth.rb", "lib/appsendr/commands/base.rb", "lib/appsendr/commands/build.rb", "lib/appsendr/commands/collaborators.rb", "lib/appsendr/commands/common.rb", "lib/appsendr/commands/deploy.rb", "lib/appsendr/commands/groups.rb", "lib/appsendr/commands/help.rb", "lib/appsendr/commands/portal.rb", "lib/appsendr/commands/testers.rb", "lib/appsendr/commands/version.rb", "lib/appsendr/constants.rb", "lib/appsendr/helpers.rb", "lib/appsendr/progressbar.rb"]
|
|
15
|
+
s.files = ["Manifest", "README.rdoc", "Rakefile", "bin/appsendr", "lib/appsendr.rb", "lib/appsendr/binary_plist.rb", "lib/appsendr/client.rb", "lib/appsendr/command.rb", "lib/appsendr/commands/app.rb", "lib/appsendr/commands/auth.rb", "lib/appsendr/commands/base.rb", "lib/appsendr/commands/build.rb", "lib/appsendr/commands/collaborators.rb", "lib/appsendr/commands/common.rb", "lib/appsendr/commands/deploy.rb", "lib/appsendr/commands/groups.rb", "lib/appsendr/commands/help.rb", "lib/appsendr/commands/portal.rb", "lib/appsendr/commands/testers.rb", "lib/appsendr/commands/version.rb", "lib/appsendr/constants.rb", "lib/appsendr/helpers.rb", "lib/appsendr/progressbar.rb", "portal.rb", "terms", "appsendr.gemspec"]
|
|
16
16
|
s.homepage = %q{http://www.appsendr.com/gem}
|
|
17
17
|
s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Appsendr", "--main", "README.rdoc"]
|
|
18
18
|
s.require_paths = ["lib"]
|
|
@@ -28,14 +28,20 @@ Gem::Specification.new do |s|
|
|
|
28
28
|
s.add_runtime_dependency(%q<rest-client>, [">= 1.4.0"])
|
|
29
29
|
s.add_runtime_dependency(%q<rubyzip>, [">= 0"])
|
|
30
30
|
s.add_runtime_dependency(%q<json_pure>, [">= 1.2.0"])
|
|
31
|
+
s.add_runtime_dependency(%q<highline>, [">= 0"])
|
|
32
|
+
s.add_runtime_dependency(%q<mechanize>, [">= 0"])
|
|
31
33
|
else
|
|
32
34
|
s.add_dependency(%q<rest-client>, [">= 1.4.0"])
|
|
33
35
|
s.add_dependency(%q<rubyzip>, [">= 0"])
|
|
34
36
|
s.add_dependency(%q<json_pure>, [">= 1.2.0"])
|
|
37
|
+
s.add_dependency(%q<highline>, [">= 0"])
|
|
38
|
+
s.add_dependency(%q<mechanize>, [">= 0"])
|
|
35
39
|
end
|
|
36
40
|
else
|
|
37
41
|
s.add_dependency(%q<rest-client>, [">= 1.4.0"])
|
|
38
42
|
s.add_dependency(%q<rubyzip>, [">= 0"])
|
|
39
43
|
s.add_dependency(%q<json_pure>, [">= 1.2.0"])
|
|
44
|
+
s.add_dependency(%q<highline>, [">= 0"])
|
|
45
|
+
s.add_dependency(%q<mechanize>, [">= 0"])
|
|
40
46
|
end
|
|
41
47
|
end
|
data/lib/appsendr/client.rb
CHANGED
|
@@ -130,13 +130,14 @@ class AppSendr::Client
|
|
|
130
130
|
post('/api/app/notify/'+app_id.to_s+'.json',{:group=>group})
|
|
131
131
|
end
|
|
132
132
|
|
|
133
|
-
def upload(app_id, ipa,provisioning, notify, notes, bundle_id, icon, later=false)
|
|
133
|
+
def upload(app_id, ipa,provisioning, is_public, notify, notes, bundle_id, icon, later=false)
|
|
134
134
|
params = {
|
|
135
135
|
:provisioning_profile => File.new(provisioning, 'rb'),
|
|
136
136
|
:notes=>notes,
|
|
137
137
|
:bundle_identifier => bundle_id,
|
|
138
138
|
:built_at=>Time.now,
|
|
139
139
|
:notify=>notify,
|
|
140
|
+
:public=>is_public,
|
|
140
141
|
:app_id => app_id.to_s
|
|
141
142
|
# :ipa=>
|
|
142
143
|
}
|
|
@@ -184,7 +185,7 @@ class AppSendr::Client
|
|
|
184
185
|
end
|
|
185
186
|
end
|
|
186
187
|
|
|
187
|
-
def finish_multipart(app_id, version_id, ipa, upload_id, parts)
|
|
188
|
+
def finish_multipart(app_id, version_id, ipa, upload_id, parts, notify)
|
|
188
189
|
ipa_name = File.basename(ipa)
|
|
189
190
|
ipa_size = File.size(ipa)
|
|
190
191
|
|
|
@@ -194,7 +195,7 @@ class AppSendr::Client
|
|
|
194
195
|
params[:upload_id] = upload_id
|
|
195
196
|
params[:parts] = parts
|
|
196
197
|
params[:id] = version_id
|
|
197
|
-
|
|
198
|
+
params[:notify] = notify
|
|
198
199
|
post('/api/version/multipart_finished.json', {:version=>params})
|
|
199
200
|
|
|
200
201
|
|
data/lib/appsendr/command.rb
CHANGED
|
@@ -16,7 +16,7 @@ module AppSendr
|
|
|
16
16
|
|
|
17
17
|
def run(command, args, retries=0)
|
|
18
18
|
begin
|
|
19
|
-
run_internal 'auth:
|
|
19
|
+
run_internal 'auth:login', args.dup if (retries > 0 or !credentials_setup?)
|
|
20
20
|
run_internal(command, args.dup)
|
|
21
21
|
rescue InvalidCommand
|
|
22
22
|
error "Unknown command. Run 'appsendr help' for usage information."
|
|
@@ -25,7 +25,9 @@ module AppSendr::Command
|
|
|
25
25
|
#
|
|
26
26
|
name = args.join(" ").strip
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
error "You must include an app name" if name.empty?
|
|
29
|
+
require_project_dir("add an app")
|
|
30
|
+
|
|
29
31
|
if has_project_droppr?
|
|
30
32
|
list = appsendr.list
|
|
31
33
|
if list["message"].size > 0
|
|
@@ -59,7 +61,6 @@ module AppSendr::Command
|
|
|
59
61
|
display "Your app has been created."
|
|
60
62
|
end
|
|
61
63
|
|
|
62
|
-
end
|
|
63
64
|
end
|
|
64
65
|
|
|
65
66
|
def url
|
|
@@ -8,6 +8,9 @@ module AppSendr::Command
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
def index
|
|
11
|
+
notify = option_exists?('--notify', false)
|
|
12
|
+
is_public = option_exists?('--public', false)
|
|
13
|
+
|
|
11
14
|
if require_project(1,"build","your active configuration name")
|
|
12
15
|
@configuration = load_configuration
|
|
13
16
|
message "Building Xcode project with configuration #{@configuration}"
|
|
@@ -25,9 +28,10 @@ module AppSendr::Command
|
|
|
25
28
|
bundle_identifier ||= info['CFBundleIdentifier']
|
|
26
29
|
icon_path = icon_path(info)
|
|
27
30
|
if is_file_to_large?(@ipa_path)
|
|
28
|
-
upload_large_ipa(read_app_id,@ipa_path, profile_path,notify,@notes,bundle_identifier,icon_path)
|
|
31
|
+
upload_large_ipa(read_app_id,@ipa_path, profile_path,is_public,notify,@notes,bundle_identifier,icon_path)
|
|
29
32
|
else
|
|
30
|
-
|
|
33
|
+
message "Uploading IPA"
|
|
34
|
+
appsendr.upload(read_app_id,@ipa_path, profile_path,is_public,notify,@notes,bundle_identifier,icon_path)
|
|
31
35
|
message "App deployed"
|
|
32
36
|
end
|
|
33
37
|
FileUtils.rm_rf @ipa_path
|
|
@@ -69,7 +73,6 @@ module AppSendr::Command
|
|
|
69
73
|
|
|
70
74
|
FileUtils.rm_rf payload_path
|
|
71
75
|
Dir.mkdir(payload_path)
|
|
72
|
-
#display "#{@app_path.cl_escape} #{payload_path.cl_escape}/#{app_name.cl_escape}"
|
|
73
76
|
`cp -r #{@app_path.cl_escape} #{payload_path.cl_escape+"/"+app_name.cl_escape}`
|
|
74
77
|
build_ipa(payload_path.cl_escape,ipa_path.cl_escape)
|
|
75
78
|
|
|
@@ -80,21 +83,19 @@ module AppSendr::Command
|
|
|
80
83
|
end
|
|
81
84
|
|
|
82
85
|
def build_ipa(payload_path,ipa_path)
|
|
83
|
-
#ditto_exec = "ditto -c -k --keepParent -rsrc #{payload_path} #{ipa_path}"
|
|
84
86
|
ditto_exec = "ditto -c -k --keepParent --sequesterRsrc #{payload_path} #{ipa_path}"
|
|
85
|
-
#display ditto_exec
|
|
86
87
|
system(ditto_exec)
|
|
87
88
|
end
|
|
88
89
|
|
|
89
|
-
def upload_large_ipa(app_id, ipa, provisioning ,notify, notes, bundle_id, icon)
|
|
90
|
-
resp = appsendr.upload(app_id,ipa, provisioning,notify,notes,bundle_id,icon, true)
|
|
90
|
+
def upload_large_ipa(app_id, ipa, provisioning ,is_public, notify, notes, bundle_id, icon)
|
|
91
|
+
resp = appsendr.upload(app_id,ipa, provisioning,is_public,notify,notes,bundle_id,icon, true)
|
|
91
92
|
|
|
92
93
|
@upload_id = nil
|
|
93
94
|
@app_version_id = resp['message']['version']['id']
|
|
94
95
|
if @app_version_id
|
|
95
96
|
begin
|
|
96
97
|
split_file(ipa)
|
|
97
|
-
upload_as_multipart(app_id, @app_version_id, ipa)
|
|
98
|
+
upload_as_multipart(app_id, @app_version_id, ipa, notify)
|
|
98
99
|
rescue Exception => e
|
|
99
100
|
clean_split_files(File.dirname(ipa))
|
|
100
101
|
appsendr.abort_multipart(app_id, @app_version_id, ipa, @upload_id)
|
|
@@ -104,7 +105,7 @@ module AppSendr::Command
|
|
|
104
105
|
|
|
105
106
|
end
|
|
106
107
|
|
|
107
|
-
def upload_as_multipart(app_id, version_id, ipa)
|
|
108
|
+
def upload_as_multipart(app_id, version_id, ipa, notify)
|
|
108
109
|
|
|
109
110
|
ipa_name = File.basename(ipa)
|
|
110
111
|
ipa_dir = File.dirname(ipa)
|
|
@@ -133,7 +134,7 @@ module AppSendr::Command
|
|
|
133
134
|
}
|
|
134
135
|
pbar.finish
|
|
135
136
|
|
|
136
|
-
appsendr.finish_multipart(app_id, version_id, ipa, @upload_id, parts)
|
|
137
|
+
appsendr.finish_multipart(app_id, version_id, ipa, @upload_id, parts, notify)
|
|
137
138
|
|
|
138
139
|
clean_split_files(ipa_dir)
|
|
139
140
|
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
require 'optparse'
|
|
2
|
+
|
|
3
|
+
module AppSendr::Command
|
|
4
|
+
class Ipa < Build ## Inherhits from Deploy
|
|
5
|
+
def create
|
|
6
|
+
|
|
7
|
+
app_name = args.join(" ").strip
|
|
8
|
+
@app_dir = Dir.pwd
|
|
9
|
+
@app_path = @app_dir+"/#{app_name}"
|
|
10
|
+
|
|
11
|
+
payload_path = @app_dir+"/Payload"
|
|
12
|
+
ipa_path = @app_dir+"/#{ipa_app_name(app_name).delete('^A-Za-z0-9\.\_\-')}"
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
FileUtils.rm_rf payload_path
|
|
16
|
+
Dir.mkdir(payload_path)
|
|
17
|
+
#display "#{@app_path.cl_escape} #{payload_path.cl_escape}/#{app_name.cl_escape}"
|
|
18
|
+
`cp -r #{@app_path.cl_escape} #{payload_path.cl_escape+"/"+app_name.cl_escape}`
|
|
19
|
+
build_ipa(payload_path.cl_escape,ipa_path.cl_escape)
|
|
20
|
+
|
|
21
|
+
FileUtils.rm_rf payload_path
|
|
22
|
+
message "IPA Built"
|
|
23
|
+
|
|
24
|
+
#return ipa_path
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
def codesign
|
|
28
|
+
# export CODESIGN_ALLOCATE=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/codesign_allocate
|
|
29
|
+
# codesign –f –s “iPhone Developer: <insert your identity>” <appname>.app/<appname>
|
|
30
|
+
#
|
|
31
|
+
# You can check the Authorities by which an app is currently signed with the following command:
|
|
32
|
+
#
|
|
33
|
+
# codesign –d –vv <appname>.app/<appname>
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
@@ -12,6 +12,7 @@ module AppSendr::Command
|
|
|
12
12
|
#
|
|
13
13
|
#
|
|
14
14
|
notify = option_exists?('--notify', false)
|
|
15
|
+
is_public = option_exists?('--public', false)
|
|
15
16
|
|
|
16
17
|
@configuration = load_configuration
|
|
17
18
|
if require_project(1,"deploy","your active configuration name",true)
|
|
@@ -30,9 +31,10 @@ module AppSendr::Command
|
|
|
30
31
|
bundle_identifier ||= info['CFBundleIdentifier']
|
|
31
32
|
icon_path = icon_path(info)
|
|
32
33
|
if is_file_to_large?(@ipa_path)
|
|
33
|
-
upload_large_ipa(read_app_id,@ipa_path, profile_path,notify,@notes,bundle_identifier,icon_path)
|
|
34
|
+
upload_large_ipa(read_app_id,@ipa_path, profile_path,is_public,notify,@notes,bundle_identifier,icon_path)
|
|
34
35
|
else
|
|
35
|
-
|
|
36
|
+
message "Uploading IPA"
|
|
37
|
+
appsendr.upload(read_app_id,@ipa_path, profile_path,is_public,notify,@notes,bundle_identifier,icon_path)
|
|
36
38
|
message "App deployed"
|
|
37
39
|
|
|
38
40
|
end
|
|
@@ -62,6 +62,8 @@ module AppSendr::Command
|
|
|
62
62
|
group.command 'collaborators', 'list collaborators'
|
|
63
63
|
group.command 'collaborators:add <email>', 'add collaborators'
|
|
64
64
|
group.command 'collaborators:remove <email>','remove collaborators'
|
|
65
|
+
group.space
|
|
66
|
+
group.command 'auth:login', 'reauthorize account'
|
|
65
67
|
end
|
|
66
68
|
|
|
67
69
|
end
|
|
@@ -75,8 +75,21 @@ module AppSendr::Command
|
|
|
75
75
|
group = args.join(" ").strip
|
|
76
76
|
|
|
77
77
|
appsendr.notify(read_app_id,group)
|
|
78
|
+
end
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
def devices
|
|
82
|
+
all = option_exists?('--all', false)
|
|
83
|
+
|
|
84
|
+
if require_project(0,nil,nil)
|
|
85
|
+
message "Devices"
|
|
86
|
+
app_id = read_app_id unless all
|
|
87
|
+
@remote_devices = appsendr.devices(app_id,false)
|
|
88
|
+
devices = @remote_devices['message']['Device UDIDs']
|
|
89
|
+
devices.each{|device|
|
|
90
|
+
puts device.to_yaml
|
|
91
|
+
}
|
|
78
92
|
end
|
|
79
|
-
|
|
80
93
|
|
|
81
94
|
end
|
|
82
95
|
|
data/lib/appsendr/constants.rb
CHANGED
data/portal.rb
ADDED
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
|
|
2
|
+
require 'rubygems'
|
|
3
|
+
require 'mechanize'
|
|
4
|
+
require 'highline'
|
|
5
|
+
@@agent = Mechanize.new
|
|
6
|
+
@@agent.user_agent_alias = 'Mac FireFox'
|
|
7
|
+
@@agent.follow_meta_refresh = true
|
|
8
|
+
|
|
9
|
+
@@available_devices = []
|
|
10
|
+
@@available_profiles = []
|
|
11
|
+
BASE_URL = "https://developer.apple.com"
|
|
12
|
+
LOGIN_URL = BASE_URL + "/ios/manage/overview/index.action"
|
|
13
|
+
DEVICES_URL = BASE_URL + "/ios/manage/devices/index.action"
|
|
14
|
+
DEVICE_BULK_UPLOAD_URL = "/ios/manage/devices/saveupload.action"
|
|
15
|
+
SAVE_TEAM_URL = BASE_URL + "/membercenter/saveTeamSelection.action"
|
|
16
|
+
|
|
17
|
+
DEV_PROVISIONING_PROFILE_URL = BASE_URL + "/ios/manage/provisioningprofiles/index.action"
|
|
18
|
+
DIST_PROVISIONING_PROFILE_URL = BASE_URL + "/ios/manage/provisioningprofiles/viewDistributionProfiles.action"
|
|
19
|
+
|
|
20
|
+
CREATE_ADHOC_PROFILE_URL = BASE_URL + "/ios/manage/provisioningprofiles/create.action?type=2"
|
|
21
|
+
DOWNLOAD_PROFILE_URL_WO_ID = BASE_URL + "/ios/manage/provisioningprofiles/download.action?blobId="
|
|
22
|
+
EDIT_PROFILE_URL_WO_ID = BASE_URL + "/ios/manage/provisioningprofiles/edit.action?provDisplayId="
|
|
23
|
+
|
|
24
|
+
SAVE_PROFILE_URL = BASE_URL + "/ios/manage/provisioningprofiles/save.action"
|
|
25
|
+
|
|
26
|
+
def login(username, password)
|
|
27
|
+
|
|
28
|
+
# Get login page
|
|
29
|
+
#puts "- fetching login page"
|
|
30
|
+
#page = agent.get('https://phobos.apple.com/WebObjects/MZLabel.woa/wa/default')
|
|
31
|
+
page = @@agent.get(LOGIN_URL)
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
# Submit form to login
|
|
35
|
+
login_form = page.forms.first
|
|
36
|
+
login_form['theAccountName']=username
|
|
37
|
+
login_form['theAccountPW']=password
|
|
38
|
+
page = @@agent.submit(login_form)
|
|
39
|
+
|
|
40
|
+
# Fail if it looks like we ended up back at a login page
|
|
41
|
+
if page.form('appleConnectForm')
|
|
42
|
+
#puts "Error: Login failed"
|
|
43
|
+
return nil
|
|
44
|
+
#exit
|
|
45
|
+
else
|
|
46
|
+
select_form = page.form('saveTeamSelection')
|
|
47
|
+
if select_form
|
|
48
|
+
options = []
|
|
49
|
+
select_form.fields.first.options.each{|option|
|
|
50
|
+
display "#{options.length + 1}. #{option.text}"
|
|
51
|
+
options.push([option.text,option.value])
|
|
52
|
+
|
|
53
|
+
}
|
|
54
|
+
print "Enter the # for the account you wish to login to: "
|
|
55
|
+
selection = ask
|
|
56
|
+
if selection.to_i > (options.length )
|
|
57
|
+
error "Invalid selection"
|
|
58
|
+
return nil
|
|
59
|
+
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
team = options[selection.to_i - 1]
|
|
63
|
+
select_form['memberDisplayId'] = team[1]
|
|
64
|
+
page = @@agent.submit(select_form, select_form.buttons[1])
|
|
65
|
+
return page
|
|
66
|
+
else
|
|
67
|
+
return page
|
|
68
|
+
end
|
|
69
|
+
end
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
def get_details(username, password)
|
|
73
|
+
if login(username,password)
|
|
74
|
+
@available_dev_profiles = development_provisioning_profiles
|
|
75
|
+
profile = @available_dev_profiles[1]
|
|
76
|
+
profile_id = profile[:id]
|
|
77
|
+
puts profile_id
|
|
78
|
+
puts profile[:editable]
|
|
79
|
+
edit_profile = edit_provisioning_profile_and_get_devices(profile_id,false)
|
|
80
|
+
devices = edit_profile[1]
|
|
81
|
+
page = edit_profile[0]
|
|
82
|
+
|
|
83
|
+
update_provisioning_profile_with_devices(page,[])
|
|
84
|
+
#puts page.parser
|
|
85
|
+
end
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
#####
|
|
89
|
+
# provisioning
|
|
90
|
+
|
|
91
|
+
def provisioning_profiles(url)
|
|
92
|
+
page = @@agent.get(url)
|
|
93
|
+
table = page.at("//table/tbody")
|
|
94
|
+
profiles = []
|
|
95
|
+
return profiles unless table
|
|
96
|
+
|
|
97
|
+
table.children.each{|tr|
|
|
98
|
+
children = tr.children
|
|
99
|
+
cert_key = children[0].children[0]['value'].strip
|
|
100
|
+
cert_name = children[2].content.strip
|
|
101
|
+
app_id = children[4].content.strip
|
|
102
|
+
editable = false
|
|
103
|
+
children[8].search("a").each{|link|
|
|
104
|
+
if link.inner_html == "Edit"
|
|
105
|
+
editable = true
|
|
106
|
+
break
|
|
107
|
+
end
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
profiles.push({:name => cert_name, :id => cert_key, :app_id => app_id, :editable => editable })
|
|
111
|
+
#p children
|
|
112
|
+
}
|
|
113
|
+
return profiles
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
def development_provisioning_profiles
|
|
117
|
+
provisioning_profiles(DEV_PROVISIONING_PROFILE_URL)
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
def distribution_provisioning_profiles
|
|
121
|
+
|
|
122
|
+
provisioning_profiles(DIST_PROVISIONING_PROFILE_URL)
|
|
123
|
+
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
def download_provisioning_profile(id)
|
|
127
|
+
page = @@agent.get(DOWNLOAD_PROFILE_URL_WO_ID+id)
|
|
128
|
+
return page
|
|
129
|
+
end
|
|
130
|
+
|
|
131
|
+
def edit_provisioning_profile_and_get_devices(id,get_devices)
|
|
132
|
+
page = @@agent.get(EDIT_PROFILE_URL_WO_ID+id)
|
|
133
|
+
profile_devices = []
|
|
134
|
+
|
|
135
|
+
if get_devices
|
|
136
|
+
devices = page.at("div[@class='checkboxlist last']")
|
|
137
|
+
|
|
138
|
+
selected_devices = []
|
|
139
|
+
|
|
140
|
+
hidden_name = ""
|
|
141
|
+
checkbox_name = ""
|
|
142
|
+
devices.at("table").children.each{|row|
|
|
143
|
+
row.children.each{|column|
|
|
144
|
+
|
|
145
|
+
column.children.each{|input|
|
|
146
|
+
if input['type'] == "hidden"
|
|
147
|
+
hidden_name = input['name']
|
|
148
|
+
elsif input['type'] == "checkbox"
|
|
149
|
+
checkbox_name = input['name']
|
|
150
|
+
device = {}
|
|
151
|
+
|
|
152
|
+
device[:checked] = !!input['checked']
|
|
153
|
+
device[:udid] = input['value']
|
|
154
|
+
device[:name] = input.parent.at("label").inner_html
|
|
155
|
+
profile_devices.push(device)
|
|
156
|
+
if input['checked']
|
|
157
|
+
selected_devices.push(device)
|
|
158
|
+
#puts "[√] #{device[:name] } #{device[:udid]}"
|
|
159
|
+
else
|
|
160
|
+
# puts "[ ] #{device[:name] } #{device[:udid]}"
|
|
161
|
+
end
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
end
|
|
165
|
+
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
end
|
|
170
|
+
return [page, profile_devices]
|
|
171
|
+
end
|
|
172
|
+
|
|
173
|
+
def update_provisioning_profile_with_devices(page, devices)
|
|
174
|
+
device_form = page.forms[1]
|
|
175
|
+
device_form.checkboxes_with(:name=>/selectedDevices/).each do |checkbox|
|
|
176
|
+
puts checkbox['value']
|
|
177
|
+
|
|
178
|
+
if devices.include?(checkbox['value'])
|
|
179
|
+
checkbox.checked
|
|
180
|
+
put " √ "
|
|
181
|
+
end
|
|
182
|
+
end
|
|
183
|
+
button = device_form.button_with(:name => /submit/)
|
|
184
|
+
page = @@agent.submit(device_form, button)
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
end
|
|
188
|
+
|
|
189
|
+
def create_provisioning_profile
|
|
190
|
+
page = @@agent.get(CREATE_ADHOC_PROFILE_URL) #adhoc profiles
|
|
191
|
+
create_form = page.forms.first
|
|
192
|
+
|
|
193
|
+
end
|
|
194
|
+
|
|
195
|
+
|
|
196
|
+
|
|
197
|
+
get_details("nolanbrown@gmail.com","98xXp649")
|
metadata
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: appsendr
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
hash:
|
|
4
|
+
hash: 19
|
|
5
5
|
prerelease: false
|
|
6
6
|
segments:
|
|
7
7
|
- 0
|
|
8
8
|
- 0
|
|
9
|
-
-
|
|
10
|
-
version: 0.0.
|
|
9
|
+
- 6
|
|
10
|
+
version: 0.0.6
|
|
11
11
|
platform: ruby
|
|
12
12
|
authors:
|
|
13
13
|
- AppSendr
|
|
@@ -15,7 +15,7 @@ autorequire:
|
|
|
15
15
|
bindir: bin
|
|
16
16
|
cert_chain: []
|
|
17
17
|
|
|
18
|
-
date: 2011-
|
|
18
|
+
date: 2011-02-22 00:00:00 -08:00
|
|
19
19
|
default_executable: appsendr
|
|
20
20
|
dependencies:
|
|
21
21
|
- !ruby/object:Gem::Dependency
|
|
@@ -64,6 +64,34 @@ dependencies:
|
|
|
64
64
|
version: 1.2.0
|
|
65
65
|
type: :runtime
|
|
66
66
|
version_requirements: *id003
|
|
67
|
+
- !ruby/object:Gem::Dependency
|
|
68
|
+
name: highline
|
|
69
|
+
prerelease: false
|
|
70
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
|
71
|
+
none: false
|
|
72
|
+
requirements:
|
|
73
|
+
- - ">="
|
|
74
|
+
- !ruby/object:Gem::Version
|
|
75
|
+
hash: 3
|
|
76
|
+
segments:
|
|
77
|
+
- 0
|
|
78
|
+
version: "0"
|
|
79
|
+
type: :runtime
|
|
80
|
+
version_requirements: *id004
|
|
81
|
+
- !ruby/object:Gem::Dependency
|
|
82
|
+
name: mechanize
|
|
83
|
+
prerelease: false
|
|
84
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
|
85
|
+
none: false
|
|
86
|
+
requirements:
|
|
87
|
+
- - ">="
|
|
88
|
+
- !ruby/object:Gem::Version
|
|
89
|
+
hash: 3
|
|
90
|
+
segments:
|
|
91
|
+
- 0
|
|
92
|
+
version: "0"
|
|
93
|
+
type: :runtime
|
|
94
|
+
version_requirements: *id005
|
|
67
95
|
description: A gem that will build and distribute an iphone/ipad app to the web for remote install
|
|
68
96
|
email: nolan@appsendr.com
|
|
69
97
|
executables:
|
|
@@ -82,6 +110,7 @@ extra_rdoc_files:
|
|
|
82
110
|
- lib/appsendr/commands/base.rb
|
|
83
111
|
- lib/appsendr/commands/build.rb
|
|
84
112
|
- lib/appsendr/commands/collaborators.rb
|
|
113
|
+
- lib/appsendr/commands/common.rb
|
|
85
114
|
- lib/appsendr/commands/deploy.rb
|
|
86
115
|
- lib/appsendr/commands/groups.rb
|
|
87
116
|
- lib/appsendr/commands/help.rb
|
|
@@ -105,6 +134,7 @@ files:
|
|
|
105
134
|
- lib/appsendr/commands/base.rb
|
|
106
135
|
- lib/appsendr/commands/build.rb
|
|
107
136
|
- lib/appsendr/commands/collaborators.rb
|
|
137
|
+
- lib/appsendr/commands/common.rb
|
|
108
138
|
- lib/appsendr/commands/deploy.rb
|
|
109
139
|
- lib/appsendr/commands/groups.rb
|
|
110
140
|
- lib/appsendr/commands/help.rb
|
|
@@ -114,6 +144,7 @@ files:
|
|
|
114
144
|
- lib/appsendr/constants.rb
|
|
115
145
|
- lib/appsendr/helpers.rb
|
|
116
146
|
- lib/appsendr/progressbar.rb
|
|
147
|
+
- portal.rb
|
|
117
148
|
- terms
|
|
118
149
|
- appsendr.gemspec
|
|
119
150
|
has_rdoc: true
|