iOS 关于图片地理位置隐私信息的分析和读取
ios 分析 关于 图片 信息 读取 隐私 地理位置
2023-09-27 14:28:41 时间
今天突然想到微信朋友圈发照片,涉及个人隐私的地理位置是否外泄。因为iphone拍照的照片都会带有地理位置等信息,我们先来实现怎么读取里面的安全信息,然后再来分析
- #import "ViewController.h"
- #import <ImageIO/ImageIO.h>
- #import <AssetsLibrary/AssetsLibrary.h>
- @interface ViewController ()<UIImagePickerControllerDelegate,UINavigationControllerDelegate>
- @end
- @implementation ViewController
- - (void)viewDidLoad {
- [super viewDidLoad];
- //创建一个UIImagePickerController对象
- UIImagePickerController *ctrl = [[UIImagePickerController alloc] init];
- //设置类型
- ctrl.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
- //设置代理
- ctrl.delegate = self;
- //显示
- [self presentViewController:ctrl animated:YES completion:nil];
- }
- -(void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info
- {
- if(picker.sourceType == UIImagePickerControllerSourceTypePhotoLibrary){
- //UIImage *image= [info objectForKey:UIImagePickerControllerOriginalImage];
- NSURL *assetURL = [info objectForKey:UIImagePickerControllerReferenceURL];
- ALAssetsLibrary *library = [[ALAssetsLibrary alloc] init];
- [library assetForURL:assetURL
- resultBlock:^(ALAsset *asset) {
- NSDictionary* imageMetadata = [[NSMutableDictionary alloc] initWithDictionary:asset.defaultRepresentation.metadata];
- NSDictionary *GPS = [imageMetadata objectForKey:(NSString *)kCGImagePropertyGPSDictionary];
- NSLog(@"--------%@",GPS);//地理位置信息
- NSLog(@"%@",imageMetadata);
- }
- failureBlock:^(NSError *error) {
- }];
- }
- }
相关文章
- IOS使用Instrument-Time Profiler工具分析和优化性能问题
- iOS 提示更新 业务逻辑
- iOS: 获取文件路径
- 极客日报:“WWW”之父将源代码用 NFT 拍卖:成交价 540 万美元;小米起诉拼多多商标侵权;iOS 15 首个公测版发布
- iOS 碰撞检測以及事件响应
- 转: HTTP Live Streaming直播(iOS直播)技术分析与实现
- iOS 14 egret H5游戏卡顿问题分析和部分解决办法
- 思科又发紧急安全通告 IOS集群管理协议漏洞和Struts2漏洞 有影响产品列表及应对措施了
- iOS加密之MD5加密
- HTTP Live Streaming直播(iOS直播)技术分析与实现
- iOS - GCD队列、任务组合
- Node.app – 用于 iOS App 开发的 Node.js 解释器
- cocos2d-x与ios内存管理分析(在游戏中减少内存压力)
- IOS学习之基于IOS7的tab bar
- iOS安全攻防(三):使用Reveal分析他人app
- iOS异常日志记录与展现功能
- 李洪强iOS开发之【零基础学习iOS开发【01-前言】03-前景和难易度分析
- iOS实现图片无限轮播之使用第三方库SDCycleScrollView(转)
- ios编码规范(by raywenderlich团队,靠谱)
- 苹果官方文档:理解和分析ios应用崩溃日志
- mac下对ios设备抓包(5.0以上系统),通过rvi方式