pindo 5.10.6 → 5.10.8
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.
- checksums.yaml +4 -4
- data/lib/pindo/base/funlog.rb +12 -1
- data/lib/pindo/base/pindocontext.rb +3 -0
- data/lib/pindo/command/android/autobuild.rb +62 -9
- data/lib/pindo/command/android/build.rb +6 -6
- data/lib/pindo/command/android/debug.rb +9 -9
- data/lib/pindo/command/deploy/build.rb +2 -4
- data/lib/pindo/command/deploy/cert.rb +4 -5
- data/lib/pindo/command/deploy/configproj.rb +3 -3
- data/lib/pindo/command/deploy/confusecode.rb +1 -1
- data/lib/pindo/command/deploy/confuseproj.rb +1 -1
- data/lib/pindo/command/deploy/pem.rb +3 -4
- data/lib/pindo/command/dev/autobuild.rb +1 -1
- data/lib/pindo/command/dev/build.rb +1 -1
- data/lib/pindo/command/dev/feishu.rb +1 -1
- data/lib/pindo/command/gplay/pullconfig.rb +48 -0
- data/lib/pindo/command/gplay.rb +6 -5
- data/lib/pindo/command/ios/adhoc.rb +6 -5
- data/lib/pindo/command/ios/autobuild.rb +24 -24
- data/lib/pindo/command/ios/build.rb +7 -6
- data/lib/pindo/command/ios/debug.rb +1 -0
- data/lib/pindo/command/ipa/import.rb +2 -3
- data/lib/pindo/command/ipa/output.rb +2 -3
- data/lib/pindo/command/jps/upload.rb +6 -5
- data/lib/pindo/command/unity/apk.rb +19 -2
- data/lib/pindo/command/unity/autobuild.rb +58 -63
- data/lib/pindo/command/unity/initpack.rb +1 -1
- data/lib/pindo/command/unity/ipa.rb +17 -14
- data/lib/pindo/command/unity/pack.rb +1 -1
- data/lib/pindo/command/unity/upload.rb +1 -1
- data/lib/pindo/command/unity/web.rb +2 -2
- data/lib/pindo/command/utils/icon.rb +1 -1
- data/lib/pindo/command/utils/renewcert.rb +1 -2
- data/lib/pindo/command/utils/renewproj.rb +9 -10
- data/lib/pindo/command/web/autobuild.rb +2 -2
- data/lib/pindo/command/web/run.rb +1 -1
- data/lib/pindo/command.rb +2 -1
- data/lib/pindo/module/android/android_build_config_helper.rb +267 -35
- data/lib/pindo/module/android/android_build_helper.rb +300 -0
- data/lib/pindo/module/android/android_project_helper.rb +279 -0
- data/lib/pindo/module/android/gp_compliance_helper.rb +33 -87
- data/lib/pindo/module/android/gradle_helper.rb +524 -255
- data/lib/pindo/module/android/java_env_helper.rb +633 -0
- data/lib/pindo/module/android/keystore_helper.rb +1118 -0
- data/lib/pindo/module/appselect.rb +109 -0
- data/lib/pindo/module/appstore/appstore_in_app_purchase.rb +1 -1
- data/lib/pindo/module/build/{buildhelper.rb → build_helper.rb} +1 -2
- data/lib/pindo/module/build/{commonconfuseproj.rb → confuse_xcodeproj.rb} +2 -2
- data/lib/pindo/module/cert/cert_helper.rb +245 -0
- data/lib/pindo/module/cert/keychain_helper.rb +152 -0
- data/lib/pindo/module/cert/pem_helper.rb +67 -0
- data/lib/pindo/module/cert/xcodecerthelper.rb +2 -2
- data/lib/pindo/module/{build/unityhelper.rb → unity/unity_helper.rb} +0 -17
- data/lib/pindo/module/xcode/{xcodereshandler.rb → res/xcode_res_handler.rb} +1 -1
- data/lib/pindo/module/xcode/{xcodebuildconfig.rb → xcode_build_config.rb} +7 -6
- data/lib/pindo/module/xcode/{xcodebuildhelper.rb → xcode_build_helper.rb} +4 -3
- data/lib/pindo/module/xcode/{xcodehelper.rb → xcode_project_helper.rb} +4 -2
- data/lib/pindo/module/xcode/{xcodereshelper.rb → xcode_res_helper.rb} +12 -9
- data/lib/pindo/version.rb +185 -7
- data/lib/pindo.rb +14 -9
- metadata +24 -23
- data/lib/pindo/module/android/apk_helper.rb +0 -138
- data/lib/pindo/module/android/base_helper.rb +0 -964
- data/lib/pindo/module/android/build_helper.rb +0 -128
- data/lib/pindo/module/android/so_helper.rb +0 -18
- data/lib/pindo/module/cert/certhelper.rb +0 -246
- data/lib/pindo/module/cert/keychainhelper.rb +0 -150
- data/lib/pindo/module/cert/pemhelper.rb +0 -65
- /data/lib/pindo/module/android/{androidreshelper.rb → android_res_helper.rb} +0 -0
- /data/lib/pindo/module/appstore/{iap_tier.json → appstore_iap_tier.json} +0 -0
- /data/lib/pindo/module/build/{swarkhelper.rb → swark_helper.rb} +0 -0
- /data/lib/pindo/module/build/{versionhelper.rb → version_helper.rb} +0 -0
- /data/lib/pindo/module/cert/{provisioninghelper.rb → provisioning_helper.rb} +0 -0
- /data/lib/pindo/module/unity/{nugethelper.rb → nuget_helper.rb} +0 -0
- /data/lib/pindo/module/xcode/{xcoderesconstant.rb → res/xcode_res_constant.rb} +0 -0
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
require 'fileutils'
|
|
2
2
|
require 'tempfile'
|
|
3
3
|
require 'nokogiri'
|
|
4
|
-
require_relative '
|
|
4
|
+
require_relative 'android_project_helper'
|
|
5
|
+
require_relative 'java_env_helper'
|
|
6
|
+
require_relative '../../base/funlog'
|
|
5
7
|
|
|
6
8
|
module Pindo
|
|
7
9
|
module GPComplianceHelper
|
|
8
|
-
include BaseAndroidHelper
|
|
9
10
|
|
|
10
11
|
# Google Play 合规检测结果
|
|
11
12
|
class ComplianceResult
|
|
@@ -53,8 +54,7 @@ module Pindo
|
|
|
53
54
|
return result
|
|
54
55
|
end
|
|
55
56
|
|
|
56
|
-
|
|
57
|
-
puts "检测文件: #{File.basename(aab_path)}"
|
|
57
|
+
Funlog.fancyinfo_start("Google Play 合规检测: #{File.basename(aab_path)}")
|
|
58
58
|
|
|
59
59
|
# 创建临时目录用于解压 AAB
|
|
60
60
|
temp_dir = nil
|
|
@@ -64,7 +64,7 @@ module Pindo
|
|
|
64
64
|
# 检查 unzip 工具是否可用
|
|
65
65
|
unless tool_available?('unzip')
|
|
66
66
|
result.add_issue("unzip 工具不可用,无法解压 AAB 文件")
|
|
67
|
-
|
|
67
|
+
Funlog.error("请安装 unzip 工具: brew install unzip (macOS) 或 apt-get install unzip (Ubuntu)")
|
|
68
68
|
return result
|
|
69
69
|
end
|
|
70
70
|
|
|
@@ -129,7 +129,7 @@ module Pindo
|
|
|
129
129
|
|
|
130
130
|
# 检测 AAB 包体积合规性
|
|
131
131
|
def self.check_aab_size_compliance(aab_path, result)
|
|
132
|
-
|
|
132
|
+
Funlog.fancyinfo_update("检测 AAB 包体积...")
|
|
133
133
|
|
|
134
134
|
begin
|
|
135
135
|
# 获取 AAB 文件大小
|
|
@@ -149,27 +149,22 @@ module Pindo
|
|
|
149
149
|
result.base_percent = aab_size > 0 ? ((base_size.to_f * 100) / aab_size).round(2) : 0
|
|
150
150
|
end
|
|
151
151
|
|
|
152
|
-
puts "AAB 包体积: #{result.aab_size_mb} MB"
|
|
153
|
-
puts "base 文件夹压缩体积: #{result.base_size_mb} MB (占比 #{result.base_percent}%)"
|
|
154
|
-
|
|
155
152
|
if base_size > base_limit_bytes
|
|
156
153
|
result.size_compliant = false
|
|
157
154
|
result.add_issue("base 文件夹已超出 Google Play 限制(#{base_limit_mb}MB),请优化资源或分包")
|
|
158
|
-
|
|
155
|
+
Funlog.error("base 文件夹超出限制: #{result.base_size_mb}MB (限制 #{base_limit_mb}MB)")
|
|
159
156
|
else
|
|
160
157
|
result.size_compliant = true
|
|
161
|
-
puts "\e[32m✓ AAB 包体积符合 Google Play 提交标准\e[0m"
|
|
162
158
|
end
|
|
163
|
-
|
|
159
|
+
|
|
164
160
|
rescue => e
|
|
165
161
|
result.add_issue("AAB 包体积检测失败: #{e.message}")
|
|
166
|
-
puts "✗ AAB 包体积检测失败: #{e.message}"
|
|
167
162
|
end
|
|
168
163
|
end
|
|
169
164
|
|
|
170
165
|
# 检测 Target SDK 版本合规性
|
|
171
166
|
def self.check_target_sdk_compliance(temp_dir, result, aab_path = nil)
|
|
172
|
-
|
|
167
|
+
Funlog.fancyinfo_update("检测 Target SDK 版本...")
|
|
173
168
|
|
|
174
169
|
target_sdk = 0
|
|
175
170
|
|
|
@@ -181,27 +176,25 @@ module Pindo
|
|
|
181
176
|
|
|
182
177
|
# 方法2: 如果 bundletool 失败,使用二进制 XML 解析(备用方法)
|
|
183
178
|
if target_sdk == 0
|
|
184
|
-
puts "bundletool 解析失败,尝试二进制 XML 解析"
|
|
185
179
|
manifest_path = find_android_manifest(temp_dir)
|
|
186
180
|
if manifest_path
|
|
187
|
-
puts "找到 AndroidManifest.xml: #{manifest_path}"
|
|
188
181
|
target_sdk = extract_target_sdk_from_manifest(manifest_path)
|
|
189
182
|
end
|
|
190
183
|
end
|
|
191
|
-
|
|
184
|
+
|
|
192
185
|
result.target_sdk_version = target_sdk
|
|
193
|
-
|
|
186
|
+
|
|
194
187
|
if target_sdk >= 35
|
|
195
188
|
result.target_sdk_compliant = true
|
|
196
|
-
puts "\e[32m✓ Target SDK: #{target_sdk} (符合 Android 15 要求)\e[0m"
|
|
197
189
|
else
|
|
198
190
|
result.target_sdk_compliant = false
|
|
199
191
|
if target_sdk == 0
|
|
200
192
|
result.add_issue("无法检测到 Target SDK 版本,请检查 AAB 文件结构")
|
|
193
|
+
Funlog.error("无法检测到 Target SDK 版本")
|
|
201
194
|
else
|
|
202
195
|
result.add_issue("Target SDK #{target_sdk} 不符合要求,需要至少 Target SDK 35 (Android 15)")
|
|
196
|
+
Funlog.warning("Target SDK: #{target_sdk} (需要至少 35)")
|
|
203
197
|
end
|
|
204
|
-
puts "\e[31m✗ Target SDK: #{target_sdk} (需要至少 35)\e[0m"
|
|
205
198
|
end
|
|
206
199
|
end
|
|
207
200
|
|
|
@@ -212,7 +205,6 @@ module Pindo
|
|
|
212
205
|
# 获取 Pindo 自带的 bundletool.jar 路径
|
|
213
206
|
bundletool_jar = get_pindo_bundletool_path
|
|
214
207
|
unless bundletool_jar && File.exist?(bundletool_jar)
|
|
215
|
-
puts "Pindo 自带的 bundletool.jar 不可用,尝试使用系统 bundletool 命令"
|
|
216
208
|
return extract_target_sdk_with_system_bundletool(aab_path)
|
|
217
209
|
end
|
|
218
210
|
|
|
@@ -236,7 +228,6 @@ module Pindo
|
|
|
236
228
|
# puts "bundletool 未找到 targetSdkVersion"
|
|
237
229
|
return 0
|
|
238
230
|
rescue => e
|
|
239
|
-
puts "bundletool 解析失败: #{e.message}"
|
|
240
231
|
return 0
|
|
241
232
|
end
|
|
242
233
|
end
|
|
@@ -246,8 +237,6 @@ module Pindo
|
|
|
246
237
|
begin
|
|
247
238
|
# 检查系统 bundletool 是否可用
|
|
248
239
|
unless tool_available?('bundletool')
|
|
249
|
-
puts "系统 bundletool 也不可用,请确保已安装 bundletool"
|
|
250
|
-
puts "安装方法: 下载 bundletool.jar 并添加到 PATH 或创建别名"
|
|
251
240
|
return 0
|
|
252
241
|
end
|
|
253
242
|
|
|
@@ -269,7 +258,6 @@ module Pindo
|
|
|
269
258
|
# puts "系统 bundletool 未找到 targetSdkVersion"
|
|
270
259
|
return 0
|
|
271
260
|
rescue => e
|
|
272
|
-
puts "系统 bundletool 解析失败: #{e.message}"
|
|
273
261
|
return 0
|
|
274
262
|
end
|
|
275
263
|
end
|
|
@@ -291,10 +279,7 @@ module Pindo
|
|
|
291
279
|
|
|
292
280
|
# 获取用于 bundletool 的 Java 命令
|
|
293
281
|
def self.get_java_command_for_bundletool
|
|
294
|
-
|
|
295
|
-
helper = Object.new
|
|
296
|
-
helper.extend(BaseAndroidHelper)
|
|
297
|
-
helper.find_java_command
|
|
282
|
+
Pindo::JavaEnvHelper.find_java_command
|
|
298
283
|
end
|
|
299
284
|
|
|
300
285
|
# 查找 AndroidManifest.xml 文件(备用方法)
|
|
@@ -325,7 +310,6 @@ module Pindo
|
|
|
325
310
|
|
|
326
311
|
# 检查是否为二进制 XML
|
|
327
312
|
if content.start_with?("\x03\x00\x08\x00") || content.include?("\x00")
|
|
328
|
-
puts "检测到二进制 XML 格式,使用二进制解析方法"
|
|
329
313
|
|
|
330
314
|
# 在二进制 XML 中搜索 targetSdkVersion 后的数字
|
|
331
315
|
# 模式: targetSdkVersion + 一些二进制数据 + 数字
|
|
@@ -413,36 +397,29 @@ module Pindo
|
|
|
413
397
|
return 0
|
|
414
398
|
|
|
415
399
|
rescue => e
|
|
416
|
-
puts "解析 AndroidManifest.xml 失败: #{e.message}"
|
|
417
400
|
return 0
|
|
418
401
|
end
|
|
419
402
|
end
|
|
420
403
|
|
|
421
404
|
# 检测 ELF 对齐合规性
|
|
422
405
|
def self.check_elf_alignment_compliance(temp_dir, result)
|
|
423
|
-
|
|
406
|
+
Funlog.fancyinfo_update("检测 ELF 对齐 (16KB 页面大小)...")
|
|
424
407
|
|
|
425
408
|
# 查找所有 .so 文件
|
|
426
409
|
so_files = find_shared_libraries(temp_dir)
|
|
427
410
|
result.total_libs = so_files.length
|
|
428
411
|
|
|
429
412
|
if so_files.empty?
|
|
430
|
-
puts "未找到共享库文件"
|
|
431
413
|
result.elf_alignment_compliant = true
|
|
432
414
|
return
|
|
433
415
|
end
|
|
434
416
|
|
|
435
|
-
puts "找到 #{so_files.length} 个共享库文件"
|
|
436
|
-
|
|
437
417
|
unaligned_libs = []
|
|
438
418
|
|
|
439
419
|
so_files.each do |so_file|
|
|
440
420
|
alignment_status = check_elf_alignment(so_file)
|
|
441
421
|
|
|
442
|
-
|
|
443
|
-
puts "\e[32m✓ #{File.basename(so_file)}: ALIGNED (#{alignment_status[:alignment]})\e[0m"
|
|
444
|
-
else
|
|
445
|
-
puts "\e[31m✗ #{File.basename(so_file)}: UNALIGNED (#{alignment_status[:alignment]})\e[0m"
|
|
422
|
+
unless alignment_status[:aligned]
|
|
446
423
|
unaligned_libs << {
|
|
447
424
|
file: so_file,
|
|
448
425
|
alignment: alignment_status[:alignment],
|
|
@@ -461,13 +438,12 @@ module Pindo
|
|
|
461
438
|
|
|
462
439
|
if critical_unaligned.empty?
|
|
463
440
|
result.elf_alignment_compliant = true
|
|
464
|
-
puts "\e[32m✓ 所有关键架构 (arm64-v8a/x86_64) 的共享库都已正确对齐\e[0m"
|
|
465
441
|
else
|
|
466
442
|
result.elf_alignment_compliant = false
|
|
467
443
|
critical_unaligned.each do |lib|
|
|
468
444
|
result.add_issue("#{lib[:architecture]} 架构的共享库 #{File.basename(lib[:file])} 未对齐 (16KB 页面大小要求)")
|
|
469
445
|
end
|
|
470
|
-
|
|
446
|
+
Funlog.error("发现 #{critical_unaligned.length} 个关键架构的未对齐共享库")
|
|
471
447
|
end
|
|
472
448
|
end
|
|
473
449
|
|
|
@@ -516,7 +492,6 @@ module Pindo
|
|
|
516
492
|
|
|
517
493
|
# 使用 objdump 检查 ELF 文件的对齐
|
|
518
494
|
unless tool_available?('objdump')
|
|
519
|
-
puts "objdump 不可用,无法检查 ELF 对齐"
|
|
520
495
|
return {
|
|
521
496
|
aligned: false,
|
|
522
497
|
alignment: "tool_missing",
|
|
@@ -557,7 +532,6 @@ module Pindo
|
|
|
557
532
|
|
|
558
533
|
# 如果 objdump 失败,尝试使用 readelf
|
|
559
534
|
unless tool_available?('readelf')
|
|
560
|
-
puts "readelf 不可用,无法检查 ELF 对齐"
|
|
561
535
|
return {
|
|
562
536
|
aligned: false,
|
|
563
537
|
alignment: "tool_missing",
|
|
@@ -598,7 +572,6 @@ module Pindo
|
|
|
598
572
|
}
|
|
599
573
|
|
|
600
574
|
rescue => e
|
|
601
|
-
puts "检查 ELF 对齐失败 #{so_file}: #{e.message}"
|
|
602
575
|
return {
|
|
603
576
|
aligned: false,
|
|
604
577
|
alignment: "error",
|
|
@@ -627,58 +600,31 @@ module Pindo
|
|
|
627
600
|
|
|
628
601
|
# 打印合规检测摘要
|
|
629
602
|
def self.print_compliance_summary(result)
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
# AAB 包体积检测结果
|
|
633
|
-
if result.size_compliant
|
|
634
|
-
puts "\e[32m✓ AAB 包体积: #{result.aab_size_mb} MB (符合 Google Play 限制)\e[0m"
|
|
635
|
-
else
|
|
636
|
-
puts "\e[31m✗ AAB 包体积: #{result.aab_size_mb} MB (超出 Google Play 限制)\e[0m"
|
|
637
|
-
end
|
|
638
|
-
|
|
639
|
-
# Target SDK 检测结果
|
|
640
|
-
if result.target_sdk_compliant
|
|
641
|
-
puts "\e[32m✓ Target SDK: #{result.target_sdk_version} (符合 Android 15 要求)\e[0m"
|
|
642
|
-
else
|
|
643
|
-
puts "\e[31m✗ Target SDK: #{result.target_sdk_version} (需要至少 35)\e[0m"
|
|
644
|
-
end
|
|
645
|
-
|
|
646
|
-
# ELF 对齐检测结果
|
|
647
|
-
if result.elf_alignment_compliant
|
|
648
|
-
puts "\e[32m✓ ELF 对齐: 所有关键架构共享库已正确对齐 (16KB 页面大小)\e[0m"
|
|
649
|
-
else
|
|
650
|
-
puts "\e[31m✗ ELF 对齐: 发现 #{result.unaligned_libs.length} 个未对齐的共享库\e[0m"
|
|
651
|
-
end
|
|
652
|
-
|
|
653
|
-
# Unity 漏洞检测结果
|
|
654
|
-
if result.unity_patch_compliant
|
|
655
|
-
puts "\e[32m✓ Unity 漏洞修复: 已正确应用 Unity 漏洞修复\e[0m"
|
|
656
|
-
elsif result.unity_xrsdk_patched || result.unity_override_patched
|
|
657
|
-
puts "\e[33m⚠ Unity 漏洞修复: 部分漏洞修复已应用,但可能不完整\e[0m"
|
|
658
|
-
else
|
|
659
|
-
puts "\e[31m✗ Unity 漏洞修复: 未检测到 Unity 漏洞修复或修复不完整\e[0m"
|
|
660
|
-
end
|
|
603
|
+
Funlog.fancyinfo_update("生成合规检测摘要...")
|
|
661
604
|
|
|
662
605
|
# 总体合规状态
|
|
663
|
-
puts "\n\e[1m--- 总体合规状态 ---\e[0m"
|
|
664
606
|
if result.compliant?
|
|
665
|
-
|
|
607
|
+
Funlog.fancyinfo_success("符合 Google Play 最新合规要求")
|
|
666
608
|
else
|
|
667
|
-
|
|
668
|
-
result.
|
|
669
|
-
|
|
609
|
+
Funlog.fancyinfo_error("不符合 Google Play 合规要求")
|
|
610
|
+
if !result.size_compliant
|
|
611
|
+
Funlog.error("AAB 包体积: #{result.aab_size_mb} MB (超出限制)")
|
|
612
|
+
end
|
|
613
|
+
if !result.target_sdk_compliant
|
|
614
|
+
Funlog.error("Target SDK: #{result.target_sdk_version} (需要至少 35)")
|
|
615
|
+
end
|
|
616
|
+
if !result.elf_alignment_compliant
|
|
617
|
+
Funlog.error("ELF 对齐: 发现 #{result.unaligned_libs.length} 个未对齐的共享库")
|
|
618
|
+
end
|
|
619
|
+
if !result.unity_patch_compliant
|
|
620
|
+
Funlog.warning("Unity 漏洞修复未检测到或不完整")
|
|
670
621
|
end
|
|
671
622
|
end
|
|
672
623
|
|
|
673
624
|
# 警告信息
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
result.warnings.each do |warning|
|
|
677
|
-
puts "\e[33m ⚠ #{warning}\e[0m"
|
|
678
|
-
end
|
|
625
|
+
result.warnings.each do |warning|
|
|
626
|
+
Funlog.warning(warning)
|
|
679
627
|
end
|
|
680
|
-
|
|
681
|
-
puts "================================"
|
|
682
628
|
end
|
|
683
629
|
|
|
684
630
|
# 检测 Unity 漏洞合规性
|