Skip to content

Commit d03e438

Browse files
authored
ITMS-91061 - privacy manifest for Charts framework (#666)
1 parent 33d6eb9 commit d03e438

3 files changed

Lines changed: 50 additions & 0 deletions

File tree

Podfile

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,36 @@ post_install do |installer|
3333
File.write(transformer, code.sub(original, patched))
3434
end
3535
end
36+
37+
# Inject a privacy manifest into the Charts framework (ITMS-91061).
38+
# Charts 4.1.0 ships no PrivacyInfo.xcprivacy; it collects no data, performs
39+
# no tracking, and uses no required-reason APIs, so this is a negative
40+
# declaration. Re-applied here because `pod install` regenerates the project.
41+
charts_manifest = <<~XML
42+
<?xml version="1.0" encoding="UTF-8"?>
43+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
44+
<plist version="1.0">
45+
<dict>
46+
\t<key>NSPrivacyTracking</key>
47+
\t<false/>
48+
\t<key>NSPrivacyTrackingDomains</key>
49+
\t<array/>
50+
\t<key>NSPrivacyCollectedDataTypes</key>
51+
\t<array/>
52+
\t<key>NSPrivacyAccessedAPITypes</key>
53+
\t<array/>
54+
</dict>
55+
</plist>
56+
XML
57+
58+
manifest_path = installer.sandbox.root + 'Charts/PrivacyInfo.xcprivacy'
59+
File.write(manifest_path, charts_manifest)
60+
61+
charts_target = installer.pods_project.targets.find { |t| t.name == 'Charts' }
62+
if charts_target
63+
file_ref = installer.pods_project.new_file(manifest_path.to_s)
64+
already_added = charts_target.resources_build_phase.files_references.include?(file_ref)
65+
charts_target.resources_build_phase.add_file_reference(file_ref) unless already_added
66+
installer.pods_project.save
67+
end
3668
end

Pods/Charts/PrivacyInfo.xcprivacy

Lines changed: 14 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Pods/Pods.xcodeproj/project.pbxproj

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)