我正在开展一个项目(移动应用),我需要监控对手的行为.那么我的问题是如何让iOS应用程序篡改?
例如
>每当任何对手尝试篡改代码时,系统应该提醒管理员这些操作
>并阻止对手
>如果用户尝试在根设备上安装应用程序,那么系统可以检测到.
>系统应该可以监控对手行动.
并研究了很多时间,但没有发现任何东西.
我发现Android的解决方案像ProGuard,SafeNet,但没有发现任何iOS.
任何帮助非常感谢,谢谢提前.
解决方法@H_404_16@
我在我的一个项目中使用了这个
JailBreak detection.
这样可以防止这种可能性.
if ([DTTJailbreakDetection isJailbroken]) {
// your custom activity and business logic here
}
另外,准确地说,你可以使用下面的代码段:
BOOL isJailbroken()
{
#if !(TARGET_IPHONE_SIMULATOR)
if ([[NSFileManager defaultManager] fileExistsAtPath:@"/Applications/Cydia.app"] ||
[[NSFileManager defaultManager] fileExistsAtPath:@"/Library/MobileSubstrate/MobileSubstrate.dylib"] ||
[[NSFileManager defaultManager] fileExistsAtPath:@"/bin/bash"] ||
[[NSFileManager defaultManager] fileExistsAtPath:@"/usr/sbin/sshd"] ||
[[NSFileManager defaultManager] fileExistsAtPath:@"/etc/apt"] ||
[[NSFileManager defaultManager] fileExistsAtPath:@"/private/var/lib/apt/"] ||
[[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:@"cydia://package/com.example.package"]]) {
return YES;
}
FILE *f = NULL ;
if ((f = fopen("/bin/bash","r")) ||
(f = fopen("/Applications/Cydia.app","r")) ||
(f = fopen("/Library/MobileSubstrate/MobileSubstrate.dylib","r")) ||
(f = fopen("/usr/sbin/sshd","r")) ||
(f = fopen("/etc/apt","r"))) {
fclose(f);
return YES;
}
fclose(f);
NSError *error;
NSString *stringToBeWritten = @"This is a test.";
[stringToBeWritten writeToFile:@"/private/jailbreak.txt" atomically:YES encoding:NSUTF8StringEncoding error:&error];
[[NSFileManager defaultManager] removeItemAtPath:@"/private/jailbreak.txt" error:nil];
if(error == nil)
{
return YES;
}
#endif
return NO;
}
另外Obfuscation在iOS – 目标C你可以使用这个open source-library和Methods & Classes.
这样可以防止这种可能性.
if ([DTTJailbreakDetection isJailbroken]) { // your custom activity and business logic here }
另外,准确地说,你可以使用下面的代码段:
BOOL isJailbroken() { #if !(TARGET_IPHONE_SIMULATOR) if ([[NSFileManager defaultManager] fileExistsAtPath:@"/Applications/Cydia.app"] || [[NSFileManager defaultManager] fileExistsAtPath:@"/Library/MobileSubstrate/MobileSubstrate.dylib"] || [[NSFileManager defaultManager] fileExistsAtPath:@"/bin/bash"] || [[NSFileManager defaultManager] fileExistsAtPath:@"/usr/sbin/sshd"] || [[NSFileManager defaultManager] fileExistsAtPath:@"/etc/apt"] || [[NSFileManager defaultManager] fileExistsAtPath:@"/private/var/lib/apt/"] || [[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:@"cydia://package/com.example.package"]]) { return YES; } FILE *f = NULL ; if ((f = fopen("/bin/bash","r")) || (f = fopen("/Applications/Cydia.app","r")) || (f = fopen("/Library/MobileSubstrate/MobileSubstrate.dylib","r")) || (f = fopen("/usr/sbin/sshd","r")) || (f = fopen("/etc/apt","r"))) { fclose(f); return YES; } fclose(f); NSError *error; NSString *stringToBeWritten = @"This is a test."; [stringToBeWritten writeToFile:@"/private/jailbreak.txt" atomically:YES encoding:NSUTF8StringEncoding error:&error]; [[NSFileManager defaultManager] removeItemAtPath:@"/private/jailbreak.txt" error:nil]; if(error == nil) { return YES; } #endif return NO; }
另外Obfuscation在iOS – 目标C你可以使用这个open source-library和Methods & Classes.