5
1

Cocoapods管理ライブラリからプライバシーマニフェストと署名の対象となるSDKを調べる

Last updated at Posted at 2023-12-25

2024年春以降、Appleから指定されたSDKについて、App Store ConnectでこれらのSDKを含むアプリを提出する場合や、アプリのアップデートの一環としてこれらのSDKのいずれかを追加するアップデートを提出する場合には、プライバシーマニフェストを含める必要があります。

このうち、アプリに該当のSDKがCocoapods管理ライブラリで混入されているかどうかを調べるruby scriptを作成しました。

ファイル

以下の2ファイルを同じディレクトリに配置します。
pod_file_pathは任意のPodfile.lockのパスに置き換えてください。

check.rb
def find_matching_keywords(text, keywords)
  text = text.downcase

  matching_keywords = []

  keywords.each do |keyword|
    matching_keywords << keyword if text.include?(keyword.downcase)
  end

  matching_keywords
end

def read_file_content(file_path)
  File.read(file_path)
end

def read_keywords_from_file(file_path)
  keywords = File.readlines(file_path, chomp: true)
  keywords.map(&:strip)
end

pod_file_path = 'path/to/your/Podfile.lock'
keywords_file_path = 'upcoming.txt'

sample_text = read_file_content(pod_file_path)
sample_keywords = read_keywords_from_file(keywords_file_path)

matching_keywords = find_matching_keywords(sample_text, sample_keywords)
puts matching_keywords

upcoming.txt
Abseil
AFNetworking
Alamofire
AppAuth
BoringSSL
Capacitor
Charts
connectivity_plus
Cordova
device_info_plus
DKImagePickerController
DKPhotoGallery
FBAEMKit
FBLPromises
FBSDKCoreKit
FBSDKCoreKit_Basics
FBSDKLoginKit
FBSDKShareKit
file_picker
FirebaseABTesting
FirebaseAuth
FirebaseCore
FirebaseCoreDiagnostics
FirebaseCoreExtension
FirebaseCoreInternal
FirebaseCrashlytics
FirebaseDynamicLinks
FirebaseFirestore
FirebaseInstallations
FirebaseMessaging
FirebaseRemoteConfig
Flutter
flutter_inappwebview
flutter_local_notifications
fluttertoast
FMDB
geolocator_apple
GoogleDataTransport
GoogleSignIn
GoogleToolboxForMac
GoogleUtilities
grpcpp
GTMAppAuth
GTMSessionFetcher
hermes
image_picker_ios
IQKeyboardManager
IQKeyboardManagerSwift
Kingfisher
leveldb
Lottie
MBProgressHUD
nanopb
OneSignal
OneSignalCore
OneSignalExtension
OneSignalOutcomes
OpenSSL
OrderedSet
package_info
package_info_plus
path_provider
path_provider_ios
Promises
Protobuf
Reachability
RealmSwift
RxCocoa
RxRelay
RxSwift
SDWebImage
share_plus
shared_preferences_ios
SnapKit
sqflite
Starscream
SVProgressHUD
SwiftyGif
SwiftyJSON
Toast
UnityFramework
url_launcher
url_launcher_ios
video_player_avfoundation
wakelock
webview_flutter_wkwebview

コマンド

以下のコマンドで、混入しているSDKがリストアップされます。

ruby check.rb   

MacのsystemのRubyバージョン 2.6.10 でも動作を確認できました。

5
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
1