Permalink
Browse files
Load daemons in /Library/LaunchDaemons and then run ldrestart to make…
… sure everything's injected properly
- Loading branch information...
|
|
@@ -316,8 +316,15 @@ do { \ |
|
|
|
|
|
wk64(rk64(kern_ucred+0x78)+0x8, 0);
|
|
|
|
|
|
+ startDaemons();
|
|
|
+
|
|
|
if (enable_tweaks){
|
|
|
- kill(backboardd_pid, SIGTERM);
|
|
|
+ sleep(2);
|
|
|
+
|
|
|
+ const char* args_ldrestart[] = {"ldrestart", itoa(1), "/usr/bin/ldrestart", NULL};
|
|
|
+ rv = posix_spawn(&pd, "/usr/bin/ldrestart", NULL, NULL, (char **)&args_ldrestart, NULL);
|
|
|
+ waitpid(pd, NULL, 0);
|
|
|
+ //kill(backboardd_pid, SIGTERM);
|
|
|
}
|
|
|
return 0;
|
|
|
}
|
|
|
@@ -12,6 +12,7 @@ |
|
|
const char* progname(const char*);;
|
|
|
void extractGz(const char *from, const char *to);
|
|
|
void update_springboard_plist(void);
|
|
|
+void startDaemons(void);
|
|
|
|
|
|
void removingLiberiOS(void);
|
|
|
void removingElectraBeta(void);
|
|
|
|
|
|
@@ -57,6 +57,23 @@ void update_springboard_plist(){ |
|
|
[[NSFileManager defaultManager] setAttributes:attr ofItemAtPath:@"/var/mobile/Library/Preferences/com.apple.springboard.plist" error:&error];
|
|
|
}
|
|
|
|
|
|
+void startDaemons(){
|
|
|
+ pid_t pd;
|
|
|
+
|
|
|
+ NSArray *files = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:@"/Library/LaunchDaemons/" error:nil];
|
|
|
+ for (NSString *fileName in files){
|
|
|
+ if ([fileName isEqualToString:@"jailbreakd.plist"])
|
|
|
+ continue;
|
|
|
+ if ([fileName isEqualToString:@"com.openssh.sshd.plist"])
|
|
|
+ continue;
|
|
|
+
|
|
|
+ NSString *fullPath = [@"/Library/LaunchDaemons" stringByAppendingPathComponent:fileName];
|
|
|
+
|
|
|
+ posix_spawn(&pd, "/bin/launchctl", NULL, NULL, (char **)&(const char*[]){ "launchctl", "load", [fullPath UTF8String], NULL }, NULL);
|
|
|
+ waitpid(pd, NULL, 0);
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
void removingLiberiOS(){
|
|
|
[[ViewController currentViewController] removingLiberiOS];
|
|
|
}
|
|
|
|
0 comments on commit
b2e97d2