iphone-privateapi

How to take screenshot of entire screen on a Jailbroken iOS Device?

淺唱寂寞╮ 提交于 2019-11-29 18:04:55
I need to take screenshot of the whole screen including the status bar, I use CARenderServerRenderDisplay to achieve this, it works right on iPad, but wrong at iPhone 6 Plus. As the * marked part in the code, if I set width=screenSize.width*scale and height=screenSize.height*scale , it will cause crash, if I just change them as: width=screenSize.height*scale and height=screenSize.width*scale , it will works, but produce a image like that: , I've tried much but no reason found, does anyone know that? I hope I've described it clear enough. - (void)snapshot { CGFloat scale = [UIScreen mainScreen]

How to import a private framework in Xcode 8.3 without getting “Undefined symbols for architecture arm64”

青春壹個敷衍的年華 提交于 2019-11-29 16:29:07
问题 I am trying to use _CDBatterySaver to turn on low power mode simply using [[_CDBatterySaver batterySaver] setMode:1]; I know there isn't the same type of directory as previous Xcode so those methods don't work. I have also tried just importing the ".h" file but that doesn't work. It is part of the CoreDuet framework (downloaded from GitHub) Thanks 回答1: You will need a .tbd file to link against. Apple stopped shipping these for private frameworks starting with the iOS 9.3 SDK, but you can

get IMEI on iPhone with CoreTelephony?

╄→尐↘猪︶ㄣ 提交于 2019-11-29 10:54:15
I have tried the accepted answer of How to get IMEI on iPhone? but I got an empty string. I saw somebody suggested to use CoreTelephony framework, but I am not sure how to use it to obtain the IMEI. Any suggestion on how to use this private API? NOTE: this does not work anymore! Haven't tested on any new iOS. You have to add CoreTelephony.h to your project. Make sure the header has int * _CTServerConnectionCopyMobileEquipmentInfo ( struct CTResult * Status, struct __CTServerConnection * Connection, CFMutableDictionaryRef * Dictionary ); Then you can try this code: #import "CoreTelephony.h"

Using IOSurface to take screenshot in iOS7 in games

可紊 提交于 2019-11-29 10:23:23
问题 I'm trying to take screenshots from background using IOSurface, here's my code IOMobileFramebufferConnection connect; kern_return_t result; IOSurfaceRef screenSurface = NULL; io_service_t framebufferService = IOServiceGetMatchingService(kIOMasterPortDefault, IOServiceMatching("AppleH1CLCD")); if(!framebufferService) framebufferService = IOServiceGetMatchingService(kIOMasterPortDefault, IOServiceMatching("AppleM2CLCD")); if(!framebufferService) framebufferService = IOServiceGetMatchingService

iOS 6.1 Dynamic Library build and link

时间秒杀一切 提交于 2019-11-29 08:21:01
I am trying to create a dynamic library for iOS and load it at runtime. After taking a look at this question and this answer , I have been doing it using iOSOpenDev and deploying everything on my iPhone. The xCode project for the dylib is called KDylibTwo and the files I modiefied are: KDylibTwo.h #import <Foundation/Foundation.h> @interface KDylibTwo : NSObject -(void)run; @end KDylibTwo.m #import "KDylibTwo.h" @implementation KDylibTwo -(id)init { if ((self = [super init])) { } return self; } -(void)run{ NSLog(@"KDylibTwo loadded."); } @end In order to test if my library works, after

Using LSApplicationWorkspace in Swift

妖精的绣舞 提交于 2019-11-29 07:48:34
I've added MobileCoreServices.framework to my Xcode project, and have the statement import MobileCoreServices in top of my file. I have the line of code let test = LSApplicationWorkspace.defaultWorkSpace() And xcode said Unresolved Identifier LSApplicationWorkspace I tried cleaning and rebuilding the project. Any ideas? Point 1: LSApplicationWorkspace is private api, so if you use this and will upload your app to app store, it will get rejected. Point 2: If you are having any in-house app and still want to use this in your app, then below is the way to use it. Add MobileCoreServices Framework

Alternative method for NSURLRequest's private “setAllowsAnyHTTPSCertificate:forHost:”?

大城市里の小女人 提交于 2019-11-29 06:21:33
问题 My iPhone application was rejected solely for using the (very safe, it seems) private method +setAllowsAnyHTTPSCertificate:forHost: for NSURLRequest. Is there a non-private API to emulate this functionality? 回答1: There seems to be a public API for that ;) How to use NSURLConnection to connect with SSL for an untrusted cert? 回答2: Actually, I'm testing with 10.6.8 and this code still works -- it's using the private API but checking that the selector exists (myurl is the NSURL I'm trying to load

Taking Screenshots from iOS app - emulating Display recorder (query on the internals)

人盡茶涼 提交于 2019-11-29 05:07:06
I need to create an iOS app which can take screenshots of other apps, videos etc. as a part of an experiment. I am open to using Private API's since I won't be publishing the app to the app store. I could successfully use the method GetUIScreenImage() to take snapshots of the current screen (app screen). However, due to sandbox restrictions I am not able to take screenshots while in the background. I get the error - "Cannot call CreateUIScreenImage() while the app is in background". I referred to this article - How does the iOS app Display Recorder record the screen without using private API?

With GSCopyPurpleNamedPort(appId) in GraphicsServices deprecated in IOS7, what is the alternative approach? [closed]

风流意气都作罢 提交于 2019-11-29 04:13:20
问题 I want to send gsevent in IOS7. Which I follow from here:How to find the purple port for the front most application in IOS 5 and above? I got it working for IOS 4,5,6, now I am working on IOS7 beta. I found out that the private API has been changed. The result of GSCopyPurpleNamedPort(appId) is always 0. So how do I get the purple port of the current running application for IOS7, anyone has any ideas? 回答1: Take a look in the console logs, whether it says anything. Most likely (it's a guess),

How to monitoring App running in the foreground in iOS8?use the PrivateFrameworks SpringBoardServices

这一生的挚爱 提交于 2019-11-29 04:05:32
问题 Everyone Great God!I really need help~ Before iOS8,I use the PrivateFrameworks SpringBoardServices monitoring the App running in foreground is fine. Like the following code: #define SPRINGBOARDPATH "/System/Library/PrivateFrameworks/SpringBoardServices.framework/SpringBoardServices" .... +(void) monitoringFrontApp { mach_port_t *port; void *uikit = dlopen(SPRINGBOARDPATH, RTLD_LAZY); int (*SBSSpringBoardServerPort)() = dlsym(uikit, "SBSSpringBoardServerPort"); port = (mach_port_t *