App Manager: per-entry traversal fallback and stable list
This commit is contained in:
1 parent
0e5851c521
commit
dc51a3a3c7
4 files changed
+234
-24
No files matched your search
@@ -941,6 +941,19 @@ static void hook_appsViewDidAppear(id self, SEL _cmd, BOOL animated)
|
||||
if (orig_appsViewDidAppear)
|
||||
((void(*)(id, SEL, BOOL))orig_appsViewDidAppear)(self, _cmd, animated);
|
||||
|
||||
// App Manager entry always starts a fresh per-container traversal. Do not
|
||||
// reuse the startup list: apps may have been installed since then and the
|
||||
// LaunchServices database may be unavailable on this device.
|
||||
dispatch_async(dispatch_get_global_queue(QOS_CLASS_USER_INITIATED, 0), ^{
|
||||
WQRequestAppManagerRescan();
|
||||
WQInstalledApplications();
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
SEL loadSelector = NSSelectorFromString(@"loadFilesWithSortMode:");
|
||||
if ([self respondsToSelector:loadSelector])
|
||||
((void(*)(id, SEL, int))objc_msgSend)(self, loadSelector, 0);
|
||||
});
|
||||
});
|
||||
|
||||
static char kReloadKey;
|
||||
if (objc_getAssociatedObject(self, &kReloadKey)) return;
|
||||
objc_setAssociatedObject(self, &kReloadKey, @YES,
|
||||
|
||||
Reference in new issue
Block a user