-static NSSet *MobilizedFiles_;
-
-static NSURL *MobilizeURL(NSURL *url) {
- NSString *path([url path]);
- if ([path hasPrefix:@"/var/root/"]) {
- NSString *file([path substringFromIndex:10]);
- if ([MobilizedFiles_ containsObject:file])
- url = [NSURL fileURLWithPath:[@"/var/mobile/" stringByAppendingString:file] isDirectory:NO];
- }
-
- return url;
-}
-
-Class $CFXPreferencesPropertyListSource;
-@class CFXPreferencesPropertyListSource;
-
-MSHook(BOOL, CFXPreferencesPropertyListSource$_backingPlistChangedSinceLastSync, CFXPreferencesPropertyListSource *self, SEL _cmd) {
- NSURL *&url(MSHookIvar<NSURL *>(self, "_url")), *old(url);
- NSAutoreleasePool *pool([[NSAutoreleasePool alloc] init]);
-
- url = MobilizeURL(url);
- BOOL value; @try {
- value = _CFXPreferencesPropertyListSource$_backingPlistChangedSinceLastSync(self, _cmd);
- //NSLog(@"CFX %@ %s", [url absoluteString], value ? "YES" : "NO");
- } @finally {
- url = old;
- }
-
- [pool release];
- return value;
-}
-
-MSHook(void *, CFXPreferencesPropertyListSource$createPlistFromDisk, CFXPreferencesPropertyListSource *self, SEL _cmd) {
- NSURL *&url(MSHookIvar<NSURL *>(self, "_url")), *old(url);
- NSAutoreleasePool *pool([[NSAutoreleasePool alloc] init]);
-
- url = MobilizeURL(url);
- void *value; @try {
- value = _CFXPreferencesPropertyListSource$createPlistFromDisk(self, _cmd);
- //NSLog(@"CFX %@ %@", [url absoluteString], value);
- } @finally {
- url = old;
- }
-
- [pool release];
- return value;
-}
-