How does the iOS app Display Recorder record the screen without using private API?

后端 未结 2 1633
轻奢々
轻奢々 2020-11-27 10:26

The iOS app Display Recorder claims to be able to record the screen of an iOS device, even while it is in the background. Given that UIGetScreenImage() is priva

2条回答
  •  独厮守ぢ
    2020-11-27 11:16

    @C0deH4cker's suggestion of the IOSurface framework is just crazy enough to work. IOSurface provides a kernel interface (allowing an app to slip out of its sandbox quietly), for a rectangular pixel buffer (screen grabs), that can be converted to a CGImage or UIImage using framework-related methods.

    Even apple suggests that the framework's raison d'être is to:

    Contain low-level interfaces for sharing graphics surfaces between applications.

    Best part is, it's not legal in iOS. The framework used to be called CoreSurface in iOS 2.x, which was quickly and quietly deprecated in 3.x, only to be replaced by iOSurface. I guess the fact that it's private and unlisted in the iOS references meant that the app store testers didn't test for it. Interesting.

提交回复
热议问题