越狱的iOS从后台应用获取屏幕截图

编程入门 行业动态 更新时间:2024-10-24 14:17:57
本文介绍了越狱的iOS从后台应用获取屏幕截图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在为自己构建一个实用程序应用程序,该应用程序可以在该实用程序在后台运行的同时,对在前台运行的任何内容进行截图.该实用程序将在越狱设备上运行,因此它可以访问私有API,而不仅限于沙盒.由于该实用程序应用程序在后台运行(作为守护程序或使用后台程序),如何访问正在显示的屏幕以生成屏幕截图?

I'm building an utility app for myself that can take screenshots of whatever is running in the foreground while this utility is running in the background. The utility will be running on a jailbroken device so it can access private APIs and not confined to the sandbox. Since the utility app is running in the background (either as a daemon or using backgrounder), how can I access the screen being displayed to generate a screenshot?

我想要这样做的原因是因为我想以编程方式/远程方式截取屏幕截图.该实用程序将截取屏幕截图并上传到我的本地服务器.我将其用作内部测试工具的一部分.

The reason I want this is because I want to take screenshots programmatically/remotely. The utility will take the screenshot and upload to my local server. I'm using this as part of internal test tools.

非常感谢您的帮助!

推荐答案

您应该可以使用 UICreateScreenImage() .这将为您提供CGImageRef,您可以使用[UIImage imageWithCGImage:screenshot]将其转换为UIImage.然后,您可以将其上传到服务器并使用CGImageRelease(screenshot)释放图像.

You should be able to grab a screenshot of the whole screen with UICreateScreenImage(). This will give you a CGImageRef, which you can turn into a UIImage with [UIImage imageWithCGImage:screenshot]. You can then upload this to your server and release the image with CGImageRelease(screenshot).

更多推荐

越狱的iOS从后台应用获取屏幕截图

本文发布于:2023-11-30 03:31:34,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1648576.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:截图   后台   屏幕   iOS

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!