iOS 判断设备是否越狱

@interface UIDevice (Helper)
- (BOOL)isJailbroken;
@end

@implementation UIDevice (Helper)
- (BOOL)isJailbroken {
BOOL jailbroken = NO;
NSString *cydiaPath = @"/Applications/Cydia.app";
NSString *aptPath = @"/private/var/lib/apt/";
if ([[NSFileManager defaultManager] fileExistsAtPath:cydiaPath]) {
jailbroken = YES;
}
if ([[NSFileManager defaultManager] fileExistsAtPath:aptPath]) {
jailbroken = YES;
}
return jailbroken;
}
@end

  

时间: 2024-11-05 06:50:17

iOS 判断设备是否越狱的相关文章

iOS 判断设备是否越狱了

1 #import "PrisonBreakCheck.h" 2 3 @implementation PrisonBreakCheck 4 /** 5 * 判断iPhone是否越狱了 6 */ 7 +(BOOL)checkPrisonBreak 8 { 9 //获取当前环境参数 10 char *env = getenv("DYLD_INSERT_LIBRARIES"); 11 NSLog(@"%s", env); 12 //如果env 不是空

IOS判断设备是否已越狱

转自:http://www.cnblogs.com/supercheng/archive/2012/12/05/2804166.html - (BOOL)isJailbroken { BOOL jailbroken = NO; NSString *cydiaPath = @"/Applications/Cydia.app"; NSString *aptPath = @"/private/var/lib/apt/"; if ([[NSFileManagerdefaul

iOS 判断设备型号的三种方式

方法一: //***宏定义 #define iPhone5 ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(640, 1136), [[UIScreen mainScreen] currentMode].size) : NO) 方法二: 还有做适配,代码中不要写320和480什么的初始化坐标,要用屏幕高度和宽度初始化#define Screen_height 

判断设备是否越狱

代码: +(BOOL)isJailbroken { NSString *cydiaPath = @"/Applications/Cydia.app"; NSString *aptPath = @"/private/var/lib/apt/"; return [[NSFileManager defaultManager] fileExistsAtPath:cydiaPath] || [[NSFileManager defaultManager] fileExistsA

IOS判断设备是否联网

1.导入SystemConfiguration.framework,并#import<SystemConfiguration/SCNetworkReachability.h> + (BOOL)connectedToNetwork { //创建零地址,0.0.0.0的地址表示查询本机的网络连接状态 struct sockaddr_storage zeroAddress;//IP地址 bzero(&zeroAddress, sizeof(zeroAddress));//将地址转换为0.0.

iOS 判断设备为iPhone还是iPad

if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) { self.viewController = [[[_ViewController alloc] initWithNibName:@"_ViewController_iPhone" bundle:nil] autorelease]; } else { self.viewController = [[[_ViewControll

iOS 判断系统是否越狱的代码

+ (BOOL) hasCydia{ return [[NSFileManager defaultManager] fileExistsAtPath:@"/Applications/Cydia.app"]; } + (BOOL) hasAPT { return [[NSFileManager defaultManager] fileExistsAtPath:@"/private/var/lib/apt/"]; } + (BOOL) successCallSystem

判断设备是否越狱的方法

- (BOOL)isJailbroken { BOOL jailbroken = NO; NSString *cydiaPath = @"/Applications/Cydia.app"; NSString *aptPath = @"/private/var/lib/apt/"; if ([[NSFileManager defaultManager] fileExistsAtPath:cydiaPath]) { jailbroken = YES; } if ([[N

ios判断设备是iphone还是ipad

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {    self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];    // Override point for customization after application