Created
June 20, 2012 14:10
-
-
Save r-plus/2960087 to your computer and use it in GitHub Desktop.
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
| #import <Foundation/Foundation.h> | |
| #import <CoreFoundation/CoreFoundation.h> | |
| #import <objc/runtime.h> | |
| #import <UIKit/UIKit.h> | |
| #import <substrate.h> | |
| @class UIKeyboardLayoutStar; | |
| static BOOL replaced_UIKeyboardLayoutStar_shouldShowDictationKey(UIKeyboardLayoutStar *self, SEL _cmd) { | |
| // can be able to call original method. | |
| NSLog(@"original return BOOL value = %@", [self PREFIX_shouldShowDictationKey] ? @"YES" : @"NO"); | |
| return NO; | |
| } | |
| __attribute__((constructor)) | |
| static void OverrideMethodFunction() { | |
| MSHookMessage([UIKeyboardLayoutStar class], | |
| @selector(shouldShowDictationKey), | |
| (IMP)&replaced_UIKeyboardLayoutStar_shouldShowDictationKey, | |
| "PREFIX_"); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment