Guest User

Untitled

a guest
Jul 16th, 2018
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.01 KB | None | 0 0
  1. extern dispatch_queue_t __BBServerQueue;
  2.  
  3. static BBServer *bbServer = nil;
  4.  
  5. static void fakeNotification(NSString *sectionID, NSDate *date) {
  6. dispatch_sync(__BBServerQueue, ^{
  7. BBBulletin *bulletin = [[BBBulletin alloc] init];
  8.  
  9. bulletin.title = @"StackXI";
  10. bulletin.message = @"Test notification!";
  11. bulletin.sectionID = sectionID;
  12. bulletin.bulletinID = [[NSProcessInfo processInfo] globallyUniqueString];
  13. bulletin.recordID = [[NSProcessInfo processInfo] globallyUniqueString];
  14. bulletin.publisherBulletinID = [[NSProcessInfo processInfo] globallyUniqueString];
  15. bulletin.date = date;
  16. bulletin.defaultAction = [BBAction actionWithLaunchBundleID:sectionID callblock:nil];
  17.  
  18. [bbServer publishBulletin:bulletin destinations:4 alwaysToLockScreen:YES];
  19. });
  20. }
  21.  
  22. static void fakeNotifications() {
  23. fakeNotification(@"com.apple.Music", [NSDate date]);
  24. //fakeNotification(@"com.apple.MobileSMS", [NSDate date]);
  25. //fakeNotification(@"com.apple.MobileSMS", [NSDate date]);
  26. //fakeNotification(@"com.apple.MobileSMS", [NSDate date]);
  27. fakeNotification(@"com.apple.Music", [NSDate date]);
  28. fakeNotification(@"com.apple.Music", [NSDate date]);
  29. //fakeNotification(@"com.apple.mobilephone", [NSDate date]);
  30. fakeNotification(@"com.apple.Music", [NSDate date]);
  31. //fakeNotification(@"com.apple.MobileSMS", [NSDate date]);
  32. }
  33.  
  34. %group DebugNotifications
  35.  
  36.  
  37. %hook BBServer
  38. -(id)initWithQueue:(id)arg1 {
  39. bbServer = %orig;
  40.  
  41. dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 10 * NSEC_PER_SEC), dispatch_get_main_queue(), ^{
  42. fakeNotifications();
  43. });
  44.  
  45. return bbServer;
  46. }
  47.  
  48. -(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 {
  49. bbServer = %orig;
  50. return bbServer;
  51. }
  52.  
  53. - (void)dealloc {
  54. if (bbServer == self) {
  55. bbServer = nil;
  56. }
  57.  
  58. %orig;
  59. }
  60. %end
  61.  
  62. %end
Add Comment
Please, Sign In to add comment