Created
May 31, 2014 16:33
-
-
Save inket/5ccfd8b64890c00cbd73 to your computer and use it in GitHub Desktop.
Swizzling dynamically-loaded Lookup.framework
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)loadPlugin { | |
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(bundleDidLoad:) name:@"NSBundleDidLoadNotification" object:nil]; | |
} | |
- (void)bundleDidLoad:(NSNotification*)note { | |
if ([[note object] isKindOfClass:[NSBundle class]]) | |
{ | |
NSBundle* loadedBundle = [note object]; | |
if ([@"com.apple.LookupFramework" isEqualToString:[loadedBundle bundleIdentifier]]) | |
{ | |
NSLog(@"Lookup framework loaded."); | |
[self swizzle]; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment