iOS开发判断手机是否越狱

iOS判断手机是否越狱,代码如下:

+ (BOOL)isJailbreaking {
    if ([[NSFileManager defaultManager] fileExistsAtPath:@"/Applications/Cydia.app"] ||
        [[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:@"cydia://package/com.example.package"]] ||
        [[NSFileManager defaultManager] fileExistsAtPath:@"/Library/MobileSubstrate/MobileSubstrate.dylib"]) {
        return YES;
    }
    return NO;
}

我曾执笔雕刻时光 奈何良辰难书过往

你可能感兴趣的:(iOS开发判断手机是否越狱)