Skip to content

Commit b371021

Browse files
committed
bug fix
1 parent 01fbeb6 commit b371021

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

Bootstrap/ViewController.m

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,8 @@ void reinstallPackageManager()
309309

310310
int rebuildIconCache()
311311
{
312+
signal(SIGPIPE, SIG_IGN);
313+
312314
ASSERT([@"1" writeToFile:jbroot(@"/var/mobile/.rebuildiconcache") atomically:YES encoding:NSUTF8StringEncoding error:nil]);
313315
AppInfo* tsapp = [AppInfo appWithBundleIdentifier:@"com.opa334.TrollStore"];
314316
if(!tsapp) {
@@ -317,7 +319,7 @@ int rebuildIconCache()
317319
return -1;
318320
}
319321

320-
STRAPLOG("rebuild icon cache...");
322+
STRAPLOG("rebuildIconCache: rebuild icon cache...");
321323
ASSERT([@"2" writeToFile:jbroot(@"/var/mobile/.rebuildiconcache") atomically:YES encoding:NSUTF8StringEncoding error:nil]);
322324
if(![LSApplicationWorkspace.defaultWorkspace _LSPrivateRebuildApplicationDatabasesForSystemApps:YES internal:YES user:YES]) {
323325
ASSERT([@"-2" writeToFile:jbroot(@"/var/mobile/.rebuildiconcache") atomically:YES encoding:NSUTF8StringEncoding error:nil]);
@@ -327,29 +329,35 @@ int rebuildIconCache()
327329
NSString* log=nil;
328330
NSString* err=nil;
329331

332+
STRAPLOG("rebuildIconCache: refresh trollstore apps...");
330333
ASSERT([@"3" writeToFile:jbroot(@"/var/mobile/.rebuildiconcache") atomically:YES encoding:NSUTF8StringEncoding error:nil]);
331334
if(spawn_root([tsapp.bundleURL.path stringByAppendingPathComponent:@"trollstorehelper"], @[@"refresh"], &log, &err) != 0) {
332335
ASSERT([@"-3" writeToFile:jbroot(@"/var/mobile/.rebuildiconcache") atomically:YES encoding:NSUTF8StringEncoding error:nil]);
333336
STRAPLOG("refresh tsapps failed:%@\nERR:%@", log, err);
334337
return -1;
335338
}
336339

340+
STRAPLOG("rebuildIconCache: launching Bootstrap app...");
337341
ASSERT([@"201" writeToFile:jbroot(@"/var/mobile/.rebuildiconcache") atomically:YES encoding:NSUTF8StringEncoding error:nil]);
338342
if(![LSApplicationWorkspace.defaultWorkspace openApplicationWithBundleID:NSBundle.mainBundle.bundleIdentifier]) {
339343
ASSERT([@"-4" writeToFile:jbroot(@"/var/mobile/.rebuildiconcache") atomically:YES encoding:NSUTF8StringEncoding error:nil]);
340344
}
341345

346+
STRAPLOG("rebuildIconCache: rebuild tweaked apps...");
342347
ASSERT([@"202" writeToFile:jbroot(@"/var/mobile/.rebuildiconcache") atomically:YES encoding:NSUTF8StringEncoding error:nil]);
343348
if(spawn_bootstrap_binary((char*[]){"/bin/sh", "/basebin/rebuildApps.sh", NULL}, &log, &err) != 0) {
344349
ASSERT([@"-5" writeToFile:jbroot(@"/var/mobile/.rebuildiconcache") atomically:YES encoding:NSUTF8StringEncoding error:nil]);
345350
STRAPLOG("rebuild apps failed:%@\nERR:%@", log, err);
346351
return -1;
347352
}
348353

354+
STRAPLOG("rebuildIconCache: respring...");
349355
ASSERT([@"203" writeToFile:jbroot(@"/var/mobile/.rebuildiconcache") atomically:YES encoding:NSUTF8StringEncoding error:nil]);
350356
killAllForExecutable("/usr/libexec/backboardd", SIGKILL);
351357

358+
STRAPLOG("rebuildIconCache: done.");
352359
ASSERT([@"100" writeToFile:jbroot(@"/var/mobile/.rebuildiconcache") atomically:YES encoding:NSUTF8StringEncoding error:nil]);
360+
353361
return 0;
354362
}
355363

basebin

0 commit comments

Comments
 (0)