越狱检查方法,苹果会批准这个吗?
Jailbreak check method, apple will approve this?
在我的应用程序中,有时我需要检查 运行 设备是否是越狱设备。这是我找到的最完整的方法:
BOOL Jail=NO;
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"]]) {
Jail= 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);
Jail= 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)
{
Jail= YES;
}
我还没有找到,这是对问题的明确答案:"Apple will approve this code?",在指南中我可以阅读:
"Apps that read or write data outside its designated container area will be rejected".
但是很明显,我正在尝试写入或只读以检查设备是否越狱...所以有人已成功将此代码提交给苹果?
这是提交的应用代码
BOOL bash = NO;
FILE *f = fopen("/bin/bash", "r");
if (f != NULL)
{
bash = YES;
}
fclose(f);
return bash;
所以,我相信你的代码也会被接受
也许吧。
许多开发人员的产品都因包括越狱检查而被拒绝,而许多人则没有。如果您提交越狱检查,您应该不会期望获得批准(尽管这次您可能会通过审核流程)。
- App with jailbreak detection rejected by Apple
- https://github.com/sat2eesh/ios-jailBroken/issues/4
在我的应用程序中,有时我需要检查 运行 设备是否是越狱设备。这是我找到的最完整的方法:
BOOL Jail=NO;
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"]]) {
Jail= 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);
Jail= 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)
{
Jail= YES;
}
我还没有找到,这是对问题的明确答案:"Apple will approve this code?",在指南中我可以阅读:
"Apps that read or write data outside its designated container area will be rejected".
但是很明显,我正在尝试写入或只读以检查设备是否越狱...所以有人已成功将此代码提交给苹果?
这是提交的应用代码
BOOL bash = NO;
FILE *f = fopen("/bin/bash", "r");
if (f != NULL)
{
bash = YES;
}
fclose(f);
return bash;
所以,我相信你的代码也会被接受
也许吧。
许多开发人员的产品都因包括越狱检查而被拒绝,而许多人则没有。如果您提交越狱检查,您应该不会期望获得批准(尽管这次您可能会通过审核流程)。
- App with jailbreak detection rejected by Apple
- https://github.com/sat2eesh/ios-jailBroken/issues/4