iOS限制此应用不可在越狱机上使用

来源:互联网 发布:我国对外投资数据 编辑:程序博客网 时间:2024/06/03 16:58

版权声明:本文为博主原创文章,未经博主允许不得转载。


先导入三方类库

JailBreakDetection.h

JailBreakDetection.m


#import "AppDelegate.h"

#import "JailBreakDetection.h"

@interface AppDelegate ()


@end


@implementation AppDelegate



- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {

    

    

    //判断此设备是否越狱

    

    if ([JailBreakDetectionisJailBreak]) {

        //Jailbreak detected. Add code to handle this.

        NSLog(@"This is jailbreaked");

        

        UIAlertView* alertView = [[UIAlertViewalloc] initWithTitle:nilmessage:@"\n\nThis application is not supported in Jailbroken iOS devices.\n此應用程式不可在已越獄的iOS裝置上執行。"delegate:nilcancelButtonTitle:nilotherButtonTitles:nil];

        [alertViewaddSubview:[[UIViewalloc] initWithFrame:CGRectMake(0,0, 0, 0)] ];

        [alertViewshow];

        

       return YES;

        

    }else{

        

        NSLog(@"This is no jailbreaked此设备不是越狱机");

    }

    return YES;

    

}



转载请注明出处:http://blog.csdn.net/sevenquan




0 0
原创粉丝点击