X-Git-Url: https://git.saurik.com/cydia.git/blobdiff_plain/f14bba6943800576a00433dae4458f472b9aae7e..7d7000357dfc9fbba18cb60b3c4021d8db8351b1:/MobileCydia.mm diff --git a/MobileCydia.mm b/MobileCydia.mm index 97ff1d4a..18737029 100644 --- a/MobileCydia.mm +++ b/MobileCydia.mm @@ -834,7 +834,7 @@ NSString *LocalizeSection(NSString *section) { NSString *Simplify(NSString *title) { const char *data = [title UTF8String]; - size_t size = [title length]; + size_t size = [title lengthOfBytesUsingEncoding:NSUTF8StringEncoding]; static Pcre square_r("^\\[(.*)\\]$"); if (square_r(data, size)) @@ -9344,6 +9344,9 @@ _end return false; } + if ([tabbar_ modalViewController] != nil) + return false; + // Use external process status API internally. // This is probably a really bad idea. // XXX: what is the point of this? does this solve anything at all? @@ -9900,10 +9903,15 @@ Class $CFXPreferencesPropertyListSource; MSHook(BOOL, CFXPreferencesPropertyListSource$_backingPlistChangedSinceLastSync, CFXPreferencesPropertyListSource *self, SEL _cmd) { NSURL *&url(MSHookIvar(self, "_url")), *old(url); NSAutoreleasePool *pool([[NSAutoreleasePool alloc] init]); + url = MobilizeURL(url); - BOOL value(_CFXPreferencesPropertyListSource$_backingPlistChangedSinceLastSync(self, _cmd)); - //NSLog(@"%@ %s", [url absoluteString], value ? "YES" : "NO"); - url = old; + BOOL value; @try { + value = _CFXPreferencesPropertyListSource$_backingPlistChangedSinceLastSync(self, _cmd); + //NSLog(@"CFX %@ %s", [url absoluteString], value ? "YES" : "NO"); + } @finally { + url = old; + } + [pool release]; return value; } @@ -9911,10 +9919,15 @@ MSHook(BOOL, CFXPreferencesPropertyListSource$_backingPlistChangedSinceLastSync, MSHook(void *, CFXPreferencesPropertyListSource$createPlistFromDisk, CFXPreferencesPropertyListSource *self, SEL _cmd) { NSURL *&url(MSHookIvar(self, "_url")), *old(url); NSAutoreleasePool *pool([[NSAutoreleasePool alloc] init]); + url = MobilizeURL(url); - void *value(_CFXPreferencesPropertyListSource$createPlistFromDisk(self, _cmd)); - //NSLog(@"%@ %@", [url absoluteString], value); - url = old; + void *value; @try { + value = _CFXPreferencesPropertyListSource$createPlistFromDisk(self, _cmd); + //NSLog(@"CFX %@ %@", [url absoluteString], value); + } @finally { + url = old; + } + [pool release]; return value; } @@ -10034,7 +10047,9 @@ int main(int argc, char *argv[]) { if (Method method = class_getInstanceMethod($WAKWindow, @selector(screenSize))) method_setImplementation(method, (IMP) &$WAKWindow$screenSize); - $CFXPreferencesPropertyListSource = objc_getClass("CFXPreferencesPropertyListSource"); + $CFXPreferencesPropertyListSource = objc_getClass("CFXPreferencesPropertyListSourceSynchronizer"); + if ($CFXPreferencesPropertyListSource == Nil) + $CFXPreferencesPropertyListSource = objc_getClass("CFXPreferencesPropertyListSource"); Method CFXPreferencesPropertyListSource$_backingPlistChangedSinceLastSync(class_getInstanceMethod($CFXPreferencesPropertyListSource, @selector(_backingPlistChangedSinceLastSync))); if (CFXPreferencesPropertyListSource$_backingPlistChangedSinceLastSync != NULL) {