xingbei
(xingbei)
2015 年10 月 27 日 00:01
1
daemon进程读取我自己客户端存储的文件一直导致程序崩溃推出
在把内容从文件读取出来的第一步就回崩溃
ios8 下[NSData dataWithContentsOfFile]一直都很正常,但是在ios9下就回导致程序崩溃,我换用C代码直接读取文件内容,但是还是崩溃
char* readFileBytes(const char *name)
{
NSLog(@" >> >> >> read file data in c start .. %s",name);
FILE *fl = fopen(name, "r");
fseek(fl, 0, SEEK_END);
long len = ftell(fl);
NSLog(@" >> >> >> read file %s data len %ld",name,len);
char *ret = malloc(len);
NSLog(@" >> >> >> read file data in c malloc");
fseek(fl, 0, SEEK_SET);
NSLog(@" >> >> >> read file data in c seek");
fread(ret, sizeof(char), len, fl);
NSLog(@" >> >> >> read file data in c fread");
fclose(fl);
NSLog(@" >> >> >> read file data in c return");
return ret;
}
测试发现程序在最后fread 的时候崩溃了
我的daemon的权限是root
#ls -lah
-rwxr-xr-x 1 root wheel 139K Oct 27 07:03 Demond*
请问是不是Ios9的安全机制导致这个问题的?这种情况怎么破啊?
xingbei
(xingbei)
2015 年10 月 27 日 01:27
3
根本没有崩溃日志,try catch都catch不到,以为我的daemon是在启动的时候读取文件内容的,现在导致daemon在启动的一瞬间就崩溃掉了,crashreporter也说不会记录这个日志,因为not-acitonable,一会儿我贴图上来
你不要在启动时读,等启动完了过10秒再读,看看崩不崩
xingbei
(xingbei)
2015 年10 月 27 日 22:36
6
NSDictionary * unPackFile(NSString* filename)
{
NSLog(@" >> >> get ziped data start");
if (![[NSFileManager defaultManager] fileExistsAtPath:filename]) {
return nil;
}
NSDictionary *fileAttributes = [[NSFileManager defaultManager] attributesOfItemAtPath:filename error:nil];
NSNumber *fileSize = [fileAttributes objectForKey:NSFileSize];
NSLog(@" >> >> check file exist %@ ", fileAttributes);
@try {
NSLog(@" >> >> read file data start");
NSData *zipedData = [NSData dataWithContentsOfFile:filename];
NSLog(@" >> >> get ziped data 。。。 %@", filename);
NSData *encryptedData = unZipData(zipedData);
NSLog(@" >> >> unziped data 。。。 %@", filename);
}
@catch (NSException *exception) {
NSLog(@" >> >> >> %@", exception.reason);
}
}
下面是syslog
Oct 28 06:27:44 iPhone Demond[1356]: >> >> get ziped data start
Oct 28 06:27:44 iPhone Demond[1356]: >> >> check file exist {
NSFileCreationDate = "2015-07-12 16:04:38 +0000";
NSFileExtensionHidden = 0;
NSFileGroupOwnerAccountID = 20;
NSFileGroupOwnerAccountName = staff;
NSFileModificationDate = "2015-07-12 16:04:38 +0000";
NSFileOwnerAccountID = 501;
NSFileOwnerAccountName = mobile;
NSFilePosixPermissions = 420;
NSFileProtectionKey = NSFileProtectionCompleteUntilFirstUserAuthentication;
NSFileReferenceCount = 1;
NSFileSize = 4422380;
NSFileSystemFileNumber = 129763;
NSFileSystemNumber = 16777219;
NSFileType = NSFileTypeRegular;
}
Oct 28 06:27:44 iPhone Demond[1356]: >> >> read file data start
Oct 28 06:27:44 iPhone ReportCrash[1362]: MS:Notice: Injecting: (null) [ReportCrash] (1240.10)
Oct 28 06:27:44 iPhone ReportCrash[1362]: MS:Notice: Loading: /Library/MobileSubstrate/DynamicLibraries/RocketBootstrap.dylib
Oct 28 06:27:44 iPhone diagnosticd[187]: error evaluating process info - pid: 1356, punique: 1356
Oct 28 06:27:44 iPhone ReportCrash[1362]: Formulating report for process[1356] IAPCrazyDemond
Oct 28 06:27:44 iPhone UserEventAgent[117]: jetsam: kernel termination snapshot being created
Oct 28 06:27:44 iPhone ReportCrash[1362]: report not saved because it is non-actionable
NSFileManager能获取文件的各种信息,但是读取的时候就会崩溃,并且
#report not saved because it is non-actionable
@snakeninny
bean
(NbeanN)
2017 年2 月 10 日 08:29
10
大神请问一下我根据狗神的文章下载的fauxsu,里面没有fauxsu和libdauxsu.dylib文件,请问一下你是在哪里在下的?
我通过一片帖子里面下载的fauxsu,里面有fauxsu和libdauxsu.dylib文件,放到$THEOS/bin/下面,执行了chmod a+x $THEOS/bin/fauxsu 然后权限还是staff
请问一下是哪里有问题吗?
我个人感觉是fauxsu的下载地址有问题,能否分享一下你的fauxsu的下载地址或者分享一个文件也行,谢过大神