pindo 4.8.2 → 4.8.3
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2bf8d058f67c7ff8510ff7fd81a253bb1c5017ff9e7b6e4081e3b8e480157110
|
4
|
+
data.tar.gz: ce4d42bab74ac5284ea3c40376a4b819bbf14b3fefa9d0fcd318b82b4112b75e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7fe9c6a4869e27a3a2a1f3e2d2c91fe3ac350717b48c86c8835c0d617812cfc11734d00b1b52a16ad2672faa4043ee97f853f3acc6926eda30e3fd639cac29f5
|
7
|
+
data.tar.gz: aaa3eeb667284e47265ebacbad633494142e98879684b862f2e2ec5704cdeb7c775d1f51af5a3bd3ee35af0eedee6540bceb56cdc3d52c1af70fa6add4a21312
|
@@ -118,12 +118,22 @@ module Pindo
|
|
118
118
|
project_path = File.dirname(project_fullname)
|
119
119
|
proj_name = File.basename(project_fullname, ".xcodeproj")
|
120
120
|
project_obj = Xcodeproj::Project.open(project_fullname)
|
121
|
+
|
122
|
+
build_platform = project_obj.root_object.build_configuration_list.get_setting("SDKROOT")["Release"]
|
121
123
|
main_target = project_obj.targets.select { |target| target.product_type.include?(Xcodeproj::Constants::PRODUCT_TYPE_UTI[:application]) }.first
|
122
124
|
provisioning_profile_name = main_target.build_configurations.first.build_settings['PROVISIONING_PROFILE_SPECIFIER'].downcase.split(" ")
|
123
125
|
|
126
|
+
|
127
|
+
|
124
128
|
build_type = "app-store"
|
125
129
|
icloud_env = "Production"
|
126
|
-
if provisioning_profile_name.include?("
|
130
|
+
if provisioning_profile_name.include?("direct") && provisioning_profile_name.include?("macos")
|
131
|
+
build_type = "developer-id"
|
132
|
+
icloud_env = "Production"
|
133
|
+
elsif provisioning_profile_name.include?("development") && provisioning_profile_name.include?("macos")
|
134
|
+
build_type = "development"
|
135
|
+
icloud_env = "Development"
|
136
|
+
elsif provisioning_profile_name.include?("adhoc")
|
127
137
|
build_type = "ad-hoc"
|
128
138
|
icloud_env = "Development"
|
129
139
|
elsif provisioning_profile_name.include?("development")
|
@@ -134,6 +144,12 @@ module Pindo
|
|
134
144
|
icloud_env = "Production"
|
135
145
|
end
|
136
146
|
|
147
|
+
if build_type.eql?("app-store") || build_type.eql?("ad-hoc")
|
148
|
+
if File.exist?(File.join(project_path, "Unity/Data/Raw/SettingsPluginFlag.txt"))
|
149
|
+
raise Informative, "Unity代码包含测试模板,请重新导出Unity代码"
|
150
|
+
end
|
151
|
+
end
|
152
|
+
|
137
153
|
|
138
154
|
app_ipaname_temp = main_target.build_configurations.first.build_settings['INFOPLIST_KEY_CFBundleDisplayName'] || main_target.display_name
|
139
155
|
app_ipaname_temp = app_ipaname_temp.gsub(/ /, '');
|
@@ -150,6 +166,11 @@ module Pindo
|
|
150
166
|
}
|
151
167
|
|
152
168
|
|
169
|
+
if !build_platform.nil? && build_platform.eql?("macosx")
|
170
|
+
values[:output_name] = nil
|
171
|
+
values[:destination] = "generic/platform=macosx"
|
172
|
+
end
|
173
|
+
|
153
174
|
if File.exist?(File.join(project_path, "Podfile"))
|
154
175
|
values[:workspace] = "#{proj_name}.xcworkspace"
|
155
176
|
values[:project] = nil
|
@@ -78,7 +78,7 @@ module Pindo
|
|
78
78
|
begin
|
79
79
|
client = Spaceship::ConnectAPI
|
80
80
|
app_sharedsecrets_item = nil
|
81
|
-
response = client.tunes_request_client.get("apps/#{app_id}/appSharedSecrets")
|
81
|
+
response = client.tunes_request_client.get("#{Spaceship::ConnectAPI::Tunes::API::Version::V1}/apps/#{app_id}/appSharedSecrets")
|
82
82
|
# puts JSON.pretty_generate(response.body)
|
83
83
|
result_data = response.body
|
84
84
|
|
@@ -1128,6 +1128,7 @@ module Pindo
|
|
1128
1128
|
|
1129
1129
|
itc_usa_latest_price = nil
|
1130
1130
|
itc_usa_latest_start_date = nil
|
1131
|
+
itc_usa_latest_price_point_id = nil
|
1131
1132
|
need_modify_price = true
|
1132
1133
|
|
1133
1134
|
if subscription_item["state"].to_s.eql?("APPROVED")
|
@@ -1168,6 +1169,7 @@ module Pindo
|
|
1168
1169
|
include_item = respose_price[:included].last
|
1169
1170
|
if include_item[:type].to_s.eql?("subscriptionPricePoints")
|
1170
1171
|
itc_usa_latest_price = include_item[:attributes][:customer_price]
|
1172
|
+
itc_usa_latest_price_point_id = include_item[:id]
|
1171
1173
|
puts " 最新线上价格:" + itc_usa_latest_price +"$"
|
1172
1174
|
end
|
1173
1175
|
end
|
@@ -1280,10 +1282,10 @@ module Pindo
|
|
1280
1282
|
}
|
1281
1283
|
}
|
1282
1284
|
|
1283
|
-
price_change_relationships_data[:newSubscriptionPricePoints][:data] << {
|
1284
|
-
|
1285
|
-
|
1286
|
-
|
1285
|
+
# price_change_relationships_data[:newSubscriptionPricePoints][:data] << {
|
1286
|
+
# type:"subscriptionPricePoints",
|
1287
|
+
# id: price_point_id
|
1288
|
+
# }
|
1287
1289
|
|
1288
1290
|
index_num = index_num +1
|
1289
1291
|
|
@@ -1368,7 +1370,7 @@ module Pindo
|
|
1368
1370
|
|
1369
1371
|
if last_data_items.size > 0
|
1370
1372
|
last_data_items.each do |last_data_item|
|
1371
|
-
if last_data_item[:type].to_s.eql?("subscriptionPrices")
|
1373
|
+
if last_data_item[:type].to_s.eql?("subscriptionPrices") && !last_data_item[:relationships][:subscription_price_point][:data][:id].eql?(itc_usa_latest_price_point_id)
|
1372
1374
|
price_change_relationships_data[:currentSubscriptionPricePoints][:data] << {
|
1373
1375
|
type:"subscriptionPricePoints",
|
1374
1376
|
id: last_data_item[:relationships][:subscription_price_point][:data][:id]
|
@@ -1392,7 +1394,7 @@ module Pindo
|
|
1392
1394
|
|
1393
1395
|
begin
|
1394
1396
|
|
1395
|
-
respose_price = client.tunes_request_client.post("subscriptionPriceChangeConsentReasons", body)
|
1397
|
+
respose_price = client.tunes_request_client.post("#{Spaceship::ConnectAPI::Tunes::API::Version::V1}/subscriptionPriceChangeConsentReasons", body)
|
1396
1398
|
|
1397
1399
|
# puts JSON.pretty_generate(respose_price)
|
1398
1400
|
rescue => err
|
@@ -1418,7 +1420,7 @@ module Pindo
|
|
1418
1420
|
# puts "included_data.size: #{included_data.size}"
|
1419
1421
|
# puts JSON.pretty_generate(body)
|
1420
1422
|
|
1421
|
-
respose_price = client.tunes_request_client.patch("subscriptions/#{subscription_id}", body)
|
1423
|
+
respose_price = client.tunes_request_client.patch("#{Spaceship::ConnectAPI::Tunes::API::Version::V1}/subscriptions/#{subscription_id}", body)
|
1422
1424
|
# respose_price = appstore_client.update_subscription(
|
1423
1425
|
# id:subscription_id,
|
1424
1426
|
# relationships: relationships_data,
|
@@ -55,7 +55,7 @@ module Pindo
|
|
55
55
|
return array
|
56
56
|
|
57
57
|
end
|
58
|
-
|
58
|
+
|
59
59
|
|
60
60
|
def camel_case_lower(string: nil)
|
61
61
|
string.split('_').inject([]) { |buffer, e| buffer.push(buffer.empty? ? e : e.capitalize) }.join
|
@@ -75,7 +75,7 @@ module Pindo
|
|
75
75
|
return new_attributes
|
76
76
|
end
|
77
77
|
|
78
|
-
def fastlane_login(apple_id:nil)
|
78
|
+
def fastlane_login(apple_id:nil)
|
79
79
|
Spaceship::Tunes.login(apple_id.to_s)
|
80
80
|
Spaceship::Tunes.select_team
|
81
81
|
end
|
@@ -91,8 +91,8 @@ module Pindo
|
|
91
91
|
rescue => error
|
92
92
|
puts "更新 Version 失败 !!! ===============+++++++============= 失败 !!!失败 !!!"
|
93
93
|
puts error
|
94
|
-
end
|
95
|
-
|
94
|
+
end
|
95
|
+
|
96
96
|
|
97
97
|
app_edit_version_info = app.get_edit_app_store_version(platform: platform, includes: 'appStoreVersionSubmission,build,appStoreVersionPhasedRelease,appStoreVersionLocalizations')
|
98
98
|
app_live_version_info = app.get_live_app_store_version(platform: platform)
|
@@ -108,7 +108,7 @@ module Pindo
|
|
108
108
|
rescue => error
|
109
109
|
puts "更新App Version Localizations 失败 !!! ===============+++++++============= 失败 !!!失败 !!!"
|
110
110
|
puts error
|
111
|
-
end
|
111
|
+
end
|
112
112
|
end
|
113
113
|
|
114
114
|
|
@@ -121,7 +121,7 @@ module Pindo
|
|
121
121
|
rescue => error
|
122
122
|
puts "更新 Copy Right 失败 !!! ===============+++++++============= 失败 !!!失败 !!!"
|
123
123
|
puts error
|
124
|
-
end
|
124
|
+
end
|
125
125
|
end
|
126
126
|
|
127
127
|
if !app_itunes_json["app_edit_version_info"][platform]['release_type'].nil?
|
@@ -132,7 +132,7 @@ module Pindo
|
|
132
132
|
rescue => error
|
133
133
|
puts "更新 ReleaseType 失败 !!! ===============+++++++============= 失败 !!!失败 !!!"
|
134
134
|
puts error
|
135
|
-
end
|
135
|
+
end
|
136
136
|
end
|
137
137
|
|
138
138
|
if !app_itunes_json["app_edit_version_info"][platform]['app_review_info'].nil?
|
@@ -150,9 +150,9 @@ module Pindo
|
|
150
150
|
rescue => error
|
151
151
|
puts "更新 Review Info 失败 !!! ===============+++++++============= 失败 !!!失败 !!!"
|
152
152
|
puts error
|
153
|
-
end
|
153
|
+
end
|
154
154
|
end
|
155
|
-
|
155
|
+
|
156
156
|
|
157
157
|
end
|
158
158
|
|
@@ -169,10 +169,10 @@ module Pindo
|
|
169
169
|
rescue => error
|
170
170
|
puts "更新 app价格 失败 !!! ===============+++++++============= 失败 !!!失败 !!!"
|
171
171
|
puts error
|
172
|
-
end
|
172
|
+
end
|
173
|
+
|
173
174
|
|
174
175
|
|
175
|
-
|
176
176
|
if !app_itunes_json['content_rights_declaration'].nil?
|
177
177
|
begin
|
178
178
|
puts "\n\n更新 Third Content ..."
|
@@ -181,9 +181,9 @@ module Pindo
|
|
181
181
|
rescue => error
|
182
182
|
puts "更新 Third Content 失败 !!! ===============+++++++============= 失败 !!!失败 !!!"
|
183
183
|
puts error
|
184
|
-
end
|
184
|
+
end
|
185
185
|
end
|
186
|
-
|
186
|
+
|
187
187
|
if !app_itunes_json['primary_locale'].nil?
|
188
188
|
begin
|
189
189
|
puts "\n\n更新 Primary Language ..."
|
@@ -192,20 +192,20 @@ module Pindo
|
|
192
192
|
rescue => error
|
193
193
|
puts "更新 Primary Language 失败 !!! ===============+++++++============= 失败 !!!失败 !!!"
|
194
194
|
puts error
|
195
|
-
end
|
195
|
+
end
|
196
196
|
end
|
197
197
|
|
198
|
-
|
198
|
+
|
199
199
|
if !app_itunes_json['privacy_data'].nil?
|
200
200
|
# begin
|
201
201
|
puts "\n\n更新 Privacy Usage Data ..."
|
202
202
|
app_privacy_data = app_itunes_json['privacy_data']
|
203
203
|
update_privacy_useagedata(app: app, app_privacy_data:app_privacy_data)
|
204
|
-
|
204
|
+
|
205
205
|
# rescue => error
|
206
206
|
# puts "更新 Privacy Usage Data 失败 !!! ===============+++++++============= 失败 !!!失败 !!!"
|
207
207
|
# puts error
|
208
|
-
# end
|
208
|
+
# end
|
209
209
|
end
|
210
210
|
|
211
211
|
|
@@ -213,10 +213,10 @@ module Pindo
|
|
213
213
|
|
214
214
|
|
215
215
|
def fastlane_update_app_info_metadata(app: nil, app_itunes_json:nil)
|
216
|
-
|
216
|
+
|
217
217
|
|
218
218
|
app_info = app.fetch_edit_app_info
|
219
|
-
|
219
|
+
|
220
220
|
begin
|
221
221
|
puts "\n\n更新 Category ..."
|
222
222
|
update_app_categories(app_info:app_info, app_info_data:app_itunes_json["app_info"])
|
@@ -224,7 +224,7 @@ module Pindo
|
|
224
224
|
rescue => error
|
225
225
|
puts "更新 Category 失败 !!! ===============+++++++============= 失败 !!!失败 !!!"
|
226
226
|
puts error
|
227
|
-
end
|
227
|
+
end
|
228
228
|
|
229
229
|
if !app_age_rating_attributes = app_itunes_json["app_info"]["app_age_rating"].nil?
|
230
230
|
begin
|
@@ -235,7 +235,7 @@ module Pindo
|
|
235
235
|
rescue => error
|
236
236
|
puts "更新 Age Rating 失败 !!! ===============+++++++============= 失败 !!!失败 !!!"
|
237
237
|
puts error
|
238
|
-
end
|
238
|
+
end
|
239
239
|
end
|
240
240
|
|
241
241
|
end
|
@@ -244,11 +244,11 @@ module Pindo
|
|
244
244
|
def fastlane_update_app_info_localizations(app: nil, app_itunes_json:nil)
|
245
245
|
|
246
246
|
app_info = app.fetch_edit_app_info
|
247
|
-
|
247
|
+
|
248
248
|
sleep(3)
|
249
|
-
|
249
|
+
|
250
250
|
begin
|
251
|
-
puts
|
251
|
+
puts
|
252
252
|
puts "更新 App Info Localizations..."
|
253
253
|
app_info_localization_attributes = app_itunes_json['app_info']["app_info_localization"]
|
254
254
|
app_info_localizations = verify_app_info_localizations(app_info:app_info, app_info_localization_attributes:app_info_localization_attributes)
|
@@ -258,7 +258,7 @@ module Pindo
|
|
258
258
|
rescue => error
|
259
259
|
puts "更新App Info Localizations 失败 !!! ===============+++++++============= 失败 !!!失败 !!!"
|
260
260
|
puts error
|
261
|
-
end
|
261
|
+
end
|
262
262
|
|
263
263
|
|
264
264
|
end
|
@@ -268,27 +268,27 @@ module Pindo
|
|
268
268
|
|
269
269
|
def update_privacy_useagedata(app: nil, app_privacy_data:nil)
|
270
270
|
all_usages = Spaceship::ConnectAPI::AppDataUsage.all(app_id: app.id, includes: "category,grouping,purpose,dataProtection", limit: 500)
|
271
|
-
|
271
|
+
|
272
272
|
begin
|
273
273
|
all_usages.each(&:delete!)
|
274
274
|
rescue => error
|
275
|
-
|
276
|
-
end
|
275
|
+
|
276
|
+
end
|
277
277
|
|
278
278
|
# old_usages_config = {}
|
279
|
-
# if !all_usages.nil? && all_usages.size > 0
|
279
|
+
# if !all_usages.nil? && all_usages.size > 0
|
280
280
|
# all_usages.each do |privacy_usage|
|
281
|
-
# if !privacy_usage.category.nil?
|
281
|
+
# if !privacy_usage.category.nil?
|
282
282
|
# category= privacy_usage.category.id
|
283
283
|
# all_usages_config[category] = all_usages_config[category] || {}
|
284
284
|
# all_usages_config[category]["category"] = category
|
285
|
-
# if !privacy_usage.purpose.nil?
|
286
|
-
# all_usages_config[category]["purposes"] = all_usages_config[category]["purposes"] || []
|
285
|
+
# if !privacy_usage.purpose.nil?
|
286
|
+
# all_usages_config[category]["purposes"] = all_usages_config[category]["purposes"] || []
|
287
287
|
# all_usages_config[category]["purposes"] << privacy_usage.purpose.id
|
288
288
|
|
289
289
|
# end
|
290
290
|
# if !privacy_usage.data_protection.nil?
|
291
|
-
# all_usages_config[category]["data_protections"] = all_usages_config[category]["data_protections"] || []
|
291
|
+
# all_usages_config[category]["data_protections"] = all_usages_config[category]["data_protections"] || []
|
292
292
|
# all_usages_config[category]["data_protections"] << privacy_usage.data_protection.id
|
293
293
|
# end
|
294
294
|
# end
|
@@ -309,7 +309,7 @@ module Pindo
|
|
309
309
|
publish_state.publish!
|
310
310
|
rescue => error
|
311
311
|
puts error
|
312
|
-
end
|
312
|
+
end
|
313
313
|
|
314
314
|
|
315
315
|
app_privacy_data.each do |usage_config|
|
@@ -328,23 +328,23 @@ module Pindo
|
|
328
328
|
app_data_usage_purpose_id: purpose
|
329
329
|
)
|
330
330
|
rescue => error
|
331
|
-
|
332
|
-
end
|
331
|
+
|
332
|
+
end
|
333
333
|
|
334
334
|
|
335
335
|
end
|
336
336
|
end
|
337
337
|
end
|
338
|
-
|
339
338
|
|
340
339
|
|
341
|
-
|
342
|
-
|
340
|
+
|
341
|
+
begin
|
342
|
+
|
343
343
|
publish_state = Spaceship::ConnectAPI::AppDataUsagesPublishState.get(app_id: app.id)
|
344
344
|
publish_state.publish!
|
345
345
|
rescue => error
|
346
346
|
puts error
|
347
|
-
end
|
347
|
+
end
|
348
348
|
|
349
349
|
|
350
350
|
end
|
@@ -352,30 +352,30 @@ module Pindo
|
|
352
352
|
|
353
353
|
def update_app_categories(app_info:nil, app_info_data:nil)
|
354
354
|
|
355
|
-
|
355
|
+
|
356
356
|
if !app_info_data.nil?
|
357
357
|
category_id_map = {}
|
358
358
|
|
359
359
|
if !app_info_data["primary_category"].nil?
|
360
|
-
category_id_map[:primary_category_id] = app_info_data["primary_category"]
|
360
|
+
category_id_map[:primary_category_id] = app_info_data["primary_category"]
|
361
361
|
|
362
362
|
if app_info_data["primary_category"].eql?("STICKERS") || app_info_data["primary_category"].eql?("GAMES")
|
363
363
|
category_id_map[:primary_subcategory_one_id] = app_info_data["primary_subcategory_one"]
|
364
|
-
category_id_map[:primary_subcategory_two_id] = app_info_data["primary_subcategory_two"]
|
364
|
+
category_id_map[:primary_subcategory_two_id] = app_info_data["primary_subcategory_two"]
|
365
365
|
|
366
366
|
else
|
367
367
|
category_id_map[:primary_subcategory_one_id] = nil
|
368
368
|
category_id_map[:primary_subcategory_two_id] = nil
|
369
|
-
end
|
369
|
+
end
|
370
370
|
end
|
371
|
-
|
371
|
+
|
372
372
|
|
373
373
|
|
374
374
|
if !app_info_data["secondary_category"].nil? && !app_info_data["primary_category"].eql?("STICKERS") && !app_info_data["primary_category"].eql?("GAMES")
|
375
|
-
category_id_map[:secondary_category_id] = app_info_data["secondary_category"]
|
375
|
+
category_id_map[:secondary_category_id] = app_info_data["secondary_category"]
|
376
376
|
if app_info_data["secondary_category"].eql?("STICKERS") || app_info_data["secondary_category"].eql?("GAMES")
|
377
|
-
category_id_map[:secondary_subcategory_one_id] = app_info_data["secondary_subcategory_one"]
|
378
|
-
category_id_map[:secondary_subcategory_two_id] = app_info_data["secondary_subcategory_two"]
|
377
|
+
category_id_map[:secondary_subcategory_one_id] = app_info_data["secondary_subcategory_one"]
|
378
|
+
category_id_map[:secondary_subcategory_two_id] = app_info_data["secondary_subcategory_two"]
|
379
379
|
else
|
380
380
|
category_id_map[:secondary_subcategory_one_id] = nil
|
381
381
|
category_id_map[:secondary_subcategory_two_id] = nil
|
@@ -403,9 +403,9 @@ module Pindo
|
|
403
403
|
attributes_key = camel_case_lower(string:key)
|
404
404
|
age_rate_attributes[attributes_key] = value
|
405
405
|
end
|
406
|
-
|
406
|
+
|
407
407
|
declaration.update(attributes: age_rate_attributes)
|
408
|
-
|
408
|
+
|
409
409
|
end
|
410
410
|
|
411
411
|
def verify_app_info_localizations(app_info:nil, app_info_localization_attributes:nil)
|
@@ -454,7 +454,7 @@ module Pindo
|
|
454
454
|
end
|
455
455
|
app_info_worker.batch_enqueue(app_info_localizations)
|
456
456
|
app_info_worker.start
|
457
|
-
|
457
|
+
|
458
458
|
end
|
459
459
|
|
460
460
|
|
@@ -472,7 +472,7 @@ module Pindo
|
|
472
472
|
locales_to_enable = languages - localizations.map(&:locale)
|
473
473
|
|
474
474
|
if locales_to_enable.count > 0
|
475
|
-
|
475
|
+
|
476
476
|
puts " 创建多语言 #{locales_to_enable.join(', ')}..."
|
477
477
|
|
478
478
|
locales_to_enable.each do |locale|
|
@@ -493,11 +493,11 @@ module Pindo
|
|
493
493
|
# Update app store version localizations
|
494
494
|
store_version_worker = FastlaneCore::QueueWorker.new do |app_store_version_localization|
|
495
495
|
attributes = version_info_localization_attributes[app_store_version_localization.locale]
|
496
|
-
|
496
|
+
|
497
497
|
if attributes
|
498
498
|
puts "Uploading app version info localized '#{app_store_version_localization.locale}'"
|
499
499
|
attributes = check_attributes(attributes:attributes)
|
500
|
-
if app_live_version_info.nil?
|
500
|
+
if app_live_version_info.nil?
|
501
501
|
attributes.delete("whats_new")
|
502
502
|
end
|
503
503
|
app_store_version_localization.update(attributes: attributes)
|
@@ -525,9 +525,46 @@ module Pindo
|
|
525
525
|
|
526
526
|
def fastlane_process_lang_screenshots(lang_screenshots_path:nil)
|
527
527
|
|
528
|
-
# puts "正在处理目录:#{lang_screenshots_path}"
|
529
528
|
valid_file_extensions = ['png', 'PNG', 'jpg', 'JPG', 'jpeg', 'JPEG']
|
530
529
|
|
530
|
+
|
531
|
+
#检查是否区分iPad 2和iPad Pro
|
532
|
+
ipad_dir_array= []
|
533
|
+
all_device_size = Deliver::AppScreenshot.devices
|
534
|
+
Dir.glob(File.join(lang_screenshots_path, "*")).each do |image_dir_path|
|
535
|
+
image_dir_basename = File.basename(image_dir_path)
|
536
|
+
# puts "image_dir_basename:#{image_dir_basename}"
|
537
|
+
if File.directory?(image_dir_path) && ![".", ".."].include?(image_dir_basename)
|
538
|
+
valide_pic_num = 0
|
539
|
+
Dir.foreach(image_dir_path) do |file|
|
540
|
+
image_full_name = File.join(image_dir_path, file)
|
541
|
+
extname = File.extname(image_full_name).delete('.')
|
542
|
+
if valid_file_extensions.include?(extname)
|
543
|
+
img_size = FastImage.size(image_full_name)
|
544
|
+
if all_device_size[Deliver::AppScreenshot::ScreenSize::IOS_IPAD_PRO].include?(img_size)
|
545
|
+
valide_pic_num = valide_pic_num + 1
|
546
|
+
end
|
547
|
+
|
548
|
+
if valide_pic_num >=1
|
549
|
+
ipad_dir_array << image_dir_basename.to_s.downcase
|
550
|
+
break;
|
551
|
+
end
|
552
|
+
end
|
553
|
+
end
|
554
|
+
|
555
|
+
|
556
|
+
end
|
557
|
+
end
|
558
|
+
if ipad_dir_array.include?("ipadpro3") || ipad_dir_array.include?("ipadpro129") || ipad_dir_array.include?("ipad_6gen")
|
559
|
+
# puts "找到ipad pro 3截屏"
|
560
|
+
else
|
561
|
+
puts lang_screenshots_path
|
562
|
+
raise Informative, "iPad 3代截屏没有iPad 2代截屏区分开,请修改iPad截屏目录, iPad 3代截屏目录修改为: ipadpro129"
|
563
|
+
end
|
564
|
+
|
565
|
+
|
566
|
+
|
567
|
+
|
531
568
|
Dir.glob(File.join(lang_screenshots_path, "*")).each do |image_dir_path|
|
532
569
|
image_dir_basename = File.basename(image_dir_path)
|
533
570
|
# puts "处理目录:#{image_dir_path}"
|
@@ -535,7 +572,7 @@ module Pindo
|
|
535
572
|
if File.directory?(image_dir_path) && ![".", ".."].include?(image_dir_basename)
|
536
573
|
Dir.foreach(image_dir_path) do |file|
|
537
574
|
|
538
|
-
image_full_name = File.join(image_dir_path, file)
|
575
|
+
image_full_name = File.join(image_dir_path, file)
|
539
576
|
extname = File.extname(image_full_name).delete('.')
|
540
577
|
extension = File.extname(image_full_name)
|
541
578
|
base_name = File.basename(image_full_name, extension)
|
@@ -549,7 +586,7 @@ module Pindo
|
|
549
586
|
img_size = FastImage.size(image_full_name)
|
550
587
|
|
551
588
|
|
552
|
-
if lang_screenshots_path.include?("/iMessage/") || lang_screenshots_path.include?("/imessage/") || lang_screenshots_path.include?("/IMESSAGE/")
|
589
|
+
if lang_screenshots_path.include?("/iMessage/") || lang_screenshots_path.include?("/imessage/") || lang_screenshots_path.include?("/IMESSAGE/")
|
553
590
|
|
554
591
|
all_device_size = Deliver::AppScreenshot.device_messages
|
555
592
|
# puts all_message_device_size
|
@@ -563,9 +600,9 @@ module Pindo
|
|
563
600
|
elsif all_device_size[Deliver::AppScreenshot::ScreenSize::IOS_67_MESSAGES].include?(img_size)
|
564
601
|
dest_name = File.join(lang_screenshots_path, display_type_dir_name["IMESSAGE_APP_IPHONE_67"] + new_base_name)
|
565
602
|
elsif all_device_size[Deliver::AppScreenshot::ScreenSize::IOS_65_MESSAGES].include?(img_size)
|
566
|
-
dest_name = File.join(lang_screenshots_path, display_type_dir_name["IMESSAGE_APP_IPHONE_65"] + new_base_name)
|
603
|
+
dest_name = File.join(lang_screenshots_path, display_type_dir_name["IMESSAGE_APP_IPHONE_65"] + new_base_name)
|
567
604
|
elsif all_device_size[Deliver::AppScreenshot::ScreenSize::IOS_55_MESSAGES].include?(img_size)
|
568
|
-
dest_name = File.join(lang_screenshots_path, display_type_dir_name["IMESSAGE_APP_IPHONE_55"] + new_base_name)
|
605
|
+
dest_name = File.join(lang_screenshots_path, display_type_dir_name["IMESSAGE_APP_IPHONE_55"] + new_base_name)
|
569
606
|
end
|
570
607
|
|
571
608
|
else
|
@@ -580,32 +617,32 @@ module Pindo
|
|
580
617
|
elsif all_device_size[Deliver::AppScreenshot::ScreenSize::IOS_67].include?(img_size)
|
581
618
|
dest_name = File.join(lang_screenshots_path, display_type_dir_name["APP_IPHONE_67"] + new_base_name)
|
582
619
|
elsif all_device_size[Deliver::AppScreenshot::ScreenSize::IOS_65].include?(img_size)
|
583
|
-
dest_name = File.join(lang_screenshots_path, display_type_dir_name["APP_IPHONE_65"] + new_base_name)
|
620
|
+
dest_name = File.join(lang_screenshots_path, display_type_dir_name["APP_IPHONE_65"] + new_base_name)
|
584
621
|
elsif all_device_size[Deliver::AppScreenshot::ScreenSize::IOS_55].include?(img_size)
|
585
|
-
dest_name = File.join(lang_screenshots_path, display_type_dir_name["APP_IPHONE_55"] + new_base_name)
|
622
|
+
dest_name = File.join(lang_screenshots_path, display_type_dir_name["APP_IPHONE_55"] + new_base_name)
|
586
623
|
end
|
587
624
|
end
|
588
|
-
|
589
|
-
# if (img_size[0] == 1290 && img_size[1] == 2796) || (img_size[0] == 2796 && img_size[1] == 1290)
|
625
|
+
|
626
|
+
# if (img_size[0] == 1290 && img_size[1] == 2796) || (img_size[0] == 2796 && img_size[1] == 1290)
|
590
627
|
# dest_name = File.join(lang_screenshots_path, display_type_dir_name["APP_IPHONE_67"] + new_base_name)
|
591
|
-
# end
|
592
|
-
# if (img_size[0] == 1242 && img_size[1] == 2688) || (img_size[0] == 2688 && img_size[1] == 1242) || (img_size[0] == 1284 && img_size[1] == 2778) || (img_size[0] == 2778 && img_size[1] == 1284)
|
593
|
-
# dest_name = File.join(lang_screenshots_path, display_type_dir_name["APP_IPHONE_65"] + new_base_name)
|
628
|
+
# end
|
629
|
+
# if (img_size[0] == 1242 && img_size[1] == 2688) || (img_size[0] == 2688 && img_size[1] == 1242) || (img_size[0] == 1284 && img_size[1] == 2778) || (img_size[0] == 2778 && img_size[1] == 1284)
|
630
|
+
# dest_name = File.join(lang_screenshots_path, display_type_dir_name["APP_IPHONE_65"] + new_base_name)
|
594
631
|
# end
|
595
632
|
|
596
633
|
# if (img_size[0] == 1242 && img_size[1] == 2208) || (img_size[0] == 2208 && img_size[1] == 1242)
|
597
|
-
# dest_name = File.join(lang_screenshots_path, display_type_dir_name["APP_IPHONE_55"] + new_base_name)
|
634
|
+
# dest_name = File.join(lang_screenshots_path, display_type_dir_name["APP_IPHONE_55"] + new_base_name)
|
598
635
|
# end
|
599
|
-
|
636
|
+
|
600
637
|
FileUtils.mv(image_full_name, dest_name, force:true)
|
601
638
|
end
|
602
|
-
|
603
|
-
end
|
639
|
+
|
640
|
+
end
|
604
641
|
|
605
642
|
FileUtils.rm_rf(image_dir_path)
|
606
643
|
end
|
607
644
|
|
608
|
-
end
|
645
|
+
end
|
609
646
|
|
610
647
|
|
611
648
|
|
@@ -616,41 +653,41 @@ module Pindo
|
|
616
653
|
|
617
654
|
|
618
655
|
def fastlane_download_app_info(app: nil, app_itunes_json:nil, app_itunes_dir:nil)
|
619
|
-
|
656
|
+
|
620
657
|
|
621
658
|
app_info = app.fetch_edit_app_info || app.fetch_live_app_info
|
622
659
|
|
623
|
-
if app_info.primary_category.nil?
|
660
|
+
if app_info.primary_category.nil?
|
624
661
|
app_itunes_json["app_info"]["primary_category"] = app_info.primary_category
|
625
662
|
else
|
626
663
|
app_itunes_json["app_info"]["primary_category"] = app_info.primary_category.id
|
627
664
|
end
|
628
665
|
|
629
|
-
if app_info.primary_subcategory_one.nil?
|
666
|
+
if app_info.primary_subcategory_one.nil?
|
630
667
|
app_itunes_json["app_info"]["primary_subcategory_one"] = app_info.primary_subcategory_one
|
631
668
|
else
|
632
669
|
app_itunes_json["app_info"]["primary_subcategory_one"] = app_info.primary_subcategory_one.id
|
633
670
|
end
|
634
671
|
|
635
|
-
if app_info.primary_subcategory_two.nil?
|
672
|
+
if app_info.primary_subcategory_two.nil?
|
636
673
|
app_itunes_json["app_info"]["primary_subcategory_two"] = app_info.primary_subcategory_two
|
637
674
|
else
|
638
675
|
app_itunes_json["app_info"]["primary_subcategory_two"] = app_info.primary_subcategory_two.id
|
639
676
|
end
|
640
677
|
|
641
|
-
if app_info.secondary_category.nil?
|
678
|
+
if app_info.secondary_category.nil?
|
642
679
|
app_itunes_json["app_info"]["secondary_category"] = app_info.secondary_category
|
643
680
|
else
|
644
681
|
app_itunes_json["app_info"]["secondary_category"] = app_info.secondary_category.id
|
645
682
|
end
|
646
683
|
|
647
|
-
if app_info.secondary_subcategory_one.nil?
|
684
|
+
if app_info.secondary_subcategory_one.nil?
|
648
685
|
app_itunes_json["app_info"]["secondary_subcategory_one"] = app_info.secondary_subcategory_one
|
649
686
|
else
|
650
687
|
app_itunes_json["app_info"]["secondary_subcategory_one"] = app_info.secondary_subcategory_one.id
|
651
688
|
end
|
652
689
|
|
653
|
-
if app_info.secondary_subcategory_two.nil?
|
690
|
+
if app_info.secondary_subcategory_two.nil?
|
654
691
|
app_itunes_json["app_info"]["secondary_subcategory_two"] = app_info.secondary_subcategory_two
|
655
692
|
else
|
656
693
|
app_itunes_json["app_info"]["secondary_subcategory_two"] = app_info.secondary_subcategory_two.id
|
@@ -679,19 +716,19 @@ module Pindo
|
|
679
716
|
end
|
680
717
|
|
681
718
|
|
682
|
-
|
683
719
|
|
684
720
|
|
685
721
|
|
686
722
|
|
687
723
|
|
688
724
|
|
689
|
-
|
725
|
+
|
726
|
+
|
690
727
|
|
691
728
|
|
692
729
|
|
693
730
|
app_info_localizations = app_info.get_app_info_localizations
|
694
|
-
|
731
|
+
|
695
732
|
if !app_info_localizations.nil?
|
696
733
|
|
697
734
|
locales_to_disable = all_languages - app_info_localizations.map(&:locale)
|
@@ -726,14 +763,14 @@ module Pindo
|
|
726
763
|
if !File.exist?(metadata_platform_path)
|
727
764
|
FileUtils.mkdir_p(metadata_platform_path)
|
728
765
|
end
|
729
|
-
app_itunes_json["app_edit_version_info"][platform] = {}
|
766
|
+
app_itunes_json["app_edit_version_info"][platform] = {}
|
730
767
|
app_itunes_json["app_edit_version_info"][platform]["app_review_info"] = {}
|
731
|
-
|
768
|
+
|
732
769
|
app_itunes_json["app_edit_version_info"][platform]["version_string"] = app_version_info.version_string.nil? ? "" : app_version_info.version_string
|
733
770
|
app_itunes_json["app_edit_version_info"][platform]["copyright"] = app_version_info.copyright.nil? ? "" : app_version_info.copyright
|
734
771
|
app_itunes_json["app_edit_version_info"][platform]["release_type"] = app_version_info.release_type.nil? ? "" : app_version_info.release_type
|
735
772
|
|
736
|
-
|
773
|
+
|
737
774
|
|
738
775
|
app_store_review_data = app_itunes_json["app_edit_version_info"][platform]["app_review_info"]
|
739
776
|
app_store_review_detail = begin
|
@@ -797,7 +834,7 @@ module Pindo
|
|
797
834
|
app_itunes_json["app_edit_version_info"][platform]["app_version_info_localization"][lang] = app_itunes_json["app_edit_version_info"][platform]["app_version_info_localization"][lang] || {}
|
798
835
|
|
799
836
|
localization_data = app_itunes_json["app_edit_version_info"][platform]["app_version_info_localization"][lang]
|
800
|
-
|
837
|
+
|
801
838
|
|
802
839
|
localization_data["description"] = app_version_info_localization.description
|
803
840
|
localization_data["keywords"] = app_version_info_localization.keywords
|
@@ -817,7 +854,7 @@ module Pindo
|
|
817
854
|
# app_itunes_json["app_edit_version_info"][platform]["app_version_screenshots"][app_version_info_localization.locale] = app_itunes_json["app_edit_version_info"][platform]["app_version_screenshots"][app_version_info_localization.locale] || []
|
818
855
|
# app_itunes_json["app_edit_version_info"][platform]["app_version_previews"][app_version_info_localization.locale] = app_itunes_json["app_edit_version_info"][platform]["app_version_previews"][app_version_info_localization.locale] || []
|
819
856
|
end
|
820
|
-
|
857
|
+
|
821
858
|
end
|
822
859
|
|
823
860
|
end
|
@@ -840,7 +877,7 @@ module Pindo
|
|
840
877
|
rescue
|
841
878
|
# if it's already there
|
842
879
|
end
|
843
|
-
|
880
|
+
|
844
881
|
|
845
882
|
app_version_info_localizations = app_version_info.get_app_store_version_localizations
|
846
883
|
|
@@ -877,7 +914,7 @@ module Pindo
|
|
877
914
|
rescue
|
878
915
|
# if it's already there
|
879
916
|
end
|
880
|
-
|
917
|
+
|
881
918
|
puts "======== #{screenshot_set.screenshot_display_type}"
|
882
919
|
dir_name = display_type_dir_name[screenshot_set.screenshot_display_type]
|
883
920
|
|
@@ -898,7 +935,7 @@ module Pindo
|
|
898
935
|
|
899
936
|
|
900
937
|
path = File.join(containing_folder, file_name)
|
901
|
-
download_screenshots_exe(file_name:path, url:url, over_write:over_write)
|
938
|
+
download_screenshots_exe(file_name:path, url:url, over_write:over_write)
|
902
939
|
end
|
903
940
|
end
|
904
941
|
end
|
@@ -907,16 +944,72 @@ module Pindo
|
|
907
944
|
|
908
945
|
if !over_write && File.exist?(file_name)
|
909
946
|
puts " Existing screenshot #{file_name}"
|
910
|
-
return
|
947
|
+
return
|
911
948
|
end
|
912
949
|
|
913
950
|
puts "Downloading existing screenshot #{file_name}"
|
914
951
|
|
915
|
-
File.binwrite(file_name,
|
916
|
-
|
952
|
+
File.binwrite(file_name, URI.open(url).read)
|
953
|
+
# File.binwrite(file_name, FastlaneCore::Helper.open_uri(url).read)
|
954
|
+
|
917
955
|
end
|
918
956
|
|
919
957
|
|
958
|
+
|
959
|
+
def change_img_sort(lang_screenshots_path:nil)
|
960
|
+
|
961
|
+
new_sort_index = [0,1, 2, 8, 9, 7, 3, 4, 5, 6]
|
962
|
+
|
963
|
+
bacK_lang_screenshots_path = lang_screenshots_path + "_bak"
|
964
|
+
FileUtils.rm_rf(bacK_lang_screenshots_path) if Dir.exist?(bacK_lang_screenshots_path)
|
965
|
+
FileUtils.mv(lang_screenshots_path, bacK_lang_screenshots_path, force:true)
|
966
|
+
|
967
|
+
all_lang_file_obj = {}
|
968
|
+
Dir.glob(File.join(bacK_lang_screenshots_path, "*")).each do |bak_image_full_name|
|
969
|
+
image_dir_basename = File.basename(bak_image_full_name)
|
970
|
+
extname = File.extname(bak_image_full_name).delete('.')
|
971
|
+
# puts "bak_image_full_name:#{bak_image_full_name}"
|
972
|
+
if File.file?(bak_image_full_name) && valid_file_extensions.include?(extname)
|
973
|
+
# puts "bak_image_full_name:#{bak_image_full_name}"
|
974
|
+
extension = File.extname(bak_image_full_name)
|
975
|
+
base_name = File.basename(bak_image_full_name, extension)
|
976
|
+
deveice_name = base_name.slice(0...-3)
|
977
|
+
# puts "deveice_name:#{deveice_name}"
|
978
|
+
all_lang_file_obj[deveice_name] = all_lang_file_obj[deveice_name] || []
|
979
|
+
all_lang_file_obj[deveice_name].push(bak_image_full_name)
|
980
|
+
|
981
|
+
end
|
982
|
+
end
|
983
|
+
|
984
|
+
# puts JSON.pretty_generate(all_lang_file_obj)
|
985
|
+
|
986
|
+
FileUtils.mkdir_p(lang_screenshots_path)
|
987
|
+
all_lang_file_obj.each do |deveice_name, bak_file_array|
|
988
|
+
|
989
|
+
for i in 0..new_sort_index.length-1 do
|
990
|
+
old_index = new_sort_index[i]
|
991
|
+
if bak_file_array.size > old_index
|
992
|
+
src_imag_file_name = bak_file_array[old_index]
|
993
|
+
extension = File.extname(src_imag_file_name)
|
994
|
+
new_name = i.to_s
|
995
|
+
if new_name.to_s.size < 2
|
996
|
+
new_name = "0" + new_name
|
997
|
+
end
|
998
|
+
|
999
|
+
new_des_file_name = File.join(lang_screenshots_path, deveice_name + "_" + new_name + extension)
|
1000
|
+
puts new_des_file_name
|
1001
|
+
FileUtils.mv(src_imag_file_name, new_des_file_name, force:true)
|
1002
|
+
end
|
1003
|
+
end
|
1004
|
+
end
|
1005
|
+
|
1006
|
+
FileUtils.rm_rf(bacK_lang_screenshots_path) if Dir.exist?(bacK_lang_screenshots_path)
|
1007
|
+
|
1008
|
+
|
1009
|
+
end
|
1010
|
+
|
1011
|
+
|
1012
|
+
|
920
1013
|
end
|
921
1014
|
|
922
1015
|
end
|
data/lib/pindo/version.rb
CHANGED
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.8.
|
4
|
+
version: 4.8.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- wade
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-08-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: claide
|
@@ -365,7 +365,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
365
365
|
- !ruby/object:Gem::Version
|
366
366
|
version: '0'
|
367
367
|
requirements: []
|
368
|
-
rubygems_version: 3.
|
368
|
+
rubygems_version: 3.5.11
|
369
369
|
signing_key:
|
370
370
|
specification_version: 3
|
371
371
|
summary: easy work
|