From fbb797946daabed85f57be133eb1285c8adc01cd Mon Sep 17 00:00:00 2001 From: Tomasz Poliszuk Date: Wed, 12 May 2021 00:02:57 +0200 Subject: [PATCH] Fixed search in app list, added app id as subtitle in app list and enable searching by app id, added new internal apps to restricted list, updated code for iOS 13.0 & 13.1 --- HomeScreenQuickActions.h | 1 + HomeScreenQuickActions.xm | 8 +++++--- ...eScreenQuickActionsApplicationSpecificQuickActions.mm | 2 ++ .../HomeScreenQuickActionsSearchableListController.mm | 9 +++++---- .../Resources/InternalApps.plist | 4 ++++ control | 2 +- 6 files changed, 18 insertions(+), 8 deletions(-) diff --git a/HomeScreenQuickActions.h b/HomeScreenQuickActions.h index d31fe5d..3a30e69 100644 --- a/HomeScreenQuickActions.h +++ b/HomeScreenQuickActions.h @@ -78,6 +78,7 @@ static NSString *const domainString = @"com.tomaszpoliszuk.homescreenquickaction @interface SBIconView : UIView @property (nonatomic, retain) SBIcon *icon; @property (nonatomic, retain) SBFolderIcon *folderIcon; +@property (nonatomic, readonly, copy) NSString *applicationBundleIdentifier; @property (nonatomic, readonly, copy) NSString *applicationBundleIdentifierForShortcuts; - (bool)isFolderIcon; - (long long)displayedLabelAccessoryType; diff --git a/HomeScreenQuickActions.xm b/HomeScreenQuickActions.xm index 74bf2d6..f032254 100644 --- a/HomeScreenQuickActions.xm +++ b/HomeScreenQuickActions.xm @@ -432,11 +432,13 @@ static void ClearDirectoryURLContents(NSURL *url) { %hook SBIconView - (void)setApplicationShortcutItems:(NSArray *)arg1 { NSString* bundleId; - if([self respondsToSelector:@selector(applicationBundleIdentifierForShortcuts)]) { + if( [self respondsToSelector:@selector(applicationBundleIdentifier)] ) { + bundleId = [self applicationBundleIdentifier]; + } else if( [self respondsToSelector:@selector(applicationBundleIdentifierForShortcuts)] ) { bundleId = [self applicationBundleIdentifierForShortcuts]; } NSString* applicationBundleID; - if([[self icon] respondsToSelector:@selector(applicationBundleID)]) { + if( [[self icon] respondsToSelector:@selector(applicationBundleID)] ) { applicationBundleID = [[self icon] applicationBundleID]; } if ( enableTweak ) { @@ -1272,7 +1274,7 @@ static void ClearDirectoryURLContents(NSURL *url) { [currentAlertWindow.rootViewController presentViewController:currentAlert animated:YES completion:nil]; } return NO; - } else if ( [self respondsToSelector:@selector(applicationBundleIdentifierForShortcuts)] && [[arg1 type] isEqualToString:@"com.tomaszpoliszuk.springboardhome.application-shortcut-item.open-app-in-filza"] ) { + } else if ( ( [self respondsToSelector:@selector(applicationBundleIdentifier)] || [self respondsToSelector:@selector(applicationBundleIdentifierForShortcuts)] ) && [[arg1 type] isEqualToString:@"com.tomaszpoliszuk.springboardhome.application-shortcut-item.open-app-in-filza"] ) { LSApplicationProxy *applicationProxy = [%c(LSApplicationProxy) applicationProxyForIdentifier:applicationBundleID]; // appStoreReceiptURL -> opens application app store receipt folder (StoreKit) // bundleContainerURL -> opens applications container and selects application diff --git a/HomeScreenQuickActionsSettings/HomeScreenQuickActionsApplicationSpecificQuickActions.mm b/HomeScreenQuickActionsSettings/HomeScreenQuickActionsApplicationSpecificQuickActions.mm index 77f4f2a..139f982 100644 --- a/HomeScreenQuickActionsSettings/HomeScreenQuickActionsApplicationSpecificQuickActions.mm +++ b/HomeScreenQuickActionsSettings/HomeScreenQuickActionsApplicationSpecificQuickActions.mm @@ -45,6 +45,8 @@ - (NSArray *)specifiers { PSSpecifier *specifier = [PSSpecifier preferenceSpecifierNamed:title target:self set:@selector(setPreferenceValue:specifier:) get:@selector(readPreferenceValue:) detail:nil cell:PSSwitchCell edit:nil]; [specifier setProperty:defaultIcon forKey:@"iconImage"]; [specifier setProperty:applicationProxy.applicationIdentifier forKey:@"appBundleID"]; + [specifier setProperty:NSClassFromString(@"PSSubtitleSwitchTableCell") forKey:@"cellClass"]; + [specifier setProperty:applicationProxy.applicationIdentifier forKey:@"cellSubtitleText"]; [specifier setProperty:@"com.tomaszpoliszuk.homescreenquickactions" forKey:@"defaults"]; [specifier setProperty:@"1" forKey:@"default"]; [specifier setProperty:@"com.tomaszpoliszuk.homescreenquickactions.settingschanged" forKey:@"PostNotification"]; diff --git a/HomeScreenQuickActionsSettings/HomeScreenQuickActionsSearchableListController.mm b/HomeScreenQuickActionsSettings/HomeScreenQuickActionsSearchableListController.mm index 43a46eb..632203a 100644 --- a/HomeScreenQuickActionsSettings/HomeScreenQuickActionsSearchableListController.mm +++ b/HomeScreenQuickActionsSettings/HomeScreenQuickActionsSearchableListController.mm @@ -18,11 +18,12 @@ - (void)updateSearchResultsWithText:(NSString *)text { return; } NSPredicate *predicate = [NSPredicate predicateWithBlock:^BOOL(PSSpecifier *specifier, NSDictionary *bindings) { - if ( specifier.cellType == PSGroupCell ) { - return [specifier.name.lowercaseString rangeOfString:text.lowercaseString].location != NSNotFound; - } else { - return YES; + if ( specifier.cellType != PSGroupCell ) { + NSString *appName = specifier.name; + NSString *appID = [specifier.properties objectForKey:@"cellSubtitleText"]; + return ( ( [appName.lowercaseString rangeOfString:text.lowercaseString].location != NSNotFound ) || ( [appID.lowercaseString rangeOfString:text.lowercaseString].location != NSNotFound ) ); } + return YES; }]; NSMutableArray *_specifiersFiltered = [NSMutableArray new]; [_specifiersFiltered addObjectsFromArray:self.specifiersInstalledSystemGroup]; diff --git a/HomeScreenQuickActionsSettings/Resources/InternalApps.plist b/HomeScreenQuickActionsSettings/Resources/InternalApps.plist index 5f73fe6..efd9702 100644 --- a/HomeScreenQuickActionsSettings/Resources/InternalApps.plist +++ b/HomeScreenQuickActionsSettings/Resources/InternalApps.plist @@ -3,10 +3,12 @@ "com.apple.ActivityMessagesApp", "com.apple.AdPlatformsDiagnostics", "com.apple.AdSheetPhone", + "com.apple.AMSEngagementViewService", "com.apple.Animoji.StickersApp", "com.apple.appleaccount.AACredentialRecoveryDialog", "com.apple.AppSSOUIService", "com.apple.AskPermissionUI", + "com.apple.AuthenticationServicesUI", "com.apple.AuthKitUIService", "com.apple.AXUIViewService", "com.apple.BarcodeScanner", @@ -49,6 +51,7 @@ "com.apple.Home.HomeUIService", "com.apple.iad.iAdOptOut", "com.apple.icloud.apps.messages.business", + "com.apple.icloud.FindMyDevice.FindMyExtensionContainer", "com.apple.icloud.spnfcurl", "com.apple.icq", "com.apple.iMessageAppsViewService", @@ -64,6 +67,7 @@ "com.apple.MusicUIService", "com.apple.nike", "com.apple.Passbook", + "com.apple.PassbookBanner", "com.apple.PassbookSecureUIService", "com.apple.PassbookStub", "com.apple.PassbookUIService", diff --git a/control b/control index 09f1e6f..065de14 100644 --- a/control +++ b/control @@ -1,7 +1,7 @@ Package: com.tomaszpoliszuk.homescreenquickactions Depends: firmware (>= 13.0), mobilesubstrate, preferenceloader Name: Home Screen Quick Actions -Version: 1.6.3 +Version: 1.6.4 Architecture: iphoneos-arm Description: Control Home Screen Quick Actions on your device Homepage: http://moreinfo.thebigboss.org/moreinfo/depiction.php?file=homescreenquickactionsDp