第1年3月31日 drm防截屏
1.
苹果系统是支持DRM(Digital Rights Management
,数字版权管理)的。它表现在,当你播放一个加密了的hls流时,你进行截屏(用手机截屏或用Xcode截屏),该视频控件会显示空白。
这里,我们返回的key是16字节纯0的数据,其实mp4文件并没有加密,只是让系统以为加密了,好在截屏时进行保护。
-(BOOL)resourceLoader:(AVAssetResourceLoader *)resourceLoader shouldWaitForLoadingOfRequestedResource:(AVAssetResourceLoadingRequest *)loadingRequest{ NSString *url = loadingRequest.request.URL.absoluteString; if ([url isEqualToString:@"jedi://text.m3u8"]) { NSData *data = [[self gen_m3u8] dataUsingEncoding:NSUTF8StringEncoding]; [loadingRequest.dataRequest respondWithData:data]; [loadingRequest finishLoading]; } else if([url isEqualToString:@"jedi://text.key"]) { NSMutableData *data = [NSMutableData dataWithLength:16]; [data resetBytesInRange:NSMakeRange(0, [data length])]; [loadingRequest.dataRequest respondWithData:[data copy]]; [loadingRequest finishLoading]; } return YES; }
https://github.com/ohswift/VTAntiScreenCapture
https://www.jianshu.com/p/86d0cfed5f4e
2.iOS逆向
https://www.jianshu.com/p/16d2205bb240
https://www.jianshu.com/p/64bbc0511e4c?utm_campaign=maleskine&utm_content=note&utm_medium=seo_notes&utm_source=recommendation