Skip to content

a cocoapods plugin to auto manager Xcode PrivacyInfo.xcprivacy file(create && search)

License

Notifications You must be signed in to change notification settings

linhaosunny/cocoapods-privacy

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

69 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cocoapods-privacy

Apple 2024 will review the App's privacy list in the spring, and any apps that don't submit a privacy list may be called back. For now, the privacy list is broken down by component, to facilitate the maintenance of component privacy, cocoapods-privacy is developed for management. Click to view details on Apple

Installation

$ gem install cocoapods-privacy

Usage

init

First of all, you must set a json config to cocoapods-privacy, this is a defalut config.json

$ pod privacy config https://raw.githubusercontent.com/ymoyao/cocoapods-privacy/main/resources/config.json

There has 3 keys in defalut config, you should custom it!

  • source.white.list : a white list of source, defalut is empty, so, you should add you self component sources, and it work in command 'pod privacy install' or 'pod install --privacy', will search white list for NSPrivacyAccessedAPITypes.
  • source.black.list : a black list of source, defalut is empty, it work in command 'pod privacy install' or 'pod install --privacy'.
  • api.template.url : its required, a template for search NSPrivacyAccessedAPITypes
"source.white.list": ["replace me with yourserver"], 
"source.black.list": ["replace me such as github.com"],
"api.template.url": "https://raw.githubusercontent.com/ymoyao/cocoapods-privacy/main/resources/NSPrivacyAccessedAPITypes.plist"

After custom,you can set local config like this

$ pod privacy config /yourfilepath/config.json

To Component

$ pod privacy spec [podspec_file_path]

This command will auto create privacy file, and search the path of podspec' source_files' define relate to NSPrivacyAccessedAPITypes, finaly, write to PrivacyInfo.xcprivacy file. if your component has much subspec, all subspec that define ‘source_files’ will create PrivacyInfo.xcprivacy, and auto modify .podspec link .xcprivacy to 'resource_bundle' key. For example

  • origin podspec
Pod::Spec.new do |s|
  s.name             = 'Demo'
  ...
  s.source_files = 'xxxx'
  s.subspec 'idfa' do |sp|
      sp.source_files = 'xxxxx'
  end
  s.subspec 'noidfa' do |sp|
  end
end

  • podspec after commad 👇👇👇👇👇👇
Pod::Spec.new do |s|
  s.name             = 'Demo'
  ...
  s.source_files = 'xxxx'
  s.resource_bundle = {"Demo.privacy"=>"Pod/Privacy/Demo/PrivacyInfo.xcprivacy"}
  s.subspec 'idfa' do |sp|
      sp.source_files = 'xxxxx'
      sp.resource_bundle = {"Demo.idfa.privacy"=>"Pod/Privacy/Demo.idfa/PrivacyInfo.xcprivacy"}
  end
  s.subspec 'noidfa' do |sp|
  end
end
截屏2024-02-02 11 23 21

To Project

$ pod install --privacy
or
$ pod privacy install
截屏2024-02-02 10 59 59

After command, a PrivacyInfo.xcprivacy will create to you project Resources if empty. and it will search component that configuration files allow and do not have their own privacy manifest file.

Notice

The plugin is focus on NSPrivacyAccessedAPITypes and automatically search and create workflow. you should manager NSPrivacyCollectedDataTypes by yourself!

About

a cocoapods plugin to auto manager Xcode PrivacyInfo.xcprivacy file(create && search)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Ruby 100.0%