Repository navigation
Expand file tree
/
Copy pathPodfile
More file actions
78 lines (67 loc) · 2.9 KB
/
Copy pathPodfile
File metadata and controls
78 lines (67 loc) · 2.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
platform :ios, '15.0'
target 'EasyPlayerRTSP' do
# Uncomment the next line if you're using Swift or would like to use dynamic frameworks
use_frameworks!
# Pods for EasyRlayer
pod 'Masonry'
pod 'Bugly'
pod 'RTRootNavigationController'
pod 'IQKeyboardManager'
pod 'YYKit'
pod 'WHToast'
# pod 'ReactiveCocoa', '~> 2.5'
pod 'ReactiveCocoa', :git => 'https://github.com/zhao0/ReactiveCocoa.git', :tag => '2.5.2'
end
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '15.0'
end
end
# iOS 18: fix YYKVStorage sqlite close crash by finalizing cached statements.
yykit_file = 'Pods/YYKit/YYKit/Cache/YYKVStorage.m'
if File.exist?(yykit_file)
content = File.read(yykit_file)
new_snippet = <<~'NEW'
if (_dbStmtCache) {
CFIndex size = CFDictionaryGetCount(_dbStmtCache);
if (size > 0) {
const void **values = (const void **)malloc(sizeof(void *) * size);
if (values) {
CFDictionaryGetKeysAndValues(_dbStmtCache, NULL, values);
for (CFIndex i = 0; i < size; i++) {
sqlite3_stmt *stmt = (sqlite3_stmt *)values[i];
if (stmt) sqlite3_finalize(stmt);
}
free(values);
}
}
CFRelease(_dbStmtCache);
}
_dbStmtCache = NULL;
NEW
unless content.include?('CFDictionaryGetCount(_dbStmtCache)')
replaced = content.sub(/if \(_dbStmtCache\) CFRelease\(_dbStmtCache\);\s*_dbStmtCache = NULL;/m, new_snippet)
if replaced != content
File.write(yykit_file, replaced)
puts 'Applied YYKit sqlite finalize fix.'
else
puts 'Skip YYKit fix: target snippet not found.'
end
else
puts 'YYKit sqlite finalize fix already present.'
end
else
puts "Skip YYKit fix: #{yykit_file} not found."
end
# ReactiveCocoa 2.5.2、YYKit 1.0.9 自身不带 App Store 要求的隐私清单,
# 把仓库里补的 PrivacyManifests/<Pod 名>/PrivacyInfo.xcprivacy 打进对应的 framework
%w[ReactiveCocoa YYKit].each do |name|
target = installer.pods_project.targets.find { |t| t.name == name }
next unless target
manifest = installer.sandbox.root.parent + "PrivacyManifests/#{name}/PrivacyInfo.xcprivacy"
group = installer.pods_project.main_group.find_subpath("PrivacyManifests/#{name}", true)
ref = group.files.find { |f| f.real_path == manifest } || group.new_reference(manifest)
target.resources_build_phase.add_file_reference(ref, true)
end
end