pindo 4.7.1 → 4.7.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.
@@ -72,20 +72,36 @@ module Pindo
72
72
 
73
73
  def initialize(proj_fullname:nil)
74
74
  @proj_fullname = proj_fullname
75
- @project_obj = Xcodeproj::Project.open(proj_fullname)
75
+ @project_obj = Xcodeproj::Project.open(proj_fullname)
76
76
  end
77
77
 
78
78
  def get_xcodeproj_icon_path
79
+
80
+ icon_path = nil
79
81
  select_target = @project_obj.targets.select { |target| target.product_type.include?(Xcodeproj::Constants::PRODUCT_TYPE_UTI[:application]) }.first
80
- file_ref = select_target.resources_build_phase.files_references.select { |file| file.display_name.include?("Assets.xcassets") }.first
81
- icon_path = File.join(file_ref.real_path,"AppIcon.appiconset")
82
+ if !select_target.nil?
83
+ file_refs = select_target.resources_build_phase.files_references.select { |file| file.display_name.include?("Assets.xcassets") } || []
84
+ file_refs.each do |file_ref|
85
+ icon_path = File.join(file_ref.real_path,"AppIcon.appiconset")
86
+ if File.exist?(icon_path)
87
+ break
88
+ else
89
+ next
90
+ end
91
+ end
92
+ end
93
+
94
+ if icon_path.nil? || icon_path.empty? || !File.exist?(icon_path)
95
+ raise Informative, "没有找到Xcode icon 目录"
96
+ end
97
+
82
98
  return icon_path
83
99
  end
84
100
 
85
101
  def install_icon_res(new_icon_dir:nil)
86
102
  icon_path = get_xcodeproj_icon_path
87
103
  begin
88
- FileUtils.rm_rf(icon_path)
104
+ FileUtils.rm_rf(icon_path)
89
105
  FileUtils.mkdir_p(icon_path)
90
106
  rescue StandardError => e
91
107
  end
@@ -110,16 +126,28 @@ module Pindo
110
126
  icon_path = nil
111
127
  select_target = @project_obj.targets.select { |target| target.product_type.include?(Xcodeproj::Constants::PRODUCT_TYPE_UTI[:messages_extension]) }.first
112
128
  if !select_target.nil?
113
- file_ref = select_target.resources_build_phase.files_references.select { |file| file.display_name.include?("Assets.xcassets") }.first
114
- icon_path = File.join(file_ref.real_path,"iMessage App Icon.stickersiconset")
129
+ file_refs = select_target.resources_build_phase.files_references.select { |file| file.display_name.include?("Assets.xcassets") } || []
130
+ file_refs.each do |file_ref|
131
+ icon_path = File.join(file_ref.real_path,"iMessage App Icon.stickersiconset")
132
+ if File.exist?(icon_path)
133
+ break
134
+ else
135
+ next
136
+ end
137
+ end
138
+
139
+ if icon_path.nil? || icon_path.empty? || !File.exist?(icon_path)
140
+ raise Informative, "没有找到Xcode iMessage icon 目录"
141
+ end
115
142
  end
143
+
116
144
  return icon_path
117
145
  end
118
146
 
119
147
  def install_imessage_icon_res(new_icon_dir:nil)
120
148
  icon_path = get_xcodeproj_imessage_icon_path
121
149
  begin
122
- FileUtils.rm_rf(icon_path)
150
+ FileUtils.rm_rf(icon_path)
123
151
  FileUtils.mkdir_p(icon_path)
124
152
  rescue StandardError => e
125
153
  end
@@ -147,7 +175,7 @@ module Pindo
147
175
  launchimg_path = nil
148
176
  select_target = @project_obj.targets.select { |target| target.product_type.include?(Xcodeproj::Constants::PRODUCT_TYPE_UTI[:application]) }.first
149
177
  file_ref = select_target.resources_build_phase.files_references.select { |file| file.display_name.include?("Assets.xcassets") }.first
150
-
178
+
151
179
  assets_path = file_ref.real_path
152
180
  if File.exist?(File.join(assets_path, "LaunchImage.imageset"))
153
181
  launchimg_path = File.join(assets_path, "LaunchImage.imageset")
@@ -167,9 +195,9 @@ module Pindo
167
195
  end
168
196
 
169
197
  project_origin_launchimg = Dir.glob(File.join(xcodeproj_launchimg_path, "/*.png")).max_by {|f| File.mtime(f)}
170
-
198
+
171
199
  if project_origin_launchimg.nil? || !File.exist?(project_origin_launchimg)
172
- return
200
+ return
173
201
  end
174
202
 
175
203
  if File.exist?(project_origin_launchimg) && !File.exist?(launchimg_file)
@@ -177,7 +205,7 @@ module Pindo
177
205
  end
178
206
 
179
207
  begin
180
- FileUtils.rm_rf(xcodeproj_launchimg_path)
208
+ FileUtils.rm_rf(xcodeproj_launchimg_path)
181
209
  FileUtils.mkdir_p(xcodeproj_launchimg_path)
182
210
  rescue StandardError => e
183
211
  end
@@ -190,7 +218,7 @@ module Pindo
190
218
  File.open(File.join(xcodeproj_launchimg_path, "Contents.json"), "w") do |f|
191
219
  f.write(JSON.pretty_generate(launch_json))
192
220
  end
193
-
221
+
194
222
  end
195
223
 
196
224
  end
data/lib/pindo/version.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  module Pindo
2
2
 
3
- VERSION = "4.7.1"
3
+ VERSION = "4.7.2"
4
4
 
5
5
  class VersionCheck
6
6
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pindo
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.7.1
4
+ version: 4.7.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - wade
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-01-02 00:00:00.000000000 Z
11
+ date: 2024-01-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: claide
@@ -278,6 +278,7 @@ files:
278
278
  - lib/pindo/command/deploy/updateconfig.rb
279
279
  - lib/pindo/command/deploy/uploadipa.rb
280
280
  - lib/pindo/command/dev.rb
281
+ - lib/pindo/command/dev/applovin.rb
281
282
  - lib/pindo/command/dev/autobuild.rb
282
283
  - lib/pindo/command/dev/autoresign.rb
283
284
  - lib/pindo/command/dev/build.rb
@@ -287,7 +288,6 @@ files:
287
288
  - lib/pindo/command/dev/debug.rb
288
289
  - lib/pindo/command/dev/pgyercert.rb
289
290
  - lib/pindo/command/dev/pub.rb
290
- - lib/pindo/command/dev/renewcert.rb
291
291
  - lib/pindo/command/env.rb
292
292
  - lib/pindo/command/env/dreamstudio.rb
293
293
  - lib/pindo/command/env/quarkenv.rb
@@ -317,11 +317,11 @@ files:
317
317
  - lib/pindo/command/setup.rb
318
318
  - lib/pindo/command/upgrade.rb
319
319
  - lib/pindo/command/utils.rb
320
- - lib/pindo/command/utils/applovin.rb
321
320
  - lib/pindo/command/utils/boss.rb
322
321
  - lib/pindo/command/utils/clearcert.rb
323
322
  - lib/pindo/command/utils/device.rb
324
323
  - lib/pindo/command/utils/icon.rb
324
+ - lib/pindo/command/utils/renewcert.rb
325
325
  - lib/pindo/command/utils/renewproj.rb
326
326
  - lib/pindo/command/utils/tgate.rb
327
327
  - lib/pindo/command/utils/xcassets.rb
@@ -1,142 +0,0 @@
1
- require 'fileutils'
2
-
3
- module Pindo
4
- class Command
5
- class Dev < Command
6
- class Renewcert < Dev
7
-
8
- include Appselect
9
-
10
- self.summary = '更新证书下所有的Provisioning Profile文件'
11
-
12
- self.description = <<-DESC
13
- 如果不存在证书,会自动生成新证书,重新生成证书下所有Provisioning Profile文件. 添加新设备或者证书过期时使用, 一般情况请勿操作!!!
14
- 用法:pindo dev renewcert
15
- DESC
16
-
17
- self.arguments = [
18
-
19
- ]
20
-
21
- def self.options
22
- [
23
-
24
- ['--fast', '快速更新证书,开发用bundle id只更新dev证书,发布bundle id只更新adhoc证书'],
25
- ['--fixedid', '重新更新bundle id的功能,检查bundle id的功能是否更新'],
26
- ].concat(super)
27
- end
28
-
29
-
30
- def initialize(argv)
31
-
32
- @fast_flag = argv.flag?('fast', false)
33
- @fixedid_flag = argv.flag?('fixedid', false)
34
-
35
- super
36
-
37
- end
38
-
39
-
40
- def run
41
-
42
- auto_fixed_cert
43
-
44
- end
45
-
46
- def auto_fixed_cert
47
-
48
-
49
- @dev_bundle_id_array = all_dev_bundleid() + all_tool_bundleid()
50
- @deploy_bundle_id_array = all_release_bundleid()
51
- @all_bundle_id_array = all_itc_bundleid()
52
-
53
-
54
- fixed_bundleid = @fixedid_flag
55
-
56
-
57
- fixed_bundleid_array = @all_bundle_id_array
58
- puts fixed_bundleid_array
59
-
60
- fixed_bundleid_array.each do |bundle_id|
61
- begin
62
- fixed_cert(bundle_id:bundle_id, fixed_bundleid:@fixedid_flag)
63
- rescue => err
64
- puts
65
- puts
66
- puts "Fixed #{bundle_id} cert---------Error-------!!!"
67
- puts
68
- puts
69
- end
70
-
71
- end
72
-
73
- end
74
-
75
- def fixed_cert(bundle_id:nil, fixed_bundleid: )
76
- puts "#{bundle_id}"
77
-
78
- args_temp = []
79
- args_temp << "#{bundle_id}"
80
-
81
- Pindo::Command::Deploy::Pullconfig::run(args_temp)
82
-
83
- if fixed_bundleid
84
- Pindo::Command::Deploy::Bundleid::run([])
85
- end
86
-
87
- if @fast_flag
88
-
89
- if @dev_bundle_id_array.include?(bundle_id)
90
- args_temp = []
91
- args_temp << "--a=#{bundle_id}"
92
- args_temp << "--dev"
93
- args_temp << "--renew"
94
- Pindo::Command::Deploy::Cert::run(args_temp)
95
- end
96
-
97
- if @deploy_bundle_id_array.include?(bundle_id)
98
- args_temp = []
99
- args_temp << "--a=#{bundle_id}"
100
- args_temp << "--adhoc"
101
- args_temp << "--renew"
102
- Pindo::Command::Deploy::Cert::run(args_temp)
103
- end
104
-
105
- else
106
-
107
- # args_temp = []
108
- # args_temp << "--a=#{bundle_id}"
109
- # args_temp << "--dev"
110
- # args_temp << "--renew"
111
- # Pindo::Command::Deploy::Cert::run(args_temp)
112
-
113
- args_temp = []
114
- args_temp << "--a=#{bundle_id}"
115
- args_temp << "--adhoc"
116
- args_temp << "--renew"
117
- Pindo::Command::Deploy::Cert::run(args_temp)
118
- end
119
- end
120
-
121
-
122
- def fixed_push(bundle_id:nil, fixed_bundleid: false)
123
-
124
- Pindo::Command::Deploy::Pullconfig::run(args_temp)
125
-
126
- args_temp = []
127
- args_temp << "--a=#{bundle_id}"
128
- args_temp << "--dev"
129
- Pindo::Command::Deploy::Pem::run(args_temp)
130
-
131
- args_temp = []
132
- args_temp << "--a=#{bundle_id}"
133
- args_temp << "--adhoc"
134
- Pindo::Command::Deploy::Pem::run(args_temp)
135
-
136
- end
137
-
138
- end
139
- end
140
- end
141
- end
142
-