cocoapods-bb-PodAssistant 0.3.16.9 → 0.3.16.10
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
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c0414aee53cb5ee338b5814ffb924c88ee3d74af9460d9b8d49aec24856563c4
|
|
4
|
+
data.tar.gz: 93063e44081f8b210bed3cff45022680fdc5a57e8aaee39d9d01f33674c80c82
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b7ad2426baf093fb38885fb68051c3a7db00285b9c242c84ed3ea7754a3b0914bba79000ca1652984cdc105b8249ee46448c3b681054e69d00a5c2a302cc9df7
|
|
7
|
+
data.tar.gz: 10c8dbfcfddb0befbe382dd05bbe5cc10412690e2953945dc73fae6c06a408cdf7aec6058f627382b30c82057cfcd6601c23be3b1c4a9962f2c5f526a8b15bdc
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
# Author = Min Hu
|
|
3
3
|
|
|
4
4
|
require 'cocoapods-bb-PodAssistant/babybus/helpers/babybus_info_plist_helper'
|
|
5
|
+
require 'fileutils'
|
|
5
6
|
|
|
6
7
|
class BabybusInstallEnv
|
|
7
8
|
#https://v3.bbcloud.babybus.com/team/184/wiki/11667
|
|
@@ -54,40 +55,64 @@ class BabybusInstallEnv
|
|
|
54
55
|
puts "===拷贝3D产物文件操作===>".yellow
|
|
55
56
|
rootPath = getProjectRootPath
|
|
56
57
|
bundleIdentifier = getProjectBundleIdentifier
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
58
|
+
formats = %w[xcframework framework]
|
|
59
|
+
locations = [
|
|
60
|
+
[File.join(rootPath, 'Configs', bundleIdentifier), 'UnityFramework'],
|
|
61
|
+
[File.join(rootPath, 'Configs/UnityFramework', bundleIdentifier), 'UnityFramework'],
|
|
62
|
+
[File.join(rootPath, 'Configs/UnityFramework'), "#{bundleIdentifier}_UnityFramework"],
|
|
63
|
+
[File.join(rootPath, 'Configs/UnityFramework'), 'UnityFramework']
|
|
64
|
+
]
|
|
65
|
+
path = nil
|
|
66
|
+
locations.each do |directory, name|
|
|
67
|
+
formats.each do |format|
|
|
68
|
+
candidate = File.join(directory, "#{name}.#{format}")
|
|
69
|
+
puts "查找UnityFramework产物:#{candidate}"
|
|
70
|
+
if File.directory?(candidate)
|
|
71
|
+
path = candidate
|
|
72
|
+
break
|
|
68
73
|
end
|
|
69
74
|
end
|
|
75
|
+
break if path
|
|
70
76
|
end
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
77
|
+
unless path
|
|
78
|
+
puts "找不到UnityFramework产物文件,替换失败".red
|
|
79
|
+
return
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
format = File.extname(path)
|
|
83
|
+
podsPath = File.join("./", 'Pods/BBUnityFramework')
|
|
84
|
+
# podsPath = File.join(rootPath, 'Pods/BBUnityFramework')
|
|
85
|
+
replaceFilePath = File.join(podsPath, "UnityFramework#{format}")
|
|
86
|
+
unless File.directory?(replaceFilePath)
|
|
87
|
+
raise "UnityFramework产物格式与Pod依赖不匹配: #{path} -> #{replaceFilePath},请检查BBUnityFramework的vendored_frameworks配置"
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
require 'tmpdir'
|
|
91
|
+
Dir.mktmpdir('unity-replacement-', podsPath) do |tempPath|
|
|
92
|
+
stagedPath = File.join(tempPath, "UnityFramework#{format}")
|
|
93
|
+
FileUtils.cp_r(path, stagedPath, preserve: true)
|
|
94
|
+
if format == '.framework'
|
|
95
|
+
FileUtils.cp(File.join(replaceFilePath, 'Info.plist'), File.join(stagedPath, 'Info.plist'), preserve: true)
|
|
96
|
+
%w[Modules Headers].each do |name|
|
|
97
|
+
oldPath = File.join(replaceFilePath, name)
|
|
98
|
+
newPath = File.join(stagedPath, name)
|
|
99
|
+
FileUtils.cp_r(oldPath, newPath, preserve: true) if !File.exist?(newPath) && File.directory?(oldPath)
|
|
100
|
+
end
|
|
101
|
+
else
|
|
102
|
+
unless File.file?(File.join(stagedPath, 'Info.plist'))
|
|
103
|
+
raise "XCFramework缺少Info.plist: #{path}"
|
|
104
|
+
end
|
|
79
105
|
end
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
106
|
+
backupPath = File.join(tempPath, 'backup')
|
|
107
|
+
File.rename(replaceFilePath, backupPath)
|
|
108
|
+
begin
|
|
109
|
+
File.rename(stagedPath, replaceFilePath)
|
|
110
|
+
rescue StandardError
|
|
111
|
+
File.rename(backupPath, replaceFilePath)
|
|
112
|
+
raise
|
|
84
113
|
end
|
|
85
|
-
system "chmod 755 #{replaceFilePath}"
|
|
86
|
-
system "rm -rf #{replaceFilePath}; cp -af #{path} #{replaceFilePath}"
|
|
87
|
-
puts "替换UnityFramework文件成功".yellow
|
|
88
|
-
else
|
|
89
|
-
puts "找不到UnityFramework产物文件,替换失败".red
|
|
90
114
|
end
|
|
115
|
+
puts "替换UnityFramework文件成功:#{replaceFilePath}".yellow
|
|
91
116
|
end
|
|
92
117
|
# 2D母包替换
|
|
93
118
|
def copyCocosPackage
|
|
@@ -379,5 +379,34 @@ install_framework()
|
|
|
379
379
|
project.save if should_save
|
|
380
380
|
# 修正Xcode16不能po问题
|
|
381
381
|
# fix_above_xcode16_no_po() # xcode27不需要
|
|
382
|
+
# Xcode 原生加固
|
|
383
|
+
apply_security_hardening(@lib)
|
|
384
|
+
end
|
|
385
|
+
|
|
386
|
+
# Xcode 原生加固
|
|
387
|
+
def apply_security_hardening(installer)
|
|
388
|
+
projects = ([installer.pods_project] + installer.pod_target_subprojects + installer.aggregate_targets.map(&:user_project)).compact.uniq
|
|
389
|
+
projects.flat_map(&:targets).uniq.each do |target|
|
|
390
|
+
target.build_configurations.each do |config|
|
|
391
|
+
# 仅跳过 Debug 类构建配置,其余配置统一执行安全加固
|
|
392
|
+
next if config.name.downcase.include?('debug')
|
|
393
|
+
settings = config.build_settings
|
|
394
|
+
# 删除无用代码
|
|
395
|
+
settings['DEAD_CODE_STRIPPING'] = 'YES'
|
|
396
|
+
# 禁止测试能力
|
|
397
|
+
settings['ENABLE_TESTABILITY'] = 'NO'
|
|
398
|
+
# 禁止生产环境断言
|
|
399
|
+
settings['ENABLE_NS_ASSERTIONS'] = 'NO'
|
|
400
|
+
# 保留崩溃分析能力
|
|
401
|
+
settings['DEBUG_INFORMATION_FORMAT'] = 'dwarf-with-dsym'
|
|
402
|
+
# 栈溢出保护
|
|
403
|
+
flags = Array(settings['OTHER_CFLAGS'] || '$(inherited)')
|
|
404
|
+
unless flags.include?('-fstack-protector-strong')
|
|
405
|
+
flags << '-fstack-protector-strong'
|
|
406
|
+
end
|
|
407
|
+
settings['OTHER_CFLAGS'] = flags
|
|
408
|
+
end
|
|
409
|
+
end
|
|
410
|
+
installer.aggregate_targets.map(&:user_project).compact.uniq.each(&:save)
|
|
382
411
|
end
|
|
383
412
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: cocoapods-bb-PodAssistant
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.3.16.
|
|
4
|
+
version: 0.3.16.10
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- humin
|
|
@@ -220,7 +220,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
220
220
|
- !ruby/object:Gem::Version
|
|
221
221
|
version: '0'
|
|
222
222
|
requirements: []
|
|
223
|
-
rubygems_version: 4.0.
|
|
223
|
+
rubygems_version: 4.0.21
|
|
224
224
|
specification_version: 4
|
|
225
225
|
summary: A longer description of cocoapods-bb-PodAssistant.
|
|
226
226
|
test_files: []
|