Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

35 rindas
1.0KB

  1. #define PLIST_PATH @"/var/mobile/Library/Preferences/com.gilshahar7.pearlretryprefs.plist"
  2. @interface SBUIBiometricResource : NSObject
  3. + (id)sharedInstance;
  4. - (void)noteScreenDidTurnOff;
  5. - (void)noteScreenWillTurnOn;
  6. @end
  7. float delay = 0;
  8. static void loadPrefs() {
  9. NSMutableDictionary *prefs = [[NSMutableDictionary alloc] initWithContentsOfFile:PLIST_PATH];
  10. delay = [[prefs objectForKey:@"delay"] floatValue];
  11. }
  12. %hook SBDashBoardPearlUnlockBehavior
  13. -(void)_handlePearlFailure{
  14. %orig;
  15. [[%c(SBUIBiometricResource) sharedInstance] noteScreenDidTurnOff];
  16. dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(delay * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
  17. [[%c(SBUIBiometricResource) sharedInstance] noteScreenWillTurnOn];
  18. });
  19. }
  20. %end
  21. %ctor{
  22. loadPrefs();
  23. CFNotificationCenterAddObserver(CFNotificationCenterGetDarwinNotifyCenter(), NULL, (CFNotificationCallback)loadPrefs, CFSTR("com.gilshahar7.pearlretryprefs.settingschanged"), NULL, CFNotificationSuspensionBehaviorCoalesce);
  24. }