Skip to content

Commit

Permalink
remove checks
Browse files Browse the repository at this point in the history
  • Loading branch information
nickpatrick committed Aug 21, 2023
1 parent be700de commit 15258c6
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 53 deletions.
1 change: 0 additions & 1 deletion RadarSDK/RadarAPIClient.m
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,6 @@ - (void)trackWithLocation:(CLLocation *_Nonnull)location
params[@"attestationString"] = attestationString;
params[@"keyId"] = keyId;
params[@"attestationError"] = attestationError;
params[@"jailbroken"] = @([RadarUtils isJailbroken]);
params[@"encrypted"] = @(encrypted);
}
params[@"appId"] = [[NSBundle mainBundle] bundleIdentifier];
Expand Down
1 change: 0 additions & 1 deletion RadarSDK/RadarUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ NS_ASSUME_NONNULL_BEGIN
+ (CLLocation *)locationForDictionary:(NSDictionary *_Nonnull)dict;
+ (NSDictionary *)dictionaryForLocation:(CLLocation *)location;
+ (NSString *)dictionaryToJson:(NSDictionary *)dict;
+ (BOOL)isJailbroken;
+ (void)runOnMainThread:(dispatch_block_t)block;

@end
Expand Down
51 changes: 0 additions & 51 deletions RadarSDK/RadarUtils.m
Original file line number Diff line number Diff line change
Expand Up @@ -158,57 +158,6 @@ + (NSString *)dictionaryToJson:(NSDictionary *)dict {
}
}

+ (BOOL)isJailbroken {
NSArray *jailbreakFilePaths = @[
@"/Applications/Cydia.app",
@"/Library/MobileSubstrate/MobileSubstrate.dylib",
@"/bin/bash",
@"/usr/sbin/sshd",
@"/etc/apt",
@"/private/var/lib/apt/"
];

for (NSString *path in jailbreakFilePaths) {
if ([[NSFileManager defaultManager] fileExistsAtPath:path]) {
NSLog(@"failed check 1");
return YES;
}
}

NSString *testPath = @"/private/JailbreakTest.txt";
NSData *data = [@"This is a test." dataUsingEncoding:NSUTF8StringEncoding];

NSError *error;
[data writeToFile:testPath options:NSDataWritingAtomic error:&error];

// If no error occurred, the device is likely jailbroken
if (!error) {
NSLog(@"failed check 2");
[[NSFileManager defaultManager] removeItemAtPath:testPath error:nil];
return YES;
}

void *dyld = dlopen(NULL, RTLD_NOW);
if (dyld != NULL) {
int imageCount = _dyld_image_count();
for (int i = 0; i< imageCount; i++) {
const char *dylibNameC = _dyld_get_image_name(i);
NSString *dylibName = [NSString stringWithUTF8String:dylibNameC];
if ([dylibName containsString:@"MobileSubstrate"]) {
NSLog(@"failed check 3");
return YES;
}
}
}

if ([[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:@"cydia://package/com.example.package"]]) {
NSLog(@"failed check 4");
return YES;
}

return NO;
}

#pragma mark - threading

+ (void)runOnMainThread:(dispatch_block_t)block {
Expand Down

0 comments on commit 15258c6

Please sign in to comment.