Created
August 18, 2015 14:33
-
-
Save shinvou/e8ca0913415b2a9b04c3 to your computer and use it in GitHub Desktop.
Revisions
-
shinvou created this gist
Aug 18, 2015 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,35 @@ extern "C" CFTypeRef SecTaskCopyValueForEntitlement(void* task, CFStringRef entitlement, CFErrorRef *error); static void PresentBannerWithMessageForIdentifier(NSString *message, NSString *identifier, NSDictionary *userInfo) { UILocalNotification *notification = [objc_getClass("UILocalNotification") new]; [notification setAlertBody:message]; [notification setUserInfo:userInfo]; //[notification setApplicationIconBadgeNumber:0]; [notification setHasAction:YES]; [notification setAlertAction:nil]; [SBSLocalNotificationClient scheduleLocalNotification:notification bundleIdentifier:identifier]; } CFTypeRef (*original__SecTaskCopyValueForEntitlement)(void *task, CFStringRef entitlement, CFErrorRef *error); CFTypeRef replaced__SecTaskCopyValueForEntitlement(void *task, CFStringRef entitlement, CFErrorRef *error) { CFTypeRef ret = original__SecTaskCopyValueForEntitlement(task, entitlement, error); NSString *entitlementString = CFBridgingRelease(entitlement); if ([entitlementString isEqualToString:@"com.apple.localnotification.schedulingproxy"]) { ret = kCFBooleanTrue; } return ret; } %ctor { @autoreleasepool { if ([[[NSClassFromString(@"NSProcessInfo") processInfo] processName] isEqualToString:@"SpringBoard"]) { MSHookFunction(MSFindSymbol(NULL, "_SecTaskCopyValueForEntitlement"), (void *)replaced__SecTaskCopyValueForEntitlement, (void **)&original__SecTaskCopyValueForEntitlement); } } }