Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
diwu committed Mar 9, 2013
0 parents commit 74cc942
Show file tree
Hide file tree
Showing 3 changed files with 70 additions and 0 deletions.
15 changes: 15 additions & 0 deletions JailBreakDetector.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
//
// JailBreakDetector.h
// JailBreakDetector
//
// Created by Di Wu on 3/9/13.
// Copyright (c) 2013 Di Wu. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface JailBreakDetector : NSObject

+ (BOOL)isJailBreak;

@end
37 changes: 37 additions & 0 deletions JailBreakDetector.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
//
// JailBreakDetector.m
// JailBreakDetector
//
// Created by Di Wu on 3/9/13.
// Copyright (c) 2013 Di Wu. All rights reserved.
//

#import "JailBreakDetector.h"

@implementation JailBreakDetector

+ (BOOL)isJailBreak
{
BOOL cydia = NO;
BOOL binBash = NO;
NSString *filePath = @"/Applications/Cydia.app";
if ([[NSFileManager defaultManager] fileExistsAtPath:filePath])
{
cydia = YES;
}

FILE * f = fopen("/bin/bash", "r");
if (f != NULL)
{
binBash = YES;
}
fclose(f);

if (cydia || binBash) {
return YES;
} else {
return NO;
}
}

@end
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# iOS Jailbreak Detector


## Overview

A drop-in class that dynamically detects whether the iOS device your app is running on has been jailbroken or not.

## 100% App Store Submission Safe. No Private API

I myself have a few apps using this class to detect jailbreak devices. So far 100% App Store submission safe.

##License
The code is released under the [MIT License](http://opensource.org/licenses/mit-license.php).

##Contact
Email: [email protected]

:)

0 comments on commit 74cc942

Please sign in to comment.