NSDictionary *preference = [NSDictionary dictionaryWithContentsOfFile:@"/var/mobile/Library/Preferences/com.test.plist"];
NSString *sn = preference[@"sn"];
记得之前10系统,Tweak中可以正常读取,但是,发现,11系统,无法读取了,直接闪退.
老师们,你们是怎么解决的?多谢了
试了 chown mobile:mobile chmod 7777 依然不能读取
进一步试验,发现,
放在:
__attribute__((constructor))
static void initialize()
{
NSDictionary *preference = [NSDictionary dictionaryWithContentsOfFile:@"/var/mobile/Library/Preferences/com.test.plist"];
NSString *sn = preference[@"sn"]; **没有读取权限**
}
这里面无法读取,
而放在:
%hook xxxxx
NSDictionary *preference = [NSDictionary dictionaryWithContentsOfFile:@"/var/mobile/Library/Preferences/com.test.plist"];
NSString *sn = preference[@"sn"]; **具有读取权限**
%end
之前一直放在initialize() 方法中,初始化时,把几个参数,读取出来,具然11系统不行了.
老师位帮分析一下原因?谢谢