diff options
Diffstat (limited to 'uicache.mm')
-rw-r--r-- | uicache.mm | 33 |
1 files changed, 30 insertions, 3 deletions
@@ -68,6 +68,27 @@ #include "csstore.hpp" +#if TARGET_OS_IPHONE +#define FRONTBOARD "SpringBoard" +#define FRONTBOARD_ID "com.apple.SpringBoard" +#elif TARGET_OS_TV +#define FRONTBOARD "PineBoard" +#define FRONTBOARD_ID "com.apple.PineBoard" + +@interface PBSSystemService : NSObject ++(id)sharedInstance; +-(void)relaunchBackboardd; +@end + +@interface PBSSystemServiceConnection : NSObject ++(id)sharedConnection; +-(id)systemServiceProxy; +@end + +#else +#error "Unsupported target OS" +#endif + @interface NSMutableArray (Cydia) - (void) addInfoDictionary:(NSDictionary *)info; @end @@ -310,7 +331,7 @@ int standard_uicache(void) NSString *home(NSHomeDirectory()); NSString *path([NSString stringWithFormat:@"%@/Library/Caches/com.apple.mobile.installation.plist", home]); - system("killall -SIGSTOP SpringBoard"); + system("killall -SIGSTOP " FRONTBOARD); sleep(1); @try { @@ -424,7 +445,7 @@ int standard_uicache(void) system("killall installd"); } @finally { - system("killall -SIGCONT SpringBoard"); + system("killall -SIGCONT " FRONTBOARD); } notify_post("com.apple.mobile.application_installed"); @@ -652,6 +673,7 @@ int main(int argc, const char *argv[]) } if ( respring ) { +#if TARGET_OS_IPHONE pid_t sb_pid = launch_get_job_pid("com.apple.SpringBoard"); if ($SBSRelaunchAction && $FBSSystemService) { id action = [$SBSRelaunchAction actionWithReason:@"respring" options:RestartRenderServer targetURL:nil]; @@ -664,9 +686,14 @@ int main(int argc, const char *argv[]) usleep(1000); } } else { - system("launchctl stop com.apple.SpringBoard"); + system("launchctl stop " FRONTBOARD_ID); system("launchctl stop com.apple.backboardd"); } +#elif TARGET_OS_TV + [[[PBSSystemServiceConnection sharedConnection] systemServiceProxy] relaunchBackboardd]; +#else +#error "Unsupported target OS" +#endif } } // @autoreleasepool return rv; |