determining whether the device iOS escape (to combine the two determination)

Note: The only real escape test machine

+ (BOOL)JailBreak{
    BOOL status1 = NO;
    BOOL status2 = NO;
    //根据是否能打开cydia判断
    status1 = [[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:@"cydia://"]];
    //根据是否能获取所有应用的名称判断 没有越狱的设备是没有读取所有应用名称的权限的
    status2 = [[NSFileManager defaultManager] fileExistsAtPath:@"User/Applications/"];
    if (status1 || status2) {  //如果有一只方式判定为设备越狱了那么设备就越狱了不接受任何反驳
        return  YES;
    }else{
        return  NO;
    }
}

Guess you like

Origin blog.csdn.net/weixin_34389926/article/details/90830786