Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- extern dispatch_queue_t __BBServerQueue;
- static BBServer *bbServer = nil;
- static void fakeNotification(NSString *sectionID, NSDate *date) {
- dispatch_sync(__BBServerQueue, ^{
- BBBulletin *bulletin = [[BBBulletin alloc] init];
- bulletin.title = @"StackXI";
- bulletin.message = @"Test notification!";
- bulletin.sectionID = sectionID;
- bulletin.bulletinID = [[NSProcessInfo processInfo] globallyUniqueString];
- bulletin.recordID = [[NSProcessInfo processInfo] globallyUniqueString];
- bulletin.publisherBulletinID = [[NSProcessInfo processInfo] globallyUniqueString];
- bulletin.date = date;
- bulletin.defaultAction = [BBAction actionWithLaunchBundleID:sectionID callblock:nil];
- [bbServer publishBulletin:bulletin destinations:4 alwaysToLockScreen:YES];
- });
- }
- static void fakeNotifications() {
- fakeNotification(@"com.apple.Music", [NSDate date]);
- //fakeNotification(@"com.apple.MobileSMS", [NSDate date]);
- //fakeNotification(@"com.apple.MobileSMS", [NSDate date]);
- //fakeNotification(@"com.apple.MobileSMS", [NSDate date]);
- fakeNotification(@"com.apple.Music", [NSDate date]);
- fakeNotification(@"com.apple.Music", [NSDate date]);
- //fakeNotification(@"com.apple.mobilephone", [NSDate date]);
- fakeNotification(@"com.apple.Music", [NSDate date]);
- //fakeNotification(@"com.apple.MobileSMS", [NSDate date]);
- }
- %group DebugNotifications
- %hook BBServer
- -(id)initWithQueue:(id)arg1 {
- bbServer = %orig;
- dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 10 * NSEC_PER_SEC), dispatch_get_main_queue(), ^{
- fakeNotifications();
- });
- return bbServer;
- }
- -(id)initWithQueue:(id)arg1 dataProviderManager:(id)arg2 syncService:(id)arg3 dismissalSyncCache:(id)arg4 observerListener:(id)arg5 utilitiesListener:(id)arg6 conduitListener:(id)arg7 systemStateListener:(id)arg8 settingsListener:(id)arg9 {
- bbServer = %orig;
- return bbServer;
- }
- - (void)dealloc {
- if (bbServer == self) {
- bbServer = nil;
- }
- %orig;
- }
- %end
- %end
Add Comment
Please, Sign In to add comment