Skip to content

Instantly share code, notes, and snippets.

@MTACS
Created July 13, 2020 18:16
Show Gist options
  • Save MTACS/fe73752f174973c5ad71c09fad6e2cc3 to your computer and use it in GitHub Desktop.
Save MTACS/fe73752f174973c5ad71c09fad6e2cc3 to your computer and use it in GitHub Desktop.
"Fix" for HBRespringController respringAndReturnTo: method freezing
#import "spawn.h"
#import "Prefs.h"
#import <Cephei/HBRespringController.h>
@implementation PrefsController
- (void)respring {
[HBRespringController respringAndReturnTo:[NSURL URLWithString:@"prefs:root=YourPrefs"]];
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
pid_t pid;
const char *args[] = {"killall", "backboardd", NULL};
posix_spawn(&pid, "/usr/bin/killall", NULL, NULL, (char *const *)args, NULL);
});
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment