Class: Pindo::Command::Ios::Autoresign
- Inherits:
-
Ios
- Object
- Ios
- Pindo::Command::Ios::Autoresign
show all
- Includes:
- Appselect
- Defined in:
- lib/pindo/command/ios/autoresign.rb
Class Method Summary
collapse
Instance Method Summary
collapse
Methods included from Appselect
#all_deploy_bundle_name, #all_dev_bundle_name, #all_dev_bundleid, #all_itc_bundleid, #all_release_bundleid, #all_tool_bundleid, #deploy_build_setting_json, #dev_build_setting_json, #get_deploy_repo_with_modul_name, #get_deploy_setting_repo, #get_dev_setting_repo, #get_selected_deploy_bundle_name, #get_selected_deploy_bundleid, #get_selected_dev_bundle_name, #get_selected_dev_bundleid, #get_setting_bundleid_withdir, #load_setting, #select_main_app
Constructor Details
Returns a new instance of Autoresign.
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
|
# File 'lib/pindo/command/ios/autoresign.rb', line 106
def initialize(argv)
positional_ipa = argv.shift_argument
@options = initialize_options(argv)
@args_ipa_file = @options[:app] || @options[:ipa] || positional_ipa
@args_deploy_flag = @options[:deploy]
@args_bundle_id = @options[:bundleid]
@args_upload_flag = @options[:upload]
@args_send_flag = @options[:send]
@args_conf = @options[:conf]
if @args_send_flag
@args_upload_flag = true
end
@args_adhoc_flag = @options[:adhoc]
@args_dev_flag = @options[:dev]
@args_develop_id_flag = @options[:develop_id]
@args_macos_flag = @options[:macos]
@args_match_flag = @options[:match]
@cert_mode = @options[:cert_mode] || 'custom'
@storage = @options[:storage] || 'https'
if @args_match_flag
@cert_mode = 'match'
@storage = 'git'
end
@build_type = @options[:build_type]
if @args_develop_id_flag
@build_type = 'developer_id'
elsif @args_adhoc_flag
@build_type = 'adhoc'
elsif @args_dev_flag
@build_type = 'dev'
elsif @build_type.nil? || @build_type.to_s.empty?
@build_type = 'dev' end
@build_type = Pindo::Options::BuildOptions.normalize_build_type(@build_type)
@platform_type = @options[:platform]
if @args_macos_flag || @options[:app]
@platform_type = 'macos'
end
if @platform_type == 'macos' && @build_type == 'adhoc'
@build_type = 'developer_id'
end
super
@additional_args = argv.remainder!
unless @additional_args.empty?
raise Informative, "只允许指定一个安装包路径,多余参数: #{@additional_args.join(' ')}"
end
end
|
Class Method Details
.option_items ⇒ Object
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
|
# File 'lib/pindo/command/ios/autoresign.rb', line 77
def self.option_items
@option_items ||= begin
items = []
items.concat(Pindo::Options::ToolOptions.select(:ipa, :app, :deploy))
items.concat(Pindo::Options::BuildOptions.select(
:bundleid, :dev, :adhoc, :develop_id, :build_type
))
items.concat(Pindo::Options::CertOptions.select(
:platform, :macos, :cert_mode, :storage, :match
))
items.concat(Pindo::Options::JPSOptions.select(:conf, :upload, :send))
items
end
end
|
.options ⇒ Object
101
102
103
|
# File 'lib/pindo/command/ios/autoresign.rb', line 101
def self.options
option_items.map { |item| item.to_claide_option }.concat(super)
end
|
.use_cache? ⇒ Boolean
23
24
25
|
# File 'lib/pindo/command/ios/autoresign.rb', line 23
def self.use_cache?
true
end
|
Instance Method Details
#run ⇒ Object
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
|
# File 'lib/pindo/command/ios/autoresign.rb', line 182
def run
begin
ipa_file_path = find_ipa_file()
unless ipa_file_path && File.exist?(ipa_file_path)
raise Informative, "未找到需要重签名的安装包"
end
bundle_id = select_bundle_id()
puts "mainapp_bundleid: #{bundle_id}"
pull_app_config(bundle_id)
app_info_obj, workflow_info = prepare_jps_config()
resigned_ipa_file = resigned_package_path(ipa_file_path)
tasks = create_resign_tasks(
ipa_file_path: ipa_file_path,
resigned_ipa_file: resigned_ipa_file,
bundle_id: bundle_id,
app_info_obj: app_info_obj,
workflow_info: workflow_info
)
task_manager = Pindo::TaskSystem::TaskManager.instance
task_manager.clear_all
tasks.each { |task| task_manager.add_task(task) }
task_manager.start
ensure
Pindo::Options::GlobalOptionsState.instance.clear
end
end
|