pindo 4.7.0 → 4.7.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4c7daab6ca92e2942ae682695e06ea741b5cb2ae45804dd9af94bdacc59a49cf
4
- data.tar.gz: d237736dfdf676455395a85590142ac30ab8604cd8dd2636577582b48d1da389
3
+ metadata.gz: 5d5ed09cbd0c1dd5f1fae766fd8d97f98e786b25d34056f8065efede5f478cc0
4
+ data.tar.gz: b75e1716c757c7d2eabcb5c757c5ea8df886f4e1338cf984d04232a6acd180b6
5
5
  SHA512:
6
- metadata.gz: d5dc55d34adbd57fd5fa0d0d5268418f88b5fe019e2f1f33c9f5dd19016e15ff3ce00272966c76d6a90b8b68af2eb0d40f49f700990010557abbad69e3338bdf
7
- data.tar.gz: f6d9f58c141d0a0b2702f84f34745315b821d59d04f59f8a61c963c6cfc8497b3532455d344e65f73cdfbccd7282cb84166ee5dd46517e5f47c7463a003f36d3
6
+ metadata.gz: 670591b6329e7d53bdb36156a3dcea8cac1a1477ada5f1451e22d1e457cdc0c91f34c4a5c705844902c48f259e06fec7bb7800f003e41702f20b1e8026cbd14c
7
+ data.tar.gz: 1327366d3216fd62a113997380b48bf66797092cb81a374557abb9d50c942278efba586751134babafa27810cad6b30eeed5d7d367eadf7071e00c5f9c081ab5
@@ -6,6 +6,34 @@ module Pindo
6
6
  module AESHelper
7
7
 
8
8
 
9
+ def self.fetch_password(keychain_name:nil)
10
+ # password = ENV["MATCH_PASSWORD"]
11
+
12
+ server_name = ["pindo", keychain_name].join("_")
13
+
14
+ item = Security::InternetPassword.find(server: server_name)
15
+
16
+ password = item.password if item
17
+
18
+ unless password
19
+
20
+ password = FastlaneCore::Helper.ask_password(message: "请输入证书仓库的加密密码: ", confirm: true)
21
+ Security::InternetPassword.add(server_name, "", password)
22
+ end
23
+ return password
24
+ end
25
+
26
+ def self.delete_password(keychain_name:nil)
27
+ server_name = ["pindo", keychain_name].join("_")
28
+ Security::InternetPassword.delete(server_name)
29
+ end
30
+
31
+ def self.store_password(keychain_name:nil, password:nil)
32
+ server_name = ["pindo", keychain_name].join("_")
33
+ Security::InternetPassword.add(server_name, "", password)
34
+ end
35
+
36
+
9
37
  def self.aes_128_ecb_encrypt(key, encrypted_string)
10
38
  cipher = OpenSSL::Cipher::Cipher.new('AES-128-ECB')
11
39
  cipher.encrypt
@@ -48,7 +76,7 @@ module Pindo
48
76
  # 1.0.x OpenSSL and earlier versions use MD5, 1.1.0c and newer uses SHA256, we try both before giving an error
49
77
  def self.decrypt_specific_file(src_file: nil, password: nil, output_dir: nil, hash_algorithm: "MD5")
50
78
 
51
- begin
79
+ begin
52
80
  stored_data = Base64.decode64(File.read(src_file))
53
81
  salt = stored_data[8..15]
54
82
  data_to_decrypt = stored_data[16..-1]
@@ -66,7 +94,8 @@ module Pindo
66
94
  if hash_algorithm != fallback_hash_algorithm
67
95
  decrypt_specific_file(src_file: src_file, password: password, hash_algorithm: fallback_hash_algorithm)
68
96
  else
69
- raise Informative, "Couldn't decrypt the repo, please make sure you enter the right password!"
97
+ Funlog.instance.fancyinfo_error("解析文件失败: #{src_file}")
98
+ return nil
70
99
  end
71
100
  end
72
101
  end
@@ -226,7 +226,7 @@ module Pindo
226
226
  current=Dir.pwd
227
227
  local_repo_dir = File::join(path, reponame)
228
228
 
229
- Funlog.instance.fancyinfo_start("开始更新仓库:#{local_repo_dir}...")
229
+ Funlog.instance.fancyinfo_update("开始更新仓库:#{local_repo_dir}...")
230
230
 
231
231
  begin
232
232
 
@@ -249,15 +249,10 @@ module Pindo
249
249
 
250
250
  git!(%W(-C #{local_repo_dir} fetch origin --progress))
251
251
  else
252
- puts "Cloning `#{remote_url}` into `#{local_repo_dir}`."
253
252
  git! ['clone', remote_url, local_repo_dir]
254
253
  end
255
254
 
256
255
  Dir.chdir(local_repo_dir)
257
- if !remote_branch_exists?(local_repo_dir:local_repo_dir, branch:new_branch)
258
- raise Informative, "仓库中的#{new_branch}分支不存在 !!!"
259
- end
260
-
261
256
  current_branch = git!(%W(-C #{local_repo_dir} rev-parse --abbrev-ref HEAD)).strip
262
257
  if current_branch.eql?(new_branch)
263
258
  git!(%W(-C #{local_repo_dir} reset --hard origin/#{new_branch}))
@@ -269,7 +264,11 @@ module Pindo
269
264
  if local_branch_exists?(local_repo_dir:local_repo_dir, branch:new_branch)
270
265
  git!(%W(-C #{local_repo_dir} checkout #{new_branch}))
271
266
  else
272
- git!(%W(-C #{local_repo_dir} checkout -b #{new_branch}))
267
+ if !remote_branch_exists?(local_repo_dir:local_repo_dir, branch:new_branch)
268
+ git!(%W(-C #{local_repo_dir} checkout -b #{new_branch}))
269
+ else
270
+ raise Informative, "仓库中的#{new_branch}分支不存在 !!!"
271
+ end
273
272
  end
274
273
  git!(%W(-C #{local_repo_dir} branch --set-upstream-to=origin/#{new_branch} #{new_branch}))
275
274
  git!(%W(-C #{local_repo_dir} pull))
@@ -285,7 +284,7 @@ module Pindo
285
284
  end
286
285
 
287
286
  end
288
-
287
+ $stdin.flush
289
288
  Funlog.instance.fancyinfo_success("仓库#{local_repo_dir}更新完成!")
290
289
  rescue StandardError => e
291
290
 
@@ -154,7 +154,7 @@ module Pindo
154
154
 
155
155
  # (char * (index/1).floor).ljust(100, ' ')
156
156
 
157
- upload_message = "已下载:#{progress_str}\%【" + (char * (index/1).floor).ljust(100, '_') + "】Total: #{total_size} M"
157
+ upload_message = "已上传:#{progress_str}\%【" + (char * (index/1).floor).ljust(100, '_') + "】Total: #{total_size} M"
158
158
  @upload_message = upload_message
159
159
  Funlog.instance.fancyinfo_update(upload_message)
160
160
  # @spinner.reset
@@ -133,10 +133,10 @@ module Pindo
133
133
 
134
134
  # all_cookies = res['set-cookie']
135
135
  all_cookies = File.read("/Users/wade/Desktop/cookie.txt")
136
- puts "111"
137
- puts all_cookies
136
+ # puts "111"
137
+ # puts all_cookies
138
138
  cookies_array = parse_cookie(all_cookies)
139
- puts JSON.pretty_generate(cookies_array)
139
+ # puts JSON.pretty_generate(cookies_array)
140
140
 
141
141
 
142
142
  end
@@ -6,9 +6,9 @@ require 'pindo/client/httpclient'
6
6
 
7
7
 
8
8
  module Pindo
9
-
10
9
 
11
- class PgyerClient
10
+
11
+ class PgyerClient
12
12
 
13
13
 
14
14
  attr_accessor :use_local_wechat_url
@@ -23,7 +23,7 @@ module Pindo
23
23
  @pgyer_token_file = File.join(File::expand_path(Pindoconfig.instance.pindo_dir), ".pgyer_token")
24
24
  config_file = File.join(File::expand_path(Pindoconfig.instance.pindo_common_configdir), "pgyer_client_config.json")
25
25
  config_json = JSON.parse(File.read(config_file))
26
-
26
+
27
27
  @use_local_wechat_url = config_json["use_local_wechat_url"]
28
28
  @baseurl = config_json["pgyerapps_base_url"]
29
29
  @request_config = config_json["pgyerapps_req_config"]
@@ -31,7 +31,7 @@ module Pindo
31
31
 
32
32
  rescue => error
33
33
  raise Informative, "加载pgyer配置文件失败, 需要执行 pindo setup 或者pindo env dreamstudio"
34
- end
34
+ end
35
35
 
36
36
  end
37
37
 
@@ -39,13 +39,13 @@ module Pindo
39
39
 
40
40
  end
41
41
 
42
-
42
+
43
43
  def do_login(force_login:false)
44
44
 
45
-
45
+
46
46
 
47
47
  login_success = false
48
- @token = load_token()
48
+ @token = load_token()
49
49
  if !@token.nil? && !@token["token"].nil? && !force_login
50
50
  login_success = true
51
51
 
@@ -58,43 +58,45 @@ module Pindo
58
58
  username = @token["username"]
59
59
  checksum_password = nil
60
60
  if !@token["password"].nil?
61
- checksum_password = @token["password"]
61
+ checksum_password = @token["password"]
62
62
  end
63
63
  end
64
- token = do_login_req(username:username, checksum_password:checksum_password)
64
+ token = do_login_req(username:username, checksum_password:checksum_password)
65
65
  if !token.nil? && !token["token"].nil?
66
66
  @token = token
67
67
  login_success = true
68
- end
69
- end
68
+ end
69
+ end
70
70
 
71
71
  return login_success
72
72
  end
73
73
 
74
74
  def do_login_req(username:nil, checksum_password:nil)
75
-
76
-
75
+
76
+
77
77
  login_name = username
78
- if login_name.nil?
78
+ if login_name.nil? || login_name.empty?
79
79
  login_name = ask('请输入pgger网站的usernmae:') || nil
80
80
  end
81
81
 
82
- puts "用户: #{login_name} "
82
+ checksum_pass = checksum_password
83
+ if checksum_pass.nil? || checksum_pass.empty?
84
+ login_passwork = ask('请输入pgger网站的密码:') || nil
85
+ checksum_pass = Digest::MD5.hexdigest(login_passwork)
86
+ end
87
+
88
+ if !login_name.nil? && !login_name.empty? && !checksum_pass.nil? && !checksum_pass.empty?
83
89
 
84
- result_data = do_send_code(username:login_name)
90
+ else
91
+ raise Informative, "请输入正确的用户名和密码!"
92
+ end
85
93
 
86
- puts "验证码: #{result_data["msg"]}"
87
94
 
95
+ Funlog.instance.fancyinfo_start("正在登录pgyer...")
88
96
 
89
- checksum_pass = checksum_password
90
- if checksum_pass.nil?
91
- login_passwork = ask('请输入pgger网站的密码:') || nil
92
- checksum_pass = Digest::MD5.hexdigest(login_passwork)
93
- end
94
97
 
95
- # puts "passwork: #{checksum_pass}"
98
+ result_data = do_send_code(username:login_name)
96
99
 
97
- Funlog.instance.fancyinfo_start("正在登录pgyer...")
98
100
 
99
101
  boss_url = @baseurl + @request_config["do_login"]
100
102
  body_params = {
@@ -109,26 +111,25 @@ module Pindo
109
111
 
110
112
  begin
111
113
 
112
- con = HttpClient.create_instance_with_proxy
113
- res = con.post do |req|
114
- req.url boss_url
115
- req.headers['Content-Type'] = 'application/json'
116
- req.body = body_params.to_json
117
- end
114
+ con = HttpClient.create_instance_with_proxy
115
+ res = con.post do |req|
116
+ req.url boss_url
117
+ req.headers['Content-Type'] = 'application/json'
118
+ req.body = body_params.to_json
119
+ end
118
120
 
119
-
120
- if !res.body.nil?
121
-
122
- login_response_data = JSON.parse(res.body)
123
- end
121
+ if !res.body.nil?
122
+
123
+ login_response_data = JSON.parse(res.body)
124
+ end
124
125
 
125
126
  rescue => error
126
127
  Funlog.instance.fancyinfo_error("pgyer登录失败!")
127
128
  puts "登录失败,请重试!!!"
128
- end
129
+ end
130
+
129
131
 
130
132
 
131
-
132
133
  # puts JSON.pretty_generate(login_response_data)
133
134
 
134
135
  if !login_response_data.nil? && !login_response_data["code"].nil? && login_response_data["code"].to_s.eql?("200")
@@ -143,7 +144,7 @@ module Pindo
143
144
 
144
145
  else
145
146
  if File.exist?(@pgyer_token_file)
146
- FileUtils.rm_rf(@pgyer_token_file)
147
+ FileUtils.rm_rf(@pgyer_token_file)
147
148
  end
148
149
  Funlog.instance.fancyinfo_error("pgyer登录失败!")
149
150
  end
@@ -158,7 +159,7 @@ module Pindo
158
159
  Funlog.instance.fancyinfo_success("正在读取pgyer token...")
159
160
  if File.exist?(@pgyer_token_file)
160
161
  begin
161
- data = File.read(@pgyer_token_file)
162
+ data = File.read(@pgyer_token_file)
162
163
 
163
164
  data_string = AESHelper::aes_128_ecb_decrypt(@pgyer_aes_key, data)
164
165
  temp_token = data_string
@@ -166,37 +167,37 @@ module Pindo
166
167
  if !temp_token.nil? && !temp_token["token"].nil? && !temp_token["username"].nil?
167
168
  @token = temp_token
168
169
  Funlog.instance.fancyinfo_success("读取pgyer token成功!")
169
- end
170
+ end
170
171
  rescue => error
171
172
  puts error
172
173
  # puts "加载pgyer token 失败!!! "
173
174
  if File.exist?(@pgyer_token_file)
174
- FileUtils.rm_rf(@pgyer_token_file)
175
+ FileUtils.rm_rf(@pgyer_token_file)
175
176
  end
176
177
  Funlog.instance.fancyinfo_error("pgyer token文件不存在!")
177
178
  @token = nil
178
- end
179
+ end
179
180
  else
180
181
  Funlog.instance.fancyinfo_error("pgyer token文件不存在!")
181
- end
182
+ end
182
183
 
183
- return @token
184
+ return @token
184
185
  end
185
186
 
186
187
  def store_token(token:nil)
187
188
 
188
189
  begin
189
190
  @token = token
190
-
191
+
191
192
  data_string = AESHelper::aes_128_ecb_encrypt(@pgyer_aes_key, @token.to_json)
192
193
  File.open(@pgyer_token_file, "w") do |f|
193
194
  f.write(data_string)
194
195
  end
195
196
  Funlog.instance.fancyinfo_success("token 存储成功!")
196
197
  # puts "store pgyer token---- sucess !!!"
197
- rescue => error
198
+ rescue => error
198
199
  Funlog.instance.fancyinfo_error("token存储失败!")
199
- end
200
+ end
200
201
  end
201
202
 
202
203
  def do_send_code(username:nil)
@@ -209,7 +210,7 @@ module Pindo
209
210
  }
210
211
  # puts JSON.pretty_generate(body_params)
211
212
 
212
- con = HttpClient.create_instance_with_proxy
213
+ con = HttpClient.create_instance_with_proxy
213
214
  res = con.post do |req|
214
215
  req.url boss_url
215
216
  req.headers['Content-Type'] = 'application/json'
@@ -218,13 +219,13 @@ module Pindo
218
219
 
219
220
  result_date = nil
220
221
  if !res.body.nil?
221
- result_date = JSON.parse(res.body)
222
+ result_date = JSON.parse(res.body)
222
223
  end
223
-
224
+
224
225
  # puts JSON.pretty_generate(result_date)
225
226
 
226
227
  if !result_date.nil? && !result_date["code"].nil? && result_date["code"].to_s.eql?("200")
227
-
228
+
228
229
 
229
230
  res = con.post do |req|
230
231
  req.url boss_url
@@ -233,14 +234,14 @@ module Pindo
233
234
  end
234
235
 
235
236
  if !res.body.nil?
236
- result_date = JSON.parse(res.body)
237
+ result_date = JSON.parse(res.body)
237
238
  end
238
-
239
+
239
240
  end
240
241
 
241
-
242
+
242
243
  # puts JSON.pretty_generate(result_date)
243
-
244
+
244
245
  return result_date
245
246
 
246
247
  end
@@ -261,9 +262,9 @@ module Pindo
261
262
  }
262
263
 
263
264
  params.each { |key,value| get_params[key] = value }
264
-
265
265
 
266
- con = HttpClient.create_instance_with_proxy
266
+
267
+ con = HttpClient.create_instance_with_proxy
267
268
  res = con.get do |req|
268
269
  req.url boss_url
269
270
  req.headers['Content-Type'] = 'application/json'
@@ -273,22 +274,17 @@ module Pindo
273
274
 
274
275
  result_date = nil
275
276
  if !res.body.nil?
276
- result_date = JSON.parse(res.body)
277
+ result_date = JSON.parse(res.body)
277
278
 
278
279
  if !result_date["code"].nil? && result_date["code"].to_s.eql?("401")
279
280
  do_login(force_login:true)
280
281
  end
281
282
  end
282
-
283
-
284
- # puts JSON.pretty_generate(result_date)
285
-
286
- return result_date
287
283
 
288
- end
289
284
 
290
- def do_request(method, params)
285
+ # puts JSON.pretty_generate(result_date)
291
286
 
287
+ return result_date
292
288
 
293
289
  end
294
290
 
@@ -304,9 +300,9 @@ module Pindo
304
300
  return
305
301
  end
306
302
  params.each { |key,value| body_params[key] = value }
307
-
308
303
 
309
- con = HttpClient.create_instance_with_proxy
304
+
305
+ con = HttpClient.create_instance_with_proxy
310
306
  res = con.post do |req|
311
307
  req.url boss_url
312
308
  req.headers['Content-Type'] = 'application/json'
@@ -317,18 +313,18 @@ module Pindo
317
313
 
318
314
  result_date = nil
319
315
  if !res.body.nil?
320
- result_date = JSON.parse(res.body)
316
+ result_date = JSON.parse(res.body)
321
317
  end
322
-
323
-
318
+
319
+
324
320
  # puts JSON.pretty_generate(result_date)
325
-
321
+
326
322
  return result_date
327
323
 
328
324
  end
329
325
 
330
326
 
331
-
327
+
332
328
  # def post_app_update_binary(appId:nil, key_id:nil, description:nil)
333
329
  def post_app_update_binary(appId:nil, params:nil)
334
330
 
@@ -344,14 +340,14 @@ module Pindo
344
340
  }
345
341
 
346
342
  # puts body_params.to_json
347
- #
343
+ #
348
344
 
349
345
  params.each { |key,value| body_params[key] = value }
350
346
  # puts body_params.to_json
351
-
347
+
352
348
  # puts JSON.pretty_generate(body_params)
353
349
  # puts "111"
354
- con = HttpClient.create_instance_with_proxy
350
+ con = HttpClient.create_instance_with_proxy
355
351
  res = con.post do |req|
356
352
  req.url boss_url
357
353
  req.headers['Content-Type'] = 'application/json'
@@ -362,12 +358,12 @@ module Pindo
362
358
 
363
359
  result_date = nil
364
360
  if !res.body.nil?
365
- result_date = JSON.parse(res.body)
361
+ result_date = JSON.parse(res.body)
366
362
  end
367
-
368
-
363
+
364
+
369
365
  # puts JSON.pretty_generate(result_date)
370
-
366
+
371
367
  return result_date
372
368
 
373
369
  end
@@ -382,11 +378,11 @@ module Pindo
382
378
  pageNo:1,
383
379
  pageSize:20,
384
380
  }
385
-
381
+
386
382
  params.each { |key,value| get_params[key] = value }
387
-
388
383
 
389
- con = HttpClient.create_instance_with_proxy
384
+
385
+ con = HttpClient.create_instance_with_proxy
390
386
  res = con.get do |req|
391
387
  req.url boss_url
392
388
  req.headers['Content-Type'] = 'application/json'
@@ -396,12 +392,12 @@ module Pindo
396
392
 
397
393
  result_date = nil
398
394
  if !res.body.nil?
399
- result_date = JSON.parse(res.body)
395
+ result_date = JSON.parse(res.body)
400
396
  end
401
-
402
-
397
+
398
+
403
399
  # puts JSON.pretty_generate(result_date)
404
-
400
+
405
401
  return result_date
406
402
 
407
403
  end
@@ -420,7 +416,7 @@ module Pindo
420
416
  }
421
417
 
422
418
 
423
- con = HttpClient.create_instance_with_proxy
419
+ con = HttpClient.create_instance_with_proxy
424
420
 
425
421
  res = con.post do |req|
426
422
  req.url boss_url
@@ -432,12 +428,12 @@ module Pindo
432
428
 
433
429
  result_date = nil
434
430
  if !res.body.nil?
435
- result_date = JSON.parse(res.body)
431
+ result_date = JSON.parse(res.body)
436
432
  end
437
-
438
-
433
+
434
+
439
435
  # puts JSON.pretty_generate(result_date)
440
-
436
+
441
437
  return result_date
442
438
 
443
439
  end
@@ -447,7 +443,7 @@ module Pindo
447
443
  params = {} if params.nil?
448
444
  boss_url = @baseurl + @request_config["get_cert_list"]
449
445
 
450
- con = HttpClient.create_instance_with_proxy
446
+ con = HttpClient.create_instance_with_proxy
451
447
  res = con.get do |req|
452
448
  req.url boss_url
453
449
  req.headers['Content-Type'] = 'application/json'
@@ -456,12 +452,12 @@ module Pindo
456
452
 
457
453
  result_date = nil
458
454
  if !res.body.nil?
459
- result_date = JSON.parse(res.body)
455
+ result_date = JSON.parse(res.body)
460
456
  end
461
-
462
-
457
+
458
+
463
459
  # puts JSON.pretty_generate(result_date)
464
-
460
+
465
461
  return result_date
466
462
 
467
463
  end
@@ -476,7 +472,7 @@ module Pindo
476
472
  }
477
473
 
478
474
 
479
- con = HttpClient.create_instance_with_proxy
475
+ con = HttpClient.create_instance_with_proxy
480
476
 
481
477
  res = con.post do |req|
482
478
  req.url boss_url
@@ -488,16 +484,15 @@ module Pindo
488
484
 
489
485
  result_date = nil
490
486
  if !res.body.nil?
491
- result_date = JSON.parse(res.body)
487
+ result_date = JSON.parse(res.body)
492
488
  end
493
-
494
-
489
+
490
+
495
491
  # puts JSON.pretty_generate(result_date)
496
-
492
+
497
493
  return result_date
498
494
 
499
495
  end
500
496
 
501
497
  end
502
498
  end
503
-
@@ -17,7 +17,7 @@ module Pindo
17
17
  DESC
18
18
 
19
19
  self.arguments = [
20
- CLAide::Argument.new('path/to/config.json', true),
20
+
21
21
  ]
22
22
 
23
23
  def initialize(argv)
@@ -81,31 +81,33 @@ module Pindo
81
81
  bundle_id_array = get_bundle_id_map.values
82
82
  provisioning_info_array = nil
83
83
 
84
- # if @renew_cert_flag || @match_flag
84
+ if @renew_cert_flag || @match_flag
85
85
  values = get_create_cert_match_values(apple_id:@apple_id, bundle_id_array:bundle_id_array, build_type:@build_type, renew_flag:@renew_cert_flag)
86
86
  config = FastlaneCore::Configuration.create(Match::Options.available_options, values)
87
87
  Match::Runner.new.run(config)
88
88
  provisioning_info_array = create_provisioning_info_array(build_type:@build_type)
89
89
  pindo_single_config.set_cert_info(dict: provisioning_info_array)
90
+
91
+ else
92
+ cert_git_url = pindo_single_config.deploy_cert_giturl
93
+ if @apple_id.eql?(pindo_single_config.demo_apple_id)
94
+ cert_git_url = pindo_single_config.dev_cert_giturl
95
+ end
96
+ cert_reponame = cert_git_url.split("/").last.chomp(".git")
97
+ certs_dir = getcode_to_dir(reponame:cert_reponame, remote_url:cert_git_url, path: pindo_single_config.pindo_dir, new_branch:@apple_id)
90
98
 
91
- # else
92
-
93
- # cert_git_url = pindo_single_config.deploy_cert_giturl
94
- # if @apple_id.eql?(pindo_single_config.demo_apple_id)
95
- # cert_git_url = pindo_single_config.dev_cert_giturl
96
- # end
97
- # cert_reponame = cert_git_url.split("/").last.chomp(".git")
98
- # certs_dir = getcode_to_dir(reponame:cert_reponame, remote_url:cert_git_url, path: pindo_single_config.pindo_dir, new_branch:@apple_id)
99
-
100
- # install_certs(certs_dir:certs_dir, cert_type:@build_type)
101
- # bundle_id_map = get_bundle_id_map
102
- # provisioning_info_array = install_provisionfiles(certs_dir:certs_dir, bundle_id_map:bundle_id_map, cert_type:@build_type)
103
- # pindo_single_config.set_cert_info(dict: provisioning_info_array)
104
- # end
99
+ install_certs(cert_url:cert_git_url, certs_dir:certs_dir, cert_type:@build_type)
100
+ bundle_id_map = get_bundle_id_map
101
+ provisioning_info_array = install_provisionfiles(cert_url:cert_git_url, certs_dir:certs_dir, bundle_id_map:bundle_id_map, cert_type:@build_type)
102
+ pindo_single_config.set_cert_info(dict: provisioning_info_array)
103
+ end
105
104
 
105
+ provisioning_info_array = provisioning_info_array || []
106
+ unless provisioning_info_array.size > 0
107
+ raise Informative, "未找到证书信息"
108
+ end
106
109
 
107
- team_id_key = Match::Utils.environment_variable_name_team_id(app_identifier: @bundle_id,type:@build_type)
108
- @team_id_vaule = ENV[team_id_key]
110
+ @team_id_vaule = provisioning_info_array.first["team_id"]
109
111
 
110
112
  #发布机需要给swark注册bundle id
111
113
  add_swark_authorize_json
@@ -124,8 +126,10 @@ module Pindo
124
126
  new_project_fullname = Dir.glob(File.join(new_project_dir, "/*.xcodeproj")).max_by {|f| File.mtime(f)}
125
127
  if !new_project_fullname.nil? && File.exist?(new_project_fullname) && !provisioning_info_array.nil? && provisioning_info_array.size > 0
126
128
  new_proj_name = File.basename(new_project_fullname, ".xcodeproj")
129
+ Funlog.instance.fancyinfo_start("正在给Xcode配置证书...")
127
130
  config_project_cert(new_proj_name:new_proj_name, new_project_dir:new_project_dir, cert_type:@build_type, team_id_vaule:@team_id_vaule, provisioning_info_array:provisioning_info_array)
128
131
  config_infoplist_cert(new_proj_name:new_proj_name, new_project_dir:new_project_dir, icloud_id:@icloud_id, group_id:@group_id, provisioning_info_array:provisioning_info_array)
132
+ Funlog.instance.fancyinfo_success("Xcode配置证书完成!")
129
133
  end
130
134
  end
131
135
  end