Linux命令查询包含指定内容的文件
命令 grep - r 查询包含指定内容的文件
所有命令执行的场景是再进入到iOS相关工程目录下:打开终端 cd xxxxxx(路径,闲麻烦直接拖文件夹到cd后边自动显示路径)
当不确定项目中是否用到某个iOS隐私功能权限的情况,自定义功能类或者第三方库用到了的时候,用以下命令进行查询
比如我用《动态壁纸大全》这个项目为教材举例子
一:命令大全
1: IDFA广告标识
grep -r advertisingIdentifier .
2: 通讯录
grep -r AddressBook .
3: 相机、麦克风
grep -r AVCaptureSession . 或者 grep -r AVCaptureDeviceInput .
4: 相册
grep -r Photos.h . 或者 grep -r PHAuthorizationStatus . 节省篇幅不截图举例子了
5: 多媒体资料库(音频、音乐等)
grep -r MPMediaPickerController .
6: 定位
grep -r CoreLocation .
7: 日历
grep -r EKEventStore .
8: 蓝牙
grep -r CoreBluetooth . 或者 grep -r CBCentralManager .
9: 健康
grep -r HealthKit . 和grep -r CMPedometer .
10: 研究
x x x x xgrep -r EKEventStore .
11: HomeKit
grep -r HMHomeManager .
12: 提醒事项
grep -r EKEntityMaskEvent .
13: 运动与健身
grep -r CoreMotion .
14健康与(运动与健身)区别
https://www.jianshu.com/p/1dd6ad5b1520
二:添加相关隐私权限
1: 表格来区分xml和plist模式
隐私数据 | 对应key值 | 提示语 | 代码XML格式添加 | info.plist 中添加(记得加提示语) |
相册(读) | NSPhotoLibraryUsageDescription | "XXX"需要您的同意,才能访问相册选择图片、上传头像等功能 | <key>NSPhotoLibraryUsageDescription</key> <string>App需要您的同意,才能访问相册</string> | Privacy - Photo Library Usage Description |
相册(写) | NSPhotoLibraryAddUsageDescription | "XXX"需要您的同意,才能保存照片到相册 | <key>NSPhotoLibraryAddUsageDescription</key> <string>App需要您的同意,才能访问相册</string> | Privacy - Photo Library Additions Usage Description |
相机 | NSCameraUsageDescription | "XXX"需要您的同意,才能访问相机做某某功能 | <key>NSCameraUsageDescription</key> <string>需要访问您的相机,以便APP进行拍照上传头像</string> | Privacy - Camera Usage Description |
麦克风 | NSMicrophoneUsageDescription | "XXX"需要您的同意,才能访问麦克风,以便APP进行语音内容的发送 | <key>NSMicrophoneUsageDescription</key> <string>提示语</string> | Privacy - Microphone Usage Description |
位置 | NSLocationUsageDescription | "XXX"需要您的同意,才能访问位置 | <key>NSLocationUsageDescription</key> <string>提示语</string> | Privacy - Location Usage Description |
在使用期间访问位置定位 | NSLocationWhenInUseUsageDescription | "XXX"需要您的同意,才能在app使用期间访问位置,用于更新位置 | <key>NSLocationAlwaysAndWhenInUseUsageDescription</key> <string>提示语</string> | Privacy - Location When In Use Usage Description |
始终访问位置定位 | NSLocationAlwaysUsageDescription | "XXX"需要您的同意,才能始终访问位置,用于实时分享点位 | <key>NSLocationWhenInUseUsageDescription</key> <string>提示语</string> | Privacy - Location Always and When In Use Usage Description |
日历 | NSCalendarsUsageDescription | "XXX"需要您的同意,才能访问日历 | <key>NSCalendarsUsageDescription</key> <string>提示语</string> | Privacy - Calendars Usage Description |
提醒事项 | NSRemindersUsageDescription | "XXX"需要您的同意,才能访问提醒事项 | <key>NSRemindersUsageDescription</key> <string>提示语</string> | Privacy - Reminders Usage Description |
运动与健身 | NSMotionUsageDescription | "XXX"需要您的同意,才能访问运动与健身 | <key>NSMotionUsageDescription</key> <string>提示语</string> | Privacy - Motion Usage Description |
健康更新 | NSHealthUpdateUsageDescription | "XXX"需要您的同意,才能访问健康更新 | <key>NSHealthUpdateUsageDescription</key> <string>提示语 </string> | Privacy - Health Update Usage Description |
健康分享 | NSHealthShareUsageDescription | "XXX"需要您的同意,才能访问健康分享 | <key>NSHealthShareUsageDescription</key> <string>提示语</string> | Privacy - Health Share Usage Description |
蓝牙 | NSBluetoothPeripheralUsageDescription | "XXX"需要您的同意,才能访问蓝牙 | <key>NSBluetoothPeripheralUsageDescription</key> <string>提示语</string> | Privacy - Bluetooth Peripheral Usage Description |
媒体资料库 | NSAppleMusicUsageDescription | "XXX"需要您的同意,才能访问媒体资料库 | <key>NSAppleMusicUsageDescription</key> <string>提示语</string> | Privacy - Music Usage Description |
2: info.plist添加的情况:
麦克风权限:Privacy - Microphone Usage Description
相机权限: Privacy - Camera Usage Description
相册权限: Privacy - Photo Library Usage Description
通讯录权限: Privacy - Contacts Usage Description
蓝牙权限:Privacy - Bluetooth Peripheral Usage Description
语音转文字权限:Privacy - Speech Recognition Usage Description
日历权限:Privacy - Calendars Usage Description
定位权限:Privacy - Location When In Use Usage Description
定位权限: Privacy - Location Always Usage Description
位置权限:Privacy - Location Usage Description
媒体库权限:Privacy - Media Library Usage Description
健康分享权限:Privacy - Health Share Usage Description
健康更新权限:Privacy - Health Update Usage Description
运动使用权限:Privacy - Motion Usage Description
音乐权限:Privacy - Music Usage Description
提醒使用权限:Privacy - Reminders Usage Description
Siri使用权限:Privacy - Siri Usage Description
电视供应商使用权限:Privacy - TV Provider Usage Description
视频用户账号使用权限:Privacy - Video Subscriber Account Usage Description
面部ID权限 :Privacy - Face ID Usage Description
保存图片到相册 : Privacy - Photo Library Additions Usage Description