AppSync 会导致 iCloud 和应用内购买出现一些问题,所以我想检测设备上是否存在它来处理 iCloud 和 IAP 的奇怪行为。有没有办法知道这一点?
没关系设备是否越狱,但AppSync阻止我的应用程序正常工作,而且这显然是“黑客的痕迹”。
我已经搜索并找到了 AppSync 的痕迹,这是找出它是否存在于设备上的代码。是的,它比需要的时间长一点,但我想确定一下。当然在发布代码中你应该以某种方式混淆字符串,但就是这样:
bool isAppSyncExist()
{
BOOL isbash = NO;
BOOL isappsync = NO;
FILE *f = fopen("/bin/bash", "r");
if (f != NULL)
{
//Device is jailbroken
isbash = YES;
fclose(f);
}
if (isbash)
{
f = fopen("/Library/MobileSubstrate/DynamicLibraries/AppSync.plist", "r");
if (f != NULL)
{
isappsync = YES;
fclose(f);
}
if (isappsync == NO)
{
NSError *err;
NSArray *files = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:@"/private/var/lib/dpkg/info" error:&err];
for (int i = 0; i < files.count; i++)
{
NSString *fname = [files objectAtIndex:i];
if ([fname rangeOfString:@"appsync" options:NSCaseInsensitiveSearch].location != NSNotFound)
{
isappsync = YES;
break;
}
}
}
if (isappsync == NO)
{
NSError *err;
NSArray *files = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:@"/var/lib/dpkg/info" error:&err];
for (int i = 0; i < files.count; i++)
{
NSString *fname = [files objectAtIndex:i];
if ([fname rangeOfString:@"appsync" options:NSCaseInsensitiveSearch].location != NSNotFound)
{
isappsync = YES;
break;
}
}
}
}
return isappsync == YES;
}