ios 루팅방지 체크 소스
+(BOOL)isJailbroken{
#if !(TARGET_IPHONE_SIMULATOR)
if ([[NSFileManager defaultManager] fileExistsAtPath:@”/Applications/Cydia.app”]){
return YES;
}else if([[NSFileManager defaultManager] fileExistsAtPath:@”/Library/MobileSubstrate/MobileSubstrate.dylib”]){
return YES;
}else if([[NSFileManager defaultManager] fileExistsAtPath:@”/bin/bash”]){
return YES;
}else if([[NSFileManager defaultManager] fileExistsAtPath:@”/usr/sbin/sshd”]){
return YES;
}else if([[NSFileManager defaultManager] fileExistsAtPath:@”/etc/apt”]){
return YES;
}
return NO;
NSError *error;
NSString *stringToBeWritten = @"This is a test.";
[stringToBeWritten writeToFile:@”/private/jailbreak.txt” atomically:YES encoding:NSUTF8StringEncoding error:&error];
if(error==nil){
//Device is jailbroken
return YES;
} else {
//Device is not jailbroken
[[NSFileManager defaultManager] removeItemAtPath:@”/private/jailbreak.txt” error:nil];
}
if([[UIApplication sharedApplication] canOpenUrl: [NSURL URLWithString:@”cydia://package/com.example.package”]]){
//Device is jailbroken
}
#endif
//All checks have failed. Most probably, the device is not jailbroken
return NO;
}
참고:http://bitxflow.synology.me/wordpress/?p=311
'ios 뽀개기 > objective-c' 카테고리의 다른 글
objective c session post get방식 정리! (1) | 2018.10.29 |
---|---|
Ios 그림파일을 텍스트로 바꾸기 (1) | 2018.10.25 |
UIViewContorller의 수명주기 관리 메서드 (0) | 2018.10.23 |
iOS 파일 시스템 관련 함수들 (NSFileManager Class) (3) | 2018.10.23 |
objective c 의 모든것 (5) | 2018.07.28 |
댓글