iphone-privateapi

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

喜夏-厌秋 提交于 2019-11-28 12:23:46
问题 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

Creating an image out of the ios surface and saving it

别说谁变了你拦得住时间么 提交于 2019-11-28 10:39:00
I am trying to acquire the surface associated with the main screen of the ios device, create an image out of it and save it. This is in relevance to this question - Taking Screenshots from iOS app - emulating Display recorder (query on the internals) . The code is as follows: IOMobileFramebufferConnection connect; kern_return_t result; io_service_t framebufferService = IOServiceGetMatchingService(kIOMasterPortDefault, IOServiceMatching("AppleH1CLCD")); if(!framebufferService) framebufferService = IOServiceGetMatchingService(kIOMasterPortDefault, IOServiceMatching("AppleM2CLCD")); if(

Taking Screenshots in the background (iOS) - Improving Performance

只谈情不闲聊 提交于 2019-11-28 09:33:37
This question is an extension to: Taking Screenshots from iOS app - emulating Display recorder (query on the internals) There are 2 ways I came across to take screenshots from the background - 1. Creating an image out of the ios surface and saving it - it captures at a very fast rate (approximately 0.2-0.3 sec/ 12-15 screenshots), however there are some problems that are encountered, discussed here: Releasing an IOSurface 2. The following code does the same job using the createScreenIOSurface API: IOSurfaceRef surface = [UIWindow createScreenIOSurface]; UIImage *surfaceImage = [[UIImage alloc]

Alternatives to NSHost in iPhone app

时光总嘲笑我的痴心妄想 提交于 2019-11-28 09:29:22
I'm currently using this code NSHost *host = [NSHost hostWithAddress:hostname]; if (host == nil) { host = [NSHost hostWithName:hostname]; if (host == nil) { [self setMessage:@"Invalid IP address or hostname:"]; return; } } to retrive my IP Address for a networking app I'm working on, however I'm aware that NSHost is a private API that will be rejected. Can anyone help me with working this code to produce the same results without using NSHost? I'm not really sure where to start. EDIT: Following suggestions that seem damn near perfect below I've added this code into my app in the place of the

iOS How to use Entitlement.plist to specify property of my app

♀尐吖头ヾ 提交于 2019-11-28 09:27:07
I'm using Jailbreak + Appsync + iOS5.0.1 device (without a developer license but with some tricks I can run my app on the device) Now I want to use a private API launchApplicationWithIdentifier:suspended:. So I need to add <key>com.apple.springboard.launchapplications</key> <true/> to myApp.entitlements.plist file. Then it should work but I still got the error 'Receiver type 'UIApplication' for instance message does not declare a method with selector 'launchApplicationWithIdentifier:suspended:'' Then I found someone said, code signing must be enable if I want to use Entitlements.plist. Is it

How to access iOS private APIs in Swift?

荒凉一梦 提交于 2019-11-28 09:09:59
How can I call non-public iOS functions and acces non public properies from Swift? Specifically, I would like to use one non-public class in QuartzCore framework. One solution that came to my mind is to create "bridging" Objective-C project that would wrap this non-public APIs into public ones and than call this Objective-C functions from Swift. However, my solution is pure Swift now and I would prefer to keep it that way. Is there any more staitforward way? (for example adding something to Objective-C bridging header file ) Note: I know what you are thinking, private APIs are private because

Will apps that use telprompt be rejected

北慕城南 提交于 2019-11-28 08:19:43
In order to return to app after call, I use telprompt instead of tel. Codes like this: [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"telprompt://10086"]]; Somebody says that it will be rejected by apple because telpromt is not the public URL Scheme. But I didn't find a certain answer - Yes or No. Can anybody help me? You may want to have a look at handleopenurl.com an index for iOS URL schemes. I do not know telprompt. Why not just use tel://10086? Sal I noticed that with iOS 8.0 the tel:// URL scheme will also return to the app after the call. The only difference now is

get IMEI on iPhone with CoreTelephony?

。_饼干妹妹 提交于 2019-11-28 04:37:27
问题 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? 回答1: 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 *

Get list of all installed application in ios 8

落花浮王杯 提交于 2019-11-28 04:12:11
How to get list of all installed Applications on iPhone device programmatically in iOS 8. If anyone knows the solution by using private APIs(but device non-jailbroken) then its well and good. I know that it is possible using iTunes Search API, but it gives only those applications that are installed from iTunes. I need all the applications on device, whether it is from iTunes or user-developed or system apps. try this. it works,I've tested. #include <objc/runtime.h> Class LSApplicationWorkspace_class = objc_getClass("LSApplicationWorkspace"); NSObject* workspace = [LSApplicationWorkspace_class

GSSendEvent - Inject Touch Event iOS

。_饼干妹妹 提交于 2019-11-27 21:36:50
I want to inject touch event in iPhone. I get the coordinates of touch event via network socket. GSSendEvent seems to be good choice. However, it needs GSEventRecord as one of the inputs. Does anyone know how to prepare GSEventRecord? I prepared it based on some examples but the app crashes after GSSendEvent call. Appreciate any help. -(void) handleMouseEventAtPoint:(CGPoint) point { static mach_port_t port_; // structure of touch GSEvent struct GSTouchEvent { GSEventRecord record; GSHandInfo handInfo; } ; struct GSTouchEvent *touchEvent = (struct GSTouchEvent *) malloc(sizeof(struct