版权声明:本文为博主原创文章,未经博主允许不得转载。
先导入三方类库
JailBreakDetection.h
JailBreakDetection.m
#import "AppDelegate.h"
#import "JailBreakDetection.h"
@interface AppDelegate ()
@end
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
//判断此设备是否越狱
if ([JailBreakDetection isJailBreak]) {
//Jailbreak detected. Add code to handle this.
NSLog(@"This is jailbreaked");
UIAlertView* alertView = [[UIAlertView alloc] initWithTitle:nil message:@"\n\nThis application is not supported in Jailbroken iOS devices.\n此應用程式不可在已越獄的iOS裝置上執行。" delegate:nil cancelButtonTitle:nil otherButtonTitles:nil];
[alertView addSubview:[[UIView alloc] initWithFrame:CGRectMake(0, 0, 0, 0)] ];
[alertView show];
return YES;
}else{
NSLog(@"This is no jailbreaked 此设备不是越狱机");
}
return YES;
}
转载请注明出处:http://blog.csdn.net/sevenquan