【发布时间】:2014-02-08 22:52:53
【问题描述】:
我正在使用 theos 为 iOS 编写我的第一个调整,但我一直在优化。正如我所见,dylib 每次都会检查(每秒?)“([[settings objectForKey:@"something"] boolValue]) " 和 "[[settings objectForKey:@"SomethingHere"] boolValue]" 在 plist 文件中。
可以吗? 有什么优化建议吗? 这是我的调整:
%hook Something
- (void)somethingheree:(_Bool)arg1 withNumberOfDevices:(int)arg2
{
NSMutableDictionary *settings = [NSMutableDictionary dictionaryWithContentsOfFile:
[NSString stringWithFormat:@"%@/Library/Preferences/%@", NSHomeDirectory(), @"com.yourcompany.mytweak.plist"]];
if([[settings objectForKey:@"something"] boolValue]) {
%orig(YES,100);
}
else %orig;
}
%end
%hook somethinganother
- (void)somethinghere:(_Bool)arg1
{
NSMutableDictionary *settings = [NSMutableDictionary dictionaryWithContentsOfFile:
[NSString stringWithFormat:@"%@/Library/Preferences/%@", NSHomeDirectory(), @"com.yourcompany.mytweak.plist"]];
if([[settings objectForKey:@"SomethingHere"] boolValue]) {
%orig(NO);
} else %orig;
}
%end
【问题讨论】:
标签: ios objective-c xcode jailbreak theos